00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00039 #ifndef QOF_BOOK_H
00040 #define QOF_BOOK_H
00041
00042 #include "qof.h"
00043
00050 #define QOF_BOOK_LOOKUP_ENTITY(book,guid,e_type,c_type) ({ \
00051 QofEntity *val = NULL; \
00052 if (guid && book) { \
00053 QofCollection *col; \
00054 col = qof_book_get_collection (book, e_type); \
00055 val = qof_collection_lookup_entity (col, guid); \
00056 } \
00057 (c_type *) val; \
00058 })
00059
00061 typedef struct _QofBook QofBook;
00062
00064 typedef GList QofBookList;
00065
00066 typedef void (*QofBookFinalCB) (QofBook *, gpointer key, gpointer user_data);
00067
00069 gboolean qof_book_register (void);
00070
00073 QofBook *qof_book_new (void);
00074
00077 void qof_book_destroy (QofBook * book);
00078
00084 void qof_book_mark_closed (QofBook * book);
00085
00099 QofCollection *qof_book_get_collection (QofBook *, QofIdType);
00100
00102 typedef void (*QofCollectionForeachCB) (QofCollection *, gpointer user_data);
00103 void qof_book_foreach_collection (QofBook *, QofCollectionForeachCB,
00104 gpointer);
00105
00113 #define qof_book_get_slots(book) qof_instance_get_slots(QOF_INSTANCE(book))
00114
00125 void qof_book_set_data (QofBook * book, const gchar * key, gpointer data);
00126
00131 void qof_book_set_data_fin (QofBook * book, const gchar * key, gpointer data,
00132 QofBookFinalCB);
00133
00135 gpointer qof_book_get_data (QofBook * book, const gchar * key);
00136
00138 gboolean qof_book_shutting_down (QofBook * book);
00139
00148 gboolean qof_book_not_saved (QofBook * book);
00149
00155 void qof_book_mark_saved (QofBook * book);
00156
00159 void qof_book_kvp_changed (QofBook * book);
00160
00164 gboolean qof_book_equal (QofBook * book_1, QofBook * book_2);
00165
00169 gint64 qof_book_get_counter (QofBook * book, const gchar *counter_name);
00170
00172 #endif