QOF  0.7.5
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 
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
60 
64 /* Comparisons for QOF_TYPE_STRING */
65 typedef enum
66 {
67  QOF_STRING_MATCH_NORMAL = 1,
68  QOF_STRING_MATCH_CASEINSENSITIVE
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
102 
103 /* Comparisons for QOF_TYPE_GUID */
104 typedef enum
105 {
109  QOF_GUID_MATCH_NONE,
110  QOF_GUID_MATCH_NULL,
117 } QofGuidMatch;
118 
127 typedef enum
128 {
129  QOF_CHAR_MATCH_ANY = 1,
130  QOF_CHAR_MATCH_NONE
131 } QofCharMatch;
132 
139 {
140  QofType type_name; /* QOF_TYPE_* */
141  QofQueryCompare how;
142 };
143 
144 
148 qof_query_string_predicate (QofQueryCompare how,
149  const gchar * str,
150  QofStringMatch options,
151  gboolean is_regex);
152 
154 qof_query_time_predicate (QofQueryCompare how,
155  QofDateMatch options,
156  QofTime *qt);
157 
159 qof_query_numeric_predicate (QofQueryCompare how,
160  QofNumericMatch options,
161  QofNumeric value);
162 
164 qof_query_guid_predicate (QofGuidMatch options,
165  GList * guids);
166 
168 qof_query_int32_predicate (QofQueryCompare how, gint32 val);
169 
171 qof_query_int64_predicate (QofQueryCompare how, gint64 val);
172 
174 qof_query_double_predicate (QofQueryCompare how,
175  double val);
176 
178 qof_query_boolean_predicate (QofQueryCompare how,
179  gboolean val);
180 
182 qof_query_char_predicate (QofCharMatch options,
183  const gchar * chars);
184 
186 qof_query_collect_predicate (QofGuidMatch options,
187  QofCollection * coll);
188 
190 qof_query_choice_predicate (QofGuidMatch options,
191  GList * guids);
192 
199  GSList * path,
200  const KvpValue * value);
201 
206  const gchar * path,
207  const KvpValue * value);
208 
212 
215 
217 gboolean
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 /* @} */