digiKam
mapbackend.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 : Base-class for backends for geolocation interface
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2011 by Michael G. Hansen <mike at mghansen dot de>
11  * Copyright (C) 2014 by Justus Schwartz <justus at gmx dot li>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_MAP_BACKEND_H
27 #define DIGIKAM_MAP_BACKEND_H
28 
29 // Qt includes
30 
31 #include <QModelIndex>
32 
33 // Local includes
34 
35 #include "geoifacecommon.h"
36 #include "digikam_export.h"
37 
38 class QMenu;
39 class QWidget;
40 
41 class KConfigGroup;
42 
43 namespace Marble
44 {
45  class GeoDataLatLonBox;
46 }
47 
48 namespace Digikam
49 {
50 
51 class DIGIKAM_EXPORT MapBackend : public QObject
52 {
53 
54 Q_OBJECT
55 
56 public:
57 
58  explicit MapBackend(const QExplicitlySharedDataPointer<GeoIfaceSharedData>& sharedData, QObject* const parent);
59  ~MapBackend() override;
60 
61  virtual QString backendName() const = 0;
62  virtual QString backendHumanName() const = 0;
63  virtual QWidget* mapWidget() = 0;
64  virtual void releaseWidget(GeoIfaceInternalWidgetInfo* const info) = 0;
65  virtual void mapWidgetDocked(const bool state) = 0;
66 
67  virtual GeoCoordinates getCenter() const = 0;
68  virtual void setCenter(const GeoCoordinates& coordinate) = 0;
69 
70  virtual bool isReady() const = 0;
71 
72  virtual void zoomIn() = 0;
73  virtual void zoomOut() = 0;
74 
75  virtual void saveSettingsToGroup(KConfigGroup* const group) = 0;
76  virtual void readSettingsFromGroup(const KConfigGroup* const group) = 0;
77 
78  virtual void addActionsToConfigurationMenu(QMenu* const configurationMenu) = 0;
79 
80  virtual void updateMarkers() = 0;
81  virtual void updateClusters() = 0;
82 
83  virtual bool screenCoordinates(const GeoCoordinates& coordinates,
84  QPoint* const point) = 0;
85  virtual bool geoCoordinates(const QPoint& point,
86  GeoCoordinates* const coordinates) const = 0;
87  virtual QSize mapSize() const = 0;
88 
89  virtual void setZoom(const QString& newZoom) = 0;
90  virtual QString getZoom() const = 0;
91 
92  virtual int getMarkerModelLevel() = 0;
94 /*
95  virtual void updateDragDropMarker(const QPoint& pos,
96  const GeoIfaceDragData* const dragData) = 0;
97  virtual void updateDragDropMarkerPosition(const QPoint& pos) = 0;
98 */
99  virtual void updateActionAvailability() = 0;
100 
101  virtual void regionSelectionChanged() = 0;
102  virtual void mouseModeChanged() = 0;
103 
104  const QExplicitlySharedDataPointer<GeoIfaceSharedData> s;
105 
106  virtual void centerOn(const Marble::GeoDataLatLonBox& box,
107  const bool useSaneZoomLevel = true) = 0;
108  virtual void setActive(const bool state) = 0;
109 
110 public Q_SLOTS:
111 
112  virtual void slotClustersNeedUpdating() = 0;
113  virtual void slotThumbnailAvailableForIndex(const QVariant& index,
114  const QPixmap& pixmap);
115  virtual void slotTrackManagerChanged();
116 
117 Q_SIGNALS:
118 
119  void signalBackendReadyChanged(const QString& backendName);
120  void signalClustersMoved(const QIntList& clusterIndices,
121  const QPair<int, QModelIndex>& snapTarget);
122  void signalClustersClicked(const QIntList& clusterIndices);
123  void signalMarkersMoved(const QIntList& markerIndices);
124  void signalZoomChanged(const QString& newZoom);
126 };
127 
128 } // namespace Digikam
129 
130 #endif // DIGIKAM_MAP_BACKEND_H
Definition: geocoordinates.h:49
QPair< GeoCoordinates, GeoCoordinates > Pair
Definition: geocoordinates.h:64
Class to hold information about map widgets stored in the GeoIfaceGlobalObject.
Definition: geoifacecommon.h:61
Definition: mapbackend.h:52
virtual void addActionsToConfigurationMenu(QMenu *const configurationMenu)=0
virtual QString getZoom() const =0
virtual bool geoCoordinates(const QPoint &point, GeoCoordinates *const coordinates) const =0
virtual void zoomOut()=0
void signalSelectionHasBeenMade(const Digikam::GeoCoordinates::Pair &coordinates)
void signalMarkersMoved(const QIntList &markerIndices)
virtual void regionSelectionChanged()=0
virtual void saveSettingsToGroup(KConfigGroup *const group)=0
virtual int getMarkerModelLevel()=0
virtual void updateMarkers()=0
virtual QString backendName() const =0
void signalClustersClicked(const QIntList &clusterIndices)
virtual void readSettingsFromGroup(const KConfigGroup *const group)=0
virtual void updateClusters()=0
virtual void setCenter(const GeoCoordinates &coordinate)=0
virtual QSize mapSize() const =0
virtual GeoCoordinates getCenter() const =0
virtual void setActive(const bool state)=0
virtual void zoomIn()=0
virtual bool screenCoordinates(const GeoCoordinates &coordinates, QPoint *const point)=0
virtual void mapWidgetDocked(const bool state)=0
void signalClustersMoved(const QIntList &clusterIndices, const QPair< int, QModelIndex > &snapTarget)
virtual QWidget * mapWidget()=0
virtual void centerOn(const Marble::GeoDataLatLonBox &box, const bool useSaneZoomLevel=true)=0
virtual bool isReady() const =0
virtual void updateActionAvailability()=0
virtual void slotClustersNeedUpdating()=0
virtual void setZoom(const QString &newZoom)=0
void signalZoomChanged(const QString &newZoom)
virtual GeoCoordinates::PairList getNormalizedBounds()=0
virtual void releaseWidget(GeoIfaceInternalWidgetInfo *const info)=0
void signalBackendReadyChanged(const QString &backendName)
virtual QString backendHumanName() const =0
const QExplicitlySharedDataPointer< GeoIfaceSharedData > s
Definition: mapbackend.h:104
virtual void mouseModeChanged()=0
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43