digiKam
Loading...
Searching...
No Matches
backendgooglemaps.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-01
7 * Description : Google-Maps-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
25namespace Digikam
26{
27
28class DIGIKAM_EXPORT BackendGoogleMaps : public MapBackend
29{
30 Q_OBJECT
31
32public:
33
34 explicit BackendGoogleMaps(const QExplicitlySharedDataPointer<GeoIfaceSharedData>& sharedData,
35 QObject* const parent = nullptr);
36 ~BackendGoogleMaps() override;
37
38 QString backendName() const override;
39 QString backendHumanName() const override;
40 QWidget* mapWidget() override;
41 void releaseWidget(GeoIfaceInternalWidgetInfo* const info) override;
42 void mapWidgetDocked(const bool state) override;
43
44 GeoCoordinates getCenter() const override;
45 void setCenter(const GeoCoordinates& coordinate) override;
46
47 bool isReady() const override;
48
49 void zoomIn() override;
50 void zoomOut() override;
51
52 void saveSettingsToGroup(KConfigGroup* const group) override;
53 void readSettingsFromGroup(const KConfigGroup* const group) override;
54
55 void addActionsToConfigurationMenu(QMenu* const configurationMenu) override;
56
57 void updateMarkers() override;
58 void updateClusters() override;
59
60 bool screenCoordinates(const GeoCoordinates& coordinates, QPoint* const point) override;
61 bool geoCoordinates(const QPoint& point, GeoCoordinates* const coordinates) const override;
62 QSize mapSize() const override;
63
64 void setZoom(const QString& newZoom) override;
65 QString getZoom() const override;
66
67 int getMarkerModelLevel() override;
68 GeoCoordinates::PairList getNormalizedBounds() override;
69/*
70 virtual void updateDragDropMarker(const QPoint& pos,
71 const GeoIfaceDragData* const dragData);
72 virtual void updateDragDropMarkerPosition(const QPoint& pos);
73*/
74 void updateActionAvailability() override;
75
76 QString getMapType() const;
77 void setMapType(const QString& newMapType);
78 void setShowMapTypeControl(const bool state);
79 void setShowScaleControl(const bool state);
80 void setShowNavigationControl(const bool state);
81
82 void regionSelectionChanged() override;
83 void mouseModeChanged() override;
84
85 void setActive(const bool state) override;
86
87#ifdef HAVE_GEOLOCATION
88
89 void centerOn(const Marble::GeoDataLatLonBox& latLonBox, const bool useSaneZoomLevel) override;
90
91#endif
92
93 void reload() override;
94
95public Q_SLOTS:
96
97 void slotClustersNeedUpdating() override;
98 void slotThumbnailAvailableForIndex(const QVariant& index, const QPixmap& pixmap) override;
99 void slotUngroupedModelChanged(const int mindex);
100
101protected:
102
103 bool eventFilter(QObject* object, QEvent* event) override;
104 void createActions();
105 void setClusterPixmap(const int clusterId,
106 const QPoint& centerPoint,
107 const QPixmap& clusterPixmap);
108 void setMarkerPixmap(const int modelId,
109 const int markerId,
110 const QPoint& centerPoint,
111 const QPixmap& markerPixmap);
112 void setMarkerPixmap(const int modelId,
113 const int markerId,
114 const QPoint& centerPoint,
115 const QSize& iconSize,
116 const QUrl& iconUrl);
117 void storeTrackChanges(const TrackManager::TrackChanges trackChanges);
118
119private Q_SLOTS:
120
121 void slotHTMLInitialized();
122 void slotSetCenterTimer();
123 void slotMessageEvent(const QString& message);
124 void slotMapTypeActionTriggered(QAction* action);
125 void slotHTMLEvents(const QStringList& eventStrings);
126 void slotFloatSettingsTriggered(QAction* action);
127 void slotSelectionHasBeenMade(const Digikam::GeoCoordinates::Pair& searchCoordinates);
128 void slotTrackManagerChanged() override;
129 void slotTracksChanged(const QList<TrackManager::TrackChanges>& trackChanges);
130 void slotTrackVisibilityChanged(const bool newState);
131
132private:
133
134 void updateZoomMinMaxCache();
135 static void deleteInfoFunction(GeoIfaceInternalWidgetInfo* const info);
136 void addPointsToTrack(const quint64 trackId,
138 const int firstPoint,
139 const int nPoints);
140
141private:
142
143 class Private;
144 Private* const d = nullptr;
145};
146
147} // namespace Digikam
Definition backendgooglemaps.h:29
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
QList< TrackPoint > List
Definition trackmanager.h:75
QPair< Id, ChangeFlag > TrackChanges
Definition trackmanager.h:53
Definition datefolderview.cpp:34