00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00033 #ifndef QOF_QUERYCORE_H
00034 #define QOF_QUERYCORE_H
00035
00036 #include "qofnumeric.h"
00037 #include "qofdate.h"
00038 #include "kvpframe.h"
00039 #include "qofclass.h"
00040
00046 typedef struct _QofQueryPredData QofQueryPredData;
00047
00051 typedef enum
00052 {
00053 QOF_COMPARE_LT = 1,
00054 QOF_COMPARE_LTE,
00055 QOF_COMPARE_EQUAL,
00056 QOF_COMPARE_GT,
00057 QOF_COMPARE_GTE,
00058 QOF_COMPARE_NEQ
00059 } QofQueryCompare;
00060
00064
00065 typedef enum
00066 {
00067 QOF_STRING_MATCH_NORMAL = 1,
00068 QOF_STRING_MATCH_CASEINSENSITIVE
00069 } QofStringMatch;
00070
00078 typedef enum
00079 {
00080 QOF_DATE_MATCH_NORMAL = 1,
00081 QOF_DATE_MATCH_DAY
00082 } QofDateMatch;
00083
00096 typedef enum
00097 {
00098 QOF_NUMERIC_MATCH_DEBIT = 1,
00099 QOF_NUMERIC_MATCH_CREDIT,
00100 QOF_NUMERIC_MATCH_ANY
00101 } QofNumericMatch;
00102
00103
00104 typedef enum
00105 {
00108 QOF_GUID_MATCH_ANY = 1,
00109 QOF_GUID_MATCH_NONE,
00110 QOF_GUID_MATCH_NULL,
00113 QOF_GUID_MATCH_ALL,
00116 QOF_GUID_MATCH_LIST_ANY,
00117 } QofGuidMatch;
00118
00127 typedef enum
00128 {
00129 QOF_CHAR_MATCH_ANY = 1,
00130 QOF_CHAR_MATCH_NONE
00131 } QofCharMatch;
00132
00138 struct _QofQueryPredData
00139 {
00140 QofType type_name;
00141 QofQueryCompare how;
00142 };
00143
00144
00147 QofQueryPredData *
00148 qof_query_string_predicate (QofQueryCompare how,
00149 const gchar * str,
00150 QofStringMatch options,
00151 gboolean is_regex);
00152
00153 QofQueryPredData *
00154 qof_query_time_predicate (QofQueryCompare how,
00155 QofDateMatch options,
00156 QofTime *qt);
00157
00158 QofQueryPredData *
00159 qof_query_numeric_predicate (QofQueryCompare how,
00160 QofNumericMatch options,
00161 QofNumeric value);
00162
00163 QofQueryPredData *
00164 qof_query_guid_predicate (QofGuidMatch options,
00165 GList * guids);
00166
00167 QofQueryPredData *
00168 qof_query_int32_predicate (QofQueryCompare how, gint32 val);
00169
00170 QofQueryPredData *
00171 qof_query_int64_predicate (QofQueryCompare how, gint64 val);
00172
00173 QofQueryPredData *
00174 qof_query_double_predicate (QofQueryCompare how,
00175 double val);
00176
00177 QofQueryPredData *
00178 qof_query_boolean_predicate (QofQueryCompare how,
00179 gboolean val);
00180
00181 QofQueryPredData *
00182 qof_query_char_predicate (QofCharMatch options,
00183 const gchar * chars);
00184
00185 QofQueryPredData *
00186 qof_query_collect_predicate (QofGuidMatch options,
00187 QofCollection * coll);
00188
00189 QofQueryPredData *
00190 qof_query_choice_predicate (QofGuidMatch options,
00191 GList * guids);
00192
00197 QofQueryPredData *
00198 qof_query_kvp_predicate (QofQueryCompare how,
00199 GSList * path,
00200 const KvpValue * value);
00201
00204 QofQueryPredData *
00205 qof_query_kvp_predicate_path (QofQueryCompare how,
00206 const gchar * path,
00207 const KvpValue * value);
00208
00210 QofQueryPredData *
00211 qof_query_core_predicate_copy (QofQueryPredData * pdata);
00212
00214 void qof_query_core_predicate_free (QofQueryPredData * pdata);
00215
00217 gboolean
00218 qof_query_time_predicate_get_time (QofQueryPredData * pd,
00219 QofTime * qt);
00220
00224 gchar *
00225 qof_query_core_to_string (QofType, gpointer object,
00226 QofParam * getter);
00227
00228 #endif
00229
00230