00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00040 #ifndef QOF_BOOK_H
00041 #define QOF_BOOK_H
00042
00043 #include "qof.h"
00044 #include "kvp_frame.h"
00045
00052 #define QOF_BOOK_LOOKUP_ENTITY(book,guid,e_type,c_type) ({ \
00053 QofEntity *val = NULL; \
00054 if (guid && book) { \
00055 QofCollection *col; \
00056 col = qof_book_get_collection (book, e_type); \
00057 val = qof_collection_lookup_entity (col, guid); \
00058 } \
00059 (c_type *) val; \
00060 })
00061
00063 typedef struct _QofBook QofBook;
00064
00066 typedef GList QofBookList;
00067
00068 typedef void (*QofBookFinalCB) (QofBook *, gpointer key, gpointer user_data);
00069
00071 gboolean qof_book_register (void);
00072
00075 QofBook *qof_book_new (void);
00076
00079 void qof_book_destroy (QofBook * book);
00080
00086 void qof_book_mark_closed (QofBook * book);
00087
00101 QofCollection *qof_book_get_collection (QofBook *, QofIdType);
00102
00104 typedef void (*QofCollectionForeachCB) (QofCollection *, gpointer user_data);
00105 void qof_book_foreach_collection (QofBook *, QofCollectionForeachCB,
00106 gpointer);
00107
00115 #define qof_book_get_slots(book) qof_instance_get_slots(QOF_INSTANCE(book))
00116
00127 void qof_book_set_data (QofBook * book, const gchar * key, gpointer data);
00128
00133 void qof_book_set_data_fin (QofBook * book, const gchar * key, gpointer data,
00134 QofBookFinalCB);
00135
00137 gpointer qof_book_get_data (QofBook * book, const gchar * key);
00138
00140 gboolean qof_book_shutting_down (QofBook * book);
00141
00150 gboolean qof_book_not_saved (QofBook * book);
00151
00157 void qof_book_mark_saved (QofBook * book);
00158
00161 void qof_book_kvp_changed (QofBook * book);
00162
00166 gboolean qof_book_equal (QofBook * book_1, QofBook * book_2);
00167
00171 gint64 qof_book_get_counter (QofBook * book, const gchar *counter_name);
00172
00173 #endif
00174