e-cal-component-property-bag

e-cal-component-property-bag — An ECalComponentPropertyBag structure

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── ECalComponentPropertyBag

Includes

#include <libecal/libecal.h>

Description

Contains functions to work with the ECalComponentPropertyBag structure.

Functions

e_cal_component_property_bag_new ()

ECalComponentPropertyBag *
e_cal_component_property_bag_new (void);

Creates a new ECalComponentPropertyBag. Free the structure with e_cal_component_property_bag_free(), when no longer needed.

Returns

a newly allocated ECalComponentPropertyBag.

[transfer full]

Since: 3.34


e_cal_component_property_bag_new_from_component ()

ECalComponentPropertyBag *
e_cal_component_property_bag_new_from_component
                               (const ICalComponent *component,
                                ECalComponentPropertyBagFilterFunc func,
                                gpointer user_data);

Creates a new ECalComponentPropertyBag, filled with properties from the component , for which the func returned TRUE. When the func is NULL, all the properties are included.

Free the structure with e_cal_component_property_bag_free(), when no longer needed.

Parameters

component

an ICalComponent containing the properties to fill the bag with

 

func

an optional ECalComponentPropertyBagFilterFunc callback.

[nullable][scope call]

user_data

user data for the func .

[closure func]

Returns

a newly allocated ECalComponentPropertyBag.

[transfer full]

Since: 3.34


e_cal_component_property_bag_copy ()

ECalComponentPropertyBag *
e_cal_component_property_bag_copy (const ECalComponentPropertyBag *bag);

Returns a newly allocated copy of bag , which should be freed with e_cal_component_property_bag_free(), when no longer needed.

Parameters

bag

an ECalComponentPropertyBag.

[not nullable]

Returns

a newly allocated copy of bag .

[transfer full]

Since: 3.34


e_cal_component_property_bag_free ()

void
e_cal_component_property_bag_free (gpointer bag);

Free bag , previously created by e_cal_component_property_bag_new(), e_cal_component_property_bag_new_from_component() or e_cal_component_property_bag_copy(). The function does nothing, if bag is NULL.

[skip]

Parameters

bag

an ECalComponentPropertyBag to free.

[type ECalComponentPropertyBag][nullable]

Since: 3.34


e_cal_component_property_bag_set_from_component ()

void
e_cal_component_property_bag_set_from_component
                               (ECalComponentPropertyBag *bag,
                                const ICalComponent *component,
                                ECalComponentPropertyBagFilterFunc func,
                                gpointer user_data);

Fills the bag with properties from the component , for which the func returned TRUE. When the func is NULL, all the properties are included. The bag content is cleared before any property is added.

Parameters

bag

an ECalComponentPropertyBag

 

component

an ICalComponent containing the properties to fill the bag with

 

func

an optional ECalComponentPropertyBagFilterFunc callback.

[nullable][scope call]

user_data

user data for the func .

[closure func]

Since: 3.34


e_cal_component_property_bag_fill_component ()

void
e_cal_component_property_bag_fill_component
                               (const ECalComponentPropertyBag *bag,
                                ICalComponent *component);

Adds all the stored properties in the bag to the component . The function doesn't verify whether the component contains the same property already.

Parameters

bag

an ECalComponentPropertyBag

 

component

an ICalComponent

 

Since: 3.34


e_cal_component_property_bag_assign ()

void
e_cal_component_property_bag_assign (ECalComponentPropertyBag *bag,
                                     const ECalComponentPropertyBag *src_bag);

Assigns content of the src_bag into the bag .

Parameters

bag

a destination ECalComponentPropertyBag

 

src_bag

a source ECalComponentPropertyBag

 

Since: 3.34


e_cal_component_property_bag_add ()

void
e_cal_component_property_bag_add (ECalComponentPropertyBag *bag,
                                  const ICalProperty *prop);

Adds a copy of the prop into the bag .

Parameters

bag

an ECalComponentPropertyBag

 

prop

an ICalProperty

 

Since: 3.34


e_cal_component_property_bag_take ()

void
e_cal_component_property_bag_take (ECalComponentPropertyBag *bag,
                                   ICalProperty *prop);

Adds the prop into the bag and assumes ownership of the prop .

Parameters

bag

an ECalComponentPropertyBag

 

prop

an ICalProperty

 

Since: 3.34


e_cal_component_property_bag_get_count ()

guint
e_cal_component_property_bag_get_count
                               (const ECalComponentPropertyBag *bag);

Parameters

Returns

how many properties are stored in the bag

Since: 3.34


e_cal_component_property_bag_get ()

ICalProperty *
e_cal_component_property_bag_get (const ECalComponentPropertyBag *bag,
                                  guint index);

Returns the ICalProperty at the given index . If the index is out of bounds (not lower than e_cal_component_property_bag_get_count()), then NULL is returned.

The returned property is owned by the bag and should not be freed by the caller.

Parameters

bag

an ECalComponentPropertyBag

 

index

an index of the property to get

 

Returns

the ICalProperty at the given index , or NULL on error.

[transfer none][nullable]

Since: 3.34


e_cal_component_property_bag_get_first_by_kind ()

guint
e_cal_component_property_bag_get_first_by_kind
                               (const ECalComponentPropertyBag *bag,
                                ICalPropertyKind kind);

Parameters

bag

an ECalComponentPropertyBag

 

kind

an ICalPropertyKind to search for

 

Returns

the index of the first property of the given kind , or value out of bounds, if such property cannot be found

Since: 3.34


e_cal_component_property_bag_remove ()

void
e_cal_component_property_bag_remove (ECalComponentPropertyBag *bag,
                                     guint index);

Removes the ICalProperty at the given index . If the index is out of bounds (not lower than e_cal_component_property_bag_get_count()), then the function does nothing.

Parameters

bag

an ECalComponentPropertyBag

 

index

an index of the property to remove

 

Since: 3.34


e_cal_component_property_bag_remove_by_kind ()

guint
e_cal_component_property_bag_remove_by_kind
                               (ECalComponentPropertyBag *bag,
                                ICalPropertyKind kind,
                                gboolean all);

Removes the first or all (depending on the all ) properties of the given kind .

Parameters

bag

an ECalComponentPropertyBag

 

kind

an ICalPropertyKind to remove

 

all

TRUE to remove all properties of the kind , or FALSE to only the first

 

Returns

how many properties had been removed

Since: 3.34


e_cal_component_property_bag_clear ()

void
e_cal_component_property_bag_clear (ECalComponentPropertyBag *bag);

Removes all properties from the bag , thus it doesn't contain any property after this function returns.

Parameters

Since: 3.34

Types and Values

ECalComponentPropertyBag

typedef struct _ECalComponentPropertyBag ECalComponentPropertyBag;

Opaque structure, which represents a bad (list) of ICalProperty objects. Use the functions below to work with it.