digiKam
versionswidget.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-08-03
7  * Description : widget displaying all image versions in a list
8  *
9  * Copyright (C) 2010 by Martin Klapetek <martin dot klapetek 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_VERSIONS_WIDGET_H
25 #define DIGIKAM_VERSIONS_WIDGET_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 #include <QModelIndex>
31 #include <QUrl>
32 
33 // Local includes
34 
35 #include "digikam_export.h"
36 
37 class KConfigGroup;
38 
39 namespace Digikam
40 {
41 
42 class ActionVersionsOverlay;
43 class ItemInfo;
44 class ShowHideVersionsOverlay;
45 class VersionsDelegate;
46 class VersionsTreeView;
47 
48 class VersionsWidget : public QWidget
49 {
50  Q_OBJECT
51 
52 public:
53 
54  explicit VersionsWidget(QWidget* const parent = nullptr);
55  ~VersionsWidget() override;
56 
57  void readSettings(const KConfigGroup& group);
58  void writeSettings(KConfigGroup& group);
59 
60  VersionsTreeView* view() const;
61  VersionsDelegate* delegate() const;
62 
63  ActionVersionsOverlay* addActionOverlay(const QIcon& icon, const QString& text, const QString& tip = QString());
65 
66 public Q_SLOTS:
67 
68  void setCurrentItem(const ItemInfo& info);
69 
70 Q_SIGNALS:
71 
72  void imageSelected(const ItemInfo& info);
73 
74 protected Q_SLOTS:
75 
76  void slotViewCurrentChanged(const QModelIndex& current, const QModelIndex& previous);
77  void slotViewModeChanged(int mode);
78  void slotSetupChanged();
79 
80 private:
81 
82  void applyViewMode();
83 
84 private:
85 
86  class Private;
87  Private* const d;
88 };
89 
90 } // namespace Digikam
91 
92 #endif // DIGIKAM_VERSIONS_WIDGET_H
Definition: versionsoverlays.h:74
Definition: iteminfo.h:78
Definition: versionsoverlays.h:45
Definition: versionsdelegate.h:41
Definition: versionstreeview.h:45
Definition: versionswidget.h:49
void setCurrentItem(const ItemInfo &info)
Definition: versionswidget.cpp:215
VersionsTreeView * view() const
Definition: versionswidget.cpp:183
ShowHideVersionsOverlay * addShowHideOverlay()
Definition: versionswidget.cpp:201
void readSettings(const KConfigGroup &group)
Definition: versionswidget.cpp:160
ActionVersionsOverlay * addActionOverlay(const QIcon &icon, const QString &text, const QString &tip=QString())
Definition: versionswidget.cpp:193
VersionsDelegate * delegate() const
Definition: versionswidget.cpp:188
void slotViewModeChanged(int mode)
Definition: versionswidget.cpp:253
void slotViewCurrentChanged(const QModelIndex &current, const QModelIndex &previous)
Definition: versionswidget.cpp:221
~VersionsWidget() override
Definition: versionswidget.cpp:155
void imageSelected(const ItemInfo &info)
void writeSettings(KConfigGroup &group)
Definition: versionswidget.cpp:210
VersionsWidget(QWidget *const parent=nullptr)
Definition: versionswidget.cpp:92
void slotSetupChanged()
Definition: versionswidget.cpp:280
Definition: datefolderview.cpp:43