digiKam
iojobdata.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 : 2018-02-24
7  * Description : Container for IOJob data.
8  *
9  * Copyright (C) 2018 by Maik Qualmann <metzpinguin 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_IO_JOB_DATA_H
25 #define DIGIKAM_IO_JOB_DATA_H
26 
27 // Qt includes
28 
29 #include <QUrl>
30 #include <QList>
31 #include <QDateTime>
32 
33 // Local includes
34 
35 #include "digikam_export.h"
36 #include "dtrashiteminfo.h"
37 
38 namespace Digikam
39 {
40 
41 class PAlbum;
42 class ItemInfo;
43 
44 class DIGIKAM_GUI_EXPORT IOJobData
45 {
46 
47 public:
48 
49  enum Operation
50  {
51  Unknown = 0,
63  Empty
64  };
65 
67  {
68  Continue = 0,
70  Overwrite
71  };
72 
73 public:
74 
75  explicit IOJobData(int operation,
76  const QList<ItemInfo>& infos,
77  PAlbum* const dest = nullptr);
78 
79  explicit IOJobData(int operation,
80  const QList<ItemInfo>& infos,
81  const QUrl& dest);
82 
83  explicit IOJobData(int operation,
84  const QList<QUrl>& urls,
85  PAlbum* const dest = nullptr);
86 
87  explicit IOJobData(int operation,
88  PAlbum* const src,
89  PAlbum* const dest = nullptr);
90 
91  explicit IOJobData(int operation,
92  const QList<QUrl>& urls,
93  const QUrl& dest);
94 
95  explicit IOJobData(int operation,
96  const ItemInfo& info,
97  const QString& newName,
98  bool overwrite = false);
99 
100  explicit IOJobData(int operation,
101  const DTrashItemInfoList& infos);
102 
103  ~IOJobData();
104 
105  void setItemInfos(const QList<ItemInfo>& infos);
106  void setSourceUrls(const QList<QUrl>& urls);
107 
108  void setDestUrl(const QUrl& srcUrl,
109  const QUrl& destUrl);
110 
111  void setProgressId(const QString& id);
112 
113  void setFileConflict(int fc);
114 
115  int operation() const;
116 
117  int fileConflict() const;
118 
119  PAlbum* srcAlbum() const;
120  PAlbum* destAlbum() const;
121 
122  QUrl destUrl(const QUrl& srcUrl = QUrl()) const;
123  QUrl getNextUrl() const;
124 
125  QString getProgressId() const;
126  QDateTime jobTime() const;
127 
128  ItemInfo findItemInfo(const QUrl& url) const;
129 
130  QList<QUrl> sourceUrls() const;
131  QList<ItemInfo> itemInfos() const;
132 
133  DTrashItemInfoList trashItems() const;
134 
135 private:
136 
137  // Disable
138  IOJobData(const IOJobData&) = delete;
139  IOJobData& operator=(const IOJobData&) = delete;
140 
141 private:
142 
143  class Private;
144  Private* const d;
145 };
146 
147 } // namespace Digikam
148 
149 #endif // DIGIKAM_IO_JOB_DATA_H
Definition: iojobdata.h:45
FileConflict
Definition: iojobdata.h:67
@ AutoRename
Definition: iojobdata.h:69
Operation
Definition: iojobdata.h:50
@ Rename
Definition: iojobdata.h:60
@ Trash
Definition: iojobdata.h:62
@ Restore
Definition: iojobdata.h:59
@ CopyToExt
Definition: iojobdata.h:55
@ CopyImage
Definition: iojobdata.h:53
@ MoveFiles
Definition: iojobdata.h:58
@ MoveAlbum
Definition: iojobdata.h:56
@ CopyAlbum
Definition: iojobdata.h:52
@ Delete
Definition: iojobdata.h:61
@ CopyFiles
Definition: iojobdata.h:54
@ MoveImage
Definition: iojobdata.h:57
Definition: iteminfo.h:78
Definition: album.h:357
Definition: datefolderview.cpp:43