digiKam
digikamitemview.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-04-24
7  * Description : Qt model-view for items
8  *
9  * Copyright (C) 2009-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_DIGIKAMITEM_VIEW_H
26 #define DIGIKAM_DIGIKAMITEM_VIEW_H
27 
28 // Local includes
29 
30 #include "applicationsettings.h"
31 #include "itemcategorizedview.h"
32 #include "itemviewutilities.h"
34 
35 namespace Digikam
36 {
37 
38 class ItemViewUtilities;
39 class ItemInfoList;
40 
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit DigikamItemView(QWidget* const parent = nullptr);
49  ~DigikamItemView() override;
50 
52 
53  int fitToWidthIcons();
54  bool getFaceMode() const;
55 
56  void setThumbnailSize(const ThumbnailSize& size) override;
57 
58  ItemInfoList allItemInfos(bool grouping = false) const;
59  ItemInfoList selectedItemInfos(bool grouping = false) const;
60  ItemInfoList selectedItemInfosCurrentFirst(bool grouping = false) const;
63 
64 public Q_SLOTS:
65 
66  void openFile(const ItemInfo& info);
67 
70 
71  void rename();
72 
73  void assignRating(const QList<QModelIndex>& index, int rating);
74 
75  void setFaceMode(bool on);
76  void confirmFaces(const QList<QModelIndex>& indexes, int tagId);
77 
83  void removeFaces(const QList<QModelIndex>& indexes);
84 
88  void unknownFaces(const QList<QModelIndex>& indexes);
89 
101  void rejectFaces(const QList<QModelIndex>& indexes);
102 
106  void ignoreFaces(const QList<QModelIndex>& indexes);
107 
108  QList<int> getFaceIds(const QList<QModelIndex>& indexes) const;
109 
110  void dragDropSort(const ItemInfo& pick, const QList<ItemInfo>& infos);
111 
112 Q_SIGNALS:
113 
114  void previewRequested(const ItemInfo& info);
115  void signalSeparationModeChanged(int category);
116  void signalShowContextMenu(QContextMenuEvent* event,
117  const QList<QAction*>& actions = QList<QAction*>());
118 
119  void signalShowContextMenuOnInfo(QContextMenuEvent* event, const ItemInfo& info,
120  const QList<QAction*>& actions,
122 
123  void signalShowGroupContextMenu(QContextMenuEvent* event,
124  const QList<ItemInfo>& selectedInfos,
126 
127 protected Q_SLOTS:
128 
129  void groupIndicatorClicked(const QModelIndex& index);
130  void showGroupContextMenu(const QModelIndex& index, QContextMenuEvent* event);
131 
132 protected:
133 
134  void addRejectionOverlay(ItemDelegate* delegate = nullptr);
135  void addAssignNameOverlay(ItemDelegate* delegate = nullptr);
136 
137  void activated(const ItemInfo& info, Qt::KeyboardModifiers modifiers) override;
138  void showContextMenuOnInfo(QContextMenuEvent* event, const ItemInfo& info) override;
139  void showContextMenu(QContextMenuEvent* event) override;
140  void slotSetupChanged() override;
141 
142  bool hasHiddenGroupedImages(const ItemInfo& info) const override;
143 
146 
147 private Q_SLOTS:
148 
149  void slotRotateLeft(const QList<QModelIndex>&);
150  void slotRotateRight(const QList<QModelIndex>&);
151  void slotFullscreen(const QList<QModelIndex>&);
152  void slotInitProgressIndicator();
153  void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible) override;
154 
155 private:
156 
157  class Private;
158  Private* const d;
159 };
160 
161 } // namespace Digikam
162 
163 #endif // DIGIKAM_DIGIKAMITEM_VIEW_H
OperationType
Definition: applicationsettings.h:99
Definition: digikamitemview_p.h:50
Definition: digikamitemview.h:43
void showGroupContextMenu(const QModelIndex &index, QContextMenuEvent *event)
Definition: digikamitemview.cpp:608
void setThumbnailSize(const ThumbnailSize &size) override
Definition: digikamitemview.cpp:190
void setFaceMode(bool on)
Definition: digikamitemview.cpp:328
void groupIndicatorClicked(const QModelIndex &index)
Definition: digikamitemview.cpp:648
void signalShowContextMenu(QContextMenuEvent *event, const QList< QAction * > &actions=QList< QAction * >())
~DigikamItemView() override
Definition: digikamitemview.cpp:180
void deleteSelectedDirectly(const ItemViewUtilities::DeleteMode deleteMode=ItemViewUtilities::DeleteUseTrash)
Definition: digikamitemview.cpp:634
void confirmFaces(const QList< QModelIndex > &indexes, int tagId)
Definition: digikamitemview.cpp:404
void assignRating(const QList< QModelIndex > &index, int rating)
Definition: digikamitemview.cpp:642
void previewRequested(const ItemInfo &info)
bool selectedNeedGroupResolving(const ApplicationSettings::OperationType type) const
Definition: digikamitemview.cpp:282
void addRejectionOverlay(ItemDelegate *delegate=nullptr)
Definition: digikamitemview.cpp:364
void signalSeparationModeChanged(int category)
void activated(const ItemInfo &info, Qt::KeyboardModifiers modifiers) override
Reimplement these in a subclass.
Definition: digikamitemview.cpp:569
bool allNeedGroupResolving(const ApplicationSettings::OperationType type) const
Definition: digikamitemview.cpp:277
QList< int > getFaceIds(const QList< QModelIndex > &indexes) const
Definition: digikamitemview.cpp:557
void showContextMenu(QContextMenuEvent *event) override
Definition: digikamitemview.cpp:614
void rejectFaces(const QList< QModelIndex > &indexes)
Definition: digikamitemview.cpp:499
void deleteSelected(const ItemViewUtilities::DeleteMode deleteMode=ItemViewUtilities::DeleteUseTrash)
Definition: digikamitemview.cpp:624
void ignoreFaces(const QList< QModelIndex > &indexes)
Definition: digikamitemview.cpp:533
void addAssignNameOverlay(ItemDelegate *delegate=nullptr)
Definition: digikamitemview.cpp:386
void unknownFaces(const QList< QModelIndex > &indexes)
Definition: digikamitemview.cpp:475
void signalShowGroupContextMenu(QContextMenuEvent *event, const QList< ItemInfo > &selectedInfos, ItemFilterModel *filterModel)
ItemInfoList imageInfos(const QList< QModelIndex > &indexes, ApplicationSettings::OperationType type) const
Definition: digikamitemview.cpp:310
void showContextMenuOnInfo(QContextMenuEvent *event, const ItemInfo &info) override
Definition: digikamitemview.cpp:603
DigikamItemView(QWidget *const parent=nullptr)
Definition: digikamitemview.cpp:78
bool hasHiddenGroupedImages(const ItemInfo &info) const override
must be implemented by parent view
Definition: digikamitemview.cpp:303
void dragDropSort(const ItemInfo &pick, const QList< ItemInfo > &infos)
Definition: digikamitemview.cpp:226
void removeFaces(const QList< QModelIndex > &indexes)
Definition: digikamitemview.cpp:452
void slotSetupChanged() override
Definition: digikamitemview.cpp:292
void rename()
Definition: digikamitemview.cpp:662
ItemViewUtilities * utilities() const
Definition: digikamitemview.cpp:185
bool getFaceMode() const
Definition: digikamitemview.cpp:323
void openFile(const ItemInfo &info)
Definition: digikamitemview.cpp:619
int fitToWidthIcons()
Definition: digikamitemview.cpp:287
void signalShowContextMenuOnInfo(QContextMenuEvent *event, const ItemInfo &info, const QList< QAction * > &actions, ItemFilterModel *filterModel)
Definition: groupingviewimplementation.h:39
Definition: itemcategorizedview.h:49
ItemInfoList selectedItemInfosCurrentFirst() const
Definition: itemcategorizedview.cpp:335
ItemInfoList allItemInfos() const
Definition: itemcategorizedview.cpp:320
ItemDelegate * delegate() const
Definition: itemcategorizedview.cpp:239
ItemInfoList selectedItemInfos() const
Definition: itemcategorizedview.cpp:330
QSortFilterProxyModel * filterModel() const override
Definition: itemcategorizedview.cpp:234
Definition: itemdelegate.h:44
Definition: itemfiltermodel.h:125
Definition: iteminfolist.h:47
Definition: iteminfo.h:78
Definition: itemviewutilities.h:44
DeleteMode
Definition: itemviewutilities.h:50
@ DeleteUseTrash
Definition: itemviewutilities.h:52
Definition: thumbnailsize.h:42
Definition: datefolderview.cpp:43