digiKam
queuepool.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 : 2009-02-13
7  * Description : tabbed queue items list.
8  *
9  * Copyright (C) 2009-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_QUEUE_POOL_H
25 #define DIGIKAM_BQM_QUEUE_POOL_H
26 
27 // Qt includes
28 
29 #include <QMap>
30 #include <QTabBar>
31 #include <QWidget>
32 #include <QDragMoveEvent>
33 #include <QDropEvent>
34 #include <QTabWidget>
35 
36 // Local includes
37 
38 #include "iteminfoset.h"
39 
40 namespace Digikam
41 {
42 
43 class DRawDecoding;
44 class AssignedBatchTools;
45 class QueueSettings;
46 class QueueListView;
47 
48 
49 class QueuePoolBar : public QTabBar
50 {
51  Q_OBJECT
52 
53 public:
54 
55  explicit QueuePoolBar(QWidget* const parent);
56  ~QueuePoolBar() override;
57 
58 Q_SIGNALS:
59 
60  void signalTestCanDecode(const QDragMoveEvent*, bool&);
61 
62 private:
63 
64  void dragEnterEvent(QDragEnterEvent* e) override;
65  void dragMoveEvent(QDragMoveEvent* e) override;
66 };
67 
68 // --------------------------------------------------------------------------------------
69 
70 class QueuePool : public QTabWidget
71 {
72  Q_OBJECT
73 
74 public:
75 
76  explicit QueuePool(QWidget* const parent);
77  ~QueuePool() override;
78 
79  QueueListView* currentQueue() const;
80  QString currentTitle() const;
81  QueueListView* findQueueByIndex(int index) const;
82  QueuePoolItemsList queueItemsList(int index) const;
83  int totalPendingItems() const;
84  int totalPendingTasks() const;
85  QMap<int, QString> queuesMap() const;
86  QString queueTitle(int index) const;
87  bool customRenamingRulesAreValid() const;
89  bool saveWorkflow() const;
90 
91  void setBusy(bool b);
92  void setItemBusy(qlonglong id);
93 
97  void applySettings();
98 
99 Q_SIGNALS:
100 
105 
106 public Q_SLOTS:
107 
108  void removeTab(int index);
109 
110  void slotAddQueue();
111  void slotRemoveCurrentQueue();
112  void slotClearList();
114  void slotRemoveItemsDone();
115  void slotAddItems(const ItemInfoList&, int queueId);
117  void slotSettingsChanged(const QueueSettings&);
118  void slotQueueSelected(int);
119 
120 protected:
121 
122  void keyPressEvent(QKeyEvent* event) override;
123 
124 private :
125 
126  QueueListView* findQueueByItemId(qlonglong id) const;
127 
128 private Q_SLOTS:
129 
130  void slotFileChanged(const QString&);
131  void slotCloseQueueRequest(int);
132  void slotTestCanDecode(const QDragMoveEvent*, bool&);
133 };
134 
135 } // namespace Digikam
136 
137 #endif // DIGIKAM_BQM_QUEUE_POOL_H
Definition: batchtoolutils.h:91
Definition: iteminfolist.h:47
Definition: queuelist.h:103
Definition: queuepool.h:50
QueuePoolBar(QWidget *const parent)
Definition: queuepool.cpp:53
void signalTestCanDecode(const QDragMoveEvent *, bool &)
~QueuePoolBar() override
Definition: queuepool.cpp:60
Definition: queuepool.h:71
void signalQueuePoolChanged()
QueuePool(QWidget *const parent)
Definition: queuepool.cpp:116
void slotQueueSelected(int)
Definition: queuepool.cpp:405
QueuePoolItemsList queueItemsList(int index) const
Definition: queuepool.cpp:251
void keyPressEvent(QKeyEvent *event) override
Definition: queuepool.cpp:142
void signalQueueSelected(int id, const QueueSettings &, const AssignedBatchTools &)
QueueListView * currentQueue() const
Definition: queuepool.cpp:169
bool customRenamingRulesAreValid() const
Definition: queuepool.cpp:485
QString queueTitle(int index) const
Definition: queuepool.cpp:221
void removeTab(int index)
Definition: queuepool.cpp:428
void slotAssignedToolsChanged(const AssignedBatchTools &)
Definition: queuepool.cpp:395
QueueListView * findQueueByIndex(int index) const
Definition: queuepool.cpp:204
void slotRemoveItemsDone()
Definition: queuepool.cpp:375
void signalQueueContentsChanged()
void slotAddQueue()
Definition: queuepool.cpp:229
bool saveWorkflow() const
Definition: queuepool.cpp:332
void slotClearList()
Definition: queuepool.cpp:355
void slotRemoveSelectedItems()
Definition: queuepool.cpp:365
void setBusy(bool b)
Definition: queuepool.cpp:154
void setItemBusy(qlonglong id)
Definition: queuepool.cpp:194
~QueuePool() override
Definition: queuepool.cpp:138
void slotSettingsChanged(const QueueSettings &)
Definition: queuepool.cpp:475
void slotAddItems(const ItemInfoList &, int queueId)
Definition: queuepool.cpp:385
void signalItemSelectionChanged()
int totalPendingTasks() const
Definition: queuepool.cpp:289
QMap< int, QString > queuesMap() const
Definition: queuepool.cpp:209
QString currentTitle() const
Definition: queuepool.cpp:174
void applySettings()
Definition: queuepool.cpp:561
int totalPendingItems() const
Definition: queuepool.cpp:272
void slotRemoveCurrentQueue()
Definition: queuepool.cpp:306
bool assignedBatchToolsListsAreValid() const
Definition: queuepool.cpp:517
Definition: queuesettings.h:44
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43