summaryrefslogtreecommitdiff
path: root/src/libical-glib/api/i-cal-attach.xml
blob: 69108e4861a328d1c5c3978b40ce77750ce2ddfe (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
<!--
  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 <https://www.gnu.org/licenses/>.
-->
<structure namespace="ICal" name="Attach" native="icalattach" destroy_func="icalattach_unref" new_full_extra_code="if (owner) { icalattach_ref (native); owner = NULL; }">
    <method name="i_cal_attach_new_from_url" corresponds="icalattach_new_from_url" kind="constructor" since="1.0">
        <parameter type="const gchar *" name="url" comment="The url from which the object is created"/>
        <returns type="ICalAttach *" annotation="transfer full" comment="The newly created #ICalAttach from the @url" />
        <comment xml:space="preserve">Create a new #ICalAttach from the url</comment>
    </method>
    <method name="i_cal_attach_new_from_data" corresponds="CUSTOM" kind="constructor" since="1.0">
        <parameter type="const gchar *" name="data" comment="The data used to create the #ICalAttach"/>
        <parameter type="GFunc" name="free_fn" translator="(icalattach_free_fn_t)" annotation="scope call, allow-none" comment="The function used to free the data when the create #ICalAttach is detroyed."/>
        <parameter type="void *" name="free_fn_data" annotation="allow-none" comment="The userdata used for the free function @free_fn"/>
        <returns type="ICalAttach *" annotation="transfer full" comment="The newly created #ICalAttach" />
        <comment xml:space="preserve">Create a new #ICalAttach from the data.</comment>
        <custom>    g_return_val_if_fail (data != NULL, NULL);

    return i_cal_attach_new_full (icalattach_new_from_data (data, (icalattach_free_fn_t) (free_fn), free_fn_data), NULL);</custom>
    </method>
    <declaration position="body">
static void unref_g_bytes(char *data, void *user_data)
{
    GBytes *bytes = user_data;

    g_return_if_fail (data != NULL);
    g_return_if_fail (bytes != NULL);

    g_bytes_unref(bytes);
}</declaration>
    <method name="i_cal_attach_new_from_bytes" corresponds="CUSTOM" kind="constructor" since="1.0">
        <parameter type="GBytes *" annotation="transfer full" name="bytes" comment="The #GBytes holding the data used to create the #ICalAttach"/>
        <returns type="ICalAttach *" annotation="transfer full" comment="The newly created #ICalAttach" />
        <comment xml:space="preserve">Create a new #ICalAttach from the data in bytes. Takes a reference of @bytes, increase the reference before calling this function if you with to use it afterward. The stored bytes should be already encoded with used encoding (like base64).</comment>
        <custom>    g_return_val_if_fail (bytes != NULL, NULL);

    return i_cal_attach_new_full (icalattach_new_from_data (g_bytes_get_data (bytes, NULL), unref_g_bytes, bytes), NULL);</custom>
    </method>
    <method name="i_cal_attach_ref" corresponds="icalattach_ref" annotation="skip" kind="others" since="1.0">
        <parameter type="ICalAttach *" name="attach" comment="The #ICalAttach to be referenced by once"/>
        <comment xml:space="preserve">Increase the ref counter by 1 for the @attach</comment>
    </method>
    <method name="i_cal_attach_unref" corresponds="icalattach_unref" annotation="skip" kind="others" since="1.0">
        <parameter type="ICalAttach *" name="attach" comment="The #ICalAttach to be unreferenced by once"/>
        <comment xml:space="preserve">Decrese the ref counter by 1 for the @attach</comment>
    </method>
    <method name="i_cal_attach_get_is_url" corresponds="icalattach_get_is_url" kind="others" since="1.0">
        <parameter type="ICalAttach *" name="attach" comment="The #ICalAttach to be queried"/>
        <returns type="gboolean" comment="whether the @attach is built from url" />
        <comment xml:space="preserve">Check whether the #ICalAttach is built from url</comment>
    </method>
    <method name="i_cal_attach_get_url" corresponds="icalattach_get_url" kind="others" since="1.0">
        <parameter type="ICalAttach *" name="attach" comment="The #ICalAttach to be queried"/>
        <returns type="const gchar *" annotation="allow-none, transfer none" comment="The url component of the @attach. %NULL if it is built from data or there is an error." />
        <comment xml:space="preserve">Get the url, if the #ICalAttach is built from the url.</comment>
    </method>
    <method name="i_cal_attach_get_data" corresponds="CUSTOM" kind="others" since="1.0">
        <parameter type="ICalAttach *" name="attach" comment="The #ICalAttach to be queried"/>
        <returns type="const gchar *" annotation="nullable, transfer none" comment="The data component of the @attach. %NULL if it is built from url or there is an error." />
        <comment xml:space="preserve">Get the data, if the #ICalAttach is built from the data.</comment>
        <custom>    g_return_val_if_fail (I_CAL_IS_ATTACH (attach), NULL);

    return (const gchar *) (icalattach_get_data ((icalattach *)i_cal_object_get_native (I_CAL_OBJECT (attach))));</custom>
    </method>
</structure>