qofbackend-p.h

Go to the documentation of this file.
00001 /********************************************************************\
00002  * qofbackend-p.h -- private api for data storage backend           *
00003  *                                                                  *
00004  * This program is free software; you can redistribute it and/or    *
00005  * modify it under the terms of the GNU General Public License as   *
00006  * published by the Free Software Foundation; either version 2 of   *
00007  * the License, or (at your option) any later version.              *
00008  *                                                                  *
00009  * This program is distributed in the hope that it will be useful,  *
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00012  * GNU General Public License for more details.                     *
00013  *                                                                  *
00014  * You should have received a copy of the GNU General Public License*
00015  * along with this program; if not, contact:                        *
00016  *                                                                  *
00017  * Free Software Foundation           Voice:  +1-617-542-5942       *
00018  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00019  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
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     /* stack of previous errors.
00329        Similar errors can repeat within the stack. */
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 /* QOF_BACKEND_P_H */

Generated on Thu Jan 31 22:50:25 2008 for QOF by  doxygen 1.5.4