00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00032 #ifndef QOF_QUERYCORE_H
00033 #define QOF_QUERYCORE_H
00034
00035 #include "gnc-numeric.h"
00036 #include "gnc-date.h"
00037 #include "kvp_frame.h"
00038 #include "qofclass.h"
00039
00045 typedef struct _QofQueryPredData QofQueryPredData;
00046
00050 typedef enum {
00051 QOF_COMPARE_LT = 1,
00052 QOF_COMPARE_LTE,
00053 QOF_COMPARE_EQUAL,
00054 QOF_COMPARE_GT,
00055 QOF_COMPARE_GTE,
00056 QOF_COMPARE_NEQ
00057 } QofQueryCompare;
00058
00062
00063 typedef enum {
00064 QOF_STRING_MATCH_NORMAL = 1,
00065 QOF_STRING_MATCH_CASEINSENSITIVE
00066 } QofStringMatch;
00067
00075 typedef enum {
00076 QOF_DATE_MATCH_NORMAL = 1,
00077 QOF_DATE_MATCH_DAY
00078 } QofDateMatch;
00079
00092 typedef enum {
00093 QOF_NUMERIC_MATCH_DEBIT = 1,
00094 QOF_NUMERIC_MATCH_CREDIT,
00095 QOF_NUMERIC_MATCH_ANY
00096 } QofNumericMatch;
00097
00098
00099 typedef enum {
00102 QOF_GUID_MATCH_ANY = 1,
00103 QOF_GUID_MATCH_NONE,
00104 QOF_GUID_MATCH_NULL,
00107 QOF_GUID_MATCH_ALL,
00110 QOF_GUID_MATCH_LIST_ANY,
00111 } QofGuidMatch;
00112
00121 typedef enum {
00122 QOF_CHAR_MATCH_ANY = 1,
00123 QOF_CHAR_MATCH_NONE
00124 } QofCharMatch;
00125
00131 struct _QofQueryPredData {
00132 QofType type_name;
00133 QofQueryCompare how;
00134 };
00135
00136
00139 QofQueryPredData *qof_query_string_predicate (QofQueryCompare how,
00140 const gchar *str,
00141 QofStringMatch options,
00142 gboolean is_regex);
00143
00144 QofQueryPredData *qof_query_date_predicate (QofQueryCompare how,
00145 QofDateMatch options,
00146 Timespec date);
00147
00148 QofQueryPredData *qof_query_numeric_predicate (QofQueryCompare how,
00149 QofNumericMatch options,
00150 gnc_numeric value);
00151
00152 QofQueryPredData *qof_query_guid_predicate (QofGuidMatch options, GList *guids);
00153 QofQueryPredData *qof_query_int32_predicate (QofQueryCompare how, gint32 val);
00154 QofQueryPredData *qof_query_int64_predicate (QofQueryCompare how, gint64 val);
00155 QofQueryPredData *qof_query_double_predicate (QofQueryCompare how, double val);
00156 QofQueryPredData *qof_query_boolean_predicate (QofQueryCompare how, gboolean val);
00157 QofQueryPredData *qof_query_char_predicate (QofCharMatch options,
00158 const gchar *chars);
00159 QofQueryPredData *qof_query_collect_predicate (QofGuidMatch options,
00160 QofCollection *coll);
00161 QofQueryPredData *qof_query_choice_predicate (QofGuidMatch options, GList *guids);
00162
00167 QofQueryPredData *qof_query_kvp_predicate (QofQueryCompare how,
00168 GSList *path,
00169 const KvpValue *value);
00170
00173 QofQueryPredData *qof_query_kvp_predicate_path (QofQueryCompare how,
00174 const gchar *path,
00175 const KvpValue *value);
00176
00178 QofQueryPredData *qof_query_core_predicate_copy (QofQueryPredData *pdata);
00179
00181 void qof_query_core_predicate_free (QofQueryPredData *pdata);
00182
00184 gboolean qof_query_date_predicate_get_date (QofQueryPredData *pd, Timespec *date);
00188 char * qof_query_core_to_string (QofType, gpointer object, QofParam *getter);
00189
00190 #endif
00191
00192