Books also provide the 'natural' place to working with a storage backend, as a book can encapsulate everything held in storage.
Files | |
file | qofbook.h |
Encapsulate all the information about a dataset. | |
Defines | |
#define | QOF_BOOK_LOOKUP_ENTITY(book, guid, e_type, c_type) |
Encapsulates all the information about a dataset manipulated by GnuCash. This is the top-most structure used for anchoring data. | |
#define | QOF_BOOK_KVP "qof-kvp" |
#define | qof_book_get_guid(X) qof_entity_get_guid (QOF_ENTITY(X)) |
Typedefs | |
typedef _QofBook | QofBook |
typedef GList | QofBookList |
typedef void(* | QofCollectionForeachCB )(QofCollection *, gpointer user_data) |
Functions | |
gboolean | qof_book_register (void) |
QofBook * | qof_book_new (void) |
void | qof_book_destroy (QofBook *book) |
QofCollection * | qof_book_get_collection (QofBook *, QofIdType) |
void | qof_book_foreach_collection (QofBook *, QofCollectionForeachCB, gpointer) |
KvpFrame * | qof_book_get_slots (QofBook *book) |
void | qof_book_set_data (QofBook *book, const char *key, gpointer data) |
gpointer | qof_book_get_data (QofBook *book, const char *key) |
QofBackend * | qof_book_get_backend (QofBook *book) |
void | qof_book_set_backend (QofBook *book, QofBackend *) |
gboolean | qof_book_not_saved (QofBook *book) |
void | qof_book_kvp_changed (QofBook *book) |
gboolean | qof_book_equal (QofBook *book_1, QofBook *book_2) |
gint64 | qof_book_get_counter (QofBook *book, const char *counter_name) |
|
deprecated |
|
Value: ({ \ QofEntity *val = NULL; \ if (guid && book) { \ QofCollection *col; \ col = qof_book_get_collection (book, e_type); \ val = qof_collection_lookup_entity (col, guid); \ } \ (c_type *) val; \ }) Lookup an entity by guid, returning pointer to the entity |
|
GList of QofBook |
|
Invoke the indicated callback on each collection in the book. |
|
End any editing sessions associated with book, and free all memory associated with it. |
|
The qof_book_equal() method returns TRUE if books are equal. XXX this routine is broken, and does not currently compare data. |
|
DOCUMENT ME! |
|
|
|
This will 'get and increment' the named counter for this book. The return value is -1 on error or the incremented counter. |
|
Retreives arbitrary pointers to structs stored by qof_book_set_data. |
|
|
|
Call this function when you change the book kvp, to make sure the book is marked 'dirty'. |
|
Allocate, initialise and return a new QofBook. Books contain references to all of the top-level object containers. |
|
qof_book_not_saved() will return TRUE if any data in the book hasn't been saved to long-term storage. (Actually, that's not quite true. The book doesn't know anything about saving. Its just that whenever data is modified, the 'dirty' flag is set. This routine returns the value of the 'dirty' flag. Its up to the backend to periodically reset this flag, when it acutally does save the data.) |
|
Register books with the engine |
|
The qof_book_set_data() allows arbitrary pointers to structs to be stored in QofBook. This is the "prefered" method for extending QofBook to hold new data types. XXX FIXME: we need to add a destroy callback, so that when the book gets destroyed, the user gets notified and thus has a chance to clean up. |