KReport

KReportMapsPlugin.cpp
1 /*
2  Copyright (C) 2010-2016 by Adam Pigg ([email protected])
3  Copyright (C) 2011 by Radoslaw Wicik ([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 #include "KReportMapsPlugin.h"
22 #include "KReportItemMaps.h"
23 #include "KReportDesignerItemMaps.h"
24 #include <KReportPluginInterface.h>
25 #ifdef KREPORT_SCRIPTING
26 #include "KReportScriptMaps.h"
27 #endif
28 #include "kreport_debug.h"
29 
30 
31 K_PLUGIN_CLASS_WITH_JSON(KReportMapsPlugin, "kreport_mapsplugin.json")
32 
33 KReportMapsPlugin::KReportMapsPlugin(QObject *parent, const QVariantList &args) : KReportPluginInterface(parent)
34 {
35  Q_UNUSED(args)
36 }
37 
38 KReportMapsPlugin::~KReportMapsPlugin()
39 {
40 }
41 
42 QObject* KReportMapsPlugin::createRendererInstance(const QDomNode& element)
43 {
44  return new KReportItemMaps(element);
45 }
46 
47 QObject* KReportMapsPlugin::createDesignerInstance(const QDomNode& element, KReportDesigner* designer, QGraphicsScene* scene)
48 {
49  return new KReportDesignerItemMaps(element, designer, scene);
50 }
51 
52 QObject* KReportMapsPlugin::createDesignerInstance(KReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
53 {
54  //kreportpluginDebug() << "KReport maps init";
55  return new KReportDesignerItemMaps(designer, scene, pos);
56 }
57 
58 #ifdef KREPORT_SCRIPTING
59 QObject* KReportMapsPlugin::createScriptInstance(KReportItemBase* item)
60 {
61  KReportItemMaps *map = qobject_cast<KReportItemMaps*>(item);
62  if (map) {
63  return new Scripting::Maps(map);
64  }
65  return nullptr;
66 }
67 #endif
68 
69 #include "KReportMapsPlugin.moc"
Base class for items that are drawn syncronously.
The ReportDesigner is the main widget for designing a report.
#define K_PLUGIN_CLASS_WITH_JSON(classname, jsonFile)
QFuture< void > map(Sequence &sequence, MapFunctor function)
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 Feb 7 2023 04:17:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.