Marble

AbstractDataPluginItem.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2009 Bastian Holst <bastianholst@gmx.de>
4//
5
6// self
7#include "AbstractDataPluginItem.h"
8
9// Marble
10#include "GeoDataCoordinates.h"
11#include "MarbleDebug.h"
12#include "ViewportParams.h"
13
14// Qt
15#include <QAction>
16#include <QRect>
17#include <QSize>
18
19namespace Marble
20{
21
22class AbstractDataPluginItemPrivate
23{
24public:
25 QString m_id;
26 QString m_toolTip;
27 bool m_favorite;
28 bool m_sticky;
29 qreal m_addedAngularResolution;
30
31 AbstractDataPluginItemPrivate();
32};
33
34AbstractDataPluginItemPrivate::AbstractDataPluginItemPrivate()
35 : m_favorite(false)
36 , m_sticky(false)
37 , m_addedAngularResolution(0)
38{
39 // nothing to do
40}
41
42AbstractDataPluginItem::AbstractDataPluginItem(QObject *parent)
43 : QObject(parent)
44 , BillboardGraphicsItem()
45 , d(new AbstractDataPluginItemPrivate)
46{
47 // nothing to do
48}
49
50AbstractDataPluginItem::~AbstractDataPluginItem()
51{
52 delete d;
53}
54
55QString AbstractDataPluginItem::toolTip() const
56{
57 return d->m_toolTip;
58}
59
60void AbstractDataPluginItem::setToolTip(const QString &toolTip)
61{
62 d->m_toolTip = toolTip;
63}
64
65QString AbstractDataPluginItem::id() const
66{
67 return d->m_id;
68}
69
70void AbstractDataPluginItem::setId(const QString &id)
71{
72 d->m_id = id;
73}
74
75bool AbstractDataPluginItem::isFavorite() const
76{
77 return d->m_favorite;
78}
79
80void AbstractDataPluginItem::setFavorite(bool favorite)
81{
82 if (isFavorite() != favorite) {
83 d->m_favorite = favorite;
84 Q_EMIT favoriteChanged(id(), favorite);
85 }
86}
87
88bool AbstractDataPluginItem::isSticky() const
89{
90 return d->m_sticky;
91}
92
93void AbstractDataPluginItem::setSticky(bool sticky)
94{
95 if (d->m_sticky != sticky) {
96 d->m_sticky = sticky;
97 Q_EMIT stickyChanged();
98 }
99}
100
101void AbstractDataPluginItem::toggleFavorite()
102{
103 setFavorite(!isFavorite());
104}
105
106qreal AbstractDataPluginItem::addedAngularResolution() const
107{
108 return d->m_addedAngularResolution;
109}
110
111void AbstractDataPluginItem::setAddedAngularResolution(qreal resolution)
112{
113 d->m_addedAngularResolution = resolution;
114}
115
116void AbstractDataPluginItem::setSettings(const QHash<QString, QVariant> &settings)
117{
118 Q_UNUSED(settings)
119}
120
121QAction *AbstractDataPluginItem::action()
122{
123 return nullptr;
124}
125
126void AbstractDataPluginItem::addDownloadedFile(const QString &url, const QString &type)
127{
128 Q_UNUSED(url)
129 Q_UNUSED(type)
130}
131
132QList<QAction *> AbstractDataPluginItem::actions()
133{
134 QList<QAction *> result;
135 QAction *pluginAction = action();
136
137 if (pluginAction) {
138 result << pluginAction;
139 }
140
141 return result;
142}
143
144} // Marble namespace
145
146#include "moc_AbstractDataPluginItem.cpp"
This file contains the headers for ViewportParams.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.