digiKam
Loading...
Searching...
No Matches
backendmarble.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2009-12-08
7 * Description : Marble-backend for geolocation interface
8 *
9 * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2009-2011 by Michael G. Hansen <mike at mghansen dot de>
11 * SPDX-FileCopyrightText: 2014 by Justus Schwartz <justus at gmx dot li>
12 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
14 *
15 * ============================================================ */
16
17#pragma once
18
19// Local includes
20
21#include "mapbackend.h"
22#include "trackmanager.h"
23#include "digikam_export.h"
24
26namespace Marble
27{
28 class GeoPainter;
29}
31
32namespace Digikam
33{
34
35class DIGIKAM_EXPORT BackendMarble : public MapBackend
36{
37 Q_OBJECT
38
39public:
40
41 explicit BackendMarble(const QExplicitlySharedDataPointer<GeoIfaceSharedData>& sharedData,
42 QObject* const parent = nullptr);
43 ~BackendMarble() override;
44
45 QString backendName() const override;
46 QString backendHumanName() const override;
47 QWidget* mapWidget() override;
48 void releaseWidget(GeoIfaceInternalWidgetInfo* const info) override;
49 void mapWidgetDocked(const bool state) override;
50
51 GeoCoordinates getCenter() const override;
52 void setCenter(const GeoCoordinates& coordinate) override;
53
54 bool isReady() const override;
55
56 void zoomIn() override;
57 void zoomOut() override;
58
59 void saveSettingsToGroup(KConfigGroup* const group) override;
60 void readSettingsFromGroup(const KConfigGroup* const group) override;
61
62 void addActionsToConfigurationMenu(QMenu* const configurationMenu) override;
63
64 void updateMarkers() override;
65 void updateClusters() override;
66
67 QString getMapTheme() const;
68 void setMapTheme(const QString& newMapTheme);
69
70 QString getProjection() const;
71 void setProjection(const QString& newProjection);
72
73 bool screenCoordinates(const GeoCoordinates& coordinates,
74 QPoint* const point) override;
75 bool geoCoordinates(const QPoint& point,
76 GeoCoordinates* const coordinates) const override;
77 QSize mapSize() const override;
78
79 void setZoom(const QString& newZoom) override;
80 QString getZoom() const override;
81
82 int getMarkerModelLevel() override;
83 GeoCoordinates::PairList getNormalizedBounds() override;
84/*
85 virtual void updateDragDropMarker(const QPoint& pos,
86 const GeoIfaceDragData* const dragData);
87 virtual void updateDragDropMarkerPosition(const QPoint& pos);
88*/
89 void updateActionAvailability() override;
90
91 void marbleCustomPaint(Marble::GeoPainter* painter);
92 void setShowCompass(const bool state);
93 void setShowScaleBar(const bool state);
94 void setShowNavigation(const bool state);
95 void setShowOverviewMap(const bool state);
96
97 void regionSelectionChanged() override;
98 void mouseModeChanged() override;
99
100 void centerOn(const Marble::GeoDataLatLonBox& box,
101 const bool useSaneZoomLevel) override;
102 void setActive(const bool state) override;
103
104 void reload() override;
105
106public Q_SLOTS:
107
108 void slotClustersNeedUpdating() override;
109 void slotThumbnailAvailableForIndex(const QVariant& index,
110 const QPixmap& pixmap) override;
111 void slotUngroupedModelChanged(const int index);
112 void slotTrackManagerChanged() override;
113
114protected:
115
116 bool eventFilter(QObject* object, QEvent* event) override;
117 void createActions();
118 bool findSnapPoint(const QPoint& actualPoint,
119 QPoint* const snapPoint,
120 GeoCoordinates* const snapCoordinates,
121 QPair<int, QModelIndex>* const snapTargetIndex);
122 void GeoPainter_drawPixmapAtCoordinates(Marble::GeoPainter* const painter,
123 const QPixmap& pixmap,
124 const GeoCoordinates& coordinates,
125 const QPoint& basePoint);
126 void drawSearchRectangle(Marble::GeoPainter* const painter,
127 const GeoCoordinates::Pair& searchRectangle,
128 const bool isOldRectangle);
129 void applyCacheToWidget();
130
131 static void deleteInfoFunction(GeoIfaceInternalWidgetInfo* const info);
132
133protected Q_SLOTS:
134
135 void slotMapThemeActionTriggered(QAction* action);
136 void slotProjectionActionTriggered(QAction* action);
137 void slotFloatSettingsTriggered(QAction* action);
138 void slotMarbleZoomChanged();
139 void slotTracksChanged(const QList<TrackManager::TrackChanges>& trackChanges);
140 void slotScheduleUpdate();
141
142private:
143
144 class Private;
145 Private* const d = nullptr;
146};
147
148} // namespace Digikam
Definition backendmarble.h:36
Definition geocoordinates.h:44
QPair< GeoCoordinates, GeoCoordinates > Pair
Definition geocoordinates.h:59
QList< GeoCoordinates::Pair > PairList
Definition geocoordinates.h:60
Class to hold information about map widgets stored in the GeoIfaceGlobalObject.
Definition geoifacecommon.h:51
Definition mapbackend.h:46
Definition datefolderview.cpp:34