digiKam
coredburl.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-19
7  * Description : Core database Url interface.
8  *
9  * Copyright (C) 2007-2008 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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_CORE_DB_URL_H
25 #define DIGIKAM_CORE_DB_URL_H
26 
27 // Qt includes
28 
29 #include <QDateTime>
30 #include <QList>
31 #include <QUrl>
32 
33 // Local includes
34 
35 #include "digikam_export.h"
36 #include "dbengineparameters.h"
37 #include "coredbaccess.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_DATABASE_EXPORT CoreDbUrl : public QUrl
43 {
44 public:
45 
63  static CoreDbUrl fromFileUrl(const QUrl& fileUrl,
64  const QUrl& albumRoot,
65  int albumRootId,
66  const DbEngineParameters& parameters = CoreDbAccess::parameters());
67 
68  static CoreDbUrl fromFileUrl(const QUrl& fileUrl,
69  const QUrl& albumRoot,
70  const DbEngineParameters& parameters = CoreDbAccess::parameters());
71 
77  static CoreDbUrl fromAlbumAndName(const QString& name,
78  const QString& album,
79  const QUrl& albumRoot,
80  int albumRootId,
81  const DbEngineParameters& parameters = CoreDbAccess::parameters());
82 
83  static CoreDbUrl fromAlbumAndName(const QString& name,
84  const QString& album,
85  const QUrl& albumRoot,
86  const DbEngineParameters& parameters = CoreDbAccess::parameters());
87 
91  static CoreDbUrl albumUrl(const DbEngineParameters& parameters = CoreDbAccess::parameters());
92 
98  static CoreDbUrl fromTagIds(const QList<int>& tagIds,
99  const DbEngineParameters& parameters = CoreDbAccess::parameters());
100 
104  static CoreDbUrl dateUrl(const DbEngineParameters& parameters = CoreDbAccess::parameters());
105 
110  static CoreDbUrl fromDateForMonth(const QDate& date,
111  const DbEngineParameters& parameters = CoreDbAccess::parameters());
112 
117  static CoreDbUrl fromDateForYear(const QDate& date,
118  const DbEngineParameters& parameters = CoreDbAccess::parameters());
119 
125  static CoreDbUrl fromDateRange(const QDate& startDate, const QDate& endDate,
126  const DbEngineParameters& parameters = CoreDbAccess::parameters());
127 
131  static CoreDbUrl mapImagesUrl(const DbEngineParameters& parameters = CoreDbAccess::parameters());
132 
133  static CoreDbUrl fromAreaRange(const qreal lat1, const qreal lng1,
134  const qreal lat2, const qreal lng2,
135  const DbEngineParameters& parameters = CoreDbAccess::parameters());
136 
140  static CoreDbUrl searchUrl(int searchId, const DbEngineParameters& parameters = CoreDbAccess::parameters());
141 
145  explicit CoreDbUrl(const QUrl& digikamUrl);
146 
150  CoreDbUrl();
151 
156  bool isAlbumUrl() const;
157  bool isTagUrl() const;
158  bool isDateUrl() const;
159  bool isSearchUrl() const;
160  bool isMapImagesUrl() const;
161 
166  DbEngineParameters parameters() const;
167 
172  void setParameters(const DbEngineParameters& parameters);
173 
180 
185  QUrl albumRoot() const;
186 
191  QString albumRootPath() const;
192 
196  int albumRootId() const;
197 
202  QString album() const;
203 
207  QString name() const;
208 
212  QUrl fileUrl() const;
213 
215 
219  int tagId() const;
220 
225  QList<int> tagIds() const;
226 
228 
232  QDate startDate() const;
233 
237  QDate endDate() const;
238 
240 
245  bool areaCoordinates(double* lat1, double* lat2, double* lon1, double* lon2) const;
246 
248 
252  int searchId() const;
253 
254  CoreDbUrl(const CoreDbUrl& url);
255 
256  CoreDbUrl& operator=(const QUrl& digikamalbumsUrl);
257  CoreDbUrl& operator=(const CoreDbUrl& url);
258 
259  bool operator==(const QUrl& digikamalbumsUrl) const;
260 };
261 
262 } // namespace Digikam
263 
264 #endif // DIGIKAM_CORE_DB_URL_H
static DbEngineParameters parameters()
Definition: coredbaccess.cpp:190
Definition: coredburl.h:43
Definition: dbengineparameters.h:49
Definition: datefolderview.cpp:43
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition: searchtextbar.cpp:49