diff options
Diffstat (limited to 'calendar/cal-util/cal-component.c')
-rw-r--r-- | calendar/cal-util/cal-component.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c index 3c063cf990..60e0a1bbd5 100644 --- a/calendar/cal-util/cal-component.c +++ b/calendar/cal-util/cal-component.c @@ -1991,6 +1991,29 @@ cal_component_set_exdate_list (CalComponent *comp, GSList *exdate_list) priv->need_sequence_inc = TRUE; } +/** + * cal_component_has_exdates: + * @comp: A calendar component object. + * + * Queries whether a calendar component object has any exception dates defined + * for it. + * + * Return value: TRUE if the component has exception dates, FALSE otherwise. + **/ +gboolean +cal_component_has_exdates (CalComponent *comp) +{ + CalComponentPrivate *priv; + + g_return_val_if_fail (comp != NULL, FALSE); + g_return_val_if_fail (IS_CAL_COMPONENT (comp), FALSE); + + priv = comp->priv; + g_return_val_if_fail (priv->icalcomp != NULL, FALSE); + + return (priv->exdate_list != NULL); +} + /* Gets a list of recurrence rules */ static void get_recur_list (GSList *recur_list, @@ -2108,6 +2131,43 @@ cal_component_set_exrule_list (CalComponent *comp, GSList *recur_list) } /** + * cal_component_has_exrules: + * @comp: A calendar component object. + * + * Queries whether a calendar component object has any exception rules defined + * for it. + * + * Return value: TRUE if the component has exception rules, FALSE otherwise. + **/ +gboolean +cal_component_has_exrules (CalComponent *comp) +{ + CalComponentPrivate *priv; + + g_return_val_if_fail (comp != NULL, FALSE); + g_return_val_if_fail (IS_CAL_COMPONENT (comp), FALSE); + + priv = comp->priv; + g_return_val_if_fail (priv->icalcomp != NULL, FALSE); + + return (priv->exrule_list != NULL); +} + +/** + * cal_component_has_exceptions: + * @comp: A calendar component object + * + * Queries whether a calendar component object has any exceptions defined + * + * Return value: TRUE if the component has exceptions, FALSE otherwise + **/ +gboolean +cal_component_has_exceptions (CalComponent *comp) +{ + return cal_component_has_exdates (comp) || cal_component_has_exrules (comp); +} + +/** * cal_component_get_geo: * @comp: A calendar component object. * @geo: Return value for the geographic position property. This should be @@ -2492,6 +2552,20 @@ cal_component_has_rrules (CalComponent *comp) } /** + * cal_component_has_recurrence: + * @comp: A calendar component object + * + * Queries whether a calendar component object has any recurrences defined + * + * Return value: TRUE if the component has recurrences, FALSE otherwise + **/ +gboolean +cal_component_has_recurrences (CalComponent *comp) +{ + return cal_component_has_rdates (comp) || cal_component_has_rrules (comp); +} + +/** * cal_component_get_sequence: * @comp: A calendar component object. * @sequence: Return value for the sequence number. This should be freed using |