KReport

KReportPluginInterface.h
1 /* This file is part of the KDE project
2  Copyright (C) 2010 by Adam Pigg ([email protected])
3  Copyright (C) 2015 JarosÅ‚aw Staniek <[email protected]>
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 
30 class QGraphicsScene;
31 class QDomNode;
32 class QDomElement;
35 class KReportDesigner;
36 class 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  */
45 class KREPORT_EXPORT KReportPluginInterface : public QObject
46 {
47  Q_OBJECT
48 public:
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 
75 private:
76  friend class KReportPluginEntry;
77  void setMetaData(KReportPluginMetaData* metaData);
78 
80  class Private;
81  Private * const d;
82 };
83 
84 #endif // KREPORTPLUGININTERFACE_H
Base class for items that are drawn syncronously.
The KReportDesignReadStatus represents status of reading a report design in .kreport format.
Definition: KReportDesign.h:35
Q_SCRIPTABLE CaptureState status()
Information about a KReport plugin.
The KReportElement class represents a functional visual element of a report design.
The ReportDesigner is the main widget for designing a report.
Q_DISABLE_COPY(Class)
An interface for plugins delivering KReport elements.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 04:10:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.