libpurple/purpleattachment.h

Mon, 11 Jan 2021 01:51:14 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 11 Jan 2021 01:51:14 -0600
changeset 40697
81f81f5d2f39
parent 40540
168407b6f9fd
child 41010
d0abbb616bea
permissions
-rw-r--r--

Split PurpleProtocolChat to its own file and clean up the API.

Testing Done:
* Compiled and tested bonjour (not affected) and irc locally.
* Built and verified the docs.
* verified `ninja pidgin-pot` was successful.

Bugs closed: 17457

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

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 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 * SECTION:purpleattachment
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 * @section_id: libpurple-attachment
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 * @short_description: message attachment
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 * @title: Message Attachments
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 * #PurpleAttachment represents a file attached to a #PurpleMessage.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 #include <glib-object.h>
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 G_BEGIN_DECLS
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 #define PURPLE_TYPE_ATTACHMENT purple_attachment_get_type()
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 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 * purple_attachment_get_type:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 * Returns: the #GType for an attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 G_DECLARE_FINAL_TYPE(PurpleAttachment, purple_attachment, PURPLE, ATTACHMENT, GObject)
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52
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 * PurpleAttachmentForeachFunc:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 * @data: User supplied data.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 * Called when iterating #PurpleAttachment's.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 *
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 typedef void (*PurpleAttachmentForeachFunc)(PurpleAttachment *attachment, gpointer data);
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_new:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 * @id: The identifier of the attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 * @content_type: The mime-type of the content.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * 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
71 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 PurpleAttachment *purple_attachment_new(guint64 id, const gchar *content_type);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75
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 * purple_attachment_get_id:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 * Gets the ID from @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 * Returns: The ID of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 guint64 purple_attachment_get_id(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87
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 * purple_attachment_get_hash_key:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 * @attachment: The #PurpleAttachment instance.
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 * 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
93 * 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
94 * g_int64_hash() as the key function.
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 * Returns: (transfer none): The hash key of @attachment.
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 guint64 *purple_attachment_get_hash_key(PurpleAttachment *attachment);
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_set_id:
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 * @id: The new ID for @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 * Sets the ID of @attachment to @id.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 void purple_attachment_set_id(PurpleAttachment *attachment, guint64 id);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112
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 * purple_attachment_get_content_type:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 * Gets the content-type of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 * Returns: The content-type of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 const gchar *purple_attachment_get_content_type(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124
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 * purple_attachment_get_local_uri:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 * Gets the local URI if any for @attachment.
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 * Returns: (nullable): The local URI for @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 const gchar *purple_attachment_get_local_uri(PurpleAttachment *attachment);
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_set_local_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 * @local_uri: The new local URI.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 * Sets the local URI of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 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
147
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 * purple_attachment_get_remote_uri:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 * Gets the remote URI if any for @attachment.
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 * Returns: (nullable): The remote URI for @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 const gchar *purple_attachment_get_remote_uri(PurpleAttachment *attachment);
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_set_remote_uri:
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 * @remote_uri: The new remote URI.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 * Sets the remote URI of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169 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
170
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 * purple_attachment_get_size:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 * @attachment: The #PurpleAttachment instance.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 * Gets the 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 * Returns: The size of @attachment.
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 guint64 purple_attachment_get_size(PurpleAttachment *attachment);
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_set_size:
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 * @size: The new size of @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188 * Sets the size of @attachment to @size.
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 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 */
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
192 void purple_attachment_set_size(PurpleAttachment *attachment, guint64 size);
40526
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 /**
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195 * purple_attachment_get_filename:
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 * @attachment: The #PurpleAttachment instance.
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 * 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
199 * 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
200 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
201 * Returns: (transfer full): The filename for @attachment.
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202 *
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
203 * Since: 3.0.0
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 */
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
205 gchar *purple_attachment_get_filename(PurpleAttachment *attachment);
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
207 G_END_DECLS
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208
c8cc1a4c4a02 Add support for message attachments
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209 #endif /* PURPLE_ATTACHMENT_H */

mercurial