KReport

KReportMapsPlugin.cpp
1/*
2 Copyright (C) 2010-2016 by Adam Pigg (adam@piggz.co.uk)
3 Copyright (C) 2011 by Radoslaw Wicik (radoslaw@wicik.pl)
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
31K_PLUGIN_CLASS_WITH_JSON(KReportMapsPlugin, "kreport_mapsplugin.json")
32
33KReportMapsPlugin::KReportMapsPlugin(QObject *parent, const QVariantList &args) : KReportPluginInterface(parent)
34{
35 Q_UNUSED(args)
36}
37
38KReportMapsPlugin::~KReportMapsPlugin()
39{
40}
41
42QObject* KReportMapsPlugin::createRendererInstance(const QDomNode& element)
43{
44 return new KReportItemMaps(element);
45}
46
47QObject* KReportMapsPlugin::createDesignerInstance(const QDomNode& element, KReportDesigner* designer, QGraphicsScene* scene)
48{
49 return new KReportDesignerItemMaps(element, designer, scene);
50}
51
52QObject* 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
59QObject* 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"
#define K_PLUGIN_CLASS_WITH_JSON(classname, jsonFile)
The ReportDesigner is the main widget for designing a report.
Base class for items that are drawn syncronously.
An interface for plugins delivering KReport elements.
T qobject_cast(QObject *object)
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.