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 #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
00198 void qof_class_register (QofIdTypeConst obj_name,
00199 QofSortFunc default_sort_fcn,
00200 const QofParam * params);
00201
00224 gboolean
00225 qof_class_is_registered (QofIdTypeConst obj_name);
00226
00228 QofType
00229 qof_class_get_parameter_type (QofIdTypeConst obj_name,
00230 const gchar *param_name);
00231
00233 const QofParam *
00234 qof_class_get_parameter (QofIdTypeConst obj_name,
00235 const gchar *parameter);
00236
00238 QofAccessFunc
00239 qof_class_get_parameter_getter (QofIdTypeConst obj_name,
00240 const gchar *parameter);
00241
00243 QofSetterFunc
00244 qof_class_get_parameter_setter (QofIdTypeConst obj_name,
00245 const gchar *parameter);
00246
00248 typedef void (*QofClassForeachCB) (QofIdTypeConst, gpointer);
00249
00253 void
00254 qof_class_foreach (QofClassForeachCB, gpointer user_data);
00255
00257 typedef void (*QofParamForeachCB) (QofParam *, gpointer user_data);
00258
00262 void
00263 qof_class_param_foreach (QofIdTypeConst obj_name,
00264 QofParamForeachCB, gpointer user_data);
00265
00272 GList *
00273 qof_class_get_referenceList (QofIdTypeConst type);
00274
00275 #endif
00276