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 #include "kvp_frame.h"
00044
00051 #define QOF_BOOK_LOOKUP_ENTITY(book,guid,e_type,c_type) ({ \
00052 QofEntity *val = NULL; \
00053 if (guid && book) { \
00054 QofCollection *col; \
00055 col = qof_book_get_collection (book, e_type); \
00056 val = qof_collection_lookup_entity (col, guid); \
00057 } \
00058 (c_type *) val; \
00059 })
00060
00062 typedef struct _QofBook QofBook;
00063
00065 typedef GList QofBookList;
00066
00067 typedef void (*QofBookFinalCB) (QofBook *, gpointer key, gpointer user_data);
00068
00070 gboolean qof_book_register (void);
00071
00074 QofBook *qof_book_new (void);
00075
00078 void qof_book_destroy (QofBook * book);
00079
00085 void qof_book_mark_closed (QofBook * book);
00086
00100 QofCollection *qof_book_get_collection (QofBook *, QofIdType);
00101
00103 typedef void (*QofCollectionForeachCB) (QofCollection *, gpointer user_data);
00104 void qof_book_foreach_collection (QofBook *, QofCollectionForeachCB,
00105 gpointer);
00106
00114 #define qof_book_get_slots(book) qof_instance_get_slots(QOF_INSTANCE(book))
00115
00126 void qof_book_set_data (QofBook * book, const gchar * key, gpointer data);
00127
00132 void qof_book_set_data_fin (QofBook * book, const gchar * key, gpointer data,
00133 QofBookFinalCB);
00134
00136 gpointer qof_book_get_data (QofBook * book, const gchar * key);
00137
00139 gboolean qof_book_shutting_down (QofBook * book);
00140
00149 gboolean qof_book_not_saved (QofBook * book);
00150
00156 void qof_book_mark_saved (QofBook * book);
00157
00160 void qof_book_kvp_changed (QofBook * book);
00161
00165 gboolean qof_book_equal (QofBook * book_1, QofBook * book_2);
00166
00170 gint64 qof_book_get_counter (QofBook * book, const gchar *counter_name);
00171
00173 #endif