<!--
  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="DurationType" native="struct icaldurationtype" is_bare="true" default_native="icaldurationtype_null_duration()">
    <method name="i_cal_duration_type_is_neg" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be queried."/>
        <returns type="gint" comment="The is_neg." />
        <comment xml:space="preserve">Get the is_neg of #ICalDurationType.</comment>
        <custom>	g_return_val_if_fail (duration_type != NULL, 0);
	return ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->is_neg;</custom>
    </method>
    <method name="i_cal_duration_type_set_is_neg" corresponds="CUSTOM" kind="set" since="1.0">
    	<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be set."/>
        <parameter type="gint" name="is_neg" comment="The is_neg."/>
        <comment>Set the is_neg of #ICalDurationType.</comment>
        <custom>	g_return_if_fail (duration_type != NULL &amp;&amp; I_CAL_IS_DURATION_TYPE (duration_type));
	((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->is_neg = is_neg;</custom>
    </method>
    <method name="i_cal_duration_type_get_days" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be queried."/>
        <returns type="guint" comment="The days." />
        <comment xml:space="preserve">Get the days of #ICalDurationType.</comment>
        <custom>	g_return_val_if_fail (duration_type != NULL, 0);
	return ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->days;</custom>
    </method>
    <method name="i_cal_duration_type_set_days" corresponds="CUSTOM" kind="set" since="1.0">
    	<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be set."/>
        <parameter type="guint" name="days" comment="The days."/>
        <comment>Set the days of #ICalDurationType.</comment>
        <custom>	g_return_if_fail (duration_type != NULL &amp;&amp; I_CAL_IS_DURATION_TYPE (duration_type));
	((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->days = days;</custom>
    </method>
    <method name="i_cal_duration_type_get_weeks" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be queried."/>
        <returns type="guint" comment="The weeks." />
        <comment xml:space="preserve">Get the weeks of #ICalDurationType.</comment>
        <custom>	g_return_val_if_fail (duration_type != NULL, 0);
	return ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->weeks;</custom>
    </method>
    <method name="i_cal_duration_type_set_weeks" corresponds="CUSTOM" kind="set" since="1.0">
    	<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be set."/>
        <parameter type="guint" name="weeks" comment="The weeks."/>
        <comment>Set the weeks of #ICalDurationType.</comment>
        <custom>	g_return_if_fail (duration_type != NULL &amp;&amp; I_CAL_IS_DURATION_TYPE (duration_type));
	((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->weeks = weeks;</custom>
    </method>
    <method name="i_cal_duration_type_get_hours" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be queried."/>
        <returns type="guint" comment="The hours." />
        <comment xml:space="preserve">Get the hours of #ICalDurationType.</comment>
        <custom>	g_return_val_if_fail (duration_type != NULL, 0);
	return ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->hours;</custom>
    </method>
    <method name="i_cal_duration_type_set_hours" corresponds="CUSTOM" kind="set" since="1.0">
    	<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be set."/>
        <parameter type="guint" name="hours" comment="The hours."/>
        <comment>Set the hours of #ICalDurationType.</comment>
        <custom>	g_return_if_fail (duration_type != NULL &amp;&amp; I_CAL_IS_DURATION_TYPE (duration_type));
	((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->hours = hours;</custom>
    </method>
    <method name="i_cal_duration_type_get_minutes" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be queried."/>
        <returns type="guint" comment="The minutes." />
        <comment xml:space="preserve">Get the minutes of #ICalDurationType.</comment>
        <custom>	g_return_val_if_fail (duration_type != NULL, 0);
	return ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->minutes;</custom>
    </method>
    <method name="i_cal_duration_type_set_minutes" corresponds="CUSTOM" kind="set" since="1.0">
    	<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be set."/>
        <parameter type="guint" name="minutes" comment="The minutes."/>
        <comment>Set the minutes of #ICalDurationType.</comment>
        <custom>	g_return_if_fail (duration_type != NULL &amp;&amp; I_CAL_IS_DURATION_TYPE (duration_type));
	((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->minutes = minutes;</custom>
    </method>
    <method name="i_cal_duration_type_get_seconds" corresponds="CUSTOM" kind="get" since="1.0">
		<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be queried."/>
        <returns type="guint" comment="The seconds." />
        <comment xml:space="preserve">Get the seconds of #ICalDurationType.</comment>
        <custom>	g_return_val_if_fail (duration_type != NULL, 0);
	return ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->seconds;</custom>
    </method>
    <method name="i_cal_duration_type_set_seconds" corresponds="CUSTOM" kind="set" since="1.0">
    	<parameter type="ICalDurationType *" name="duration_type" comment="The #ICalDurationType to be set."/>
        <parameter type="guint" name="seconds" comment="The seconds."/>
        <comment>Set the seconds of #ICalDurationType.</comment>
        <custom>	g_return_if_fail (duration_type != NULL &amp;&amp; I_CAL_IS_DURATION_TYPE (duration_type));
	((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration_type))->seconds = seconds;</custom>
    </method>
    <method name="i_cal_duration_type_from_int" corresponds="icaldurationtype_from_int" kind="constructor" since="1.0">
        <parameter type="gint" name="t" comment="the duration in second"/>
        <returns type="ICalDurationType *" annotation="transfer full" comment="The newly created #ICalDurationType" />
        <comment xml:space="preserve">Create a #ICalDurationType from the duration in second</comment>
    </method> 
    <method name="i_cal_duration_type_from_string" corresponds="icaldurationtype_from_string" kind="constructor" since="1.0">
        <parameter type="const gchar *" name="str" comment="The string representation of the duration"/>
        <returns type="ICalDurationType *" annotation="transfer full" comment="The newly created #ICalDurationType" />
        <comment xml:space="preserve">Create a #ICalDurationType from the duration in string</comment>
    </method> 
    <method name="i_cal_duration_type_as_int" corresponds="icaldurationtype_as_int" kind="others" since="1.0">
        <parameter type="ICalDurationType *" name="duration" comment="The #ICalDurationType to be converted"/>
        <returns type="gint" comment="The duration in second" />
        <comment xml:space="preserve">Convert the #ICalDurationType to the representation in second</comment>
    </method>
    <method name="i_cal_duration_type_as_ical_string_r" corresponds="icaldurationtype_as_ical_string_r" kind="others" since="1.0">
        <parameter type="ICalDurationType *" name="duration" comment="The #ICalDurationType to be converted"/>
        <returns type="gchar *" annotation="transfer full" comment="The duration in string" />
        <comment xml:space="preserve">Convert the #ICalDurationType to the representation in string</comment>
    </method>
    <method name="i_cal_duration_type_null_duration" corresponds="icaldurationtype_null_duration" kind="constructor" since="1.0">
        <returns type="ICalDurationType *" annotation="transfer full" comment="The newly created #ICalDurationType" />
        <comment xml:space="preserve">Create a #ICalDurationType with all the fields to be zero</comment>
    </method>
    <method name="i_cal_duration_type_bad_duration" corresponds="icaldurationtype_bad_duration" kind="constructor" since="1.0">
        <returns type="ICalDurationType *" annotation="transfer full" comment="The newly created #ICalDurationType" />
        <comment xml:space="preserve">Create a bad #ICalDurationType</comment>
    </method>
    <method name="i_cal_duration_type_is_null_duration" corresponds="icaldurationtype_is_null_duration" kind="others" since="1.0">
        <parameter type="ICalDurationType *" name="duration" comment="The #ICalDurationType to be checked"/>
        <returns type="gint" comment="1 if @duration is the null_duration, 0 if not." />
        <comment xml:space="preserve">Check whether the #ICalDurationType is the null_duration</comment>
    </method>
    <method name="i_cal_duration_type_is_bad_duration" corresponds="icaldurationtype_is_bad_duration" kind="others" since="1.0">
        <parameter type="ICalDurationType *" name="duration" comment="The #ICalDurationType to be checked"/>
        <returns type="gint" comment="1 if @duration is the bad_duration, 0 if not." />
        <comment xml:space="preserve">Check whether the #ICalDurationType is the bad_duration</comment>
    </method>
</structure>
