qofquerycore.h

Go to the documentation of this file.
00001 /********************************************************************\
00002  * qofquerycore.h -- API for providing core Query data types        *
00003  * Copyright (C) 2002 Derek Atkins <warlord@MIT.EDU>                *
00004  * Copyright (C) 2006 Neil Williams <linux@codehelp.co.uk>          *
00005  *                                                                  *
00006  * This program is free software; you can redistribute it and/or    *
00007  * modify it under the terms of the GNU General Public License as   *
00008  * published by the Free Software Foundation; either version 2 of   *
00009  * the License, or (at your option) any later version.              *
00010  *                                                                  *
00011  * This program is distributed in the hope that it will be useful,  *
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00014  * GNU General Public License for more details.                     *
00015  *                                                                  *
00016  * You should have received a copy of the GNU General Public License*
00017  * along with this program; if not, contact:                        *
00018  *                                                                  *
00019  * Free Software Foundation           Voice:  +1-617-542-5942       *
00020  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00021  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
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 /* Comparisons for QOF_TYPE_STRING */
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 /* Comparisons for QOF_TYPE_GUID */
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;          /* QOF_TYPE_* */
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 /* QOF_QUERYCORE_H */
00229 /* @} */
00230 /* @} */

Generated on Thu Jan 31 22:50:26 2008 for QOF by  doxygen 1.5.4