KReport

KReportItemMaps.h
1 /*
2  * Copyright (C) 2007-2008 by Adam Pigg ([email protected])
3  * Copyright (C) 2011-2015 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 Lesser 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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef KREPORTITEMMAPS_H
20 #define KREPORTITEMMAPS_H
21 
22 #include "KReportAsyncItemBase.h"
23 
24 #include <marble/MarbleWidget.h>
25 #include <marble/MapThemeManager.h>
26 
27 #include <KProperty>
28 
29 #include "KReportMapRenderer.h"
30 
31 #include <QDomNode>
32 
33 class OROImage;
34 class OROPicture;
35 class OROPage;
36 class OROSection;
37 
38 namespace Scripting
39 {
40 class Maps;
41 }
42 
43 class KReportItemMaps : public KReportAsyncItemBase
44 {
45  Q_OBJECT
46 public:
47  KReportItemMaps();
48  explicit KReportItemMaps(const QDomNode &element);
49  ~KReportItemMaps() override;
50 
51  QString typeName() const override;
52  int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script) override;
53 
54  QVariant realItemData(const QVariant &itemData) const override;
55 
56  void renderFinished();
57 
58  qreal longtitude() const;
59  qreal latitude() const;
60  int zoom() const;
61  QString themeId() const;
62 
63  OROPicture* oroImage();
64 
65 protected:
66  KProperty* m_latitudeProperty;
67  KProperty* m_longitudeProperty;
68  KProperty* m_zoomProperty;
69  KProperty* m_themeProperty;
70 
71  qreal m_longtitude = 0.0;
72  qreal m_latitude = 0.0;
73  int m_zoom = 1200;
74  OROPage *m_pageId = nullptr;
75  OROSection *m_sectionId = nullptr;
76  QPointF m_offset;
77  OROPicture * m_oroPicture = nullptr;
78  KReportMapRenderer m_mapRenderer;
79  Marble::MapThemeManager m_themeManager;
80 
81 private:
82  void createProperties() override;
83  void deserializeData(const QVariant& serialized);
84 
85  bool m_longDataSetFromScript = false;
86  bool m_latDataSetFromScript = false;
87  bool m_zoomDataSetFromScript = false;
88 
89  friend class Scripting::Maps;
90 };
91 
92 #endif
Q_OBJECTQ_OBJECT
Defines an image. An image is a bitmap.
virtual QString typeName() const =0
Return the item type as a string.
Represents a single page in a document and may contain zero or more OROPrimitive objects all of which...
QAction * zoom(const QObject *recvr, const char *slot, QObject *parent)
Defines a picture. A picture is different to an image, in that it is drawn using commands.
int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script) override=0
Render the item into a primitive which is used by the second stage renderer.
Represents a single a single row in a document and may contain zero or more OROPrimitives.
Field item script interface.
Base class for items that are drawn asyncronously due to unknown loading times.
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.