summaryrefslogtreecommitdiff
path: root/src/libical-glib/api/i-cal-recurrence.xml
diff options
context:
space:
mode:
Diffstat (limited to 'src/libical-glib/api/i-cal-recurrence.xml')
-rw-r--r--src/libical-glib/api/i-cal-recurrence.xml124
1 files changed, 96 insertions, 28 deletions
diff --git a/src/libical-glib/api/i-cal-recurrence.xml b/src/libical-glib/api/i-cal-recurrence.xml
index be71e6f8..70dfe838 100644
--- a/src/libical-glib/api/i-cal-recurrence.xml
+++ b/src/libical-glib/api/i-cal-recurrence.xml
@@ -1,17 +1,9 @@
<!--
- Copyright (C) 2015 William Yu <williamyu@gnome.org>
+ SPDX-FileCopyrightText: 2015 William Yu <williamyu@gnome.org>
- This library is free software: you can redistribute it and/or modify it
- under the terms of version 2.1. of the GNU Lesser General Public License
- as published by the Free Software Foundation.
+ SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- for more details.
- You should have received a copy of the GNU Lesser General Public License
- along with this library. If not, see <https://www.gnu.org/licenses/>.
-->
<structure namespace="ICal" name="Recurrence" native="struct icalrecurrencetype" is_bare="true" default_native="i_cal_recurrence_new_default ()">
<enum name="ICalRecurrenceFrequency" native_name="icalrecurrencetype_frequency" default_native="I_CAL_NO_RECURRENCE">
@@ -93,6 +85,12 @@
<returns type="gint" comment="The decoded day of the week. 0 == any of day of week. 1 == first, 2 = second, -2 == second to last, etc"/>
<comment xml:space="preserve">Decodes a day to a position of the weekday.</comment>
</method>
+ <method name="i_cal_recurrence_encode_day" corresponds="icalrecurrencetype_encode_day" since="3.0.5">
+ <parameter type="ICalRecurrenceWeekday" name="weekday" comment="The #ICalRecurrenceWeekday to use."/>
+ <parameter type="gint" name="position" comment="The position to use. 0 == any of day of week. 1 == first, 2 = second, -2 == second to last, etc"/>
+ <returns type="gshort" comment="Encoded @weekday and @position into a single value"/>
+ <comment xml:space="preserve">Encodes the @weekday and @position into a single value, which can by split by i_cal_recurrence_day_day_of_week() and i_cal_recurrence_day_position().</comment>
+ </method>
<method name="i_cal_recurrence_month_is_leap" corresponds="icalrecurrencetype_month_is_leap" since="2.0">
<parameter type="gshort" name="month" comment="The month to be decoded"/>
<returns type="gboolean" comment="Whether this month is a leap month."/>
@@ -101,6 +99,13 @@
<method name="i_cal_recurrence_month_month" corresponds="icalrecurrencetype_month_month" since="2.0">
<parameter type="gshort" name="month" comment="The month to be decoded"/>
<returns type="gint" comment="The actual month number regardless of the leap flag."/>
+ <comment xml:space="preserve">Decode a month from an encoded value by i_cal_recurrence_encode_month().</comment>
+ </method>
+ <method name="i_cal_recurrence_encode_month" corresponds="icalrecurrencetype_encode_month" since="3.0.5">
+ <parameter type="gint" name="month" comment="The month to be encoded"/>
+ <parameter type="gboolean" name="is_leap" comment="%TRUE, when the month is leap, %FALSE otherwise"/>
+ <returns type="gshort" comment="Encoded @month and @is_leap"/>
+ <comment xml:space="preserve">Encodes the @month and the @is_leap flag into a single value, which can be split by i_cal_recurrence_month_is_leap() and i_cal_recurrence_month_month().</comment>
</method>
<method name="i_cal_recurrence_new_from_string" corresponds="icalrecurrencetype_from_string" since="1.0">
<parameter type="const gchar *" name="str" comment="The string representation of the #ICalRecurrence"/>
@@ -186,11 +191,18 @@
<method name="i_cal_recurrence_get_by_second_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_second of #ICalRecurrence."/>
- <comment>Gets the by_second array from #ICalRecurrence. The array size if I_CAL_BY_SECOND_SIZE.</comment>
+ <comment>Gets the by_second array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_SECOND_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
array = g_array_new (FALSE, TRUE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_second, I_CAL_BY_SECOND_SIZE);
+ for (size = 0; size &lt; I_CAL_BY_SECOND_SIZE; size++) {
+ if (native_recurrence->by_second[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_second, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_second_array" corresponds="CUSTOM" kind="set" since="1.0">
@@ -233,11 +245,18 @@
<method name="i_cal_recurrence_get_by_minute_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_minute of #ICalRecurrence."/>
- <comment>Gets the by_minute array from #ICalRecurrence. The array size is I_CAL_BY_MINUTE_SIZE.</comment>
+ <comment>Gets the by_minute array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_MINUTE_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
array = g_array_new (FALSE, FALSE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_minute, I_CAL_BY_MINUTE_SIZE);
+ for (size = 0; size &lt; I_CAL_BY_MINUTE_SIZE; size++) {
+ if (native_recurrence->by_minute[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_minute, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_minute_array" corresponds="CUSTOM" kind="set" since="1.0">
@@ -280,11 +299,18 @@
<method name="i_cal_recurrence_get_by_hour_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_hour of #ICalRecurrence."/>
- <comment>Gets the by_hour array from #ICalRecurrence. The array size is I_CAL_BY_HOUR_SIZE.</comment>
+ <comment>Gets the by_hour array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_HOUR_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
array = g_array_new (FALSE, FALSE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_hour, I_CAL_BY_HOUR_SIZE);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
+ for (size = 0; size &lt; I_CAL_BY_HOUR_SIZE; size++) {
+ if (native_recurrence->by_hour[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_hour, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_hour_array" corresponds="CUSTOM" kind="set" since="1.0">
@@ -327,11 +353,18 @@
<method name="i_cal_recurrence_get_by_day_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_day of #ICalRecurrence."/>
- <comment>Gets the by_day array from #ICalRecurrence. The array size is I_CAL_BY_DAY_SIZE.</comment>
+ <comment>Gets the by_day array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_DAY_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
array = g_array_new (FALSE, FALSE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_day, I_CAL_BY_DAY_SIZE);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
+ for (size = 0; size &lt; I_CAL_BY_DAY_SIZE; size++) {
+ if (native_recurrence->by_day[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_day, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_day_array" corresponds="CUSTOM" kind="set" since="1.0">
@@ -374,11 +407,18 @@
<method name="i_cal_recurrence_get_by_month_day_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_month_day of #ICalRecurrence."/>
- <comment>Gets the by_month_day array from #ICalRecurrence. The array size is I_CAL_BY_MONTHDAY_SIZE.</comment>
+ <comment>Gets the by_month_day array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_MONTHDAY_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
array = g_array_new (FALSE, FALSE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_month_day, I_CAL_BY_MONTHDAY_SIZE);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
+ for (size = 0; size &lt; I_CAL_BY_MONTHDAY_SIZE; size++) {
+ if (native_recurrence->by_month_day[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_month_day, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_month_day_array" corresponds="CUSTOM" kind="set" since="1.0">
@@ -421,11 +461,18 @@
<method name="i_cal_recurrence_get_by_year_day_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_year_day of #ICalRecurrence."/>
- <comment>Gets the by_year_day array from #ICalRecurrence. The array size is I_CAL_BY_YEARDAY_SIZE.</comment>
+ <comment>Gets the by_year_day array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_YEARDAY_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
array = g_array_new (FALSE, FALSE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_year_day, I_CAL_BY_YEARDAY_SIZE);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
+ for (size = 0; size &lt; I_CAL_BY_YEARDAY_SIZE; size++) {
+ if (native_recurrence->by_year_day[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_year_day, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_year_day_array" corresponds="CUSTOM" kind="set" since="1.0">
@@ -468,11 +515,18 @@
<method name="i_cal_recurrence_get_by_week_no_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_week_no of #ICalRecurrence."/>
- <comment>Gets the by_week_no array from #ICalRecurrence. The array size is I_CAL_BY_WEEKNO_SIZE.</comment>
+ <comment>Gets the by_week_no array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_WEEKNO_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
array = g_array_new (FALSE, FALSE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_week_no, I_CAL_BY_WEEKNO_SIZE);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
+ for (size = 0; size &lt; I_CAL_BY_WEEKNO_SIZE; size++) {
+ if (native_recurrence->by_week_no[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_week_no, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_week_no_array" corresponds="CUSTOM" kind="set" since="1.0">
@@ -515,11 +569,18 @@
<method name="i_cal_recurrence_get_by_month_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_month of #ICalRecurrence."/>
- <comment>Gets the by_month array from #ICalRecurrence. The array size is I_CAL_BY_MONTH_SIZE.</comment>
+ <comment>Gets the by_month array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_MONTH_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
array = g_array_new (FALSE, FALSE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_month, I_CAL_BY_MONTH_SIZE);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
+ for (size = 0; size &lt; I_CAL_BY_MONTH_SIZE; size++) {
+ if (native_recurrence->by_month[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_month, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_month_array" corresponds="CUSTOM" kind="set" since="1.0">
@@ -562,11 +623,18 @@
<method name="i_cal_recurrence_get_by_set_pos_array" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/>
<returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_set_pos of #ICalRecurrence."/>
- <comment>Gets the by_set_pos array from #ICalRecurrence. The array size is I_CAL_BY_SETPOS_SIZE.</comment>
+ <comment>Gets the by_set_pos array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_SETPOS_SIZE.</comment>
<custom> GArray *array;
+ struct icalrecurrencetype *native_recurrence;
+ guint size;
g_return_val_if_fail (recur != NULL &amp;&amp; I_CAL_IS_RECURRENCE (recur), NULL);
array = g_array_new (FALSE, FALSE, sizeof (gshort));
- g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_set_pos, I_CAL_BY_SETPOS_SIZE);
+ native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur);
+ for (size = 0; size &lt; I_CAL_BY_SETPOS_SIZE; size++) {
+ if (native_recurrence->by_set_pos[size] == I_CAL_RECURRENCE_ARRAY_MAX)
+ break;
+ }
+ g_array_append_vals (array, native_recurrence->by_set_pos, size);
return array;</custom>
</method>
<method name="i_cal_recurrence_set_by_set_pos_array" corresponds="CUSTOM" kind="set" since="1.0">