ECal.ComponentParameterBag

Fields

None

Methods

class

new ()

class

new_from_property (property, func, *user_data)

add (param)

assign (src_bag)

clear ()

copy ()

fill_property (property)

get (index)

get_count ()

get_first_by_kind (kind)

remove (index)

remove_by_kind (kind, all)

set_from_property (property, func, *user_data)

take (param)

Details

class ECal.ComponentParameterBag

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

classmethod new()
Returns:

a newly allocated ECal.ComponentParameterBag

Return type:

ECal.ComponentParameterBag

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

New in version 3.34.

classmethod new_from_property(property, func, *user_data)
Parameters:
Returns:

a newly allocated ECal.ComponentParameterBag

Return type:

ECal.ComponentParameterBag

Creates a new ECal.ComponentParameterBag, filled with parameters from the property, for which the func returned True. When the func is None, all the parameters are included.

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

New in version 3.34.

add(param)
Parameters:

param (ICalGLib.Parameter) – an ICalGLib.Parameter

Adds a copy of the param into the self.

New in version 3.34.

assign(src_bag)
Parameters:

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

Assigns content of the src_bag into the self.

New in version 3.34.

clear()

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

New in version 3.34.

copy()
Returns:

a newly allocated copy of self

Return type:

ECal.ComponentParameterBag

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

New in version 3.34.

fill_property(property)
Parameters:

property (ICalGLib.Property) – an ICalGLib.Property

Adds all the stored parameters in the self to the property. The function replaces any existing parameter with the new value, if any such exists. Otherwise the parameter is added.

New in version 3.34.

get(index)
Parameters:

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

Returns:

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

Return type:

ICalGLib.Parameter or None

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

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

New in version 3.34.

get_count()
Returns:

how many parameters are stored in the self

Return type:

int

New in version 3.34.

get_first_by_kind(kind)
Parameters:

kind (ICalGLib.ParameterKind) – an ICalGLib.ParameterKind to search for

Returns:

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

Return type:

int

New in version 3.34.

remove(index)
Parameters:

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

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

New in version 3.34.

remove_by_kind(kind, all)
Parameters:
Returns:

how many parameters had been removed

Return type:

int

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

New in version 3.34.

set_from_property(property, func, *user_data)
Parameters:

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

New in version 3.34.

take(param)
Parameters:

param (ICalGLib.Parameter) – an ICalGLib.Parameter

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

New in version 3.34.