## MrpObject

MrpObject

## Synopsis

    #include <libplanner/planner.h>

                        MrpObjectPriv;
    struct              MrpObject;
    void                mrp_object_removed                  (MrpObject *object);
    void                mrp_object_changed                  (MrpObject *object);
    void                mrp_object_set                      (gpointer object,
                                                             const gchar *first_property_name,
                                                             ...);
    void                mrp_object_get                      (gpointer object,
                                                             const gchar *first_property_name,
                                                             ...);
    void                mrp_object_set_valist               (MrpObject *object,
                                                             const gchar *first_property_name,
                                                             va_list var_args);
    void                mrp_object_get_valist               (MrpObject *object,
                                                             const gchar *first_property_name,
                                                             va_list var_args);
    GList *             mrp_object_get_properties           (MrpObject *object);
    void                mrp_object_get_property             (MrpObject *object,
                                                             MrpProperty *property,
                                                             GValue *value);
    void                mrp_object_set_property             (MrpObject *object,
                                                             MrpProperty *property,
                                                             GValue *value);

## Object Hierarchy

      GObject
       +----MrpObject
             +----MrpProject
             +----MrpTask
             +----MrpResource
             +----MrpGroup
             +----MrpAssignment
             +----MrpCalendar

## Properties

      "project"                  MrpProject*           : Read / Write

## Signals

      "prop-changed"                                   : Has Details
      "removed"                                        : Run Last

## Description

## Details

### MrpObjectPriv

    typedef struct _MrpObjectPriv MrpObjectPriv;

A private struct for internal use only. The definition of this structure is not publically available.

### struct MrpObject

    struct MrpObject;

The base class for objects in libmrproject.

### mrp_object_removed ()

    void                mrp_object_removed                  (MrpObject *object);

Emits the signal `removed`. This means that any references to the object should be dropped, since the object is removed from the project.

`object` : | an MrpObject

### mrp_object_changed ()

    void                mrp_object_changed                  (MrpObject *object);

Emits the signal needs-saving on the project that this object belongs to, indicating that the project has unsaved changes.

`object` : | an MrpObject

### mrp_object_set ()

    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

### mrp_object_get ()

    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

### mrp_object_set_valist ()

    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

### mrp_object_get_valist ()

    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

### mrp_object_get_properties ()

    GList *             mrp_object_get_properties           (MrpObject *object);

Retrieves the list of custom properties for the type of `object`.

`object` : | an MrpObject
Returns : | A list of MrpProperty, must not be changed or freed.

### mrp_object_get_property ()

    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.

`object` : | an MrpObject
`property` : | the property to get
`value` : | the value to get

### mrp_object_set_property ()

    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.

`object` : | an MrpObject
`property` : | the property to set
`value` : | the value to set

## Property Details

### The `"project"` property

      "project"                  MrpProject*           : Read / Write

The project this object belongs to.

## Signal Details

### The `"prop-changed"` signal

    void                user_function                      (MrpObject *mrpobject,
                                                            gpointer   arg1,
                                                            GValue    *arg2,
                                                            gpointer   user_data)      : Has Details

`mrpobject` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"removed"` signal

    void                user_function                      (MrpObject *mrpobject,
                                                            gpointer   user_data)      : Run Last

`mrpobject` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.