digiKam
Loading...
Searching...
No Matches
mapwidgetview.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 : 2010-07-15
7 * Description : central Map view
8 *
9 * SPDX-FileCopyrightText: 2010 by Gabriel Voicu <ping dot gabi at gmail dot com>
10 * SPDX-FileCopyrightText: 2010 by Michael G. Hansen <mike at mghansen dot de>
11 * SPDX-FileCopyrightText: 2014-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
12 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
14 *
15 * ============================================================ */
16
17#pragma once
18
19// Qt includes
20
21#include <QWidget>
22
23// Local includes
24
25#include "geomodelhelper.h"
26#include "digikam_export.h"
28#include "statesavingobject.h"
29#include "itemalbummodel.h"
30#include "thumbnailloadthread.h"
31#include "itemfiltermodel.h"
32#include "camiteminfo.h"
33
34namespace Digikam
35{
36
37class AlbumWidgetStack;
38class ImageChangeset;
39
40class DIGIKAM_GUI_EXPORT MapWidgetView : public QWidget,
42{
43 Q_OBJECT
44
45public:
46
48 {
49 ApplicationDigikam = 1,
50 ApplicationImportUI = 2
51 };
52
53public:
54
55 explicit MapWidgetView(QItemSelectionModel* const selectionModel,
56 DCategorizedSortFilterProxyModel* const imageFilterModel,
57 QWidget* const parent,
58 const Application application);
59 ~MapWidgetView() override;
60
61 void setActive(const bool state);
62 bool getActiveState() const;
63
64 ItemInfo currentItemInfo() const;
65 CamItemInfo currentCamItemInfo() const;
66
67private Q_SLOTS:
68
69 void slotModelChanged();
70 void slotAllTrackFilesReady();
71 void slotLoadTracksFromAlbums();
72
73protected:
74
75 void doLoadState() override;
76 void doSaveState() override;
77
78private:
79
80 class Private;
81 const QScopedPointer<Private> d;
82};
83
84// ----------------------------------------------------------------------------------------------
85
87{
88 Q_OBJECT
89
90public:
91
92 explicit MapViewModelHelper(QItemSelectionModel* const selection,
93 DCategorizedSortFilterProxyModel* const filterModel,
94 QObject* const parent,
95 const MapWidgetView::Application application);
96 ~MapViewModelHelper() override;
97
98 QAbstractItemModel* model() const override;
99 QItemSelectionModel* selectionModel() const override;
100 bool itemCoordinates(const QModelIndex& index,
101 GeoCoordinates* const coordinates) const override;
102
103 QPixmap pixmapFromRepresentativeIndex(const QPersistentModelIndex& index,
104 const QSize& size) override;
105 QPersistentModelIndex bestRepresentativeIndexFromList(const QList<QPersistentModelIndex>& list,
106 const int sortKey) override;
107
108 void onIndicesClicked(const QList<QPersistentModelIndex>& clickedIndices) override;
109
110Q_SIGNALS:
111
112 void signalFilteredImages(const QList<qlonglong>& idList);
113
114private Q_SLOTS:
115
116 void slotThumbnailLoaded(const LoadingDescription&, const QPixmap&);
117 void slotThumbnailLoaded(const CamItemInfo& info);
118 void slotImageChange(const ImageChangeset& changeset);
119
120private:
121
122 class Private;
123 const QScopedPointer<Private> d;
124};
125
126} // namespace Digikam
Definition camiteminfo.h:39
Definition dcategorizedsortfilterproxymodel.h:43
Definition geocoordinates.h:44
Helper class to access data in models.
Definition geomodelhelper.h:37
Definition coredbchangesets.h:38
Definition iteminfo.h:68
Definition loadingdescription.h:35
Definition mapwidgetview.h:87
bool itemCoordinates(const QModelIndex &index, GeoCoordinates *const coordinates) const override
Gets the coordinates of a marker found at current model index.
Definition mapwidgetview.cpp:511
QPersistentModelIndex bestRepresentativeIndexFromList(const QList< QPersistentModelIndex > &list, const int sortKey) override
This function finds the best representative marker from a group of markers. This is needed to display...
Definition mapwidgetview.cpp:618
QAbstractItemModel * model() const override
Definition mapwidgetview.cpp:479
void onIndicesClicked(const QList< QPersistentModelIndex > &clickedIndices) override
Definition mapwidgetview.cpp:809
void signalFilteredImages(const QList< qlonglong > &idList)
QPixmap pixmapFromRepresentativeIndex(const QPersistentModelIndex &index, const QSize &size) override
This function retrieves the thumbnail for an index.
Definition mapwidgetview.cpp:571
~MapViewModelHelper() override
Destructor.
Definition mapwidgetview.cpp:472
QItemSelectionModel * selectionModel() const override
Definition mapwidgetview.cpp:500
Class containing digiKam's central map view.
Definition mapwidgetview.h:42
Application
Definition mapwidgetview.h:48
Definition statesavingobject.h:66
Definition datefolderview.cpp:34