libpurple/purpleattachment.h

Mon, 12 Dec 2022 23:38:47 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 12 Dec 2022 23:38:47 -0600
changeset 41966
c7bcaf2f41ef
parent 41686
9bcd6ad114eb
child 42387
d9350cda1556
permissions
-rw-r--r--

Create PurpleAvatar to represent avatars

Testing Done:
Ran the unit tests and manually verified the docs.

Reviewed at https://reviews.imfreedom.org/r/2092/

40526
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * purple
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * source distribution.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * (at your option) any later version.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * GNU General Public License for more details.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public
40539
2941deda6d8d Use an https link to gnu.org in the license file headers
Gary Kramlich <grim@reaperworld.com>
parents: 40526
diff changeset
19 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
40526
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 # error "only <purple.h> may be included directly"
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #endif
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #ifndef PURPLE_ATTACHMENT_H
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #define PURPLE_ATTACHMENT_H
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include <glib-object.h>
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 G_BEGIN_DECLS
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #define PURPLE_TYPE_ATTACHMENT purple_attachment_get_type()
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 /**
41207
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41010
diff changeset
36 * PurpleAttachment:
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41010
diff changeset
37 *
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41010
diff changeset
38 * #PurpleAttachment represents a file attached to a #PurpleMessage.
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41010
diff changeset
39 */
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41010
diff changeset
40
40526
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 G_DECLARE_FINAL_TYPE(PurpleAttachment, purple_attachment, PURPLE, ATTACHMENT, GObject)
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 * PurpleAttachmentForeachFunc:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 * @data: User supplied data.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 * Called when iterating #PurpleAttachment's.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 typedef void (*PurpleAttachmentForeachFunc)(PurpleAttachment *attachment, gpointer data);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 * purple_attachment_new:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 * @id: The identifier of the attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 * @content_type: The mime-type of the content.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 * Creates a new #PurpleAttachment with the given @id and @content_type.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 PurpleAttachment *purple_attachment_new(guint64 id, const gchar *content_type);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 * purple_attachment_get_id:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 * Gets the ID from @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 * Returns: The ID of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 guint64 purple_attachment_get_id(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * purple_attachment_get_hash_key:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 * Gets the hash key of @attachment. This should only be used when
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 * trying to address a #PurpleAttachment in a #GHashTable that is using
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 * g_int64_hash() as the key function.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 * Returns: (transfer none): The hash key of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 guint64 *purple_attachment_get_hash_key(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 * purple_attachment_set_id:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 * @id: The new ID for @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 * Sets the ID of @attachment to @id.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 void purple_attachment_set_id(PurpleAttachment *attachment, guint64 id);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 * purple_attachment_get_content_type:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 * Gets the content-type of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 * Returns: The content-type of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 const gchar *purple_attachment_get_content_type(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 * purple_attachment_get_local_uri:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 * Gets the local URI if any for @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 * Returns: (nullable): The local URI for @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 const gchar *purple_attachment_get_local_uri(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 * purple_attachment_set_local_uri:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 * @local_uri: The new local URI.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 * Sets the local URI of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 void purple_attachment_set_local_uri(PurpleAttachment *attachment, const gchar *local_uri);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 * purple_attachment_get_remote_uri:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 * Gets the remote URI if any for @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 * Returns: (nullable): The remote URI for @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 const gchar *purple_attachment_get_remote_uri(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 * purple_attachment_set_remote_uri:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 * @remote_uri: The new remote URI.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 * Sets the remote URI of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158 void purple_attachment_set_remote_uri(PurpleAttachment *attachment, const gchar *remote_uri);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 * purple_attachment_get_size:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 * Gets the size of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 * Returns: The size of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169 */
40540
168407b6f9fd Fix the prototypes for purple_attachment_[gs]et_size to match the actual implementation
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
170 guint64 purple_attachment_get_size(PurpleAttachment *attachment);
40526
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 * purple_attachment_set_size:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 * @size: The new size of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177 * Sets the size of @attachment to @size.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 */
40540
168407b6f9fd Fix the prototypes for purple_attachment_[gs]et_size to match the actual implementation
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
181 void purple_attachment_set_size(PurpleAttachment *attachment, guint64 size);
40526
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 * purple_attachment_get_filename:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
185 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 * Gets the base filename for @attachment. Remote URI will be checked before
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188 * local URI, but the basename of one of those is what will be returned.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190 * Returns: (transfer full): The filename for @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 gchar *purple_attachment_get_filename(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 G_END_DECLS
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198 #endif /* PURPLE_ATTACHMENT_H */

mercurial