ECal.ComponentPropertyBag¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
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:
component (
ICalGLib.Component
) – anICalGLib.Component
containing the properties to fill the bag withfunc (
ECal.ComponentPropertyBagFilterFunc
orNone
) – an optionalECal.ComponentPropertyBagFilterFunc
callback
- Returns:
a newly allocated
ECal.ComponentPropertyBag
- Return type:
Creates a new
ECal.ComponentPropertyBag
, filled with properties from the component, for which the func returnedTrue
. When the func isNone
, 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
) – anICalGLib.Property
Adds a copy of the prop into the self.
New in version 3.34.
- assign(src_bag)¶
- Parameters:
src_bag (
ECal.ComponentPropertyBag
) – a sourceECal.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:
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
) – anICalGLib.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, orNone
on error- Return type:
Returns the
ICalGLib.Property
at the given index. If the index is out of bounds (not lower thanECal.ComponentPropertyBag.get_count
()), thenNone
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:
New in version 3.34.
- get_first_by_kind(kind)¶
- Parameters:
kind (
ICalGLib.PropertyKind
) – anICalGLib.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:
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 thanECal.ComponentPropertyBag.get_count
()), then the function does nothing.New in version 3.34.
- remove_by_kind(kind, all)¶
- Parameters:
kind (
ICalGLib.PropertyKind
) – anICalGLib.PropertyKind
to removeall (
bool
) –True
to remove all properties of the kind, orFalse
to only the first
- Returns:
how many properties had been removed
- Return type:
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:
component (
ICalGLib.Component
) – anICalGLib.Component
containing the properties to fill the self withfunc (
ECal.ComponentPropertyBagFilterFunc
orNone
) – an optionalECal.ComponentPropertyBagFilterFunc
callback
Fills the self with properties from the component, for which the func returned
True
. When the func isNone
, 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
) – anICalGLib.Property
Adds the prop into the self and assumes ownership of the prop.
New in version 3.34.