qofclass.h

Go to the documentation of this file.
00001 /********************************************************************\
00002  * qofclass.h -- API for registering parameters on objects          *
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 \********************************************************************/
00022 
00066 #ifndef QOF_CLASS_H
00067 #define QOF_CLASS_H
00068 
00069 #include "qofid.h"
00070 
00071 #define QOF_MOD_CLASS "qof-class"
00072 
00082 #define QOF_TYPE_STRING    "string"
00083 #define QOF_TYPE_TIME      "time"
00084 #define QOF_TYPE_NUMERIC   "numeric"
00085 #define QOF_TYPE_DEBCRED   "debcred"
00086 #define QOF_TYPE_GUID      "guid"
00087 #define QOF_TYPE_INT32     "gint32"
00088 #define QOF_TYPE_INT64     "gint64"
00089 #define QOF_TYPE_DOUBLE    "double"
00090 #define QOF_TYPE_BOOLEAN   "boolean"
00091 #define QOF_TYPE_KVP       "kvp"
00092 #define QOF_TYPE_CHAR      "character"
00093 #define QOF_TYPE_COLLECT   "collection" 
00123 typedef const gchar *QofType;
00124 
00125 typedef struct _QofParam QofParam;
00126 
00142 typedef gpointer (*QofAccessFunc) (gpointer object, const QofParam * param);
00143 
00149 typedef void (*QofSetterFunc) (gpointer, gpointer);
00150 
00168 struct _QofParam
00169 {
00170     const gchar *param_name;
00171     QofType param_type;
00172     QofAccessFunc param_getfcn;
00173     QofSetterFunc param_setfcn;
00174     gpointer param_userdata;
00175 };
00176 
00178 typedef 
00179 gint (*QofSortFunc) (gconstpointer, gconstpointer);
00180 
00194 void qof_class_register (QofIdTypeConst obj_name,
00195                          QofSortFunc default_sort_fcn,
00196                          const QofParam * params);
00197 
00220 gboolean 
00221 qof_class_is_registered (QofIdTypeConst obj_name);
00222 
00224 QofType 
00225 qof_class_get_parameter_type (QofIdTypeConst obj_name,
00226                               const gchar *param_name);
00227 
00229 const QofParam *
00230 qof_class_get_parameter (QofIdTypeConst obj_name,
00231                         const gchar *parameter);
00232 
00234 QofAccessFunc 
00235 qof_class_get_parameter_getter (QofIdTypeConst obj_name,
00236                                 const gchar *parameter);
00237 
00239 QofSetterFunc 
00240 qof_class_get_parameter_setter (QofIdTypeConst obj_name,
00241                                 const gchar *parameter);
00242 
00244 typedef void (*QofClassForeachCB) (QofIdTypeConst, gpointer);
00245 
00249 void 
00250 qof_class_foreach (QofClassForeachCB, gpointer user_data);
00251 
00253 typedef void (*QofParamForeachCB) (QofParam *, gpointer user_data);
00254 
00258 void 
00259 qof_class_param_foreach (QofIdTypeConst obj_name,
00260                          QofParamForeachCB, gpointer user_data);
00261 
00268 GList *
00269 qof_class_get_referenceList (QofIdTypeConst type);
00270 
00271 #endif /* QOF_CLASS_H */
00272 

Generated on Sat Aug 18 19:00:09 2007 for QOF by  doxygen 1.5.2