digiKam
workflowmanager.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-17
7  * Description : workflow manager.
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_WORKFLOW_MANAGER_H
25 #define DIGIKAM_BQM_WORKFLOW_MANAGER_H
26 
27 // Qt includes
28 
29 #include <QList>
30 #include <QObject>
31 #include <QString>
32 #include <QStringList>
33 
34 // Local includes
35 
36 #include "queuesettings.h"
37 #include "batchtoolutils.h"
38 
39 namespace Digikam
40 {
41 
45 class Workflow
46 {
47 public:
48 
49  explicit Workflow() {};
50  ~Workflow() {};
51 
52 public:
53 
54  QString title;
55  QString desc;
56 
59 };
60 
61 // -----------------------------------------------------------------------------------------------------------
62 
63 class WorkflowManager : public QObject
64 {
65  Q_OBJECT
66 
67 public:
68 
69  static WorkflowManager* instance();
70 
71 public:
72 
77  bool load(QStringList& failed);
78 
82  bool save();
83  void clear();
84 
85  void insert(const Workflow& q);
86  void remove(const Workflow& q);
87 
88  Workflow findByTitle(const QString& title) const;
90 
91 Q_SIGNALS:
92 
93  void signalQueueSettingsAdded(const QString&);
94  void signalQueueSettingsRemoved(const QString&);
95 
96 private:
97 
98  void insertPrivate(const Workflow& q);
99  void removePrivate(const Workflow& q);
100 
101 private:
102 
103  // Disable
104  WorkflowManager();
105  WorkflowManager(QObject*) = delete;
106  ~WorkflowManager() override;
107 
108 private:
109 
111 
112  class Private;
113  Private* const d;
114 };
115 
116 } // namespace Digikam
117 
118 #endif // DIGIKAM_BQM_WORKFLOW_MANAGER_H
Definition: queuesettings.h:44
Definition: workflowmanager.h:64
void signalQueueSettingsRemoved(const QString &)
void signalQueueSettingsAdded(const QString &)
Workflow findByTitle(const QString &title) const
Definition: workflowmanager.cpp:158
void remove(const Workflow &q)
Definition: workflowmanager.cpp:107
friend class WorkflowManagerCreator
Definition: workflowmanager.h:110
bool save()
Definition: workflowmanager.cpp:193
void clear()
Definition: workflowmanager.cpp:173
QList< Workflow > queueSettingsList() const
Definition: workflowmanager.cpp:188
void insert(const Workflow &q)
Definition: workflowmanager.cpp:96
bool load(QStringList &failed)
Definition: workflowmanager.cpp:349
static WorkflowManager * instance()
Definition: workflowmanager.cpp:76
Definition: workflowmanager.h:46
QueueSettings qSettings
Definition: workflowmanager.h:57
BatchSetList aTools
Definition: workflowmanager.h:58
QString desc
Definition: workflowmanager.h:55
~Workflow()
Definition: workflowmanager.h:50
QString title
Definition: workflowmanager.h:50
Workflow()
Definition: workflowmanager.h:49
Definition: datefolderview.cpp:43