<!--
  Copyright (C) 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.
  
  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 <http://www.gnu.org/licenses/>.
-->
<structure namespace="ICal" name="Recur">
    <method name="i_cal_recur_expand_recurrence" corresponds="CUSTOM" since="1.0">
        <parameter type="gchar *" name="rule" comment="The rule of the recurrence."/>
        <parameter type="time_t" name="start" comment="the start seconds past the POSIX epoch."/>
        <parameter type="gint" name="count" comment="The number of elements to be filled up in the @array."/>
        <returns type="GArray *" annotation="array, element-type long, transfer full" comment="If successful, return the array. NULL if failed."/>
        <comment xml:space="preserve">Fill an array with the 'count' number of occurrences generated by the rrule. Note that the times are returned in UTC, but the times are calculated in local time. YOu will have to convert the results back into local time before using them.</comment>
        <custom>	time_t *array;
	GArray *garray;
	gint result;
	g_return_val_if_fail (rule != NULL, 0);
	array = g_new (time_t, count);
	result = icalrecur_expand_recurrence (rule, start, count, array);
	if (result == 0) {
		g_free (array);
		return NULL;
	} else {
		garray = g_array_new (FALSE, FALSE, sizeof (time_t));
		g_array_append_vals (garray, array, count);
		return garray;
	}</custom>
    </method>    
    <method name="i_cal_recur_string_to_weekday" corresponds="icalrecur_string_to_weekday" since="1.0">
        <parameter type="const gchar *" name="str" comment="The string representation of the weekday."/>
        <returns type="ICalRecurrenceTypeWeekday" comment="The enum representation of the weekday."/>
        <comment xml:space="preserve">Convert a string representation to an enum representation for the weekday.</comment>
    </method>
</structure>
