digiKam
versionsoverlays.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-12-26
7  * Description : images versions tree view overlays
8  *
9  * Copyright (C) 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
10  * Copyright (C) 2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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_VERSIONS_OVERLAYS_H
26 #define DIGIKAM_VERSIONS_OVERLAYS_H
27 
28 #include <QString>
29 #include <QIcon>
30 
31 // Local includes
32 
33 #include "digikam_export.h"
34 #include "itemdelegateoverlay.h"
35 #include "itemfiltersettings.h"
36 
37 namespace Digikam
38 {
39 
40 class ItemInfo;
41 class ItemModel;
42 class VersionManagerSettings;
43 
45 {
46  Q_OBJECT
47 
48 public:
49 
50  explicit ShowHideVersionsOverlay(QObject* const parent);
51  void setActive(bool active) override;
52 
53  void setSettings(const VersionManagerSettings& settings);
54 
55 protected:
56 
58  void updateButton(const QModelIndex& index) override;
59  bool checkIndex(const QModelIndex& index) const override;
60 
61 protected Q_SLOTS:
62 
63  void slotClicked(bool checked);
64 
65 protected:
66 
68  class Button;
69 };
70 
71 // -------------------------------------------------------------------
72 
74 {
75  Q_OBJECT
76 
77 public:
78 
79  explicit ActionVersionsOverlay(QObject* const parent,
80  const QIcon& icon,
81  const QString& text,
82  const QString& tip = QString());
83  void setActive(bool active) override;
84 
85  void setReferenceModel(const ItemModel* model);
86 
87 Q_SIGNALS:
88 
89  void activated(const ItemInfo& info);
90 
91 protected:
92 
94  void updateButton(const QModelIndex& index) override;
95  bool checkIndex(const QModelIndex& index) const override;
96 
97 protected Q_SLOTS:
98 
99  void slotClicked(bool checked);
100 
101 protected:
102 
103  class Button;
104  Button* button() const;
105 
106 protected:
107 
108  QIcon m_icon;
109  QString m_text;
110  QString m_tip;
112 };
113 
114 } // namespace Digikam
115 
116 #endif // DIGIKAM_VERSIONS_OVERLAYS_H
Definition: versionsoverlays.h:74
void setActive(bool active) override
Definition: versionsoverlays.cpp:229
void setReferenceModel(const ItemModel *model)
Definition: versionsoverlays.cpp:224
const ItemModel * m_referenceModel
Definition: versionsoverlays.h:111
void activated(const ItemInfo &info)
Button * button() const
Definition: versionsoverlays.cpp:219
void updateButton(const QModelIndex &index) override
Definition: versionsoverlays.cpp:249
QString m_text
Definition: versionsoverlays.h:109
ItemViewHoverButton * createButton() override
Definition: versionsoverlays.cpp:244
QString m_tip
Definition: versionsoverlays.h:110
bool checkIndex(const QModelIndex &index) const override
Definition: versionsoverlays.cpp:271
ActionVersionsOverlay(QObject *const parent, const QIcon &icon, const QString &text, const QString &tip=QString())
Definition: versionsoverlays.cpp:210
void slotClicked(bool checked)
Definition: versionsoverlays.cpp:260
QIcon m_icon
Definition: versionsoverlays.h:108
Definition: itemdelegateoverlay.h:225
Definition: iteminfo.h:78
Definition: itemmodel.h:53
Definition: itemviewhoverbutton.h:42
Definition: versionsoverlays.h:45
ItemViewHoverButton * createButton() override
Definition: versionsoverlays.cpp:111
ShowHideVersionsOverlay(QObject *const parent)
Definition: versionsoverlays.cpp:86
VersionItemFilterSettings m_filter
Definition: versionsoverlays.h:67
bool checkIndex(const QModelIndex &index) const override
Definition: versionsoverlays.cpp:150
void updateButton(const QModelIndex &index) override
Definition: versionsoverlays.cpp:116
void slotClicked(bool checked)
Definition: versionsoverlays.cpp:130
void setActive(bool active) override
Definition: versionsoverlays.cpp:96
void setSettings(const VersionManagerSettings &settings)
Definition: versionsoverlays.cpp:91
Definition: itemfiltersettings.h:269
Definition: versionmanagersettings.h:43
Definition: datefolderview.cpp:43