digiKam
filtershistorywidget.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 filters history used on an image
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_FILTERS_HISTORY_WIDGET_H
25 #define DIGIKAM_FILTERS_HISTORY_WIDGET_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 #include <QAction>
31 #include <QModelIndex>
32 #include <QUrl>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 #include "dmetadata.h"
38 
39 namespace Digikam
40 {
41 
42 class DImageHistory;
43 
44 class RemoveFilterAction : public QAction
45 {
46  Q_OBJECT
47 
48 public:
49 
50  explicit RemoveFilterAction(const QString& label, const QModelIndex& index, QObject* const parent = nullptr);
51  ~RemoveFilterAction() override;
52 
53  void setIndex(const QModelIndex& index);
54 
55 public Q_SLOTS:
56 
57  void triggerSlot();
58 
59 Q_SIGNALS:
60 
61  void actionTriggered(QModelIndex index);
62 
63 private:
64 
65  QModelIndex m_index;
66 };
67 
68 // -------------------------------------------------------------------------------------
69 
70 class FiltersHistoryWidget : public QWidget
71 {
72  Q_OBJECT
73 
74 public:
75 
76  explicit FiltersHistoryWidget(QWidget* const parent);
77  ~FiltersHistoryWidget() override;
78 
79  void setCurrentURL(const QUrl& url = QUrl());
80 
81 public Q_SLOTS:
82 
83  void showCustomContextMenu(const QPoint& position);
84  void setHistory(const DImageHistory& history);
85  void clearData();
86  void setEnabledEntries(int count);
87  void disableEntries(int count);
88  void enableEntries(int count);
89 
90 private:
91 
92  class Private;
93  Private* const d;
94 };
95 
96 } // namespace Digikam
97 
98 #endif // DIGIKAM_FILTERS_HISTORY_WIDGET_H
Definition: dimagehistory.h:49
Definition: filtershistorywidget.h:71
void setHistory(const DImageHistory &history)
Definition: filtershistorywidget.cpp:159
void showCustomContextMenu(const QPoint &position)
Definition: filtershistorywidget.cpp:129
void disableEntries(int count)
Definition: filtershistorywidget.cpp:169
FiltersHistoryWidget(QWidget *const parent)
Definition: filtershistorywidget.cpp:90
void setCurrentURL(const QUrl &url=QUrl())
Definition: filtershistorywidget.cpp:122
void enableEntries(int count)
Definition: filtershistorywidget.cpp:174
void setEnabledEntries(int count)
Definition: filtershistorywidget.cpp:164
void clearData()
Definition: filtershistorywidget.cpp:179
~FiltersHistoryWidget() override
Definition: filtershistorywidget.cpp:115
void actionTriggered(QModelIndex index)
RemoveFilterAction(const QString &label, const QModelIndex &index, QObject *const parent=nullptr)
void setIndex(const QModelIndex &index)
Definition: datefolderview.cpp:43
Definition: scan.h:26