QOF  0.8.7
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 */
void qof_session_call_close_hooks(QofSession *session)
Definition: qofsession.c:89
gboolean qof_entity_copy_coll(QofSession *new_session, QofCollection *entity_coll)
Copy a QofCollection of entities.
Definition: qofsession.c:685
API for data storage Backend.
gboolean qof_entity_copy_one_r(QofSession *new_session, QofEntity *ent)
Recursively copy a single entity to a new session.
Definition: qofsession.c:883
gboolean qof_session_events_pending(QofSession *session)
Definition: qofsession.c:1463
the Core Object Description Interface
void qof_session_add_book(QofSession *session, QofBook *book)
Definition: qofsession.c:145
gboolean qof_session_process_events(QofSession *session)
Definition: qofsession.c:1476
void qof_session_swap_data(QofSession *session_1, QofSession *session_2)
Definition: qofsession.c:1429
struct QofCollection_s QofCollection
Definition: qofid.h:138
void(* QofPercentageFunc)(const gchar *message, gdouble percent)
Definition: qofsession.h:168
gboolean qof_entity_copy_coll_r(QofSession *new_session, QofCollection *coll)
Recursively copy a collection of entities to a session.
Definition: qofsession.c:859
gboolean qof_session_save_may_clobber_data(QofSession *session)
Definition: qofsession.c:1207
void qof_session_begin(QofSession *session, const gchar *book_id, gboolean ignore_lock, gboolean create_if_nonexistent)
Definition: qofsession.c:1032
gboolean qof_entity_copy_list(QofSession *new_session, GList *entity_list)
Copy a GList of entities to another session.
Definition: qofsession.c:663
const gchar * qof_session_get_file_path(QofSession *session)
Definition: qofsession.c:189
gboolean qof_entity_copy_to_session(QofSession *new_session, QofEntity *original)
Copy a single QofEntity to another session.
Definition: qofsession.c:631
gboolean qof_session_not_saved(QofSession *session)
Encapsulate all the information about a dataset.
void qof_session_add_close_hook(GFunc fn, gpointer data)
Definition: qofsession.c:69
API for registering parameters on objects.
void qof_session_save(QofSession *session, QofPercentageFunc percentage_func)
Definition: qofsession.c:1220
void qof_session_end(QofSession *session)
Definition: qofsession.c:1374