ICalObject

## ICalObject ICalObject |

## Synopsis

    struct              ICalObject;
    struct              ICalObjectClass;
    void                i_cal_object_construct              (ICalObject *iobject,
                                                             gpointer native,
                                                             GDestroyNotify native_destroy_func,
                                                             gboolean is_global_memory,
                                                             GObject *owner);
    gpointer            i_cal_object_get_native             (ICalObject *iobject);
    gpointer            i_cal_object_steal_native           (ICalObject *iobject);
    gboolean            i_cal_object_get_is_global_memory   (ICalObject *iobject);
    GDestroyNotify      i_cal_object_get_native_destroy_func
                                                            (ICalObject *iobject);
    void                i_cal_object_set_native_destroy_func
                                                            (ICalObject *iobject,
                                                             GDestroyNotify native_destroy_func);
    void                i_cal_object_set_owner              (ICalObject *iobject,
                                                             GObject *owner);
    GObject *           i_cal_object_ref_owner              (ICalObject *iobject);
    void                i_cal_object_remove_owner           (ICalObject *iobject);
    void                i_cal_object_add_depender           (ICalObject *iobject,
                                                             GObject *depender);
    void                i_cal_object_remove_depender        (ICalObject *iobject,
                                                             GObject *depender);

## Object Hierarchy

      GObject
       +----ICalObject
             +----ICalArray
             +----ICalAttach
             +----ICalCompIter
             +----ICalComponent
             +----ICalDatetimeperiodType
             +----ICalDurationType
             +----ICalGeoType
             +----ICalParameter
             +----ICalParser
             +----ICalPeriodType
             +----ICalProperty
             +----ICalRecurIterator
             +----ICalRecurrenceType
             +----ICalReqstatType
             +----ICalTimeSpan
             +----ICalTimetype
             +----ICalTimezone
             +----ICalTimezonePhase
             +----ICalTimezonetype
             +----ICalTriggerType
             +----ICalValue

## Properties

      "is-global-memory"         gboolean              : Read / Write / Construct Only
      "native"                   gpointer              : Read / Write / Construct Only
      "native-destroy-func"      gpointer              : Read / Write
      "owner"                    GObject*              : Read / Write

## Description

## Details

### struct ICalObject

    struct ICalObject;

This is an ICalObject instance struct.

### struct ICalObjectClass

    struct ICalObjectClass {
    };

This is an ICalObject class struct.

### i_cal_object_construct ()

    void                i_cal_object_construct              (ICalObject *iobject,
                                                             gpointer native,
                                                             GDestroyNotify native_destroy_func,
                                                             gboolean is_global_memory,
                                                             GObject *owner);

Initialize private members of iobject at once. The descendants should call this function in their `_new()` function, or use corresponding properties during the construction time. This should not be mixed, either use properties or this function.

`iobject` : | an ICalObject
`native` : | a native libical structure
`native_destroy_func` : | a function to be called on `native` when it should be freed
`is_global_memory` : | whether `native` is a global shared memory structure
`owner` : | an owner of `native`. [allow-none]

Since 1.0

### i_cal_object_get_native ()

    gpointer            i_cal_object_get_native             (ICalObject *iobject);

Obtain native libical structure pointer associated with this `iobject`.

`iobject` : | an ICalObject
Returns : | Native libical structure pointer associated with this `iobject`. [transfer none]

Since 1.0

### i_cal_object_steal_native ()

    gpointer            i_cal_object_steal_native           (ICalObject *iobject);

Obtain native libical structure pointer associated with this `iobject` and sets the one at `iobject` to NULL, thus it's invalid since now on.

`iobject` : | an ICalObject
Returns : | Native libical structure pointer associated with this `iobject`. [transfer full]

Since 1.0

### i_cal_object_get_is_global_memory ()

    gboolean            i_cal_object_get_is_global_memory   (ICalObject *iobject);

Obtains whether the native libical structure is a global shared memory, thus should not be destroyed. This can be set only during contruction time.

`iobject` : | an ICalObject
Returns : | Whether the native libical structure is a global shared memory.

Since 1.0

### i_cal_object_get_native_destroy_func ()

    GDestroyNotify      i_cal_object_get_native_destroy_func
                                                            (ICalObject *iobject);

Obtain a pointer to a function responsible to free the libical native structure.

`iobject` : | an ICalObject
Returns : | Pointer to a function responsible to free the libical native structure. [transfer none]

Since 1.0

### i_cal_object_set_native_destroy_func ()

    void                i_cal_object_set_native_destroy_func
                                                            (ICalObject *iobject,
                                                             GDestroyNotify native_destroy_func);

Sets a function to be used to destroy the native libical structure.

`iobject` : | an ICalObject
`native_destroy_func` : | Function to be used to destroy the native libical structure

Since 1.0

### i_cal_object_set_owner ()

    void                i_cal_object_set_owner              (ICalObject *iobject,
                                                             GObject *owner);

Sets an owner of the native libical structure, that is an object responsible for a destroy of the native libical structure.

`iobject` : | an ICalObject
`owner` : | Owner of the native libical structure

Since 1.0

### i_cal_object_ref_owner ()

    GObject *           i_cal_object_ref_owner              (ICalObject *iobject);

Obtain current owner of the native libical structure. The returned pointer, if not NULL, is referenced for thread safety. Unref it with g_object_unref when done with it.

`iobject` : | an ICalObject
Returns : | Current owner of the libical native structure. returns NULL, when there is no owner. [transfer full][allow-none]

Since 1.0

### i_cal_object_remove_owner ()

    void                i_cal_object_remove_owner           (ICalObject *iobject);

Unref and remove the owner.

`iobject` : | an ICalObject

Since 1.0

### i_cal_object_add_depender ()

    void                i_cal_object_add_depender           (ICalObject *iobject,
                                                             GObject *depender);

Adds a `depender` into the list of objects which should not be destroyed before this `iobject`. It's usually used for cases where the `iobject` uses native libical structure from the `depender`. The `depender` is referenced. It's illegal to try to add one `depender` multiple times.

`iobject` : | an ICalObject
`depender` : | a GObject depender

Since 1.0

### i_cal_object_remove_depender ()

    void                i_cal_object_remove_depender        (ICalObject *iobject,
                                                             GObject *depender);

Removes a `depender` from the list of objects which should not be destroyed before this `iobject`, previously added with `i_cal_object_add_depender()`. It's illegal to try to remove the `depender` which is not in the internal list.

`iobject` : | an ICalObject
`depender` : | a GObject depender

Since 1.0

## Property Details

### The `"is-global-memory"` property

      "is-global-memory"         gboolean              : Read / Write / Construct Only

Whether the native libical structure is from a global shared memory. If TRUE, then it is not freed on ICalObject's finalize.

Default value: FALSE

### The `"native"` property

      "native"                   gpointer              : Read / Write / Construct Only

The native libical structure for this ICalObject.

### The `"native-destroy-func"` property

      "native-destroy-func"      gpointer              : Read / Write

GDestroyNotify function to use to destroy the native libical pointer.

### The `"owner"` property

      "owner"                    GObject*              : Read / Write

Owner of the native libical structure. If set, then it is responsible for a free of the native libical structure.