digiKam
Loading...
Searching...
No Matches
importcategorizedview.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 : 2012-07-13
7 * Description : Qt categorized item view for camera items
8 *
9 * SPDX-FileCopyrightText: 2012 by Islam Wazery <wazery at ubuntu dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Local includes
18
19#include "itemviewcategorized.h"
20#include "importimagemodel.h"
21#include "importfiltermodel.h"
23#include "itemdelegateoverlay.h"
24#include "camiteminfo.h"
25#include "digikam_export.h"
26
27namespace Digikam
28{
29
30class ImportDelegate;
31class ICCSettingsContainer;
32
33class DIGIKAM_GUI_EXPORT ImportCategorizedView : public ItemViewCategorized
34{
35 Q_OBJECT
36
37public:
38
39 explicit ImportCategorizedView(QWidget* const parent = nullptr);
40 ~ImportCategorizedView() override;
41
42 void setModels(ImportItemModel* model,
43 ImportSortFilterModel* filterModel);
44
45 ImportItemModel* importItemModel() const;
46 ImportSortFilterModel* importSortFilterModel() const;
47
48 QItemSelectionModel* getSelectionModel() const;
49
53 ImportFilterModel* importFilterModel() const;
54
58 ImportThumbnailModel* importThumbnailModel() const;
59
60 ImportDelegate* delegate() const;
61
62 CamItemInfo currentInfo() const;
63 QUrl currentUrl() const;
64
65 QList<CamItemInfo> selectedCamItemInfos() const;
66 QList<CamItemInfo> selectedCamItemInfosCurrentFirst() const;
67 QList<QUrl> selectedUrls() const;
68
69 QList<CamItemInfo> camItemInfos() const;
70 QList<QUrl> urls() const;
71
75 void toIndex(const QUrl& url);
76
83 CamItemInfo nextInOrder(const CamItemInfo& startingPoint, int nth);
84
86 {
87 return nextInOrder(info, -1);
88 }
89
91 {
92 return nextInOrder(info, 1);
93 }
94
99 void addOverlay(ItemDelegateOverlay* overlay, ImportDelegate* delegate = nullptr);
100 void removeOverlay(ItemDelegateOverlay* overlay);
101
102 void addSelectionOverlay(ImportDelegate* delegate = nullptr);
103
104 ThumbnailSize thumbnailSize() const;
105
106 virtual void setThumbnailSize(const ThumbnailSize& size);
107
108public Q_SLOTS:
109
110 void setThumbnailSize(int size);
111
115 void setCurrentWhenAvailable(qlonglong camItemId);
116
120 void setCurrentUrl(const QUrl& url);
121
125 void setCurrentInfo(const CamItemInfo& info);
126
130 void setSelectedUrls(const QList<QUrl>& urlList);
131
135 void setSelectedCamItemInfos(const QList<CamItemInfo>& infos);
136
140 void hintAt(const CamItemInfo& info);
141
142Q_SIGNALS:
143
144 void currentChanged(const CamItemInfo& info);
145
150 void selected(const QList<CamItemInfo>& newSelectedInfos);
151
156 void deselected(const QList<CamItemInfo>& nowDeselectedInfos);
157
162
167
168protected Q_SLOTS:
169
170 void slotCamItemInfosAdded();
171
172protected:
173
175 QSortFilterProxyModel* filterModel() const override;
176 AbstractItemDragDropHandler* dragDropHandler() const override;
177 QModelIndex nextIndexHint(const QModelIndex& indexToAnchor, const QItemSelectionRange& removed) const override;
178
179 void setItemDelegate(ImportDelegate* delegate);
180 void indexActivated(const QModelIndex& index, Qt::KeyboardModifiers modifiers) override;
181 void currentChanged(const QModelIndex& index, const QModelIndex& previous) override;
182 void paintEvent(QPaintEvent* e) override;
183 void selectionChanged(const QItemSelection&, const QItemSelection&) override;
184 void updateGeometries() override;
185
187 virtual void activated(const CamItemInfo& info, Qt::KeyboardModifiers modifiers);
188 virtual void showContextMenuOnInfo(QContextMenuEvent* event, const CamItemInfo& info);
189 void showContextMenuOnIndex(QContextMenuEvent* event, const QModelIndex& index) override;
190
191private Q_SLOTS:
192
193 void slotFileChanged(const QString& filePath);
194 void slotDelayedEnter();
195 void slotIccSettingsChanged(const ICCSettingsContainer&, const ICCSettingsContainer&);
196
197private:
198
199 void scrollToStoredItem();
200
201private:
202
203 // Disable
205 ImportCategorizedView& operator=(const ImportCategorizedView&) = delete;
206
207private:
208
209 class Private;
210 Private* const d = nullptr;
211};
212
213} // namespace Digikam
Definition abstractitemdragdrophandler.h:32
Definition camiteminfo.h:39
Definition iccsettingscontainer.h:35
Definition importcategorizedview.h:34
CamItemInfo nextInfo(const CamItemInfo &info)
Definition importcategorizedview.h:90
void deselected(const QList< CamItemInfo > &nowDeselectedInfos)
void selected(const QList< CamItemInfo > &newSelectedInfos)
CamItemInfo previousInfo(const CamItemInfo &info)
Definition importcategorizedview.h:85
void currentChanged(const CamItemInfo &info)
void camItemInfoActivated(const CamItemInfo &info)
Definition importdelegate.h:35
Definition importfiltermodel.h:91
Definition importimagemodel.h:33
Definition importfiltermodel.h:33
Definition importthumbnailmodel.h:30
Definition itemdelegateoverlay.h:31
Definition itemviewcategorized.h:34
Definition thumbnailsize.h:32
Definition datefolderview.cpp:34