Debian Codegraph @

HercPrinter/PagePrinter.h

raw symbols SCIP
1 /*
2 * File: PagePrinter.h
3 *
4 * Author: Jacob Dekel
5 * Created on: May 10, 2014
6 *
7 * Copyright (c) 2009-2014 Jacob Dekel
8 * $Id$
9 *
10 * This file contains the page formatting and PDF extension classes
11 *
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 *
25 */
26
27 #ifndef PAGEPRINTER_H
28 #define PAGEPRINTER_H
29
30 #include "PrinterInterface.h"
31 #include "HerculesStudio.h"
32
33 #include <QPdfWriter>
34
35 class PrintRunner;
36
37 class PagePrinter : public GenericPagePrinter
38 {
39 Q_OBJECT
40 public:
41 PagePrinter(StationeryPtr &stationery, QPainter& painter);
42 virtual void setBarsColor();
43 virtual bool print(QByteArray);
44
45 protected:
46 void setValues(bool);
47 virtual void close();
48
49 private:
50 const DecolationRulesPtr mRules;
51 QString mStationeryName;
52 QPainter* mPainter;
53
54 signals:
55 void endPage();
56 };
57
58 class PdfPrinter : public GenericPagePrinter
59 {
60 public:
61 PdfPrinter(const QString& dir, StationeryPtr& stationery, DecolationRulesPtr& decolation, int linesPerInch, int fontSize);
62 virtual void setBarsColor();
63 virtual bool print(QByteArray line);
64 virtual void close();
65 virtual bool endOfJob(QByteArray& line);
66
67 private:
68 QString decodeFilename();
69 bool doPrint(QByteArray& line);
70 void setValues(bool eject);
71
72
73 QMultiMap<int, AccountingField> mAccountingFields;
74 QMap<QString, QString> mVariables;
75 QPdfWriter * mPdf;
76 QString mDir;
77 QList<QByteArray> mFirstPage;
78 int mFontSize;
79 int mCurPage;
80 int mCurLine;
81 int mLastPages;
82 int mLastPagesCountdown;
83 };
84
85 #endif // PAGEPRINTER_H
86