00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00121 #define QOF_TYPE_COLLECT "collection"
00122
00125 typedef const gchar *QofType;
00126
00127 typedef struct _QofParam QofParam;
00128
00144 typedef gpointer (*QofAccessFunc) (gpointer object, const QofParam * param);
00145
00151 typedef void (*QofSetterFunc) (gpointer, gpointer);
00152
00170 struct _QofParam
00171 {
00172 const gchar *param_name;
00173 QofType param_type;
00174 QofAccessFunc param_getfcn;
00175 QofSetterFunc param_setfcn;
00176 gpointer param_userdata;
00177 };
00178
00180 typedef
00181 gint (*QofSortFunc) (gconstpointer, gconstpointer);
00182
00200 void qof_class_register (QofIdTypeConst obj_name,
00201 QofSortFunc default_sort_fcn,
00202 const QofParam * params);
00203
00227 gboolean
00228 qof_class_is_registered (QofIdTypeConst obj_name);
00229
00231 QofType
00232 qof_class_get_parameter_type (QofIdTypeConst obj_name,
00233 const gchar *param_name);
00234
00236 const QofParam *
00237 qof_class_get_parameter (QofIdTypeConst obj_name,
00238 const gchar *parameter);
00239
00241 QofAccessFunc
00242 qof_class_get_parameter_getter (QofIdTypeConst obj_name,
00243 const gchar *parameter);
00244
00246 QofSetterFunc
00247 qof_class_get_parameter_setter (QofIdTypeConst obj_name,
00248 const gchar *parameter);
00249
00251 typedef void (*QofClassForeachCB) (QofIdTypeConst, gpointer);
00252
00256 void
00257 qof_class_foreach (QofClassForeachCB, gpointer user_data);
00258
00260 typedef void (*QofParamForeachCB) (QofParam *, gpointer user_data);
00261
00265 void
00266 qof_class_param_foreach (QofIdTypeConst obj_name,
00267 QofParamForeachCB, gpointer user_data);
00268
00275 GList *
00276 qof_class_get_referenceList (QofIdTypeConst type);
00277
00278 #endif
00279