Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/reports/kexireportpart.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Kexi Report Plugin | 2 | * Kexi Report Plugin | ||
3 | * Copyright (C) 2007-2008 by Adam Pigg <adam@piggz.co.uk> | 3 | * Copyright (C) 2007-2008 by Adam Pigg <adam@piggz.co.uk> | ||
4 | * Copyright (C) 2011-2015 Jarosław Staniek <staniek@kde.org> | 4 | * Copyright (C) 2011-2017 Jarosław Staniek <staniek@kde.org> | ||
5 | * | 5 | * | ||
6 | * This library is free software; you can redistribute it and/or | 6 | * This library is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU Lesser General Public | 7 | * modify it under the terms of the GNU Lesser General Public | ||
8 | * License as published by the Free Software Foundation; either | 8 | * License as published by the Free Software Foundation; either | ||
9 | * version 2.1 of the License, or (at your option) any later version. | 9 | * version 2.1 of the License, or (at your option) any later version. | ||
10 | * | 10 | * | ||
11 | * This library is distributed in the hope that it will be useful, | 11 | * This library is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * Lesser General Public License for more details. | 14 | * Lesser General Public License for more details. | ||
15 | * | 15 | * | ||
16 | * You should have received a copy of the GNU Lesser General Public | 16 | * You should have received a copy of the GNU Lesser General Public | ||
17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 17 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef _KEXIREPORTPART_H_ | 20 | #ifndef _KEXIREPORTPART_H_ | ||
21 | #define _KEXIREPORTPART_H_ | 21 | #define _KEXIREPORTPART_H_ | ||
22 | 22 | | |||
23 | #include <core/kexipart.h> | 23 | #include <core/kexipart.h> | ||
24 | #include <core/KexiWindowData.h> | 24 | #include <core/KexiWindowData.h> | ||
25 | 25 | | |||
26 | #include <KReportDataSource> | 26 | #include <KReportDataSource> | ||
27 | #include <KReportScriptSource> | 27 | #include <KReportScriptSource> | ||
28 | | ||||
29 | #include <KDbTableSchemaChangeListener> | ||||
30 | | ||||
28 | #include <QDomElement> | 31 | #include <QDomElement> | ||
29 | 32 | | |||
30 | class KexiReportPartTempData : public KexiWindowData | 33 | class KexiReportPartTempData : public KexiWindowData, public KDbTableSchemaChangeListener | ||
31 | { | 34 | { | ||
32 | Q_OBJECT | 35 | Q_OBJECT | ||
33 | public: | 36 | public: | ||
34 | explicit KexiReportPartTempData(KexiWindow* parent); | 37 | KexiReportPartTempData(KexiWindow* parent, KDbConnection *conn); | ||
38 | ~KexiReportPartTempData(); | ||||
35 | QDomElement reportDefinition; | 39 | QDomElement reportDefinition; | ||
36 | QDomElement connectionDefinition; | 40 | QDomElement connectionDefinition; | ||
37 | 41 | | |||
38 | /*! true, if \a document member has changed in previous view. Used on view switching. | 42 | /*! true, if \a document member has changed in previous view. Used on view switching. | ||
39 | Check this flag to see if we should refresh data for DataViewMode. */ | 43 | Check this flag to see if we should refresh data for DataViewMode. */ | ||
40 | bool reportSchemaChangedInPreviousView; | 44 | bool reportSchemaChangedInPreviousView; | ||
45 | | ||||
46 | KDbConnection *connection(); | ||||
47 | | ||||
48 | protected: | ||||
49 | //! This temp-data acts as a listener for tracking changes in table schema | ||||
50 | //! used by the report. This method closes the report on request. | ||||
51 | tristate closeListener() override; | ||||
52 | | ||||
53 | private: | ||||
54 | Q_DISABLE_COPY(KexiReportPartTempData) | ||||
55 | class Private; | ||||
56 | Private * const d; | ||||
41 | }; | 57 | }; | ||
42 | 58 | | |||
43 | /** | 59 | /** | ||
44 | * @short Application Main Window | 60 | * @short Application Main Window | ||
45 | */ | 61 | */ | ||
46 | class KexiReportPart : public KexiPart::Part, public KReportScriptSource | 62 | class KexiReportPart : public KexiPart::Part, public KReportScriptSource | ||
47 | { | 63 | { | ||
48 | Q_OBJECT | 64 | Q_OBJECT | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |