![]() | ![]() | ![]() | Libmergeant Reference Manual | ![]() |
---|
#define MG_ENTITY_TYPE #define MG_ENTITY (obj) #define IS_MG_ENTITY (obj) #define MG_ENTITY_GET_IFACE (obj) struct MgEntity; GType mg_entity_get_type (void); GSList* mg_entity_get_all_fields (MgEntity *iface); GSList* mg_entity_get_visible_fields (MgEntity *iface); MgField* mg_entity_get_field_by_name (MgEntity *iface, const gchar *name); MgField* mg_entity_get_field_by_xml_id (MgEntity *iface, const gchar *xml_id); MgField* mg_entity_get_field_by_index (MgEntity *iface, gint index); gint mg_entity_get_field_index (MgEntity *iface, MgField *field); void mg_entity_add_field (MgEntity *iface, MgField *field); void mg_entity_add_field_before (MgEntity *iface, MgField *field, MgField *field_before); void mg_entity_swap_fields (MgEntity *iface, MgField *field1, MgField *field2); void mg_entity_remove_field (MgEntity *iface, MgField *field); gboolean mg_entity_is_writable (MgEntity *iface); GSList* mg_entity_get_parameters (MgEntity *iface); MgContext* mg_entity_get_exec_context (MgEntity *iface);
"field-added" void user_function (MgEntity *mgentity, gpointer arg1, gpointer user_data); "field-removed" void user_function (MgEntity *mgentity, gpointer arg1, gpointer user_data); "field-updated" void user_function (MgEntity *mgentity, gpointer arg1, gpointer user_data); "fields-order-changed" void user_function (MgEntity *mgentity, gpointer user_data);
#define MG_ENTITY(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, mg_entity_get_type(), MgEntity)
obj : |
|
#define IS_MG_ENTITY(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, mg_entity_get_type ())
obj : |
|
#define MG_ENTITY_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MG_ENTITY_TYPE, MgEntityIface))
obj : |
|
GSList* mg_entity_get_all_fields (MgEntity *iface);
Get a new list containing all the DbField objects held within the object implementing the MgEntity interface.
iface : | an object implementing the MgEntity interface |
Returns : | the new list. |
GSList* mg_entity_get_visible_fields (MgEntity *iface);
Same as mg_entity_get_all_fields() but returns only the visible fields, the ones which are not hidden (this makes sense only for queries, not for DBMS tables where there are no hidden fields).
The returned list nodes are in the order in which the fields are within the entity.
iface : | an object implementing the MgEntity interface |
Returns : | the new list. |
MgField* mg_entity_get_field_by_name (MgEntity *iface, const gchar *name);
Get a MgField using its name
iface : | an object implementing the MgEntity interface |
name : | |
Returns : | the requested MgField |
MgField* mg_entity_get_field_by_xml_id (MgEntity *iface, const gchar *xml_id);
iface : | an object implementing the MgEntity interface |
xml_id : | |
Returns : | the requested MgField |
MgField* mg_entity_get_field_by_index (MgEntity *iface, gint index);
iface : | an object implementing the MgEntity interface |
index : | |
Returns : | the requested MgField or NULL if the index is out of bounds |
gint mg_entity_get_field_index (MgEntity *iface, MgField *field);
Get the position of the field in the given entity. Positions start at 0. field MUST be a visible field.
iface : | an object implementing the MgEntity interface |
field : | an object implementing the MgField interface |
Returns : | the position or -1 if the field is not in the entity |
void mg_entity_add_field (MgEntity *iface, MgField *field);
Add field to iface's fields (at the end of the list)
iface : | an object implementing the MgEntity interface |
field : | an object implementing the MgField interface to add |
void mg_entity_add_field_before (MgEntity *iface, MgField *field, MgField *field_before);
Add field to iface's fields, before field_before if it is not NULL, or at the end if field_before is NULL.
iface : | an object implementing the MgEntity interface |
field : | an object implementing the MgField interface to add |
field_before : | an object implementing the MgField interface before which field will be added, or NULL |
void mg_entity_swap_fields (MgEntity *iface, MgField *field1, MgField *field2);
iface : | an object implementing the MgEntity interface |
field1 : | an object implementing the MgField interface |
field2 : | an object implementing the MgField interface |
void mg_entity_remove_field (MgEntity *iface, MgField *field);
iface : | an object implementing the MgEntity interface |
field : | an object implementing the MgField interface to remove |
gboolean mg_entity_is_writable (MgEntity *iface);
Tells if the real entity (the corresponding DBMS object) represented by iface can be written to.
iface : | an object implementing the MgEntity interface |
Returns : | TRUE if it is possible to write to iface |
GSList* mg_entity_get_parameters (MgEntity *iface);
Get a list of parameters required before iface can be used. Usualy this function is used with queries to grab the required parameters before executing a query.
iface : | an object implementing the MgEntity interface |
Returns : | a new list of MgParameter objects. iface DOES NOT hold any reference to any of the listed parameter. |
void user_function (MgEntity *mgentity, gpointer arg1, gpointer user_data);
mgentity : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (MgEntity *mgentity, gpointer arg1, gpointer user_data);
mgentity : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (MgEntity *mgentity, gpointer arg1, gpointer user_data);
mgentity : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (MgEntity *mgentity, gpointer user_data);
mgentity : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
<<< MgDataEntry | MgField >>> |