GnuCash  4.12-558-g06612b8434
Macros | Enumerations

find objects that match a certain expression. More...

#include "guid.h"
#include "qofbook.h"
#include "qofquerycore.h"
#include "qofchoice.h"

Go to the source code of this file.


#define QOF_MOD_QUERY   "qof.query"
 First/only term is same as 'and'.
#define QUERY_DEFAULT_SORT   "QofQueryDefaultSort"
 Default sort object type.
#define QOF_PARAM_BOOK   "book"
 "Known" Object Parameters – all objects must support these
#define QOF_PARAM_GUID   "guid"
#define QOF_PARAM_KVP   "kvp"
 "Known" Object Parameters – some objects might support these
#define QOF_PARAM_ACTIVE   "active"
#define QOF_PARAM_VERSION   "version"


enum  QofQueryOp {
 Query Term Operators, for combining Query Terms.


Query Subsystem Initialization and Shutdown
void qof_query_init (void)
 Subsystem initialization and shutdown. More...
void qof_query_shutdown (void)
Low-Level API Functions
QofQueryParamListqof_query_build_param_list (char const *param,...)
QofQueryqof_query_create (void)
 Create a new query. More...
QofQueryqof_query_create_for (QofIdTypeConst obj_type)
void qof_query_destroy (QofQuery *q)
 Frees the resources associate with a Query object. More...
void qof_query_search_for (QofQuery *query, QofIdTypeConst obj_type)
 Set the object type to be searched for. More...
void qof_query_set_book (QofQuery *q, QofBook *book)
 Set the book to be searched. More...
void qof_query_add_term (QofQuery *query, QofQueryParamList *param_list, QofQueryPredData *pred_data, QofQueryOp op)
 This is the general function that adds a new Query Term to a query. More...
void qof_query_add_guid_match (QofQuery *q, QofQueryParamList *param_list, const GncGUID *guid, QofQueryOp op)
void qof_query_add_guid_list_match (QofQuery *q, QofQueryParamList *param_list, GList *guid_list, QofGuidMatch options, QofQueryOp op)
void qof_query_add_boolean_match (QofQuery *q, QofQueryParamList *param_list, gboolean value, QofQueryOp op)
 Handy-dandy convenience routines, avoids having to create a separate predicate for boolean matches. More...
GList * qof_query_run (QofQuery *query)
 Perform the query, return the results. More...
GList * qof_query_last_run (QofQuery *query)
 Return the results of the last query, without causing the query to be re-run. More...
GList * qof_query_run_subquery (QofQuery *subquery, const QofQuery *primary_query)
 Perform a subquery, return the results. More...
void qof_query_clear (QofQuery *query)
 Remove all query terms from query. More...
void qof_query_purge_terms (QofQuery *q, QofQueryParamList *param_list)
 Remove query terms of a particular type from q. More...
int qof_query_has_terms (QofQuery *q)
 Return boolean FALSE if there are no terms in the query Can be used as a predicate to see if the query has been initialized (return value > 0) or is "blank" (return value == 0).
int qof_query_num_terms (QofQuery *q)
 Return the number of terms in the canonical form of the query.
gboolean qof_query_has_term_type (QofQuery *q, QofQueryParamList *term_param)
GSList * qof_query_get_term_type (QofQuery *q, QofQueryParamList *term_param)
QofQueryqof_query_copy (QofQuery *q)
 Make a copy of the indicated query.
QofQueryqof_query_invert (QofQuery *q)
 Make a copy of the indicated query, inverting the sense of the search. More...
QofQueryqof_query_merge (QofQuery *q1, QofQuery *q2, QofQueryOp op)
 Combine two queries together using the Boolean set (logical) operator 'op'. More...
void qof_query_merge_in_place (QofQuery *q1, QofQuery *q2, QofQueryOp op)
 Like qof_query_merge, but this will merge a copy of q2 into q1. More...
void qof_query_set_sort_order (QofQuery *q, QofQueryParamList *primary_sort_params, QofQueryParamList *secondary_sort_params, QofQueryParamList *tertiary_sort_params)
 When a query is run, the results are sorted before being returned. More...
void qof_query_set_sort_options (QofQuery *q, gint prim_op, gint sec_op, gint tert_op)
void qof_query_set_sort_increasing (QofQuery *q, gboolean prim_inc, gboolean sec_inc, gboolean tert_inc)
 When a query is run, the results are sorted before being returned. More...
void qof_query_set_max_results (QofQuery *q, int n)
 Set the maximum number of results that should be returned. More...
gboolean qof_query_equal (const QofQuery *q1, const QofQuery *q2)
 Compare two queries for equality. More...
void qof_query_print (QofQuery *query)
 Log the Query. More...
QofIdType qof_query_get_search_for (const QofQuery *q)
 Return the type of data we're querying for.
GList * qof_query_get_books (QofQuery *q)
 Return the list of books we're using.

Detailed Description

find objects that match a certain expression.

Copyright (C) 2002 Derek Atkins warlo.nosp@m.rd@M.nosp@m.IT.ED.nosp@m.U
Copyright (C) 2003 Linas Vepstas

Definition in file qofquery.h.