QOF iteration and callbacks
Neil Williams
linux at codehelp.co.uk
Fri Jun 18 16:24:04 EDT 2004
"one can then ask, at run time, what parameters are associated with a given
type, even if those parameters were not known at compile time."
src/doc/html/group__Class.html
I can see how to query individual parameters from qofclass when you know the
name and I've got access to the getter and setter func's - what I'm looking
at now is a generic way to read back everything originally set by
qof_class_register - to build a complete list of all registered objects,
types and data. This will be the core of the rules and it has to cover
everything possible in a GNCBook - and as agreed already, without requiring
any objects to be re-defined in code, it's all run-time stuff. I can see how
qof_class_register reads the params into a GHashTable - how do I read the
entire hashtable back?
I've looked at:
GSList * qof_query_build_param_list (char const *param, ...);
haven't got it right yet though. It looks more like something I'd need later
to look for a match in the second book prior to comparison.
I've got access to the GUID's, the QofIdType's and almost everything else. I'm
hoping I don't have to copy a whole batch of these sections from the source
tree:
/** @name Account parameter names */
/** @{ */
#define ACCOUNT_KVP "kvp"
#define ACCOUNT_NAME_ "name"
#define ACCOUNT_CODE_ "code"
#define ACCOUNT_DESCRIPTION_ "desc"
#define ACCOUNT_NOTES_ "notes"
#define ACCOUNT_BALANCE_ "balance"
#define ACCOUNT_CLEARED_ "cleared"
#define ACCOUNT_RECONCILED_ "reconciled"
#define ACCOUNT_PRESENT_ "present"
#define ACCOUNT_FUTURE_MINIMUM_ "future-minimum"
#define ACCOUNT_TAX_RELATED "tax-related-p"
/** @} */
when they are all already loaded:
gboolean xaccAccountRegister (void)
{
static QofParam params[] = {}
}
The most recent (working) draft is back on codehelp:
(It also includes a revision of the naming convention for the merge - I've
followed the format of GncInvoice.c)
--
Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/
http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20040618/811fe763/attachment.bin
More information about the gnucash-devel
mailing list