qofbackend.h

Go to the documentation of this file.
00001 /********************************************************************\
00002  * qofbackend.h: api for data storage backend                       *
00003  * This program is free software; you can redistribute it and/or    *
00004  * modify it under the terms of the GNU General Public License as   *
00005  * published by the Free Software Foundation; either version 2 of   *
00006  * the License, or (at your option) any later version.              *
00007  *                                                                  *
00008  * This program is distributed in the hope that it will be useful,  *
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00011  * GNU General Public License for more details.                     *
00012  *                                                                  *
00013  * You should have received a copy of the GNU General Public License*
00014  * along with this program; if not, contact:                        *
00015  *                                                                  *
00016  * Free Software Foundation           Voice:  +1-617-542-5942       *
00017  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00018  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
00019  *                                                                  *
00020 \********************************************************************/
00042 #ifndef QOF_BACKEND_H
00043 #define QOF_BACKEND_H
00044 
00045 #include "qofinstance.h"
00046 
00047 #define QOF_MOD_BACKEND "qof-backend"
00048 
00054 typedef gint32 QofErrorId;
00055 
00060 typedef struct QofBackendProvider_s QofBackendProvider;
00061 
00069 typedef struct QofBackend_s QofBackend;
00070 
00072 typedef void (*QofBePercentageFunc) (const gchar * message, double percent);
00073 
00083 void qof_backend_run_begin (QofBackend * be, QofInstance * inst);
00084 
00085 gboolean qof_backend_begin_exists (QofBackend * be);
00086 
00087 void qof_backend_run_commit (QofBackend * be, QofInstance * inst);
00088 
00089 gboolean qof_backend_commit_exists (QofBackend * be);
00114 typedef struct QofBackendOption_s
00115 {
00116     KvpValueType type;         
00118     const gchar *option_name;  
00119     const gchar *description;  
00120     const gchar *tooltip;      
00121     gpointer value;            
00122 } QofBackendOption;
00123 
00125 void qof_backend_prepare_frame (QofBackend * be);
00126 
00128 void qof_backend_prepare_option (QofBackend * be, QofBackendOption * option);
00129 
00131 KvpFrame *qof_backend_complete_frame (QofBackend * be);
00132 
00134 typedef void (*QofBackendOptionCB) (QofBackendOption *, gpointer data);
00135 
00137 void
00138 qof_backend_option_foreach (KvpFrame * config, QofBackendOptionCB cb,
00139                             gpointer data);
00140 
00149 void qof_backend_load_config (QofBackend * be, KvpFrame * config);
00150 
00168 KvpFrame *qof_backend_get_config (QofBackend * be);
00181 gboolean
00182 qof_load_backend_library (const gchar * directory,
00183                           const gchar * filename, const gchar * init_fcn);
00184 
00186 QofBackend *qof_book_get_backend (QofBook * book);
00187 
00192 void qof_book_set_backend (QofBook * book, QofBackend *);
00193 
00196 #endif /* QOF_BACKEND_H */

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