Top | ![]() |
![]() |
![]() |
![]() |
void | mrp_object_removed () |
void | mrp_object_changed () |
void | mrp_object_set () |
void | mrp_object_get () |
void | mrp_object_set_property () |
void | mrp_object_get_property () |
void | mrp_object_set_valist () |
void | mrp_object_get_valist () |
GList * | mrp_object_get_properties () |
guint | mrp_object_get_id () |
gboolean | mrp_object_set_id () |
gpointer | mrp_object_get_project () |
GObject ╰── MrpObject ├── MrpAssignment ├── MrpCalendar ├── MrpGroup ├── MrpProject ├── MrpRelation ├── MrpResource ╰── MrpTask
MrpObject extends GObject.
Most of libplanner
entities are MrpObject instances.
Others are GBoxed like MrpInterval or GEnum like MrpTaskType.
MrpApplication is a GObject.
MrpObject has no constructor.
MrpObject instances belong to a project.
MrpObject has properties.
MrpApplication can associate pointers to ids.
MrpObject uses the mechanism to register with
MrpApplication, gaining an id.
mrp_application_id_get_data()
retrieves an MrpObject given its id.
MrpObject signals removal and modification.
void
mrp_object_removed (MrpObject *object
);
Emits the “removed” signal. This means that any references to the object should be dropped, since the object is removed from the project.
void
mrp_object_changed (MrpObject *object
);
Emits the “needs-saving-changed” on the project object
belongs to,
indicating that the project has unsaved changes.
void mrp_object_set (gpointer object
,const gchar *first_property_name
,...
);
MrpObject can have custom properties, which are added runtime, for example
by a user or plugin. mrp_object_set()
allows you to set these the value of
those properties. It also handles the regular GObject properties, so you can
use it to set both custom properties and regular properties at the same time.
object |
an MrpObject |
|
first_property_name |
the name of the first property to set |
|
... |
first value to set, followed by additional name/value pairs to set, NULL terminated |
void mrp_object_get (gpointer object
,const gchar *first_property_name
,...
);
Retrieves the values of a variable number of custom properties or regular
properties from an object. See mrp_object_set()
.
object |
an MrpProject |
|
first_property_name |
the name of the first property to get |
|
... |
first value to get, followed by additional name/value pairs to get, NULL terminated |
void mrp_object_set_property (MrpObject *object
,MrpProperty *property
,GValue *value
);
Sets a custom property. This is mostly for language bindings. C programmers should use mrp_object_set instead.
void mrp_object_get_property (MrpObject *object
,MrpProperty *property
,GValue *value
);
Gets a custom property. This is mostly for language bindings. C programmers should use mrp_object_get instead.
void mrp_object_set_valist (MrpObject *object
,const gchar *first_property_name
,va_list var_args
);
va_list version of mrp_object_set()
.
object |
an MrpObject |
|
first_property_name |
the name of the first property to set |
|
var_args |
va_list of arguments |
void mrp_object_get_valist (MrpObject *object
,const gchar *first_property_name
,va_list var_args
);
va_list version of mrp_object_get()
.
object |
an MrpObject |
|
first_property_name |
the name of the first property to get |
|
var_args |
va_list of arguments |
GList *
mrp_object_get_properties (MrpObject *object
);
Retrieves the list of custom properties for the type of object
.
guint
mrp_object_get_id (MrpObject *object
);
Retrieves the unique object id in the application
gboolean mrp_object_set_id (MrpObject *object
,guint id
);
Change the unique object id in the application. This function must be called only from Undo/Redo operations.
gpointer
mrp_object_get_project (MrpObject *object
);
to which project does object
belongs to?
struct MrpObjectClass { GObjectClass parent_class; /* Signals */ void (*removed) (MrpObject *object); void (*prop_changed) (MrpObject *object, MrpProperty *property, GValue *new_value); };
“project”
property“project” MrpProject *
The project this object belongs to.
Owner: MrpObject
Flags: Read / Write
“prop-changed”
signalvoid user_function (MrpObject *object, gpointer property, GValue *new_value, gpointer user_data)
emitted when property
changes.
object |
a libplanner object. |
|
property |
the property that changed. |
|
new_value |
the new value. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Has Details
“removed”
signalvoid user_function (MrpObject *object, gpointer user_data)
emitted when object
is removed.
object |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last