QOF  0.8.7
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 
121 #define QOF_TYPE_COLLECT "collection"
122 
125 typedef const gchar *QofType;
126 
127 typedef struct _QofParam QofParam;
128 
144 typedef gpointer (*QofAccessFunc) (gpointer object, const QofParam * param);
145 
151 typedef void (*QofSetterFunc) (gpointer, gpointer);
152 
170 struct _QofParam
171 {
172  const gchar *param_name;
173  QofType param_type;
174  QofAccessFunc param_getfcn;
175  QofSetterFunc param_setfcn;
176  gpointer param_userdata;
177 };
178 
180 typedef
181 gint (*QofSortFunc) (gconstpointer, gconstpointer);
182 
200 void qof_class_register (QofIdTypeConst obj_name,
201  QofSortFunc default_sort_fcn,
202  const QofParam * params);
203 
227 gboolean
229 
231 QofType
233  const gchar *param_name);
234 
236 const QofParam *
238  const gchar *parameter);
239 
243  const gchar *parameter);
244 
248  const gchar *parameter);
249 
251 typedef void (*QofClassForeachCB) (QofIdTypeConst, gpointer);
252 
256 void
257 qof_class_foreach (QofClassForeachCB, gpointer user_data);
258 
260 typedef void (*QofParamForeachCB) (QofParam *, gpointer user_data);
261 
265 void
267  QofParamForeachCB, gpointer user_data);
268 
275 GList *
277 
278 #endif /* QOF_CLASS_H */
279 
gboolean qof_class_is_registered(QofIdTypeConst obj_name)
Definition: qofclass.c:133
void qof_class_param_foreach(QofIdTypeConst obj_name, QofParamForeachCB, gpointer user_data)
Definition: qofclass.c:268
QofSetterFunc qof_class_get_parameter_setter(QofIdTypeConst obj_name, const gchar *parameter)
Definition: qofclass.c:183
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:94
gint(* QofSortFunc)(gconstpointer, gconstpointer)
Definition: qofclass.h:181
void(* QofClassForeachCB)(QofIdTypeConst, gpointer)
Definition: qofclass.h:251
QOF entity type identification system.
void(* QofSetterFunc)(gpointer, gpointer)
Definition: qofclass.h:151
const QofParam * qof_class_get_parameter(QofIdTypeConst obj_name, const gchar *parameter)
Definition: qofclass.c:147
void qof_class_foreach(QofClassForeachCB, gpointer user_data)
Definition: qofclass.c:234
gpointer(* QofAccessFunc)(gpointer object, const QofParam *param)
Definition: qofclass.h:144
const gchar * QofType
Definition: qofclass.h:125
GList * qof_class_get_referenceList(QofIdTypeConst type)
List of the parameters that could be references.
Definition: qofclass.c:329
const gchar * QofIdTypeConst
Definition: qofid.h:83
QofType qof_class_get_parameter_type(QofIdTypeConst obj_name, const gchar *param_name)
Definition: qofclass.c:199
QofAccessFunc qof_class_get_parameter_getter(QofIdTypeConst obj_name, const gchar *parameter)
Definition: qofclass.c:167
void(* QofParamForeachCB)(QofParam *, gpointer user_data)
Definition: qofclass.h:260