00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00040 #ifndef QOF_BACKEND_P_H
00041 #define QOF_BACKEND_P_H
00042
00043 #include "qofinstance-p.h"
00044 #include "qofquery.h"
00045 #include "qofsession.h"
00046
00238 struct QofBackendProvider_s
00239 {
00241 const gchar *provider_name;
00242
00247 const gchar *access_method;
00248
00254 gboolean partial_book_supported;
00255
00260 QofBackend *(*backend_new) (void);
00261
00277 gboolean (*check_data_type) (const gchar *);
00278
00280 void (*provider_free) (QofBackendProvider *);
00281 };
00282
00283 struct QofBackend_s
00284 {
00285 void (*session_begin) (QofBackend * be,
00286 QofSession * session,
00287 const gchar * book_id,
00288 gboolean ignore_lock,
00289 gboolean create_if_nonexistent);
00290 void (*session_end) (QofBackend *);
00291 void (*destroy_backend) (QofBackend *);
00292 void (*load) (QofBackend *, QofBook *);
00293 void (*begin) (QofBackend *, QofInstance *);
00294 void (*commit) (QofBackend *, QofInstance *);
00295 void (*rollback) (QofBackend *, QofInstance *);
00296 gpointer (*compile_query) (QofBackend *, QofQuery *);
00297 void (*free_query) (QofBackend *, gpointer);
00298 void (*run_query) (QofBackend *, gpointer);
00299 void (*sync) (QofBackend *, QofBook *);
00300 void (*load_config) (QofBackend *, KvpFrame *);
00301 KvpFrame *(*get_config) (QofBackend *);
00302 gint64 (*counter) (QofBackend *, const gchar * counter_name);
00303 gboolean (*events_pending) (QofBackend *);
00304 gboolean (*process_events) (QofBackend *);
00305 QofBePercentageFunc percentage;
00306 QofBackendProvider *provider;
00307
00320 gboolean (*save_may_clobber_data) (QofBackend *);
00321
00322 #ifndef QOF_DISABLE_DEPRECATED
00323
00324 QofErrorId last_err;
00326 gchar *error_msg;
00327 #endif
00328
00329
00330 GList * error_stack;
00331
00332
00333 KvpFrame *backend_configuration;
00334 gint config_count;
00338 gchar *fullpath;
00339
00341 void (*price_lookup) (QofBackend *, gpointer);
00342
00344 void (*export) (QofBackend *, QofBook *);
00345
00346 };
00347
00355 void
00356 qof_backend_register_provider (QofBackendProvider *);
00357
00358 void qof_backend_init (QofBackend * be);
00359
00364 gchar qof_book_get_open_marker (QofBook * book);
00365
00373 gint32 qof_book_get_version (QofBook * book);
00374
00379 guint32 qof_book_get_idata (QofBook * book);
00380
00381 void qof_book_set_version (QofBook * book, gint32 version);
00382
00383 void qof_book_set_idata (QofBook * book, guint32 idata);
00384
00388 #endif