digiKam
lighttablethumbbar.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 : 2007-04-11
7  * Description : light table thumbs bar
8  *
9  * Copyright (C) 2007-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_LIGHT_TABLE_THUMB_BAR_H
25 #define DIGIKAM_LIGHT_TABLE_THUMB_BAR_H
26 
27 // Local includes
28 
29 #include "itemthumbnailbar.h"
30 #include "iteminfo.h"
31 #include "itemlistmodel.h"
32 
33 namespace Digikam
34 {
35 
37 {
38  Q_OBJECT
39 
40 public:
41 
42  explicit LightTableThumbBar(QWidget* const parent);
43  ~LightTableThumbBar() override;
44 
45  void clear();
46 
47  void setItems(const ItemInfoList& list);
48  void setOnLeftPanel(const ItemInfo& info);
49  void setOnRightPanel(const ItemInfo& info);
50  void setNavigateByPair(bool b);
51 
52  void removeItemByInfo(const ItemInfo& info);
53  void toggleTag(int tagID);
54 
55  bool isOnLeftPanel(const ItemInfo& info) const;
56  bool isOnRightPanel(const ItemInfo& info) const;
57  int countItems() const;
58  QModelIndex findItemByInfo(const ItemInfo& info) const;
59  ItemInfo findItemByIndex(const QModelIndex& index) const;
60 
61 Q_SIGNALS:
62 
65  void signalEditItem(const ItemInfo&);
66  void signalRemoveItem(const ItemInfo&);
70 
71 public Q_SLOTS:
72 
73  void slotAssignPickLabel(int);
74  void slotAssignColorLabel(int);
75  void slotAssignRating(int);
76  void slotRatingChanged(const QUrl&, int);
77  void slotColorLabelChanged(const QUrl&, int);
78  void slotPickLabelChanged(const QUrl&, int);
79  void slotToggleTag(const QUrl&, int);
80  void slotDockLocationChanged(Qt::DockWidgetArea area);
81 
82 private:
83 
84  void paintEvent(QPaintEvent*) override;
85  void showContextMenuOnInfo(QContextMenuEvent* e, const ItemInfo& info) override;
86  void assignPickLabel(const ItemInfo& info, int pickId);
87  void assignColorLabel(const ItemInfo& info, int colorId);
88  void assignRating(const ItemInfo& info, int rating);
89  void toggleTag(const ItemInfo& info, int tagID);
90 
91 private Q_SLOTS:
92 
93  void slotSetupChanged() override;
94 
95 private:
96 
97  // Disable
98  LightTableThumbBar(const LightTableThumbBar&) = delete;
99  LightTableThumbBar& operator=(const LightTableThumbBar&) = delete;
100 
101 private:
102 
103  class Private;
104  Private* const d;
105 };
106 
107 } // namespace Digikam
108 
109 #endif // DIGIKAM_LIGHT_TABLE_THUMB_BAR_H
Definition: iteminfolist.h:47
Definition: iteminfo.h:78
Definition: itemthumbnailbar.h:36
Definition: lighttablethumbbar.h:37
bool isOnLeftPanel(const ItemInfo &info) const
Definition: lighttablethumbbar.cpp:423
void slotAssignPickLabel(int)
Definition: lighttablethumbbar.cpp:342
LightTableThumbBar(QWidget *const parent)
Definition: lighttablethumbbar.cpp:181
void removeItemByInfo(const ItemInfo &info)
Definition: lighttablethumbbar.cpp:453
QModelIndex findItemByInfo(const ItemInfo &info) const
Definition: lighttablethumbbar.cpp:433
void setOnRightPanel(const ItemInfo &info)
Definition: lighttablethumbbar.cpp:413
void setNavigateByPair(bool b)
Definition: lighttablethumbbar.cpp:260
bool isOnRightPanel(const ItemInfo &info) const
Definition: lighttablethumbbar.cpp:428
void slotPickLabelChanged(const QUrl &, int)
Definition: lighttablethumbbar.cpp:337
void signalSetItemOnLeftPanel(const ItemInfo &)
void setOnLeftPanel(const ItemInfo &info)
Definition: lighttablethumbbar.cpp:403
void signalRemoveItem(const ItemInfo &)
ItemInfo findItemByIndex(const QModelIndex &index) const
Definition: lighttablethumbbar.cpp:443
void signalSetItemOnRightPanel(const ItemInfo &)
void slotAssignRating(int)
Definition: lighttablethumbbar.cpp:357
void slotAssignColorLabel(int)
Definition: lighttablethumbbar.cpp:347
void slotToggleTag(const QUrl &, int)
Definition: lighttablethumbbar.cpp:378
void toggleTag(int tagID)
Definition: lighttablethumbbar.cpp:383
void clear()
Definition: lighttablethumbbar.cpp:254
void slotRatingChanged(const QUrl &, int)
Definition: lighttablethumbbar.cpp:352
void setItems(const ItemInfoList &list)
Definition: lighttablethumbbar.cpp:229
void signalEditItem(const ItemInfo &)
int countItems() const
Definition: lighttablethumbbar.cpp:463
void slotDockLocationChanged(Qt::DockWidgetArea area)
Definition: lighttablethumbbar.cpp:240
~LightTableThumbBar() override
Definition: lighttablethumbbar.cpp:224
void slotColorLabelChanged(const QUrl &, int)
Definition: lighttablethumbbar.cpp:332
void signalDroppedItems(const QList< ItemInfo > &)
Definition: datefolderview.cpp:43