QOF  0.7.5
qofsession.h
Go to the documentation of this file.
1 /********************************************************************\
2  * qofsession.h -- session access (connection to backend) *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License*
15  * along with this program; if not, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA gnu@gnu.org *
20  * *
21 \********************************************************************/
22 
101 #ifndef QOF_SESSION_H
102 #define QOF_SESSION_H
103 
104 #include "qofbackend.h"
105 #include "qofbook.h"
106 #include "qofclass.h"
107 #include "qofobject.h"
108 
109 #define QOF_MOD_SESSION "qof-session"
110 
111 /* PROTOTYPES ******************************************************/
112 
113 typedef struct _QofSession QofSession;
114 
115 QofSession *qof_session_new (void);
116 
117 void qof_session_destroy (QofSession * session);
118 
122 void
123 qof_session_swap_data (QofSession * session_1, QofSession * session_2);
124 
152 void qof_session_begin (QofSession * session, const gchar *book_id,
153  gboolean ignore_lock, gboolean create_if_nonexistent);
154 
168 typedef void (*QofPercentageFunc) (const gchar *message, gdouble percent);
169 void qof_session_load (QofSession * session,
170  QofPercentageFunc percentage_func);
171 
179 void
180 qof_session_add_book (QofSession * session, QofBook * book);
181 
182 QofBook *
183 qof_session_get_book (QofSession * session);
184 
199 const gchar *qof_session_get_file_path (QofSession * session);
200 
201 const gchar *qof_session_get_url (QofSession * session);
202 
207 gboolean qof_session_not_saved (QofSession * session);
208 
210 gboolean qof_session_save_may_clobber_data (QofSession * session);
211 
218 void qof_session_save (QofSession * session,
219  QofPercentageFunc percentage_func);
228 void qof_session_end (QofSession * session);
229 
277 gboolean qof_entity_copy_to_session (QofSession * new_session,
278  QofEntity * original);
279 
298 gboolean qof_entity_copy_list (QofSession * new_session, GList * entity_list);
299 
313 gboolean qof_entity_copy_coll (QofSession * new_session,
314  QofCollection * entity_coll);
315 
344 gboolean
345 qof_entity_copy_coll_r (QofSession * new_session, QofCollection * coll);
346 
366 gboolean qof_entity_copy_one_r (QofSession * new_session, QofEntity * ent);
367 
386 #define QOF_STDOUT "file:"
387 
395 gboolean qof_session_events_pending (QofSession * session);
396 
401 gboolean qof_session_process_events (QofSession * session);
410 void qof_session_add_close_hook (GFunc fn, gpointer data);
411 
417 
421 #endif /* QOF_SESSION_H */