digiKam
itemlister.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 : 2007-03-20
7  * Description : Listing information from database.
8  *
9  * Copyright (C) 2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2007-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11  * Copyright (C) 2007-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  * Copyright (C) 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_ITEM_LISTER_H
28 #define DIGIKAM_ITEM_LISTER_H
29 
30 // Qt includes
31 
32 #include <QString>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 #include "iteminfo.h"
38 #include "iteminfolist.h"
39 #include "coredbaccess.h"
40 #include "coredburl.h"
41 #include "itemlisterrecord.h"
42 #include "itemlisterreceiver.h"
43 #include "dbjobinfo.h"
44 
45 namespace Digikam
46 {
47 
48 class DIGIKAM_DATABASE_EXPORT ItemLister
49 {
50 
51 public:
52 
53  explicit ItemLister();
54  ~ItemLister();
55 
59  void setRecursive(bool recursive);
60 
65  void setListOnlyAvailable(bool listOnlyAvailable);
66 
70  void list(ItemListerReceiver* const receiver,
71  const CoreDbUrl& url);
72 
77  void listDateRange(ItemListerReceiver* const receiver,
78  const QDate& startDate,
79  const QDate& endDate);
80 
81  // -----------------------------------------------------------------------------
82 
87 
88 public:
89 
94  void listPAlbum(ItemListerReceiver* const receiver,
95  int albumRootId,
96  const QString& album);
97 
98 private:
99 
100  QSet<int> albumRootsToList() const;
101 
103 
104  // -----------------------------------------------------------------------------
105 
110 
111 public:
112 
117  void listTag(ItemListerReceiver* const receiver,
118  const QList<int>& tagIds);
119 
127  void listImageTagPropertySearch(ItemListerReceiver* const receiver,
128  const QString& xml);
129 
130  QString tagSearchXml(int tagId,
131  const QString& type,
132  bool includeChildTags) const;
133 
135 
136  // -----------------------------------------------------------------------------
137 
142 
143 public:
144 
152  void listSearch(ItemListerReceiver* const receiver,
153  const QString& xml,
154  int limit = 0,
155  qlonglong referenceImageId = -1);
156 
162  void listHaarSearch(ItemListerReceiver* const receiver,
163  const QString& xml);
164 
169  void listAreaRange(ItemListerReceiver* const receiver,
170  double lat1,
171  double lat2,
172  double lon1,
173  double lon2);
174 
175 private:
176 
182  void listFromHaarSearch(ItemListerReceiver* const receiver,
183  const QMap<qlonglong,
184  double>& imageSimilarityMap);
186 
187  // -----------------------------------------------------------------------------
188 
193 
194 public:
195 
200  void listFaces(ItemListerReceiver* const receiver,
201  int personId);
202 
203 private:
204 
205  void listFromIdList(ItemListerReceiver* const receiver,
206  const QList<qlonglong>& imageIds);
207 
209 
210 private:
211 
212  // Disable
213  ItemLister(const ItemLister&) = delete;
214  ItemLister& operator=(const ItemLister&) = delete;
215 
216 private:
217 
218  class Private;
219  Private* const d;
220 };
221 
222 } // namespace Digikam
223 
224 #endif // DIGIKAM_ITEM_LISTER_H
Definition: coredburl.h:43
Definition: itemlisterreceiver.h:45
Definition: itemlister_p.h:80
Definition: itemlister.h:49
Definition: datefolderview.cpp:43