libical-glib Reference Manual: ICalObject

## ICalObject ICalObject |

## Functions

void | i_cal_object_construct ()
gpointer | i_cal_object_get_native ()
gpointer | i_cal_object_steal_native ()
gboolean | i_cal_object_get_is_global_memory ()
GDestroyNotify | i_cal_object_get_native_destroy_func ()
void | i_cal_object_set_native_destroy_func ()
void | i_cal_object_set_owner ()
GObject * | i_cal_object_ref_owner ()
void | i_cal_object_remove_owner ()
void | i_cal_object_add_depender ()
void | i_cal_object_remove_depender ()

## Properties

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

## Types and Values

struct | ICalObject
struct | ICalObjectClass

## 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

## Description

## Functions

### 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.

#### Parameters

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` .

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

iobject | an ICalObject |
depender | a GObject depender |

Since 1.0

## Types and Values

### struct ICalObject

    struct ICalObject;

This is an ICalObject instance struct.

### struct ICalObjectClass

    struct ICalObjectClass {
    };

This is an ICalObject class struct.

## Property Details

### The `“is-global-memory”` property

      “is-global-memory”         gboolean

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

Flags: Read / Write / Construct Only

Default value: FALSE

### The `“native”` property

      “native”                   gpointer

The native libical structure for this ICalObject.

Flags: Read / Write / Construct Only

### The `“native-destroy-func”` property

      “native-destroy-func”      gpointer

GDestroyNotify function to use to destroy the native libical pointer.

Flags: Read / Write

### The `“owner”` property

      “owner”                    GObject *

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

Flags: Read / Write