MyBooks
printerinterface.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This file is part of the CuteReport project *
3  * Copyright (C) 2012-2017 by Alexander Mikhalov *
4  * alexander.mikhalov@gmail.com *
5  * *
6  ** GNU General Public License Usage **
7  * *
8  * This library is free software: you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation, either version 3 of the License, or *
11  * (at your option) any later version. *
12  * You should have received a copy of the GNU General Public License *
13  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
14  * *
15  ** GNU Lesser General Public License **
16  * *
17  * This library is free software: you can redistribute it and/or modify *
18  * it under the terms of the GNU Lesser General Public License as *
19  * published by the Free Software Foundation, either version 3 of the *
20  * License, or (at your option) any later version. *
21  * You should have received a copy of the GNU Lesser General Public *
22  * License along with this library. *
23  * If not, see <http://www.gnu.org/licenses/>. *
24  * *
25  * This library is distributed in the hope that it will be useful, *
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
28  * GNU General Public License for more details. *
29  ****************************************************************************/
30 #ifndef PRINTERINTERFACE_H
31 #define PRINTERINTERFACE_H
32 
33 #include "reportplugininterface.h"
34 #include "reportinterface.h"
35 #include "cutereport_globals.h"
36 
37 #include <QtGui>
38 #include <QWidget>
39 
40 namespace CuteReport {
41 
42 class PrinterHelperInterface;
43 
45 {
46  Q_OBJECT
48 
49  Q_PROPERTY(QString printerName READ printerName WRITE setPrinterName NOTIFY printerNameChanged)
50 
51  Q_PROPERTY(int _current_property READ _currentProperty WRITE _setCurrentProperty DESIGNABLE false STORED false)
52  Q_PROPERTY(QString _current_property_description READ _current_property_description DESIGNABLE false STORED false)
53 
54 public:
55  explicit PrinterInterface(QObject *parent = 0);
56  virtual ~PrinterInterface();
57 
58  virtual PrinterHelperInterface * helper() = 0;
59  virtual PrinterInterface * createInstance(QObject * parent = 0) const = 0;
60  virtual PrinterInterface * clone() const = 0;
61 
62  virtual bool print(CuteReport::ReportInterface * report) = 0;
63 
64  QString printerName() const;
65  void setPrinterName(const QString & printerName);
66 
67  virtual QString lastError() = 0;
68 
69  virtual void _setCurrentProperty(int num) { m_currentProperty = num; }
70  virtual int _currentProperty() { return m_currentProperty; }
71  virtual QString _current_property_description() const;
72 
73 signals:
74  void printerNameChanged(const QString &);
75 
76 protected:
77  explicit PrinterInterface(const PrinterInterface &dd, QObject * parent);
78 
79  QString m_printerName;
81 
82  friend class ReportCore;
83 };
84 
85 
87 {
88  Q_OBJECT
89 public:
90  enum VisibleOptions{ReportsOptions, ObjectsOptions, AllOptions};
92  virtual void load() = 0;
93  virtual void save() = 0;
94 };
95 
96 
97 }
98 
99 Q_DECLARE_INTERFACE(CuteReport::PrinterInterface, "CuteReport.PrinterInterface/1.0")
100 Q_DECLARE_INTERFACE(CuteReport::PrinterHelperInterface, "CuteReport.PrinterHelperInterface/1.0")
101 //Q_DECLARE_INTERFACE(CuteReport::PrinterOptionsInterface, "CuteReport.PrinterOptionsInterface/1.0")
102 
103 #endif // PRINTERINTERFACE_H
Definition: abstractpainterdelegate.h:42
Definition: printerinterface.h:44
TODO v2: rename to ReportObject.
Definition: reportinterface.h:71
PrinterHelperInterface(PrinterInterface *, VisibleOptions=AllOptions)
Definition: printerinterface.h:91
Definition: reportplugininterface.h:53
QString m_printerName
Definition: printerinterface.h:79
virtual int _currentProperty()
Definition: printerinterface.h:70
VisibleOptions
Definition: printerinterface.h:90
int m_currentProperty
Definition: printerinterface.h:80
#define CUTEREPORT_EXPORTS
Definition: cutereport_globals.h:47
Definition: printerinterface.h:86
Definition: reportcore.h:83