digiKam
dbjobinfo.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-05
7  * Description : DB Jobs Info
8  *
9  * Copyright (C) 2015 by Mohamed_Anwer <m_dot_anwer at gmx 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_DB_JOB_INFO_H
25 #define DIGIKAM_DB_JOB_INFO_H
26 
27 // Qt includes
28 
29 #include <QString>
30 #include <QSet>
31 
32 // Local includes
33 
34 #include "coredburl.h"
35 #include "digikam_export.h"
36 
37 namespace Digikam
38 {
39 
40 class DIGIKAM_DATABASE_EXPORT DBJobInfo
41 {
42 public:
43 
44  void setFoldersJob();
45  bool isFoldersJob() const;
46 
47  void setListAvailableImagesOnly();
48  bool isListAvailableImagesOnly() const;
49 
50  void setRecursive();
51  bool isRecursive() const;
52 
53 protected:
54 
55  explicit DBJobInfo();
56 
57 private:
58 
59  bool m_folders;
60  bool m_listAvailableImagesOnly;
61  bool m_recursive;
62 };
63 
64 // ---------------------------------------------
65 
66 class DIGIKAM_DATABASE_EXPORT AlbumsDBJobInfo : public DBJobInfo
67 {
68 public:
69 
70  explicit AlbumsDBJobInfo();
71 
72  void setAlbumRootId(int id);
73  int albumRootId();
74 
75  void setAlbum(const QString& album);
76  QString album();
77 
78 private:
79 
80  int m_albumRootId;
81  QString m_album;
82 };
83 
84 // ---------------------------------------------
85 
86 class DIGIKAM_DATABASE_EXPORT TagsDBJobInfo : public DBJobInfo
87 {
88 public:
89 
90  explicit TagsDBJobInfo();
91 
92  void setFaceFoldersJob();
93  bool isFaceFoldersJob() const;
94 
95  void setSpecialTag(const QString& tag);
96  QString specialTag() const;
97 
98  void setTagsIds(const QList<int>& tagsIds);
99  QList<int> tagsIds() const;
100 
101 private:
102 
103  bool m_faceFolders;
104  QString m_specialTag;
105  QList<int> m_tagsIds;
106 };
107 
108 // ---------------------------------------------
109 
110 class DIGIKAM_DATABASE_EXPORT GPSDBJobInfo : public DBJobInfo
111 {
112 public:
113 
114  explicit GPSDBJobInfo();
115 
116  void setDirectQuery();
117  bool isDirectQuery() const;
118 
119  void setLat1(qreal lat);
120  qreal lat1() const;
121 
122  void setLng1(qreal lng);
123  qreal lng1() const;
124 
125  void setLat2(qreal lat);
126  qreal lat2() const;
127 
128  void setLng2(qreal lng);
129  qreal lng2() const;
130 
131 private:
132 
133  bool m_directQuery;
134  qreal m_lat1;
135  qreal m_lng1;
136  qreal m_lat2;
137  qreal m_lng2;
138 };
139 
140 // ---------------------------------------------
141 
142 class DIGIKAM_DATABASE_EXPORT SearchesDBJobInfo : public DBJobInfo
143 {
144 public:
145 
146  explicit SearchesDBJobInfo(QList<int>&& searchIds);
147  SearchesDBJobInfo(QSet<qlonglong>&& imageIds, bool isAlbumUpdate);
148 
149  bool isDuplicatesJob() const;
150  bool isAlbumUpdate() const;
151 
152  const QList<int>& searchIds() const;
153  const QSet<qlonglong>& imageIds() const;
154 
155  void setMinThreshold(double t);
156  double minThreshold() const;
157 
158  void setMaxThreshold(double t);
159  double maxThreshold() const;
160 
161  void setSearchResultRestriction(int type);
162  int searchResultRestriction() const;
163 
164 public:
165 
170  QSet<qlonglong> m_imageIds;
173 };
174 
175 // ---------------------------------------------
176 
177 class DIGIKAM_DATABASE_EXPORT DatesDBJobInfo : public DBJobInfo
178 {
179 public:
180 
181  explicit DatesDBJobInfo();
182 
183  void setStartDate(const QDate& date);
184  QDate startDate() const;
185 
186  void setEndDate(const QDate& date);
187  QDate endDate() const;
188 
189 private:
190 
191  QDate m_startDate;
192  QDate m_endDate;
193 };
194 
195 } // namespace Digikam
196 
197 #endif // DIGIKAM_DB_JOB_INFO_H
Definition: dbjobinfo.h:67
Definition: dbjobinfo.h:41
Definition: dbjobinfo.h:178
Definition: dbjobinfo.h:111
Definition: dbjobinfo.h:143
bool m_duplicates
Definition: dbjobinfo.h:166
QList< int > m_searchIds
Definition: dbjobinfo.h:169
double m_minThreshold
Definition: dbjobinfo.h:171
int m_searchResultRestriction
Definition: dbjobinfo.h:168
double m_maxThreshold
Definition: dbjobinfo.h:172
QSet< qlonglong > m_imageIds
Definition: dbjobinfo.h:170
bool m_albumUpdate
Definition: dbjobinfo.h:167
Definition: dbjobinfo.h:87
Definition: datefolderview.cpp:43