r19863 - gnucash/trunk/src/engine - Bug #635469: Add bindings for running a qofquery on invoices.

Christian Stimming cstim at code.gnucash.org
Mon Nov 22 15:17:18 EST 2010


Author: cstim
Date: 2010-11-22 15:17:18 -0500 (Mon, 22 Nov 2010)
New Revision: 19863
Trac: http://svn.gnucash.org/trac/changeset/19863

Modified:
   gnucash/trunk/src/engine/business-core.i
   gnucash/trunk/src/engine/gncInvoice.h
Log:
Bug #635469: Add bindings for running a qofquery on invoices.

This adds a new typedef "GncInvoiceList" with the corresponding typemap,
and adds two new functions qof_query_create_for_invoices and
qof_query_run_for_invoices, which are trivial wrappers around
qof_query_create_for and qof_query_run respectively.

Modified: gnucash/trunk/src/engine/business-core.i
===================================================================
--- gnucash/trunk/src/engine/business-core.i	2010-11-22 19:42:16 UTC (rev 19862)
+++ gnucash/trunk/src/engine/business-core.i	2010-11-22 20:17:18 UTC (rev 19863)
@@ -76,6 +76,7 @@
 
 %}
 
+GLIST_HELPER_INOUT(GncInvoiceList, SWIGTYPE_p__gncInvoice);
 GLIST_HELPER_INOUT(EntryList, SWIGTYPE_p__gncEntry);
 GLIST_HELPER_INOUT(GncTaxTableEntryList, SWIGTYPE_p__gncTaxTableEntry);
 GLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);
@@ -127,6 +128,7 @@
 %include <gncTaxTable.h>
 %include <gncVendor.h>
 %include <gncBusGuile.h>
+%include <libqof/qof/qofquery.h>
 
 #define URL_TYPE_CUSTOMER GNC_ID_CUSTOMER
 #define URL_TYPE_VENDOR GNC_ID_VENDOR
@@ -136,6 +138,16 @@
 // not exactly clean
 #define URL_TYPE_OWNERREPORT "owner-report"
 
+%inline %{
+static QofQuery * qof_query_create_for_invoices(void) {
+  return qof_query_create_for(GNC_ID_INVOICE);
+}
+
+static GncInvoiceList * qof_query_run_for_invoices(QofQuery *q) {
+    return qof_query_run(q);
+}
+%}
+
 %init {
   {
     char tmp[100];

Modified: gnucash/trunk/src/engine/gncInvoice.h
===================================================================
--- gnucash/trunk/src/engine/gncInvoice.h	2010-11-22 19:42:16 UTC (rev 19862)
+++ gnucash/trunk/src/engine/gncInvoice.h	2010-11-22 20:17:18 UTC (rev 19863)
@@ -39,6 +39,7 @@
 struct _gncInvoice;
 typedef struct _gncInvoice GncInvoice;
 typedef struct _gncInvoiceClass GncInvoiceClass;
+typedef GList GncInvoiceList;
 
 #include "gncBillTerm.h"
 #include "gncEntry.h"



More information about the gnucash-changes mailing list