QOF: qofquerycore.h Source File

QOF 0.7.5

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

qofquerycore.h
Go to the documentation of this file.
1 /********************************************************************\
2 * qofquerycore.h -- API for providing core Query data types *
3 * Copyright (C) 2002 Derek Atkins <warlord@MIT.EDU> *
4 * Copyright (C) 2006 Neil Williams <linux@codehelp.co.uk> *
5 * *
6 * This program is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU General Public License as *
8 * published by the Free Software Foundation; either version 2 of *
9 * the License, or (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License*
17 * along with this program; if not, contact: *
18 * *
19 * Free Software Foundation Voice: +1-617-542-5942 *
20 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
21 * Boston, MA 02110-1301, USA gnu@gnu.org *
22 * *
23 \********************************************************************/
24
33 #ifndef QOF_QUERYCORE_H
34 #define QOF_QUERYCORE_H
35
36 #include "qofnumeric.h"
37 #include "qofdate.h"
38 #include "kvpframe.h"
39 #include "qofclass.h"
40
46 typedef struct _QofQueryPredData QofQueryPredData;
47
51 typedef enum
52 {
53 QOF_COMPARE_LT = 1,
54 QOF_COMPARE_LTE,
55 QOF_COMPARE_EQUAL,
56 QOF_COMPARE_GT,
57 QOF_COMPARE_GTE,
58 QOF_COMPARE_NEQ
59 } QofQueryCompare;
60
64 /* Comparisons for QOF_TYPE_STRING */
65 typedef enum
66 {
67 QOF_STRING_MATCH_NORMAL = 1,
68 QOF_STRING_MATCH_CASEINSENSITIVE
69 } QofStringMatch;
70
78 typedef enum
79 {
80 QOF_DATE_MATCH_NORMAL = 1,
81 QOF_DATE_MATCH_DAY
82 } QofDateMatch;
83
96 typedef enum
97 {
98 QOF_NUMERIC_MATCH_DEBIT = 1,
99 QOF_NUMERIC_MATCH_CREDIT,
100 QOF_NUMERIC_MATCH_ANY
101 } QofNumericMatch;
102
103 /* Comparisons for QOF_TYPE_GUID */
104 typedef enum
105 {
108 QOF_GUID_MATCH_ANY = 1,
109 QOF_GUID_MATCH_NONE,
110 QOF_GUID_MATCH_NULL,
113 QOF_GUID_MATCH_ALL,
116 QOF_GUID_MATCH_LIST_ANY,
117 } QofGuidMatch;
118
127 typedef enum
128 {
129 QOF_CHAR_MATCH_ANY = 1,
130 QOF_CHAR_MATCH_NONE
131 } QofCharMatch;
132
138 struct _QofQueryPredData
139 {
140 QofType type_name; /* QOF_TYPE_* */
141 QofQueryCompare how;
142 };
143
144
147 QofQueryPredData *
148 qof_query_string_predicate (QofQueryCompare how,
149 const gchar * str,
150 QofStringMatch options,
151 gboolean is_regex);
152
153 QofQueryPredData *
154 qof_query_time_predicate (QofQueryCompare how,
155 QofDateMatch options,
156 QofTime *qt);
157
158 QofQueryPredData *
159 qof_query_numeric_predicate (QofQueryCompare how,
160 QofNumericMatch options,
161 QofNumeric value);
162
163 QofQueryPredData *
164 qof_query_guid_predicate (QofGuidMatch options,
165 GList * guids);
166
167 QofQueryPredData *
168 qof_query_int32_predicate (QofQueryCompare how, gint32 val);
169
170 QofQueryPredData *
171 qof_query_int64_predicate (QofQueryCompare how, gint64 val);
172
173 QofQueryPredData *
174 qof_query_double_predicate (QofQueryCompare how,
175 double val);
176
177 QofQueryPredData *
178 qof_query_boolean_predicate (QofQueryCompare how,
179 gboolean val);
180
181 QofQueryPredData *
182 qof_query_char_predicate (QofCharMatch options,
183 const gchar * chars);
184
185 QofQueryPredData *
186 qof_query_collect_predicate (QofGuidMatch options,
187 QofCollection * coll);
188
189 QofQueryPredData *
190 qof_query_choice_predicate (QofGuidMatch options,
191 GList * guids);
192
197 QofQueryPredData *
198 qof_query_kvp_predicate (QofQueryCompare how,
199 GSList * path,
200 const KvpValue * value);
201
204 QofQueryPredData *
205 qof_query_kvp_predicate_path (QofQueryCompare how,
206 const gchar * path,
207 const KvpValue * value);
208
210 QofQueryPredData *
211 qof_query_core_predicate_copy (QofQueryPredData * pdata);
212
214 void qof_query_core_predicate_free (QofQueryPredData * pdata);
215
217 gboolean
218 qof_query_time_predicate_get_time (QofQueryPredData * pd,
219 QofTime * qt);
220
224 gchar *
225 qof_query_core_to_string (QofType, gpointer object,
226 QofParam * getter);
227
228 #endif /* QOF_QUERYCORE_H */
229 /* @} */
230 /* @} */
qof_query_kvp_predicate_path
QofQueryPredData * qof_query_kvp_predicate_path(QofQueryCompare how, const gchar *path, const KvpValue *value)
_QofParam
Definition: qofclass.h:195
qof_query_core_predicate_free
void qof_query_core_predicate_free(QofQueryPredData *pdata)
Definition: qofquerycore.c:2042
qofnumeric.h
An exact-rational-number library for QOF.
QofStringMatch
QofStringMatch
Definition: qofquerycore.h:65
QOF_GUID_MATCH_ANY
Definition: qofquerycore.h:108
kvpframe.h
A key-value frame system.
QofCollection
struct QofCollection_s QofCollection
Definition: qofid.h:138
KvpValue
struct _KvpValue KvpValue
Definition: kvpframe.h:78
QofGuidMatch
QofGuidMatch
Definition: qofquerycore.h:104
_QofNumeric
Definition: qofnumeric.h:52
qof_query_core_predicate_copy
QofQueryPredData * qof_query_core_predicate_copy(QofQueryPredData *pdata)
Definition: qofquerycore.c:2054
qofdate.h
64bit Date handling routines
QofQueryCompare
QofQueryCompare
Definition: qofquerycore.h:51
QofCharMatch
QofCharMatch
Definition: qofquerycore.h:127
QOF_GUID_MATCH_LIST_ANY
Definition: qofquerycore.h:116
QofType
const gchar * QofType
Definition: qofclass.h:150
QOF_GUID_MATCH_ALL
Definition: qofquerycore.h:113
qof_query_time_predicate_get_time
gboolean qof_query_time_predicate_get_time(QofQueryPredData *pd, QofTime *qt)
Definition: qofquerycore.c:381
qofclass.h
API for registering paramters on objects.
_QofQueryPredData
Definition: qofquerycore.h:138
QofTime
struct QofTime64 QofTime
Use a 64-bit signed int QofTime.
Definition: qoftime.h:120
QofDateMatch
QofDateMatch
Definition: qofquerycore.h:78
qof_query_core_to_string
gchar * qof_query_core_to_string(QofType, gpointer object, QofParam *getter)
Definition: qofquerycore.c:2066
qof_query_kvp_predicate
QofQueryPredData * qof_query_kvp_predicate(QofQueryCompare how, GSList *path, const KvpValue *value)
Definition: qofquerycore.c:1285
QofNumericMatch
QofNumericMatch
Definition: qofquerycore.h:96