digiKam
itemquerybuilder_p.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-22
7  * Description : Building complex database SQL queries from search descriptions
8  * Internal containers.
9  *
10  * Copyright (C) 2005 by Renchi Raju <renchi dot raju at gmail dot com>
11  * Copyright (C) 2007-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
12  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail 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_QUERY_BUILDER_P_H
28 #define DIGIKAM_ITEM_QUERY_BUILDER_P_H
29 
30 #include "itemquerybuilder.h"
31 
32 // C++ includes
33 
34 #include <cmath>
35 
36 // Qt includes
37 
38 #include <QFile>
39 #include <QDir>
40 #include <QMap>
41 #include <QRectF>
42 #include <QUrl>
43 #include <QLocale>
44 #include <QUrlQuery>
45 
46 // Local includes
47 
48 #include "metaengine.h"
49 #include "digikam_debug.h"
50 #include "coredbaccess.h"
51 #include "coredb.h"
52 #include "coredbbackend.h"
53 #include "fieldquerybuilder.h"
54 
55 namespace Digikam
56 {
57 
58 class Q_DECL_HIDDEN RuleTypeForConversion
59 {
60 public:
61 
63 
64  QString key;
66  QString val;
67 };
68 
69 // -------------------------------------------------------------------------
70 
71 enum SKey
72 {
73  ALBUM = 0,
77  TAG,
83  RATING
84 };
85 
87 {
88  EQ = 0,
89  NE,
90  LT,
91  GT,
94  LTE,
95  GTE
96 };
97 
98 // -------------------------------------------------------------------------
99 
100 class Q_DECL_HIDDEN RuleType
101 {
102 public:
103 
106  QString val;
107 };
108 
109 // -------------------------------------------------------------------------
110 
111 class Q_DECL_HIDDEN SubQueryBuilder
112 {
113 public:
114 
115  QString build(enum SKey key,
116  enum SOperator op,
117  const QString& passedVal,
118  QList<QVariant>* boundValues) const;
119 };
120 
121 } // namespace Digikam
122 
123 #endif // DIGIKAM_ITEM_QUERY_BUILDER_P_H
Definition: itemquerybuilder_p.h:59
SearchXml::Relation op
Definition: itemquerybuilder_p.h:65
QString key
Definition: itemquerybuilder_p.h:64
QString val
Definition: itemquerybuilder_p.h:66
Definition: itemquerybuilder_p.h:101
QString val
Definition: itemquerybuilder_p.h:106
SOperator op
Definition: itemquerybuilder_p.h:105
SKey key
Definition: itemquerybuilder_p.h:104
Definition: itemquerybuilder_p.h:112
Relation
Definition: coredbsearchxml.h:66
Definition: datefolderview.cpp:43
SKey
Definition: itemquerybuilder_p.h:72
@ ALBUMCOLLECTION
Definition: itemquerybuilder_p.h:76
@ ALBUM
Definition: itemquerybuilder_p.h:73
@ IMAGEDATE
Definition: itemquerybuilder_p.h:81
@ RATING
Definition: itemquerybuilder_p.h:83
@ TAGNAME
Definition: itemquerybuilder_p.h:78
@ TAG
Definition: itemquerybuilder_p.h:77
@ IMAGECAPTION
Definition: itemquerybuilder_p.h:80
@ ALBUMCAPTION
Definition: itemquerybuilder_p.h:75
@ ALBUMNAME
Definition: itemquerybuilder_p.h:74
@ IMAGENAME
Definition: itemquerybuilder_p.h:79
@ KEYWORD
Definition: itemquerybuilder_p.h:82
SOperator
Definition: itemquerybuilder_p.h:87
@ GTE
Definition: itemquerybuilder_p.h:95
@ NLIKE
Definition: itemquerybuilder_p.h:93
@ NE
Definition: itemquerybuilder_p.h:89
@ LT
Definition: itemquerybuilder_p.h:90
@ GT
Definition: itemquerybuilder_p.h:91
@ EQ
Definition: itemquerybuilder_p.h:88
@ LTE
Definition: itemquerybuilder_p.h:94
@ LIKE
Definition: itemquerybuilder_p.h:92