00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00098 #ifndef QOF_SESSION_H
00099 #define QOF_SESSION_H
00100
00101 #include "qofbackend.h"
00102 #include "qofbook.h"
00103 #include "qofclass.h"
00104 #include "qofobject.h"
00105
00106 #define QOF_MOD_SESSION "qof-session"
00107
00108
00109
00110 typedef struct _QofSession QofSession;
00111
00112 QofSession *qof_session_new (void);
00113 void qof_session_destroy (QofSession * session);
00114
00118 void qof_session_swap_data (QofSession * session_1, QofSession * session_2);
00119
00147 void qof_session_begin (QofSession * session, const char *book_id,
00148 gboolean ignore_lock, gboolean create_if_nonexistent);
00149
00163 typedef void (*QofPercentageFunc) (const gchar *message, double percent);
00164 void qof_session_load (QofSession * session,
00165 QofPercentageFunc percentage_func);
00166
00172 QofBackendError qof_session_get_error (QofSession * session);
00173 const gchar *qof_session_get_error_message (QofSession * session);
00174
00185 QofBackendError qof_session_pop_error (QofSession * session);
00195 void qof_session_add_book (QofSession * session, QofBook * book);
00196
00197 QofBook *qof_session_get_book (QofSession * session);
00198
00213 const gchar *qof_session_get_file_path (QofSession * session);
00214
00215 const gchar *qof_session_get_url (QofSession * session);
00216
00221 gboolean qof_session_not_saved (QofSession * session);
00222
00224 gboolean qof_session_save_may_clobber_data (QofSession * session);
00225
00232 void qof_session_save (QofSession * session,
00233 QofPercentageFunc percentage_func);
00242 void qof_session_end (QofSession * session);
00243
00291 gboolean qof_entity_copy_to_session (QofSession * new_session,
00292 QofEntity * original);
00293
00312 gboolean qof_entity_copy_list (QofSession * new_session, GList * entity_list);
00313
00327 gboolean qof_entity_copy_coll (QofSession * new_session,
00328 QofCollection * entity_coll);
00329
00358 gboolean
00359 qof_entity_copy_coll_r (QofSession * new_session, QofCollection * coll);
00360
00380 gboolean qof_entity_copy_one_r (QofSession * new_session, QofEntity * ent);
00381
00400 #define QOF_STDOUT "file:"
00401
00409 gboolean qof_session_events_pending (QofSession * session);
00410
00415 gboolean qof_session_process_events (QofSession * session);
00424 void qof_session_add_close_hook (GFunc fn, gpointer data);
00425
00430 void qof_session_call_close_hooks (QofSession * session);
00431
00432 #endif
00433