KReport

KReportPluginInterface.h
1/* This file is part of the KDE project
2 Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
3 Copyright (C) 2015 Jarosław Staniek <staniek@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KREPORTPLUGININTERFACE_H
22#define KREPORTPLUGININTERFACE_H
23
24#include "config-kreport.h"
25#include "kreport_export.h"
26#include "KReportElement.h"
27
28#include <KPluginFactory>
29
30class QGraphicsScene;
31class QDomNode;
32class QDomElement;
35class KReportDesigner;
36class KReportItemBase;
37
38//! deprecated, use K_PLUGIN_CLASS_WITH_JSON instead!
39#define KREPORT_PLUGIN_FACTORY(class_name, name) \
40 K_PLUGIN_FACTORY_WITH_JSON(class_name ## Factory, name, registerPlugin<class_name>();)
41
42/*!
43 * @brief An interface for plugins delivering KReport elements.
44 */
45class KREPORT_EXPORT KReportPluginInterface : public QObject
46{
47 Q_OBJECT
48public:
49 explicit KReportPluginInterface(QObject *parent = nullptr,
50 const QVariantList &args = QVariantList());
51
52 ~KReportPluginInterface() override;
53
54 virtual QObject* createDesignerInstance(KReportDesigner *designer, QGraphicsScene * scene,
55 const QPointF &pos) = 0;
56
57 //! @todo 4.0: Use QDomElement
58 virtual QObject* createDesignerInstance(const QDomNode &element, KReportDesigner *designer,
59 QGraphicsScene *scene) = 0;
60
61 //! @todo 4.0: Use QDomElement
62 virtual QObject* createRendererInstance(const QDomNode &element) = 0;
63
64 virtual KReportElement createElement();
65
66 virtual bool loadElement(KReportElement *el, const QDomElement &dom, KReportDesignReadingStatus *status);
67
68#ifdef KREPORT_SCRIPTING
69 virtual QObject* createScriptInstance(KReportItemBase* item) = 0;
70#endif
71
72 //! @return information about the plugin
73 const KReportPluginMetaData* metaData() const;
74
75private:
76 friend class KReportPluginEntry;
77 void setMetaData(KReportPluginMetaData* metaData);
78
79 Q_DISABLE_COPY(KReportPluginInterface)
80 class Private;
81 Private * const d;
82};
83
84#endif // KREPORTPLUGININTERFACE_H
The KReportDesignReadStatus represents status of reading a report design in .kreport format.
The ReportDesigner is the main widget for designing a report.
The KReportElement class represents a functional visual element of a report design.
Base class for items that are drawn syncronously.
An interface for plugins delivering KReport elements.
virtual QObject * createRendererInstance(const QDomNode &element)=0
virtual QObject * createDesignerInstance(const QDomNode &element, KReportDesigner *designer, QGraphicsScene *scene)=0
Information about a KReport plugin.
Q_SCRIPTABLE CaptureState status()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.