GnuCash c935c2f+
Loading...
Searching...
No Matches
qofinstance.h
Go to the documentation of this file.
1/********************************************************************\
2 * qofinstance.h -- fields common to all object instances *
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\********************************************************************/
37#ifndef QOF_INSTANCE_H
38#define QOF_INSTANCE_H
39
40typedef struct _QofInstanceClass QofInstanceClass;
41typedef struct QofInstance_s QofInstance;
42
44typedef struct QofBook QofBook;
45
46#include "qofid.h"
47#include "guid.h"
48#include "gnc-date.h"
49#include "qof-gobject.h"
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55/* --- type macros --- */
56#define QOF_TYPE_INSTANCE (qof_instance_get_type ())
57#define QOF_INSTANCE(o) \
58 (G_TYPE_CHECK_INSTANCE_CAST ((o), QOF_TYPE_INSTANCE, QofInstance))
59#define QOF_INSTANCE_CLASS(k) \
60 (G_TYPE_CHECK_CLASS_CAST((k), QOF_TYPE_INSTANCE, QofInstanceClass))
61#define QOF_IS_INSTANCE(o) \
62 (G_TYPE_CHECK_INSTANCE_TYPE ((o), QOF_TYPE_INSTANCE))
63#define QOF_IS_INSTANCE_CLASS(k) \
64 (G_TYPE_CHECK_CLASS_TYPE ((k), QOF_TYPE_INSTANCE))
65#define QOF_INSTANCE_GET_CLASS(o) \
66 (G_TYPE_INSTANCE_GET_CLASS ((o), QOF_TYPE_INSTANCE, QofInstanceClass))
67#ifndef __KVP_FRAME
68typedef struct KvpFrameImpl KvpFrame;
69#define __KVP_FRAME
70#endif
71
73{
74 GObject object;
76 KvpFrame *kvp_data;
77};
78
80{
81 GObjectClass parent_class;
82
83 /* Returns a displayable string to represent this object */
84 gchar* (*get_display_name)(const QofInstance*);
85
86 /* Does this object refer to a specific object */
87 gboolean (*refers_to_object)(const QofInstance* inst, const QofInstance* ref);
88
89 /* Returns a list of my type of object which refers to an object */
90 GList* (*get_typed_referring_object_list)(const QofInstance* inst, const QofInstance* ref);
91};
92
95
98
100/*@ dependent @*/
101QofBook *qof_instance_get_book (gconstpointer);
102
104void qof_instance_set_book (gconstpointer inst, QofBook *book);
105
107void qof_instance_copy_book (gpointer ptr1, gconstpointer ptr2);
108
110gboolean qof_instance_books_equal (gconstpointer ptr1, gconstpointer ptr2);
111
113/*@ dependent @*/
114const GncGUID * qof_instance_get_guid (gconstpointer);
115
118/*@ dependent @*/
119const GncGUID * qof_entity_get_guid (gconstpointer);
120
122/*@ dependent @*/
123QofCollection* qof_instance_get_collection (gconstpointer inst);
124
128gint qof_instance_guid_compare(const gconstpointer ptr1, const gconstpointer ptr2);
129
130gint qof_instance_get_editlevel (gconstpointer ptr);
131
138int qof_instance_version_cmp (const QofInstance *left, const QofInstance *right);
139
148gboolean qof_instance_get_destroying (gconstpointer ptr);
149
161gboolean qof_instance_get_dirty_flag (gconstpointer ptr);
162
163void qof_instance_print_dirty (const QofInstance *entity, gpointer dummy);
164
166#define qof_instance_is_dirty qof_instance_get_dirty
167gboolean qof_instance_get_dirty (QofInstance *);
168
169gboolean qof_instance_get_infant(const QofInstance *inst);
170
174void qof_instance_get (const QofInstance *inst, const gchar *first_param, ...);
175
180void qof_instance_set (QofInstance *inst, const gchar *first_param, ...);
181
184guint32 qof_instance_get_idata (gconstpointer inst);
185
190
196
198gboolean qof_instance_refers_to_object(const QofInstance* inst, const QofInstance* ref);
199
207
211GList* qof_instance_get_referring_object_list_from_collection(const QofCollection* coll, const QofInstance* ref);
212
213#ifdef __cplusplus
214}
215#endif
216
217/* @} */
218/* @} */
219#endif /* QOF_INSTANCE_H */
Date and Time handling routines.
const gchar * QofIdType
QofIdType declaration.
Definition qofid.h:80
QofBook * qof_instance_get_book(gconstpointer)
Return the book pointer.
void qof_instance_copy_book(gpointer ptr1, gconstpointer ptr2)
Copy the book from one QofInstances to another.
const GncGUID * qof_instance_get_guid(gconstpointer)
Return the GncGUID of this instance.
GType qof_instance_get_type(void)
Return the GType of a QofInstance.
int qof_instance_version_cmp(const QofInstance *left, const QofInstance *right)
Compare two instances, based on their last update times.
QofCollection * qof_instance_get_collection(gconstpointer inst)
Return the collection this instance belongs to.
void qof_instance_set(QofInstance *inst, const gchar *first_param,...)
Wrapper for g_object_set Group setting multiple parameters in a single begin/commit/rollback.
void qof_instance_init_data(QofInstance *, QofIdType, QofBook *)
Initialise the settings associated with an instance.
gboolean qof_instance_get_dirty_flag(gconstpointer ptr)
Retrieve the flag that indicates whether or not this object has been modified.
gboolean qof_instance_get_destroying(gconstpointer ptr)
Retrieve the flag that indicates whether or not this object is about to be destroyed.
void qof_instance_get(const QofInstance *inst, const gchar *first_param,...)
Wrapper for g_object_get.
gboolean qof_instance_books_equal(gconstpointer ptr1, gconstpointer ptr2)
See if two QofInstances share the same book.
gint qof_instance_guid_compare(const gconstpointer ptr1, const gconstpointer ptr2)
Compare the GncGUID values of two instances.
gchar * qof_instance_get_display_name(const QofInstance *inst)
Returns a displayable name for this object.
guint32 qof_instance_get_idata(gconstpointer inst)
get the instance tag number used for kvp management in sql backends.
GList * qof_instance_get_typed_referring_object_list(const QofInstance *inst, const QofInstance *ref)
Returns a list of my type of object which refers to an object.
QofIdType e_type
Entity type.
Definition qofinstance.h:75
void qof_instance_set_book(gconstpointer inst, QofBook *book)
Set the book pointer.
gboolean qof_instance_refers_to_object(const QofInstance *inst, const QofInstance *ref)
Does this object refer to a specific object.
GList * qof_instance_get_referring_object_list(const QofInstance *inst)
Returns a list of objects which refer to a specific object.
GList * qof_instance_get_referring_object_list_from_collection(const QofCollection *coll, const QofInstance *ref)
Returns a list of objects from the collection which refer to the specific object.
const GncGUID * qof_entity_get_guid(gconstpointer)
globally unique ID User API
QOF entity type identification system.
The type used to store guids in C.
Definition guid.h:75
Implements KvpFrame.
QofBook reference.
Definition qofbook-p.hpp:47