00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00101 #ifndef QOF_SESSION_H
00102 #define QOF_SESSION_H
00103
00104 #include "qofbackend.h"
00105 #include "qofbook.h"
00106 #include "qofclass.h"
00107 #include "qofobject.h"
00108
00109 #define QOF_MOD_SESSION "qof-session"
00110
00111
00112
00113 typedef struct _QofSession QofSession;
00114
00115 QofSession *qof_session_new (void);
00116
00117 void qof_session_destroy (QofSession * session);
00118
00122 void
00123 qof_session_swap_data (QofSession * session_1, QofSession * session_2);
00124
00152 void qof_session_begin (QofSession * session, const gchar *book_id,
00153 gboolean ignore_lock, gboolean create_if_nonexistent);
00154
00168 typedef void (*QofPercentageFunc) (const gchar *message, gdouble percent);
00169 void qof_session_load (QofSession * session,
00170 QofPercentageFunc percentage_func);
00171
00179 void
00180 qof_session_add_book (QofSession * session, QofBook * book);
00181
00182 QofBook *
00183 qof_session_get_book (QofSession * session);
00184
00199 const gchar *qof_session_get_file_path (QofSession * session);
00200
00201 const gchar *qof_session_get_url (QofSession * session);
00202
00207 gboolean qof_session_not_saved (QofSession * session);
00208
00210 gboolean qof_session_save_may_clobber_data (QofSession * session);
00211
00218 void qof_session_save (QofSession * session,
00219 QofPercentageFunc percentage_func);
00228 void qof_session_end (QofSession * session);
00229
00277 gboolean qof_entity_copy_to_session (QofSession * new_session,
00278 QofEntity * original);
00279
00298 gboolean qof_entity_copy_list (QofSession * new_session, GList * entity_list);
00299
00313 gboolean qof_entity_copy_coll (QofSession * new_session,
00314 QofCollection * entity_coll);
00315
00344 gboolean
00345 qof_entity_copy_coll_r (QofSession * new_session, QofCollection * coll);
00346
00366 gboolean qof_entity_copy_one_r (QofSession * new_session, QofEntity * ent);
00367
00386 #define QOF_STDOUT "file:"
00387
00395 gboolean qof_session_events_pending (QofSession * session);
00396
00401 gboolean qof_session_process_events (QofSession * session);
00410 void qof_session_add_close_hook (GFunc fn, gpointer data);
00411
00416 void qof_session_call_close_hooks (QofSession * session);
00417
00421 #endif