summaryrefslogtreecommitdiff
path: root/src/libical-glib/api/i-cal-value.xml
blob: ed54e510860f86af4bdd3d04ee9529061ffdd063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!--
  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="Value" native="icalvalue" destroy_func="icalvalue_free" includes="string.h">
    <method name="i_cal_value_new" corresponds="icalvalue_new" kind="constructor" since="1.0">
        <parameter type="ICalValueKind" name="kind" comment="A #ICalValueKind"/>
        <returns type="ICalValue *" annotation="transfer full" comment="The newly created #ICalValue."/>
        <comment xml:space="preserve">Create a new #ICalValue with specific kind.</comment>
    </method>
    <method name="i_cal_value_clone" corresponds="icalvalue_new_clone" kind="clone" since="1.0">
        <parameter type="const ICalValue *" name="value" comment="The #ICalValue to be cloned."/>
        <returns type="ICalValue *" annotation="transfer full" comment="The newly created #ICalValue with the same property as @value."/>
        <comment xml:space="preserve">Deeply clone a #ICalValue.</comment>
    </method>
    <method name="i_cal_value_new_from_string" corresponds="icalvalue_new_from_string" kind="constructor" since="1.0">
        <parameter type="ICalValueKind" name="kind" comment="A #ICalValueKind"/>
        <parameter type="const gchar *" name="str" comment="A string."/>
        <returns type="ICalValue *" annotation="transfer full" comment="The newly created #ICalValue based on the @kind and @str."/>
        <comment xml:space="preserve">Create a new #ICalValue based on the #ICalValueKind and a string.</comment>
    </method>
    <method name="i_cal_value_free" corresponds="icalvalue_free" annotation="skip" kind="destructor" since="1.0">
        <parameter type="ICalValue *" name="value" comment="The #ICalValue to be freed."/>
        <comment xml:space="preserve">Free a #ICalValue.</comment>
    </method>
    <method name="i_cal_value_is_valid" corresponds="icalvalue_is_valid" since="1.0">
        <parameter type="const ICalValue *" name="value" comment="The #ICalValue to be checked."/>
        <returns type="gboolean" comment="1 if valid, 0 if not."/>
        <comment xml:space="preserve">Check if #ICalValue is valid.</comment>
    </method>
    <method name="i_cal_value_as_ical_string" corresponds="icalvalue_as_ical_string_r" since="1.0">
        <parameter type="const ICalValue *" name="value" comment="A #ICalValue."/>
        <returns type="gchar *" annotation="transfer full" comment="The string representation."/>
        <comment xml:space="preserve">Convert the #ICalValue to a string.</comment>
    </method>
    <method name="i_cal_value_isa" corresponds="icalvalue_isa" since="1.0">
        <parameter type="const ICalValue *" name="value" comment="A #ICalValue."/>
        <returns type="ICalValueKind" comment="The kind of @value."/>
        <comment xml:space="preserve">Get the kind of #ICalValue.</comment>
    </method>
    <method name="i_cal_value_isa_value" corresponds="icalvalue_isa_value" since="1.0">
        <parameter type="ICalValue *" name="value" comment="A #ICalValue"/>
        <returns type="gint" comment="1 if yes, 0 if not."/>
        <comment xml:space="preserve">Check whether the native part of #ICalValue is an icalvalue</comment>
    </method>
    <method name="i_cal_value_compare" corresponds="icalvalue_compare" since="1.0">
        <parameter type="const ICalValue *" name="a" comment="A #ICalValue."/>
        <parameter type="const ICalValue *" name="b" comment="A #ICalValue."/>
        <returns type="ICalParameterXliccomparetype" comment="The compare result."/>
        <comment xml:space="preserve">Compare two #ICalValue.</comment>
    </method>
    <method name="i_cal_value_kind_from_string" corresponds="icalvalue_string_to_kind" since="1.0">
        <parameter type="const gchar *" name="str" comment="A string."/>
        <returns type="ICalValueKind" comment="A #ICalValueKind."/>
        <comment xml:space="preserve">Convert a string to #ICalValueKind.</comment>
    </method>
    <method name="i_cal_value_kind_to_string" corresponds="icalvalue_kind_to_string" since="1.0">
        <parameter type="const ICalValueKind" name="kind" comment="A #ICalValueKind."/>
        <returns type="const gchar *" comment="The string representation of #ICalValueKind."/>
        <comment xml:space="preserve">Convert the #ICalValueKind to a string.</comment>
    </method>
    <method name="i_cal_value_kind_is_valid" corresponds="icalvalue_kind_is_valid" since="1.0">
        <parameter type="const ICalValueKind" name="kind" comment="The #ICalValueKind to be checked."/>
        <returns type="gboolean" comment="1 if yes, 0 if not."/>
        <comment xml:space="preserve">Check whether the #ICalValueKind is valid.</comment>
    </method>
    <method name="i_cal_value_encode_ical_string" corresponds="CUSTOM" since="1.0">
        <parameter type="const gchar *" name="szText" comment="A string."/>
        <returns type="gchar *" annotation="allow-none, transfer full" comment="The encoded string. NULL if fail."/>
        <comment xml:space="preserve">Encode a character string in ical format, escape certain characters, etc.</comment>
        <custom>    gchar *szEncText;
    gchar *buffer = NULL;
    gsize bufSize;
    gint result;

    g_return_val_if_fail(szText != NULL, NULL);

    bufSize = 2 * strlen(szText);
    szEncText = g_new0(gchar, bufSize + 1);

    result = icalvalue_encode_ical_string(szText, szEncText, bufSize);
    if (result)
        buffer = g_strdup(szEncText);
    g_free(szEncText);

    return buffer;</custom>
    </method>
    <method name="i_cal_value_decode_ical_string" corresponds="CUSTOM" since="1.0">
        <parameter type="const gchar *" name="szText" comment="A string."/>
        <returns type="gchar *" annotation="allow-none, transfer full" comment="The decoded string. NULL if fail."/>
        <comment xml:space="preserve">Extract the original character string encoded by the above function</comment>
        <custom>    gchar *szDecText;
    gchar *buffer = NULL;
    gsize bufSize;
    gint result;

    g_return_val_if_fail (szText != NULL, NULL);

    bufSize = strlen(szText);
    szDecText = g_new0(gchar, bufSize + 1);

    result = icalvalue_decode_ical_string(szText, szDecText, bufSize);
    if (result)
        buffer = g_strdup(szDecText);
    g_free (szDecText);

    return buffer;</custom>
    </method>
</structure>