QOF  0.7.5
qofbook.h
Go to the documentation of this file.
1 /********************************************************************\
2  * qofbook.h -- Encapsulate all the information about a dataset. *
3  * This program is free software; you can redistribute it and/or *
4  * modify it under the terms of the GNU General Public License as *
5  * published by the Free Software Foundation; either version 2 of *
6  * the License, or (at your option) any later version. *
7  * *
8  * This program is distributed in the hope that it will be useful, *
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11  * GNU General Public License for more details. *
12  * *
13  * You should have received a copy of the GNU General Public License*
14  * along with this program; if not, contact: *
15  * *
16  * Free Software Foundation Voice: +1-617-542-5942 *
17  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
18  * Boston, MA 02110-1301, USA gnu@gnu.org *
19  * *
20 \********************************************************************/
39 #ifndef QOF_BOOK_H
40 #define QOF_BOOK_H
41 
42 #include "qof.h"
43 
50 #define QOF_BOOK_LOOKUP_ENTITY(book,guid,e_type,c_type) ({ \
51  QofEntity *val = NULL; \
52  if (guid && book) { \
53  QofCollection *col; \
54  col = qof_book_get_collection (book, e_type); \
55  val = qof_collection_lookup_entity (col, guid); \
56  } \
57  (c_type *) val; \
58 })
59 
61 typedef struct _QofBook QofBook;
62 
64 typedef GList QofBookList;
65 
66 typedef void (*QofBookFinalCB) (QofBook *, gpointer key, gpointer user_data);
67 
69 gboolean qof_book_register (void);
70 
73 QofBook *qof_book_new (void);
74 
77 void qof_book_destroy (QofBook * book);
78 
84 void qof_book_mark_closed (QofBook * book);
85 
100 
102 typedef void (*QofCollectionForeachCB) (QofCollection *, gpointer user_data);
103 void qof_book_foreach_collection (QofBook *, QofCollectionForeachCB,
104  gpointer);
105 
113 #define qof_book_get_slots(book) qof_instance_get_slots(QOF_INSTANCE(book))
114 
125 void qof_book_set_data (QofBook * book, const gchar * key, gpointer data);
126 
131 void qof_book_set_data_fin (QofBook * book, const gchar * key, gpointer data,
132  QofBookFinalCB);
133 
135 gpointer qof_book_get_data (QofBook * book, const gchar * key);
136 
138 gboolean qof_book_shutting_down (QofBook * book);
139 
148 gboolean qof_book_not_saved (QofBook * book);
149 
155 void qof_book_mark_saved (QofBook * book);
156 
159 void qof_book_kvp_changed (QofBook * book);
160 
164 gboolean qof_book_equal (QofBook * book_1, QofBook * book_2);
165 
169 gint64 qof_book_get_counter (QofBook * book, const gchar *counter_name);
170 
172 #endif /* QOF_BOOK_H */