MyBooks
forminterface.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 FORMINTERFACE_H
31 #define FORMINTERFACE_H
32 
33 #include "reportplugininterface.h"
34 #include <QWidget>
35 #include <QVariant>
36 #include "cutereport_globals.h"
37 
38 
39 namespace CuteReport
40 {
41 
42 class ScriptEngineInterface;
43 class FormHelperInterface;
44 
46 {
47  Q_OBJECT
48  Q_PROPERTY(QString data READ data WRITE setData NOTIFY dataChanged)
49 
50 public:
51  explicit FormInterface(QObject *parent = 0);
52  virtual ~FormInterface(){}
53 
54  virtual void init(){}
55  virtual FormHelperInterface * helper() {return 0;}
56  virtual FormInterface * clone() const = 0;
57 
58  virtual QString data() const = 0;
59  virtual void setData(const QString &data) = 0;
60 
61  virtual QStringList renderingStrings(){return QStringList();}
62 
63  virtual void renderInit(CuteReport::ScriptEngineInterface * scriptEngine) = 0;
64  virtual void renderpPrepare() = 0;
65  virtual void renderReset() = 0;
66 
67  Q_INVOKABLE virtual void show() = 0;
68  Q_INVOKABLE virtual QVariant invoke(const QString & objectName, const QString & method, const QVariant & arg1 = QVariant(),
69  const QVariant & arg2 = QVariant(), const QVariant & arg3 = QVariant(),
70  const QVariant & arg4 = QVariant(), const QVariant & arg5 = QVariant(), const QVariant & arg6 = QVariant()) = 0;
71 
72 signals:
73  void accepted();
74  void rejected();
75  void dataChanged(const QString &);
76  void renderingStringsChanged();
77 
78 protected:
79  virtual FormInterface * createInstance(QObject * parent) const = 0;
80 
81  friend class ReportCore;
82 };
83 
84 class FormHelperInterface: public QWidget
85 {
86 
87 };
88 
89 }
90 
91 Q_DECLARE_INTERFACE(CuteReport::FormInterface, "CuteReport.FormInterface/1.0")
92 #endif // FORMINTERFACE_H
Definition: forminterface.h:45
Definition: abstractpainterdelegate.h:42
virtual QStringList renderingStrings()
Definition: forminterface.h:61
Definition: reportplugininterface.h:53
virtual ~FormInterface()
Definition: forminterface.h:52
virtual FormHelperInterface * helper()
Definition: forminterface.h:55
Definition: forminterface.h:84
#define CUTEREPORT_EXPORTS
Definition: cutereport_globals.h:47
virtual void init()
Definition: forminterface.h:54
Definition: reportcore.h:83