QOF: qofclass.h Source File

QOF 0.7.5

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

qofclass.h
Go to the documentation of this file.
1 /********************************************************************\
2 * qofclass.h -- API for registering parameters on objects *
3 * *
4 * This program is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU General Public License as *
6 * published by the Free Software Foundation; either version 2 of *
7 * the License, or (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License*
15 * along with this program; if not, contact: *
16 * *
17 * Free Software Foundation Voice: +1-617-542-5942 *
18 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19 * Boston, MA 02110-1301, USA gnu@gnu.org *
20 * *
21 \********************************************************************/
22
66 #ifndef QOF_CLASS_H
67 #define QOF_CLASS_H
68
69 #include "qofid.h"
70
71 #define QOF_MOD_CLASS "qof-class"
72
82 #define QOF_TYPE_STRING "string"
83 #define QOF_TYPE_TIME "time"
84 #define QOF_TYPE_NUMERIC "numeric"
85 #define QOF_TYPE_DEBCRED "debcred"
86 #define QOF_TYPE_GUID "guid"
87 #define QOF_TYPE_INT32 "gint32"
88 #define QOF_TYPE_INT64 "gint64"
89 #define QOF_TYPE_DOUBLE "double"
90 #define QOF_TYPE_BOOLEAN "boolean"
91 #define QOF_TYPE_KVP "kvp"
92 #define QOF_TYPE_CHAR "character"
93 #define QOF_TYPE_COLLECT "collection"
123 typedef const gchar *QofType;
124
125 typedef struct _QofParam QofParam;
126
142 typedef gpointer (*QofAccessFunc) (gpointer object, const QofParam * param);
143
149 typedef void (*QofSetterFunc) (gpointer, gpointer);
150
168 struct _QofParam
169 {
170 const gchar *param_name;
171 QofType param_type;
172 QofAccessFunc param_getfcn;
173 QofSetterFunc param_setfcn;
174 gpointer param_userdata;
175 };
176
178 typedef
179 gint (*QofSortFunc) (gconstpointer, gconstpointer);
180
198 void qof_class_register (QofIdTypeConst obj_name,
199 QofSortFunc default_sort_fcn,
200 const QofParam * params);
201
224 gboolean
225 qof_class_is_registered (QofIdTypeConst obj_name);
226
228 QofType
229 qof_class_get_parameter_type (QofIdTypeConst obj_name,
230 const gchar *param_name);
231
233 const QofParam *
234 qof_class_get_parameter (QofIdTypeConst obj_name,
235 const gchar *parameter);
236
238 QofAccessFunc
239 qof_class_get_parameter_getter (QofIdTypeConst obj_name,
240 const gchar *parameter);
241
243 QofSetterFunc
244 qof_class_get_parameter_setter (QofIdTypeConst obj_name,
245 const gchar *parameter);
246
248 typedef void (*QofClassForeachCB) (QofIdTypeConst, gpointer);
249
253 void
254 qof_class_foreach (QofClassForeachCB, gpointer user_data);
255
257 typedef void (*QofParamForeachCB) (QofParam *, gpointer user_data);
258
262 void
263 qof_class_param_foreach (QofIdTypeConst obj_name,
264 QofParamForeachCB, gpointer user_data);
265
272 GList *
273 qof_class_get_referenceList (QofIdTypeConst type);
274
275 #endif /* QOF_CLASS_H */
276
qof_class_is_registered
gboolean qof_class_is_registered(QofIdTypeConst obj_name)
Definition: qofclass.c:132
qof_class_param_foreach
void qof_class_param_foreach(QofIdTypeConst obj_name, QofParamForeachCB, gpointer user_data)
Definition: qofclass.c:267
_QofParam
Definition: qofclass.h:195
qof_class_get_parameter_setter
QofSetterFunc qof_class_get_parameter_setter(QofIdTypeConst obj_name, const gchar *parameter)
Definition: qofclass.c:182
qof_class_register
void qof_class_register(QofIdTypeConst obj_name, QofSortFunc default_sort_fcn, const QofParam *params)
registers a new object class with the Qof subsystem.
Definition: qofclass.c:93
QofSortFunc
gint(* QofSortFunc)(gconstpointer, gconstpointer)
Definition: qofclass.h:206
QofClassForeachCB
void(* QofClassForeachCB)(QofIdTypeConst, gpointer)
Definition: qofclass.h:275
qofid.h
QOF entity type identification system.
QofSetterFunc
void(* QofSetterFunc)(gpointer, gpointer)
Definition: qofclass.h:176
qof_class_get_parameter
const QofParam * qof_class_get_parameter(QofIdTypeConst obj_name, const gchar *parameter)
Definition: qofclass.c:146
qof_class_foreach
void qof_class_foreach(QofClassForeachCB, gpointer user_data)
Definition: qofclass.c:233
QofAccessFunc
gpointer(* QofAccessFunc)(gpointer object, const QofParam *param)
Definition: qofclass.h:169
QofType
const gchar * QofType
Definition: qofclass.h:150
qof_class_get_referenceList
GList * qof_class_get_referenceList(QofIdTypeConst type)
List of the parameters that could be references.
Definition: qofclass.c:332
QofIdTypeConst
const gchar * QofIdTypeConst
Definition: qofid.h:83
qof_class_get_parameter_type
QofType qof_class_get_parameter_type(QofIdTypeConst obj_name, const gchar *param_name)
Definition: qofclass.c:198
qof_class_get_parameter_getter
QofAccessFunc qof_class_get_parameter_getter(QofIdTypeConst obj_name, const gchar *parameter)
Definition: qofclass.c:166
QofParamForeachCB
void(* QofParamForeachCB)(QofParam *, gpointer user_data)
Definition: qofclass.h:284