<!--
  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="PeriodType" native="struct icalperiodtype" is_bare="true" default_native="icalperiodtype_null_period ()">
	<method name="i_cal_period_type_get_start" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalPeriodType *" name="period" comment="The #ICalPeriodType to be queried."/>
		<returns type="ICalTimetype *" annotation="transfer full" comment="The start of @period."/>
		<comment>Get the start time from an #ICalPeriodType.</comment>
		<custom>	g_return_val_if_fail (period != NULL, NULL);
	g_return_val_if_fail (I_CAL_IS_PERIOD_TYPE (period), NULL);
	
	return i_cal_timetype_new_full ((* (struct icalperiodtype *)i_cal_object_get_native ((ICalObject *)period)).start);</custom>
	</method>
	<method name="i_cal_period_type_set_start" corresponds="CUSTOM" kind="set" since="1.0">
		<parameter type="ICalPeriodType *" name="period" comment="The #ICalPeriodType to be set."/>
		<parameter type="ICalTimetype *" name="start" comment="The start of @period."/>
		<comment>Set the start time of an #ICalPeriodType.</comment>
		<custom>	struct icalperiodtype *periodtype;
	g_return_if_fail (period != NULL);
	g_return_if_fail (I_CAL_IS_PERIOD_TYPE (period));
	g_return_if_fail (start != NULL);
	g_return_if_fail (I_CAL_IS_TIMETYPE (start));
	
	periodtype = (struct icalperiodtype *)i_cal_object_get_native ((ICalObject *)period);
	periodtype->start = * (struct icaltimetype *)i_cal_object_get_native ((ICalObject *)start);</custom>
	</method>
	<method name="i_cal_period_type_get_end" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalPeriodType *" name="period" comment="The #ICalPeriodType to be queried."/>
		<returns type="ICalTimetype *" annotation="transfer full" comment="The end of @period."/>
		<comment>Get the end time from an #ICalPeriodType.</comment>
		<custom>	g_return_val_if_fail (period != NULL, NULL);
	g_return_val_if_fail (I_CAL_IS_PERIOD_TYPE (period), NULL);
	
	return i_cal_timetype_new_full ((* (struct icalperiodtype *)i_cal_object_get_native ((ICalObject *)period)).end);</custom>
	</method>
	<method name="i_cal_period_type_set_end" corresponds="CUSTOM" kind="set" since="1.0">
		<parameter type="ICalPeriodType *" name="period" comment="The #ICalPeriodType to be set."/>
		<parameter type="ICalTimetype *" name="end" comment="The end of @period."/>
		<comment>Set the end time of an #ICalPeriodType.</comment>
		<custom>	struct icalperiodtype *periodtype;
	g_return_if_fail (period != NULL);
	g_return_if_fail (I_CAL_IS_PERIOD_TYPE (period));
	g_return_if_fail (end != NULL);
	g_return_if_fail (I_CAL_IS_TIMETYPE (end));
	
	periodtype = (struct icalperiodtype *)i_cal_object_get_native ((ICalObject *)period);
	periodtype->end = (* (struct icaltimetype *)i_cal_object_get_native ((ICalObject *)end));</custom>
	</method>
	<method name="i_cal_period_type_get_duration" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalPeriodType *" name="period" comment="The #ICalPeriodType to be queried."/>
		<returns type="ICalDurationType *" annotation="transfer full" comment="The duration of @period."/>
		<comment>Get the duration from an #ICalPeriodType.</comment>
		<custom>	g_return_val_if_fail (period != NULL, NULL);
	g_return_val_if_fail (I_CAL_IS_PERIOD_TYPE (period), NULL);
	
	return i_cal_duration_type_new_full ((* (struct icalperiodtype *)i_cal_object_get_native ((ICalObject *)period)).duration);</custom>
	</method>
	<method name="i_cal_period_type_set_duration" corresponds="CUSTOM" kind="set" since="1.0">
		<parameter type="ICalPeriodType *" name="period" comment="The #ICalPeriodType to be set."/>
		<parameter type="ICalDurationType *" name="duration" comment="The duration of @period."/>
		<comment>Set the duration of an #ICalPeriodType.</comment>
		<custom>	struct icalperiodtype *periodtype;
	g_return_if_fail (period != NULL);
	g_return_if_fail (I_CAL_IS_PERIOD_TYPE (period));
	g_return_if_fail (duration != NULL);
	g_return_if_fail (I_CAL_IS_DURATION_TYPE (duration));
	
	periodtype = (struct icalperiodtype *)i_cal_object_get_native ((ICalObject *)period);
	periodtype->duration = (* (struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration));</custom>
	</method>
    <method name="i_cal_period_type_from_string" corresponds="icalperiodtype_from_string" kind="constructor" since="1.0">
        <parameter type="const gchar *" name="str" comment="The string used to create the #ICalPeriodType"/>
        <returns type="ICalPeriodType *" annotation="transfer full" comment="The newly created #ICalPeriodType"/>
        <comment xml:space="preserve">Create a #ICalPeriodType from a string.</comment>
    </method>
    <method name="i_cal_period_type_as_ical_string_r" corresponds="icalperiodtype_as_ical_string_r" since="1.0">
        <parameter type="ICalPeriodType *" name="p" comment="The #ICalPeriodType to be translated."/>
        <returns type="gchar *" annotation="transfer full" comment="The string representation of #ICalPeriodType."/>
        <comment xml:space="preserve">Translate #ICalPeriodType to string.</comment>
    </method>
    <method name="i_cal_period_type_null_period" corresponds="icalperiodtype_null_period" since="1.0">
        <returns type="ICalPeriodType *" annotation="transfer full" comment="The newly created default #ICalPeriodType"/>
        <comment xml:space="preserve">Create a default #ICalPeriodType.</comment>
    </method>
    <method name="i_cal_period_type_is_null_period" corresponds="icalperiodtype_is_null_period" since="1.0">
        <parameter type="ICalPeriodType *" name="p" comment="The #ICalPeriodType to be checked."/>
        <returns type="gint" comment="1 if yes, 0 if not."/>
        <comment xml:space="preserve">Check the #ICalPeriodType is null_period.</comment>
    </method>
    <method name="i_cal_period_type_is_valid_period" corresponds="icalperiodtype_is_valid_period" since="1.0">
        <parameter type="ICalPeriodType *" name="p" comment="The #ICalPeriodType to be checked."/>
        <returns type="gint" comment="1 if yes, 0 if not."/>
        <comment xml:space="preserve">Check the #ICalPeriodType is valid_period.</comment>
    </method>
</structure>
