Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/scripting/KReportScriptHandler.h
Show All 32 Lines | |||||
33 | class KReportDocument; | 33 | class KReportDocument; | ||
34 | class OROPage; | 34 | class OROPage; | ||
35 | 35 | | |||
36 | namespace Scripting | 36 | namespace Scripting | ||
37 | { | 37 | { | ||
38 | class Report; | 38 | class Report; | ||
39 | class Section; | 39 | class Section; | ||
40 | } | 40 | } | ||
41 | | ||||
41 | class KREPORT_EXPORT KReportScriptHandler : public QObject | 42 | class KREPORT_EXPORT KReportScriptHandler : public QObject | ||
42 | { | 43 | { | ||
43 | Q_OBJECT | 44 | Q_OBJECT | ||
44 | public: | 45 | public: | ||
45 | KReportScriptHandler(const KReportData *, KReportDocument*); | 46 | KReportScriptHandler(const KReportData *, KReportDocument*); | ||
46 | ~KReportScriptHandler(); | 47 | ~KReportScriptHandler(); | ||
47 | 48 | | |||
48 | QVariant evaluate(const QString&); | 49 | QVariant evaluate(const QString&); | ||
49 | void displayErrors(); | 50 | void displayErrors(); | ||
50 | QJSValue registerScriptObject(QObject*, const QString&); | 51 | QJSValue registerScriptObject(QObject*, const QString&); | ||
51 | bool trigger(); | 52 | bool trigger(); | ||
52 | 53 | | |||
53 | public Q_SLOTS: | 54 | public Q_SLOTS: | ||
54 | 55 | | |||
55 | void slotEnteredSection(KReportSectionData*, OROPage*, QPointF); | 56 | void slotEnteredSection(KReportSectionData*, OROPage*, QPointF); | ||
56 | void slotEnteredGroup(const QString&, const QVariant&); | 57 | void slotEnteredGroup(const QString&, const QVariant&); | ||
57 | void slotExitedGroup(const QString&, const QVariant&); | 58 | void slotExitedGroup(const QString&, const QVariant&); | ||
58 | void setPageNumber(int p) { | 59 | void setPageNumber(int p); | ||
59 | m_constants->setPageNumber(p); | 60 | void setPageTotal(int t); | ||
60 | } | | |||
61 | void setPageTotal(int t) { | | |||
62 | m_constants->setPageTotal(t); | | |||
63 | } | | |||
64 | void newPage(); | 61 | void newPage(); | ||
65 | 62 | | |||
66 | Q_SIGNALS: | 63 | Q_SIGNALS: | ||
67 | void groupChanged(const QMap<QString, QVariant> &groupData); | 64 | void groupChanged(const QMap<QString, QVariant> &groupData); | ||
68 | 65 | | |||
69 | private: | 66 | private: | ||
70 | KReportScriptConstants *m_constants; | | |||
71 | KReportScriptDebug *m_debug; | | |||
72 | KReportScriptDraw *m_draw; | | |||
73 | | ||||
74 | Scripting::Report *m_report; | | |||
75 | | ||||
76 | const KReportData *m_kreportData; | | |||
77 | | ||||
78 | QString m_source; | | |||
79 | KReportDocument *m_reportData; | | |||
80 | | ||||
81 | QJSEngine* m_engine; | | |||
82 | QJSValue m_scriptValue; | | |||
83 | | ||||
84 | QMap<QString, QVariant> m_groups; | | |||
85 | QMap<KReportSectionData*, Scripting::Section*> m_sectionMap; | | |||
86 | //! @todo KEXI3 QString where(); | 67 | //! @todo KEXI3 QString where(); | ||
staniek: +Q_DISABLE_COPY | |||||
68 | Q_DISABLE_COPY(KReportScriptHandler) | ||||
69 | class Private; | ||||
70 | Private * const d; | ||||
87 | }; | 71 | }; | ||
88 | 72 | | |||
89 | #else // !KREPORT_SCRIPTING | 73 | #else // !KREPORT_SCRIPTING | ||
90 | #define KReportScriptHandler void | 74 | #define KReportScriptHandler void | ||
91 | #endif | 75 | #endif | ||
92 | 76 | | |||
93 | #endif | 77 | #endif |
+Q_DISABLE_COPY