00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00069 #ifndef QOF_CLASS_H
00070 #define QOF_CLASS_H
00071
00072 #include "qofid.h"
00073
00074 #define QOF_MOD_CLASS "qof-class"
00075
00085 #define QOF_TYPE_STRING "string"
00086 #define QOF_TYPE_TIME "time"
00087 #define QOF_TYPE_NUMERIC "numeric"
00088 #define QOF_TYPE_DEBCRED "debcred"
00089 #define QOF_TYPE_GUID "guid"
00090 #define QOF_TYPE_INT32 "gint32"
00091 #define QOF_TYPE_INT64 "gint64"
00092 #define QOF_TYPE_DOUBLE "double"
00093 #define QOF_TYPE_BOOLEAN "boolean"
00094 #define QOF_TYPE_KVP "kvp"
00095 #define QOF_TYPE_CHAR "character"
00096 #define QOF_TYPE_COLLECT "collection"
00126 typedef const gchar *QofType;
00127
00128 typedef struct _QofParam QofParam;
00129
00145 typedef gpointer (*QofAccessFunc) (gpointer object, const QofParam * param);
00146
00152 typedef void (*QofSetterFunc) (gpointer, gpointer);
00153
00171 struct _QofParam
00172 {
00173 const gchar *param_name;
00174 QofType param_type;
00175 QofAccessFunc param_getfcn;
00176 QofSetterFunc param_setfcn;
00177 gpointer param_userdata;
00178 };
00179
00181 typedef
00182 gint (*QofSortFunc) (gconstpointer, gconstpointer);
00183
00197 void qof_class_register (QofIdTypeConst obj_name,
00198 QofSortFunc default_sort_fcn,
00199 const QofParam * params);
00200
00223 gboolean
00224 qof_class_is_registered (QofIdTypeConst obj_name);
00225
00227 QofType
00228 qof_class_get_parameter_type (QofIdTypeConst obj_name,
00229 const gchar *param_name);
00230
00232 const QofParam *
00233 qof_class_get_parameter (QofIdTypeConst obj_name,
00234 const gchar *parameter);
00235
00237 QofAccessFunc
00238 qof_class_get_parameter_getter (QofIdTypeConst obj_name,
00239 const gchar *parameter);
00240
00242 QofSetterFunc
00243 qof_class_get_parameter_setter (QofIdTypeConst obj_name,
00244 const gchar *parameter);
00245
00247 typedef void (*QofClassForeachCB) (QofIdTypeConst, gpointer);
00248
00252 void
00253 qof_class_foreach (QofClassForeachCB, gpointer user_data);
00254
00256 typedef void (*QofParamForeachCB) (QofParam *, gpointer user_data);
00257
00261 void
00262 qof_class_param_foreach (QofIdTypeConst obj_name,
00263 QofParamForeachCB, gpointer user_data);
00264
00271 GList *
00272 qof_class_get_referenceList (QofIdTypeConst type);
00273
00274 #endif
00275