digiKam
Loading...
Searching...
No Matches
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 * SPDX-FileCopyrightText: 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QString>
20#include <QSet>
21
22// Local includes
23
24#include "coredburl.h"
25#include "digikam_export.h"
26#include "haariface.h"
27
28namespace Digikam
29{
30
31class DIGIKAM_DATABASE_EXPORT DBJobInfo
32{
33public:
34
35 void setFoldersJob();
36 bool isFoldersJob() const;
37
38 void setListAvailableImagesOnly();
39 bool isListAvailableImagesOnly() const;
40
41 void setRecursive();
42 bool isRecursive() const;
43
44protected:
45
46 DBJobInfo() = default;
47
48private:
49
50 bool m_folders = false;
51 bool m_listAvailableImagesOnly = false;
52 bool m_recursive = false;
53};
54
55// ---------------------------------------------
56
57class DIGIKAM_DATABASE_EXPORT AlbumsDBJobInfo : public DBJobInfo
58{
59public:
60
62
63 void setAlbumRootId(int id);
64 int albumRootId();
65
66 void setAlbum(const QString& album);
67 QString album();
68
69private:
70
71 int m_albumRootId = -1;
72 QString m_album;
73};
74
75// ---------------------------------------------
76
77class DIGIKAM_DATABASE_EXPORT TagsDBJobInfo : public DBJobInfo
78{
79public:
80
82
83 void setFaceFoldersJob();
84 bool isFaceFoldersJob() const;
85
86 void setSpecialTag(const QString& tag);
87 QString specialTag() const;
88
89 void setTagsIds(const QList<int>& tagsIds);
90 QList<int> tagsIds() const;
91
92private:
93
94 bool m_faceFolders = false;
95 QString m_specialTag;
96 QList<int> m_tagsIds;
97};
98
99// ---------------------------------------------
100
101class DIGIKAM_DATABASE_EXPORT GPSDBJobInfo : public DBJobInfo
102{
103public:
104
105 GPSDBJobInfo();
106
107 void setDirectQuery();
108 bool isDirectQuery() const;
109
110 void setLat1(qreal lat);
111 qreal lat1() const;
112
113 void setLng1(qreal lng);
114 qreal lng1() const;
115
116 void setLat2(qreal lat);
117 qreal lat2() const;
118
119 void setLng2(qreal lng);
120 qreal lng2() const;
121
122private:
123
124 bool m_directQuery = false;
125 qreal m_lat1 = 0.0;
126 qreal m_lng1 = 0.0;
127 qreal m_lat2 = 0.0;
128 qreal m_lng2 = 0.0;
129};
130
131// ---------------------------------------------
132
133class DIGIKAM_DATABASE_EXPORT SearchesDBJobInfo : public DBJobInfo
134{
135public:
136
137 explicit SearchesDBJobInfo(QList<int>&& searchIds);
138 SearchesDBJobInfo(QSet<qlonglong>&& imageIds,
139 bool isAlbumUpdate,
140 HaarIface::RefImageSelMethod referenceSelectionMethod,
141 QSet<qlonglong>&& refImageIds);
142
143 bool isDuplicatesJob() const;
144 bool isAlbumUpdate() const;
145
146 const QList<int>& searchIds() const;
147 const QSet<qlonglong>& imageIds() const;
148
149 HaarIface::RefImageSelMethod refImageSelectionMethod() const;
150 const QSet<qlonglong>& refImageIds() const;
151
152 void setMinThreshold(double t);
153 double minThreshold() const;
154
155 void setMaxThreshold(double t);
156 double maxThreshold() const;
157
158 void setSearchResultRestriction(int type);
159 int searchResultRestriction() const;
160
161public:
162
163 bool m_duplicates = false;
164 bool m_albumUpdate = false;
165 int m_searchResultRestriction = 0;
166 QList<int> m_searchIds;
167 QSet<qlonglong> m_imageIds;
168 double m_minThreshold = 0.4;
169 double m_maxThreshold = 1.0;
170 QSet<qlonglong> m_refImageIds;
171 HaarIface::RefImageSelMethod m_refImageSelectionMethod = HaarIface::RefImageSelMethod::OlderOrLarger;
172};
173
174// ---------------------------------------------
175
176class DIGIKAM_DATABASE_EXPORT DatesDBJobInfo : public DBJobInfo
177{
178public:
179
181
182 void setStartDate(const QDate& date);
183 QDate startDate() const;
184
185 void setEndDate(const QDate& date);
186 QDate endDate() const;
187
188private:
189
190 QDate m_startDate;
191 QDate m_endDate;
192};
193
194} // namespace Digikam
Definition dbjobinfo.h:58
Definition dbjobinfo.h:32
Definition dbjobinfo.h:177
Definition dbjobinfo.h:102
RefImageSelMethod
The RefImageSelMethod enum Selection method to determine which image will be the reference in the dup...
Definition haariface.h:100
Definition dbjobinfo.h:134
QSet< qlonglong > m_refImageIds
Image ids of the reference images if duplicates are available.
Definition dbjobinfo.h:170
QList< int > m_searchIds
Definition dbjobinfo.h:166
QSet< qlonglong > m_imageIds
Definition dbjobinfo.h:167
Definition dbjobinfo.h:78
Definition datefolderview.cpp:34