ECal.ComponentPropertyBag

Fields

None

Methods

class

new ()

class

new_from_component (component, func, *user_data)

add (prop)

assign (src_bag)

clear ()

copy ()

fill_component (component)

get (index)

get_count ()

get_first_by_kind (kind)

remove (index)

remove_by_kind (kind, all)

set_from_component (component, func, *user_data)

take (prop)

Details

class ECal.ComponentPropertyBag

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

classmethod new()
Returns:

a newly allocated ECal.ComponentPropertyBag

Return type:

ECal.ComponentPropertyBag

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

New in version 3.34.

classmethod new_from_component(component, func, *user_data)
Parameters:
Returns:

a newly allocated ECal.ComponentPropertyBag

Return type:

ECal.ComponentPropertyBag

Creates a new ECal.ComponentPropertyBag, filled with properties from the component, for which the func returned True. When the func is None, all the properties are included.

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

New in version 3.34.

add(prop)
Parameters:

prop (ICalGLib.Property) – an ICalGLib.Property

Adds a copy of the prop into the self.

New in version 3.34.

assign(src_bag)
Parameters:

src_bag (ECal.ComponentPropertyBag) – a source ECal.ComponentPropertyBag

Assigns content of the src_bag into the self.

New in version 3.34.

clear()

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

New in version 3.34.

copy()
Returns:

a newly allocated copy of self

Return type:

ECal.ComponentPropertyBag

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

New in version 3.34.

fill_component(component)
Parameters:

component (ICalGLib.Component) – an ICalGLib.Component

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

New in version 3.34.

get(index)
Parameters:

index (int) – an index of the property to get

Returns:

the ICalGLib.Property at the given index, or None on error

Return type:

ICalGLib.Property or None

Returns the ICalGLib.Property at the given index. If the index is out of bounds (not lower than ECal.ComponentPropertyBag.get_count()), then None is returned.

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

New in version 3.34.

get_count()
Returns:

how many properties are stored in the self

Return type:

int

New in version 3.34.

get_first_by_kind(kind)
Parameters:

kind (ICalGLib.PropertyKind) – an ICalGLib.PropertyKind 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

Return type:

int

New in version 3.34.

remove(index)
Parameters:

index (int) – an index of the property to remove

Removes the ICalGLib.Property at the given index. If the index is out of bounds (not lower than ECal.ComponentPropertyBag.get_count()), then the function does nothing.

New in version 3.34.

remove_by_kind(kind, all)
Parameters:
Returns:

how many properties had been removed

Return type:

int

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

New in version 3.34.

set_from_component(component, func, *user_data)
Parameters:

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

New in version 3.34.

take(prop)
Parameters:

prop (ICalGLib.Property) – an ICalGLib.Property

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

New in version 3.34.