GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 [email protected] *
20  * *
21 \********************************************************************/
22 
98 #ifndef QOF_SESSION_H
99 #define QOF_SESSION_H
100 
101 #include "qofbackend.h"
102 #include "qofbook.h"
103 #include "qofclass.h"
104 #include "qofobject.h"
105 
106 #ifdef __cplusplus
107 extern "C"
108 {
109 #endif
110 
111 #define QOF_MOD_SESSION "qof.session"
112 
113 /* PROTOTYPES ******************************************************/
114 
115 typedef struct _QofSession QofSession;
116 
117 QofSession * qof_session_new (void);
118 void qof_session_destroy (QofSession *session);
119 
123 void qof_session_swap_data (QofSession *session_1, QofSession *session_2);
124 
155 void qof_session_begin (QofSession *session, const char * book_id,
156  gboolean ignore_lock, gboolean create,
157  gboolean force);
158 
159 
173 typedef void (*QofPercentageFunc) (const char *message, double percent);
174 void qof_session_load (QofSession *session,
175  QofPercentageFunc percentage_func);
176 
183 const char * qof_session_get_error_message(const QofSession *session);
184 
200 QofBook * qof_session_get_book (const QofSession *session);
201 
216 const char * qof_session_get_file_path (const QofSession *session);
217 
218 const char * qof_session_get_url (const QofSession *session);
219 
224 /* gboolean qof_session_not_saved(const QofSession *session); <- unimplemented */
225 gboolean qof_session_save_in_progress(const QofSession *session);
226 
233 void qof_session_save (QofSession *session,
234  QofPercentageFunc percentage_func);
235 
243 void qof_session_safe_save (QofSession *session,
244  QofPercentageFunc percentage_func);
245 
254 void qof_session_end (QofSession *session);
255 
274 #define QOF_STDOUT ">"
275 
283 gboolean qof_session_events_pending (const QofSession *session);
284 
289 gboolean qof_session_process_events (QofSession *session);
298 void qof_session_add_close_hook (GFunc fn, gpointer data);
299 
305 
306 gboolean qof_session_export (QofSession *tmp_session,
307  QofSession *real_session,
308  QofPercentageFunc percentage_func);
309 
314 
318 
319 #ifdef __cplusplus
320 }
321 #endif
322 
323 #endif /* QOF_SESSION_H */
324 
void qof_session_save(QofSession *session, QofPercentageFunc percentage_func)
gboolean qof_session_save_in_progress(const QofSession *session)
API for data storage Backend.
void(* QofPercentageFunc)(const char *message, double percent)
Definition: qofsession.h:173
QofBackendError
The errors that can be reported to the GUI & other front-end users.
Definition: qofbackend.h:59
the Core Object Registration/Lookup Interface
void qof_session_safe_save(QofSession *session, QofPercentageFunc percentage_func)
gboolean qof_session_events_pending(const QofSession *session)
const char * qof_session_get_file_path(const QofSession *session)
QofBook * qof_session_get_book(const QofSession *session)
void qof_session_call_close_hooks(QofSession *session)
QofBackendError qof_session_pop_error(QofSession *session)
void qof_session_add_close_hook(GFunc fn, gpointer data)
QofBackendError qof_session_get_error(QofSession *session)
void qof_session_swap_data(QofSession *session_1, QofSession *session_2)
Encapsulate all the information about a dataset.
API for registering paramters on objects.
void qof_session_begin(QofSession *session, const char *book_id, gboolean ignore_lock, gboolean create, gboolean force)
gboolean qof_session_process_events(QofSession *session)
void qof_session_ensure_all_data_loaded(QofSession *session)
GList * qof_backend_get_registered_access_method_list(void)
void qof_session_end(QofSession *session)