digiKam
Loading...
Searching...
No Matches
itemmarkertiler.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-17
7 * Description : A marker tiler operating on item models
8 *
9 * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2010-2011 by Michael G. Hansen <mike at mghansen dot de>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Qt includes
19
20#include <QItemSelection>
21
22// Local includes
23
24#include "digikam_export.h"
25#include "abstractmarkertiler.h"
26
27namespace Digikam
28{
29class GeoModelHelper;
30
31class DIGIKAM_EXPORT ItemMarkerTiler : public AbstractMarkerTiler
32{
33 Q_OBJECT
34
35private:
36
37 class MyTile;
38
39public:
40
41 explicit ItemMarkerTiler(GeoModelHelper* const modelHelper, QObject* const parent = nullptr);
42 ~ItemMarkerTiler() override;
43
44 TilerFlags tilerFlags() const override;
45 Tile* tileNew() override;
46 void prepareTiles(const GeoCoordinates& upperLeft, const GeoCoordinates& lowerRight, int level) override;
47 void regenerateTiles() override;
48 Tile* getTile(const TileIndex& tileIndex, const bool stopIfEmpty) override;
49 int getTileMarkerCount(const TileIndex& tileIndex) override;
50 int getTileSelectedCount(const TileIndex& tileIndex) override;
51
52 QVariant getTileRepresentativeMarker(const TileIndex& tileIndex, const int sortKey) override;
53 QVariant bestRepresentativeIndexFromList(const QList<QVariant>& indices, const int sortKey) override;
54 QPixmap pixmapFromRepresentativeIndex(const QVariant& index, const QSize& size) override;
55 bool indicesEqual(const QVariant& a, const QVariant& b) const override;
56 GeoGroupState getTileGroupState(const TileIndex& tileIndex) override;
57 GeoGroupState getGlobalGroupState() override;
58
59 void onIndicesClicked(const ClickInfo& clickInfo) override;
60 void onIndicesMoved(const TileIndex::List& tileIndicesList,
61 const GeoCoordinates& targetCoordinates,
62 const QPersistentModelIndex& targetSnapIndex) override;
63
64 void setMarkerGeoModelHelper(GeoModelHelper* const modelHelper);
65 void removeMarkerIndexFromGrid(const QModelIndex& markerIndex, const bool ignoreSelection = false);
66 void addMarkerIndexToGrid(const QPersistentModelIndex& markerIndex);
67
68 void setActive(const bool state) override;
69
70private Q_SLOTS:
71
72 void slotSourceModelRowsInserted(const QModelIndex& parentIndex, int start, int end);
73 void slotSourceModelRowsAboutToBeRemoved(const QModelIndex& parentIndex, int start, int end);
74 void slotSourceModelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
75 void slotSourceModelReset();
76 void slotSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
77 void slotThumbnailAvailableForIndex(const QPersistentModelIndex& index, const QPixmap& pixmap);
78 void slotSourceModelLayoutChanged();
79
80private:
81
82 QList<QPersistentModelIndex> getTileMarkerIndices(const TileIndex& tileIndex);
83
84private:
85
86 class Private;
87 Private* const d = nullptr;
88};
89
90} // namespace Digikam
Definition abstractmarkertiler.h:51
Definition abstractmarkertiler.h:67
Definition abstractmarkertiler.h:35
Definition geocoordinates.h:44
Helper class to access data in models.
Definition geomodelhelper.h:37
Definition itemmarkertiler.h:32
Definition tileindex.h:35
QList< TileIndex > List
Definition tileindex.h:93
Definition datefolderview.cpp:34