1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2008 Inge Wallin <inge@lysator.liu.se>
4 //
5 
6 
7 // Local
8 #include "FITemplateFloatItem.h"
9 
10 // Qt
11 #include <QRect>
12 #include <QColor>
13 #include <QSvgRenderer>
14 
15 // Marble
16 #include "MarbleDebug.h"
17 #include "MarbleDirs.h"
18 #include "GeoPainter.h"
19 #include "GeoDataCoordinates.h"
20 #include "ViewportParams.h"
21 
22 namespace Marble
23 {
24 
FITemplateFloatItem(const QPointF & point,const QSizeF & size)25 FITemplateFloatItem::FITemplateFloatItem ( const QPointF &point,
26 					    const QSizeF &size )
27     : AbstractFloatItem( point, size ),
28       m_compass(),
29       m_polarity( 0 )
30 {
31     m_svgobj = new QSvgRenderer(MarbleDirs::path(QStringLiteral("svg/compass.svg")),
32                                  this );
33 }
34 
~FITemplateFloatItem()35 FITemplateFloatItem::~FITemplateFloatItem ()
36 {
37     delete m_svgobj;
38 }
39 
backendTypes() const40 QStringList FITemplateFloatItem::backendTypes() const
41 {
42     return QStringList(QStringLiteral("FITemplate"));
43 }
44 
name() const45 QString FITemplateFloatItem::name() const
46 {
47     return tr( "FITemplate" );
48 }
49 
guiString() const50 QString FITemplateFloatItem::guiString() const
51 {
52     return tr( "Float Item &Template" );
53 }
54 
nameId() const55 QString FITemplateFloatItem::nameId() const
56 {
57     return QStringLiteral("floatitemtemplate");
58 }
59 
description() const60 QString FITemplateFloatItem::description() const
61 {
62     return tr( "This is a template class for float items." );
63 }
64 
icon() const65 QIcon FITemplateFloatItem::icon () const
66 {
67     return QIcon();
68 }
69 
70 
initialize()71 void FITemplateFloatItem::initialize ()
72 {
73     // Initialize your float item here
74 }
75 
isInitialized() const76 bool FITemplateFloatItem::isInitialized () const
77 {
78     // Return whether your float item is initialized here.
79     return true;
80 }
81 
backgroundShape() const82 QPainterPath FITemplateFloatItem::backgroundShape() const
83 {
84     // Return a QPainterPath here that contains the outer shape of
85     // your float item.
86 }
87 
needsUpdate(ViewportParams * viewport)88 bool FITemplateFloatItem::needsUpdate( ViewportParams *viewport )
89 {
90     // Return whether your float item needs to be redrawn.
91 }
92 
renderFloatItem(GeoPainter * painter,ViewportParams * viewport,GeoSceneLayer * layer)93 bool FITemplateFloatItem::renderFloatItem( GeoPainter     *painter,
94 					   ViewportParams *viewport,
95 					   GeoSceneLayer  *layer )
96 {
97     // Here you should render your float item
98 }
99 
100 }
101 
102 #include "moc_FITemplateFloatItem.cpp"
103