25 #include "gnc-entry-quickfill.h"
30 G_GNUC_UNUSED
static QofLogModule log_module = GNC_MOD_REGISTER;
35 QuickFillSort qf_sort;
38 gboolean using_invoices;
43 gpointer user_data, gpointer event_data)
50 if (!GNC_IS_ENTRY (entity))
56 if (0 == (event_type & (QOF_EVENT_MODIFY | QOF_EVENT_DESTROY)))
62 desc = gncEntryGetDescription(GNC_ENTRY(entity));
63 if (event_type & QOF_EVENT_MODIFY)
67 if (!desc || strlen(desc) == 0)
73 else if (event_type & QOF_EVENT_DESTROY)
75 if (!desc || strlen(desc) == 0)
84 shared_quickfill_destroy (
QofBook *book, gpointer key, gpointer user_data)
87 gnc_quickfill_destroy (qfb->qf);
92 static void entry_cb(gpointer data, gpointer user_data)
96 if (s->using_invoices == (gncEntryGetInvAccount(entry) != NULL))
99 gncEntryGetDescription(entry),
108 GSList *primary_sort_params = NULL;
109 QofQuery *query = qof_query_create_for (GNC_ID_ENTRY);
115 primary_sort_params = qof_query_build_param_list(ENTRY_DATE_ENTERED, NULL);
122 static EntryQF* build_shared_quickfill (
QofBook *book,
const char * key, gboolean use_invoices)
125 QofQuery *query = new_query_for_entrys(book);
132 result->using_invoices = use_invoices;
133 result->qf = gnc_quickfill_new();
134 result->qf_sort = QUICKFILL_LIFO;
137 g_list_foreach (entries, entry_cb, result);
151 const char * key, gboolean use_invoices)
162 qfb = build_shared_quickfill(book, key, use_invoices);
165 g_assert(use_invoices == qfb->using_invoices);
void gnc_quickfill_insert(QuickFill *qf, const char *text, QuickFillSort sort)
void qof_query_set_sort_order(QofQuery *q, QofQueryParamList *primary_sort_params, QofQueryParamList *secondary_sort_params, QofQueryParamList *tertiary_sort_params)
void qof_query_set_sort_increasing(QofQuery *q, gboolean prim_inc, gboolean sec_inc, gboolean tert_inc)
struct _QofQuery QofQuery
gint qof_event_register_handler(QofEventHandler handler, gpointer handler_data)
Register a handler for events.
void qof_query_destroy(QofQuery *q)
void qof_query_set_book(QofQuery *q, QofBook *book)
void qof_book_set_data_fin(QofBook *book, const gchar *key, gpointer data, QofBookFinalCB)
void qof_event_unregister_handler(gint handler_id)
Unregister an event handler.
Additional event handling code.
GList * qof_query_run(QofQuery *query)
QuickFill * gnc_get_shared_entry_desc_quickfill(QofBook *book, const char *key, gboolean use_invoices)
Business Entry Interface.
gpointer qof_book_get_data(const QofBook *book, const gchar *key)
const gchar * QofLogModule