digiKam
iojob.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 : 2015-06-15
7  * Description : IO Jobs for file systems jobs
8  *
9  * Copyright (C) 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10  * Copyright (C) 2018 by Maik Qualmann <metzpinguin at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_IO_JOB_H
26 #define DIGIKAM_IO_JOB_H
27 
28 // Qt includes
29 
30 #include <QUrl>
31 
32 // Local includes
33 
34 #include "actionthreadbase.h"
35 #include "digikam_export.h"
36 #include "iojobdata.h"
37 
38 namespace Digikam
39 {
40 
41 class ItemInfo;
42 
43 class DIGIKAM_GUI_EXPORT IOJob : public ActionJob
44 {
45  Q_OBJECT
46 
47 protected:
48 
49  IOJob();
50 
51 Q_SIGNALS:
52 
53  void signalError(const QString& errMsg);
54  void signalOneProccessed(const QUrl& url);
55 
56 private:
57 
58  // Disable
59  explicit IOJob(QObject*);
60 };
61 
62 // ---------------------------------------
63 
64 class DIGIKAM_GUI_EXPORT CopyOrMoveJob : public IOJob
65 {
66  Q_OBJECT
67 
68 public:
69 
70  explicit CopyOrMoveJob(IOJobData* const data);
71 
72 protected:
73 
74  void run() override;
75 
76 private:
77 
78  // Disable
79  CopyOrMoveJob(QObject*);
80 
81 private:
82 
83  IOJobData* m_data;
84 };
85 
86 // ---------------------------------------
87 
88 class DIGIKAM_GUI_EXPORT DeleteJob : public IOJob
89 {
90  Q_OBJECT
91 
92 public:
93 
94  explicit DeleteJob(IOJobData* const data);
95 
96 protected:
97 
98  void run() override;
99 
100 private:
101 
102  // Disable
103  DeleteJob(QObject*);
104 
105 private:
106 
107  IOJobData* m_data;
108 };
109 
110 // ---------------------------------------
111 
112 class DIGIKAM_GUI_EXPORT RenameFileJob : public IOJob
113 {
114  Q_OBJECT
115 
116 public:
117 
118  explicit RenameFileJob(IOJobData* const data);
119 
120 Q_SIGNALS:
121 
122  void signalRenameFailed(const QUrl& url);
123 
124 protected:
125 
126  void run() override;
127 
128 private:
129 
130  // Disable
131  RenameFileJob(QObject*);
132 
133 private:
134 
135  IOJobData* m_data;
136 };
137 
138 // ----------------------------------------------
139 
140 class DIGIKAM_GUI_EXPORT DTrashItemsListingJob : public IOJob
141 {
142  Q_OBJECT
143 
144 public:
145 
146  explicit DTrashItemsListingJob(const QString& collectionPath);
147 
148 Q_SIGNALS:
149 
150  void trashItemInfo(const DTrashItemInfo& info);
151 
152 protected:
153 
154  void run() override;
155 
156 private:
157 
158  // Disable
159  DTrashItemsListingJob(QObject*);
160 
161 private:
162 
163  QString m_collectionPath;
164 };
165 
166 // ----------------------------------------------
167 
168 class DIGIKAM_GUI_EXPORT RestoreDTrashItemsJob : public IOJob
169 {
170  Q_OBJECT
171 
172 public:
173 
174  explicit RestoreDTrashItemsJob(IOJobData* const data);
175 
176 protected:
177 
178  void run() override;
179 
180 private:
181 
182  // Disable
183  RestoreDTrashItemsJob(QObject*);
184 
185 private:
186 
187  IOJobData* m_data;
188 };
189 
190 // ----------------------------------------------
191 
192 class DIGIKAM_GUI_EXPORT EmptyDTrashItemsJob : public IOJob
193 {
194  Q_OBJECT
195 
196 public:
197 
198  explicit EmptyDTrashItemsJob(IOJobData* const data);
199 
200 protected:
201 
202  void run() override;
203 
204 private:
205 
206  // Disable
207  EmptyDTrashItemsJob(QObject*);
208 
209 private:
210 
211  IOJobData* m_data;
212 };
213 
214 } // namespace Digikam
215 
216 #endif // DIGIKAM_IO_JOB_H
Definition: actionthreadbase.h:45
Definition: iojob.h:65
Definition: dtrashiteminfo.h:36
Definition: iojob.h:141
void trashItemInfo(const DTrashItemInfo &info)
Definition: iojob.h:89
Definition: iojob.h:193
Definition: iojobdata.h:45
Definition: iojob.h:44
void signalError(const QString &errMsg)
void signalOneProccessed(const QUrl &url)
Definition: iojob.h:113
void signalRenameFailed(const QUrl &url)
Definition: iojob.h:169
Definition: datefolderview.cpp:43