GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Files | Data Structures | Macros | Typedefs | Functions

Files

file  qofinstance.h
 Object instance holds common fields that most gnucash objects use.
 

Data Structures

struct  QofInstance_s
 
struct  _QofInstanceClass
 

Macros

#define QOF_TYPE_INSTANCE   (qof_instance_get_type ())
 
#define QOF_INSTANCE(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), QOF_TYPE_INSTANCE, QofInstance))
 
#define QOF_INSTANCE_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST((k), QOF_TYPE_INSTANCE, QofInstanceClass))
 
#define QOF_IS_INSTANCE(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), QOF_TYPE_INSTANCE))
 
#define QOF_IS_INSTANCE_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), QOF_TYPE_INSTANCE))
 
#define QOF_INSTANCE_GET_CLASS(o)   (G_TYPE_INSTANCE_GET_CLASS ((o), QOF_TYPE_INSTANCE, QofInstanceClass))
 
#define qof_instance_is_dirty   qof_instance_get_dirty
 

Typedefs

typedef struct _QofInstanceClass QofInstanceClass
 
typedef struct QofInstance_s QofInstance
 
typedef struct _QofBook QofBook
 QofBook reference.
 

Functions

GType qof_instance_get_type (void)
 
void qof_instance_init_data (QofInstance *, QofIdType, QofBook *)
 
QofBookqof_instance_get_book (gconstpointer)
 
void qof_instance_set_book (gconstpointer inst, QofBook *book)
 
void qof_instance_copy_book (gpointer ptr1, gconstpointer ptr2)
 
gboolean qof_instance_books_equal (gconstpointer ptr1, gconstpointer ptr2)
 
const GncGUIDqof_instance_get_guid (gconstpointer)
 
const GncGUIDqof_entity_get_guid (gconstpointer)
 
QofCollection * qof_instance_get_collection (gconstpointer inst)
 
gint qof_instance_guid_compare (const gconstpointer ptr1, const gconstpointer ptr2)
 
gint qof_instance_get_editlevel (gconstpointer ptr)
 
int qof_instance_version_cmp (const QofInstance *left, const QofInstance *right)
 
gboolean qof_instance_get_destroying (gconstpointer ptr)
 
gboolean qof_instance_get_dirty_flag (gconstpointer ptr)
 
void qof_instance_print_dirty (const QofInstance *entity, gpointer dummy)
 
gboolean qof_instance_get_dirty (QofInstance *)
 
gboolean qof_instance_get_infant (const QofInstance *inst)
 
void qof_instance_get (const QofInstance *inst, const gchar *first_param,...)
 Wrapper for g_object_get.
 
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.
 
guint32 qof_instance_get_idata (gconstpointer inst)
 
gchar * qof_instance_get_display_name (const QofInstance *inst)
 
GList * qof_instance_get_referring_object_list (const QofInstance *inst)
 
gboolean qof_instance_refers_to_object (const QofInstance *inst, const QofInstance *ref)
 
GList * qof_instance_get_typed_referring_object_list (const QofInstance *inst, const QofInstance *ref)
 
GList * qof_instance_get_referring_object_list_from_collection (const QofCollection *coll, const QofInstance *ref)
 

Detailed Description

Qof Instances are a derived type of QofInstance. The Instance adds some common features and functions that most objects will want to use.

Macro Definition Documentation

#define qof_instance_is_dirty   qof_instance_get_dirty

Return value of is_dirty flag

Definition at line 165 of file qofinstance.h.

Function Documentation

const GncGUID* qof_entity_get_guid ( gconstpointer  )
Deprecated:
Use qof_instance_get_guid instead. Works like qof_instance_get_guid, but returns NULL on NULL
gboolean qof_instance_books_equal ( gconstpointer  ptr1,
gconstpointer  ptr2 
)

See if two QofInstances share the same book.

void qof_instance_copy_book ( gpointer  ptr1,
gconstpointer  ptr2 
)

Copy the book from one QofInstances to another.

QofBook* qof_instance_get_book ( gconstpointer  )

Return the book pointer

QofCollection* qof_instance_get_collection ( gconstpointer  inst)

Return the collection this instance belongs to

gboolean qof_instance_get_destroying ( gconstpointer  ptr)

Retrieve the flag that indicates whether or not this object is about to be destroyed.

Parameters
ptrThe object whose flag should be retrieved.
Returns
TRUE if the object has been marked for destruction. FALSE if the object is not marked for destruction, or if a bad parameter is passed to the function.
gboolean qof_instance_get_dirty_flag ( gconstpointer  ptr)

Retrieve the flag that indicates whether or not this object has been modified. This is specifically the flag on the object. It does not perform any other checking which might normally be performed when testing to see if an object is dirty. If there is any question, use the qof_instance_is_dirty() function instead.

Parameters
ptrThe object whose flag should be retrieved.
Returns
TRUE if the object has been modified and not saved. FALSE if the object has not been modified, or if a bad parameter is passed to the function.
gchar* qof_instance_get_display_name ( const QofInstance inst)

Returns a displayable name for this object. The returned string must be freed by the caller.

const GncGUID* qof_instance_get_guid ( gconstpointer  )

Return the GncGUID of this instance

guint32 qof_instance_get_idata ( gconstpointer  inst)

get the instance tag number used for kvp management in sql backends.

GList* qof_instance_get_referring_object_list ( const QofInstance inst)

Returns a list of objects which refer to a specific object. The list must be freed by the caller, but the objects on the list must not.

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. The list must be freed by the caller but the objects on the list must not.

GType qof_instance_get_type ( void  )

Return the GType of a QofInstance

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. For example, when called as qof_instance_get_typed_referring_object_list(taxtable, account); it will return the list of taxtables which refer to a specific account. The result should be the same regardless of which taxtable object is used. The list must be freed by the caller but the objects on the list must not.

gint qof_instance_guid_compare ( const gconstpointer  ptr1,
const gconstpointer  ptr2 
)

Compare the GncGUID values of two instances. This routine returns 0 if the two values are equal, <0 if the first is smaller than the second, or >0 if the second is smaller tan the first.

void qof_instance_init_data ( QofInstance ,
QofIdType  ,
QofBook  
)

Initialise the settings associated with an instance

gboolean qof_instance_refers_to_object ( const QofInstance inst,
const QofInstance ref 
)

Does this object refer to a specific object

void qof_instance_set_book ( gconstpointer  inst,
QofBook book 
)

Set the book pointer

int qof_instance_version_cmp ( const QofInstance left,
const QofInstance right 
)

Compare two instances, based on thier last update times. Returns a negative, zero or positive value, respectively, if 'left' is earlier, same as or later than 'right'. Accepts NULL pointers, NULL's are by definition earlier than any value.