:right-sidebar: True Component =================================================================== .. currentmodule:: gi.repository.ICalGLib .. class:: Component(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.ICalGLib.Object`, :class:`~gi.repository.GObject.Object` This is the ICalComponent instance. Constructors ------------ .. rst-class:: interim-class .. class:: Component :no-index: .. classmethod:: new(kind: ~gi.repository.ICalGLib.ComponentKind) -> ~gi.repository.ICalGLib.Component Creates a new :obj:`~gi.repository.ICalGLib.Component` with specific type. .. versionadded:: 1.0 :param kind: The :obj:`~gi.repository.ICalGLib.ComponentKind` .. classmethod:: new_from_string(str: str) -> ~gi.repository.ICalGLib.Component Creates a new :obj:`~gi.repository.ICalGLib.Component` based on a string. .. versionadded:: 1.0 :param str: The string used to create :obj:`~gi.repository.ICalGLib.Component` .. classmethod:: new_vagenda() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vagenda. .. versionadded:: 1.0 .. classmethod:: new_valarm() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be valarm. .. versionadded:: 1.0 .. classmethod:: new_vavailability() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vavailability. .. versionadded:: 1.0 .. classmethod:: new_vcalendar() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vcalendar. .. versionadded:: 1.0 .. classmethod:: new_vevent() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vevent. .. versionadded:: 1.0 .. classmethod:: new_vfreebusy() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vfreebusy. .. versionadded:: 1.0 .. classmethod:: new_vjournal() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vjournal. .. versionadded:: 1.0 .. classmethod:: new_vpoll() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vpoll. .. versionadded:: 1.0 .. classmethod:: new_vquery() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vquery. .. versionadded:: 1.0 .. classmethod:: new_vtimezone() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vtimezone. .. versionadded:: 1.0 .. classmethod:: new_vtodo() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vtodo. .. versionadded:: 1.0 .. classmethod:: new_vvoter() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be vvoter. .. versionadded:: 1.0 .. classmethod:: new_x(x_name: str) -> ~gi.repository.ICalGLib.Component Creates a new :obj:`~gi.repository.ICalGLib.Component` based on name of x property. .. versionadded:: 1.0 :param x_name: The name of x property .. classmethod:: new_xavailable() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be xavailable. .. versionadded:: 1.0 .. classmethod:: new_xdaylight() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be xdaylight. .. versionadded:: 1.0 .. classmethod:: new_xstandard() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be xstandard. .. versionadded:: 1.0 .. classmethod:: new_xvote() -> ~gi.repository.ICalGLib.Component Creates a :obj:`~gi.repository.ICalGLib.Component` with the type to be xvote. .. versionadded:: 1.0 Methods ------- .. rst-class:: interim-class .. class:: Component :no-index: .. method:: add_component(child: ~gi.repository.ICalGLib.Component) -> None Adds a :obj:`~gi.repository.ICalGLib.Component` into another :obj:`~gi.repository.ICalGLib.Component` as a child component. .. versionadded:: 1.0 :param child: A child :obj:`~gi.repository.ICalGLib.Component` .. method:: add_property(property: ~gi.repository.ICalGLib.Property) -> None Adds an :obj:`~gi.repository.ICalGLib.Property` into :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param property: An :obj:`~gi.repository.ICalGLib.Property` .. method:: as_ical_string() -> str Converts a :obj:`~gi.repository.ICalGLib.Component` to a string. .. versionadded:: 1.0 .. method:: begin_component(kind: ~gi.repository.ICalGLib.ComponentKind) -> ~gi.repository.ICalGLib.CompIter Gets the :obj:`~gi.repository.ICalGLib.CompIter` pointing to the first child :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param kind: A :obj:`~gi.repository.ICalGLib.ComponentKind` .. method:: check_restrictions() -> int Checks the number of restrictions in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: clone() -> ~gi.repository.ICalGLib.Component Deeply clone a :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: convert_errors() -> None Converts some X-LIC-ERROR properties into RETURN-STATUS properties. .. versionadded:: 1.0 .. method:: count_components(kind: ~gi.repository.ICalGLib.ComponentKind) -> int Counts the child :obj:`~gi.repository.ICalGLib.Component` with the target kind in the parent one. .. versionadded:: 1.0 :param kind: The target :obj:`~gi.repository.ICalGLib.ComponentKind` .. method:: count_errors() -> int Counts the number of errors in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: count_properties(kind: ~gi.repository.ICalGLib.PropertyKind) -> int Counts the number of :obj:`~gi.repository.ICalGLib.Property` in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param kind: A :obj:`~gi.repository.ICalGLib.PropertyKind` .. method:: end_component(kind: ~gi.repository.ICalGLib.ComponentKind) -> ~gi.repository.ICalGLib.CompIter Gets the :obj:`~gi.repository.ICalGLib.CompIter` pointing to the end child :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param kind: A :obj:`~gi.repository.ICalGLib.ComponentKind` .. method:: foreach_recurrence(start: ~gi.repository.ICalGLib.Time, end: ~gi.repository.ICalGLib.Time, callback: ~collections.abc.Callable[[~gi.repository.ICalGLib.Component, ~gi.repository.ICalGLib.TimeSpan, ~typing.Any], None], user_data: ~typing.Any = None) -> None Cycles through all recurrences of an event. This function will call the specified callback function for once for the base value of DTSTART, and foreach recurring date/time value. It will filter out events that are specified as an EXDATE or an EXRULE. .. versionadded:: 3.0.5 :param start: Ignore timespans before this :param end: Ignore timespans after this :param callback: Function called for each timespan within the range :param user_data: The user data for callback function .. method:: foreach_tzid(callback: ~collections.abc.Callable[[~gi.repository.ICalGLib.Parameter, ~typing.Any], None], user_data: ~typing.Any = None) -> None Applies the same manipulation on every tzid in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 3.0.5 :param callback: The callback function :param user_data: The data for callback function .. method:: get_comment() -> str Gets the comment of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_current_component() -> ~gi.repository.ICalGLib.Component Gets the current :obj:`~gi.repository.ICalGLib.Component` in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_current_property() -> ~gi.repository.ICalGLib.Property Gets the current :obj:`~gi.repository.ICalGLib.Property` in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_description() -> str Gets the description of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_dtend() -> ~gi.repository.ICalGLib.Time Gets the dtend of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_dtstamp() -> ~gi.repository.ICalGLib.Time Gets the dtstamp of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_dtstart() -> ~gi.repository.ICalGLib.Time Gets the dtstart of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_due() -> ~gi.repository.ICalGLib.Time Gets the due of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_duration() -> ~gi.repository.ICalGLib.Duration Gets the duration of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_first_component(kind: ~gi.repository.ICalGLib.ComponentKind) -> ~gi.repository.ICalGLib.Component | None Gets the first :obj:`~gi.repository.ICalGLib.Component` with specific kind in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param kind: A :obj:`~gi.repository.ICalGLib.ComponentKind` .. method:: get_first_property(kind: ~gi.repository.ICalGLib.PropertyKind) -> ~gi.repository.ICalGLib.Property | None Gets the first :obj:`~gi.repository.ICalGLib.Property` with specific kind in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param kind: A :obj:`~gi.repository.ICalGLib.PropertyKind` .. method:: get_first_real_component() -> ~gi.repository.ICalGLib.Component For VCOMPONENT: Returns a reference to the first VEVENT, VTODO or VJOURNAL. .. versionadded:: 1.0 .. method:: get_inner() -> ~gi.repository.ICalGLib.Component | None Returns the first VEVENT, VTODO or VJOURNAL sub-component of cop, or comp if it is one of those types. .. versionadded:: 1.0 .. method:: get_location() -> str Gets the location of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_method() -> ~gi.repository.ICalGLib.PropertyMethod Gets the method of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_next_component(kind: ~gi.repository.ICalGLib.ComponentKind) -> ~gi.repository.ICalGLib.Component | None Gets the next :obj:`~gi.repository.ICalGLib.Component` with specific kind in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param kind: A :obj:`~gi.repository.ICalGLib.ComponentKind` .. method:: get_next_property(kind: ~gi.repository.ICalGLib.PropertyKind) -> ~gi.repository.ICalGLib.Property | None Gets the next :obj:`~gi.repository.ICalGLib.Property` with specific kind in :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param kind: A :obj:`~gi.repository.ICalGLib.PropertyKind` .. method:: get_parent() -> ~gi.repository.ICalGLib.Component | None Gets the parent component of the ``component``\. .. versionadded:: 3.0 .. method:: get_recurrenceid() -> ~gi.repository.ICalGLib.Time Gets the recurrenceid of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_relcalid() -> str Gets the relcalid of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_sequence() -> int Gets the sequence of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_span() -> ~gi.repository.ICalGLib.TimeSpan For VEVENT, VTODO, VJOURNAL and VTIMEZONE: reports the start and end times of an event in UTC. .. versionadded:: 1.0 .. method:: get_status() -> ~gi.repository.ICalGLib.PropertyStatus Gets the status of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_summary() -> str Gets the summary of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: get_timezone(tzid: str) -> ~gi.repository.ICalGLib.Timezone | None Returns the icaltimezone in the component corresponding to the TZID, or NULL if it can't be found. .. versionadded:: 1.0 :param tzid: A string representing timezone .. method:: get_uid() -> str Gets the uid of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: is_valid() -> bool Checks whether :obj:`~gi.repository.ICalGLib.Component` is valid. .. versionadded:: 1.0 .. method:: isa() -> ~gi.repository.ICalGLib.ComponentKind Gets the type of :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 .. method:: isa_component() -> int Checks whether the native part of :obj:`~gi.repository.ICalGLib.Component` is icalcomponent. .. versionadded:: 1.0 .. classmethod:: kind_from_string() -> ~gi.repository.ICalGLib.ComponentKind Converts a string to a :obj:`~gi.repository.ICalGLib.ComponentKind`\. .. versionadded:: 1.0 .. classmethod:: kind_is_valid() -> bool Checks if a :obj:`~gi.repository.ICalGLib.ComponentKind` is valid. .. versionadded:: 1.0 .. classmethod:: kind_to_string() -> str Converts a :obj:`~gi.repository.ICalGLib.ComponentKind` to a string. .. versionadded:: 1.0 .. method:: merge_component(comp_to_merge: ~gi.repository.ICalGLib.Component) -> None Takes 2 VCALENDAR components and merges the second one into the first, resolving any problems with conflicting TZIDs. comp_to_merge will no longer exist after calling this function. .. versionadded:: 1.0 :param comp_to_merge: A :obj:`~gi.repository.ICalGLib.Component`\. After merged it will not exist any more. .. method:: remove_component(child: ~gi.repository.ICalGLib.Component) -> None Removes a child :obj:`~gi.repository.ICalGLib.Component` from another :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param child: A child :obj:`~gi.repository.ICalGLib.Component` .. method:: remove_property(property: ~gi.repository.ICalGLib.Property) -> None Removes :obj:`~gi.repository.ICalGLib.Property` from :obj:`~gi.repository.ICalGLib.Component`\. Caution: The compare is based on address. So you must use the original :obj:`~gi.repository.ICalGLib.Property` as the target. .. versionadded:: 1.0 :param property: A :obj:`~gi.repository.ICalGLib.Property` .. method:: set_comment(v: str) -> None Sets the comment of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A string representing comment .. method:: set_description(v: str) -> None Sets the description of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A string representing description .. method:: set_dtend(v: ~gi.repository.ICalGLib.Time) -> None Sets the dtend of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A :obj:`~gi.repository.ICalGLib.Time` .. method:: set_dtstamp(v: ~gi.repository.ICalGLib.Time) -> None Sets the dtstamp of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A :obj:`~gi.repository.ICalGLib.Time` .. method:: set_dtstart(v: ~gi.repository.ICalGLib.Time) -> None Sets the dtstart of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A :obj:`~gi.repository.ICalGLib.Time` .. method:: set_due(v: ~gi.repository.ICalGLib.Time) -> None Sets the due of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A :obj:`~gi.repository.ICalGLib.Time` .. method:: set_duration(v: ~gi.repository.ICalGLib.Duration) -> None Sets the duration of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A :obj:`~gi.repository.ICalGLib.Duration` .. method:: set_location(v: str) -> None Sets the location of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A string representing location .. method:: set_method(method: ~gi.repository.ICalGLib.PropertyMethod) -> None Sets the method of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param method: A :obj:`~gi.repository.ICalGLib.PropertyMethod` .. method:: set_parent(parent: ~gi.repository.ICalGLib.Component | None = None) -> None Sets the ``parent`` :obj:`~gi.repository.ICalGLib.Component` of the specified ``component``\. .. versionadded:: 3.0 :param parent: An :obj:`~gi.repository.ICalGLib.Component`\, a new parent .. method:: set_recurrenceid(v: ~gi.repository.ICalGLib.Time) -> None Sets the recurrenceid of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A :obj:`~gi.repository.ICalGLib.Time` .. method:: set_relcalid(v: str) -> None Sets the relcalid of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A string representing relcalid .. method:: set_sequence(v: int) -> None Sets the sequence of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: The sequence number .. method:: set_status(status: ~gi.repository.ICalGLib.PropertyStatus) -> None Sets the status of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param status: A :obj:`~gi.repository.ICalGLib.PropertyStatus` .. method:: set_summary(v: str) -> None Sets the summary of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A string representing summary .. method:: set_uid(v: str) -> None Sets the uid of the :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0 :param v: A string representing uid .. method:: strip_errors() -> None Removes all X-LIC-ERROR properties. .. versionadded:: 1.0