digiKam
workflowlist.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 : 2012-12-18
7  * Description : Customized Workflow Settings list.
8  *
9  * Copyright (C) 2012-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_BQM_WORK_FLOW_LIST_H
25 #define DIGIKAM_BQM_WORK_FLOW_LIST_H
26 
27 // Qt includes
28 
29 #include <QTreeWidget>
30 #include <QWidget>
31 #include <QPixmap>
32 #include <QMap>
33 #include <QString>
34 #include <QList>
35 
36 // Local includes
37 
38 #include "batchtool.h"
39 #include "batchtoolsfactory.h"
40 
41 namespace Digikam
42 {
43 
44 class WorkflowList;
45 
46 class WorkflowItem : public QTreeWidgetItem
47 {
48 
49 public:
50 
51  WorkflowItem(WorkflowList* const parent, const QString& name);
52  ~WorkflowItem() override;
53 
54  QString title() const;
55  int count() const;
56 
57 private:
58 
59  Q_DISABLE_COPY(WorkflowItem)
60 };
61 
62 // -------------------------------------------------------------------------
63 
64 class WorkflowList : public QTreeWidget
65 {
66  Q_OBJECT
67 
68 public:
69 
70  explicit WorkflowList(QWidget* const parent);
71  ~WorkflowList() override;
72 
73 Q_SIGNALS:
74 
75  void signalAssignQueueSettings(const QString&);
76 
77 public Q_SLOTS:
78 
79  void slotRemoveQueueSettings(const QString& title);
80  void slotsAddQueueSettings(const QString& title);
81 
82 private Q_SLOTS:
83 
84  void slotContextMenu();
85  void slotAssignQueueSettings();
86 
87 private:
88 
89  WorkflowItem* findByTitle(const QString& title);
90 
91  void startDrag(Qt::DropActions supportedActions) override;
92  QStringList mimeTypes() const override;
93 
94 #if (QT_VERSION > QT_VERSION_CHECK(5, 99, 0))
95  QMimeData* mimeData(const QList<QTreeWidgetItem*>& items) const override;
96 #else
97  // cppcheck-suppress passedByValue
98  QMimeData* mimeData(const QList<QTreeWidgetItem*> items) const override; // clazy:exclude=function-args-by-ref
99 #endif
100 
101  void mouseDoubleClickEvent(QMouseEvent*) override;
102 };
103 
104 } // namespace Digikam
105 
106 #endif // DIGIKAM_BQM_WORK_FLOW_LIST_H
Definition: workflowlist.h:47
~WorkflowItem() override
Definition: workflowlist.cpp:67
QString title() const
Definition: workflowlist.cpp:71
WorkflowItem(WorkflowList *const parent, const QString &name)
Definition: workflowlist.cpp:53
int count() const
Definition: workflowlist.cpp:76
Definition: workflowlist.h:65
~WorkflowList() override
Definition: workflowlist.cpp:130
void slotsAddQueueSettings(const QString &title)
Definition: workflowlist.cpp:134
WorkflowList(QWidget *const parent)
Definition: workflowlist.cpp:83
void slotRemoveQueueSettings(const QString &title)
Definition: workflowlist.cpp:144
void signalAssignQueueSettings(const QString &)
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43