Tue, 04 Aug 2009 04:03:41 +0000
merge of '5cc8bb002fd80dded75fbe9e34ae56a95033d295'
and 'afcf938f83caa730df0ff19a8bb92f14f88c9d0e'
| 4514 | 1 | /** |
|
7820
06fc9f66d2cb
[gaim-migrate @ 8472]
Mark Doliner <markdoliner@pidgin.im>
parents:
7805
diff
changeset
|
2 | * @file ft.h File Transfer API |
|
5034
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4675
diff
changeset
|
3 | * @ingroup core |
|
20889
3d0ef192f98c
All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
4 | * @see @ref xfer-signals |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
7 | /* purple |
| 4514 | 8 | * |
| 15884 | 9 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 10 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 11 | * source distribution. | |
| 8231 | 12 | * |
| 4514 | 13 | * This program is free software; you can redistribute it and/or modify |
| 14 | * it under the terms of the GNU General Public License as published by | |
| 15 | * the Free Software Foundation; either version 2 of the License, or | |
| 16 | * (at your option) any later version. | |
| 17 | * | |
| 18 | * This program is distributed in the hope that it will be useful, | |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 21 | * GNU General Public License for more details. | |
| 22 | * | |
| 23 | * You should have received a copy of the GNU General Public License | |
| 24 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17852
diff
changeset
|
25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 4514 | 26 | */ |
| 15884 | 27 | #ifndef _PURPLE_FT_H_ |
| 28 | #define _PURPLE_FT_H_ | |
| 4514 | 29 | |
| 30 | /**************************************************************************/ | |
| 31 | /** Data Structures */ | |
| 32 | /**************************************************************************/ | |
| 15884 | 33 | typedef struct _PurpleXfer PurpleXfer; |
| 4514 | 34 | |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
35 | #include <glib.h> |
|
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
36 | #include <stdio.h> |
|
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
37 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
38 | #include "account.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
39 | |
| 4514 | 40 | /** |
| 41 | * Types of file transfers. | |
| 42 | */ | |
| 43 | typedef enum | |
| 44 | { | |
| 15884 | 45 | PURPLE_XFER_UNKNOWN = 0, /**< Unknown file transfer type. */ |
| 46 | PURPLE_XFER_SEND, /**< File sending. */ | |
| 47 | PURPLE_XFER_RECEIVE /**< File receiving. */ | |
| 4514 | 48 | |
| 15884 | 49 | } PurpleXferType; |
| 4514 | 50 | |
| 7805 | 51 | /** |
| 52 | * The different states of the xfer. | |
| 53 | */ | |
| 7738 | 54 | typedef enum |
| 55 | { | |
| 15884 | 56 | PURPLE_XFER_STATUS_UNKNOWN = 0, /**< Unknown, the xfer may be null. */ |
| 57 | PURPLE_XFER_STATUS_NOT_STARTED, /**< It hasn't started yet. */ | |
| 58 | PURPLE_XFER_STATUS_ACCEPTED, /**< Receive accepted, but destination file not selected yet */ | |
| 59 | PURPLE_XFER_STATUS_STARTED, /**< purple_xfer_start has been called. */ | |
| 60 | PURPLE_XFER_STATUS_DONE, /**< The xfer completed successfully. */ | |
| 61 | PURPLE_XFER_STATUS_CANCEL_LOCAL, /**< The xfer was canceled by us. */ | |
| 62 | PURPLE_XFER_STATUS_CANCEL_REMOTE /**< The xfer was canceled by the other end, or we couldn't connect. */ | |
| 63 | } PurpleXferStatusType; | |
| 7738 | 64 | |
| 4514 | 65 | /** |
| 66 | * File transfer UI operations. | |
| 67 | * | |
| 68 | * Any UI representing a file transfer must assign a filled-out | |
| 15884 | 69 | * PurpleXferUiOps structure to the purple_xfer. |
| 4514 | 70 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
71 | typedef struct |
| 4514 | 72 | { |
| 15884 | 73 | void (*new_xfer)(PurpleXfer *xfer); |
| 74 | void (*destroy)(PurpleXfer *xfer); | |
| 75 | void (*add_xfer)(PurpleXfer *xfer); | |
| 76 | void (*update_progress)(PurpleXfer *xfer, double percent); | |
| 77 | void (*cancel_local)(PurpleXfer *xfer); | |
| 78 | void (*cancel_remote)(PurpleXfer *xfer); | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
79 | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
80 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
81 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
82 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
83 | void (*_purple_reserved4)(void); |
| 15884 | 84 | } PurpleXferUiOps; |
| 4514 | 85 | |
| 86 | /** | |
| 87 | * A core representation of a file transfer. | |
| 88 | */ | |
| 15884 | 89 | struct _PurpleXfer |
| 4514 | 90 | { |
|
15280
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
91 | guint ref; /**< The reference count. */ |
| 15884 | 92 | PurpleXferType type; /**< The type of transfer. */ |
| 4514 | 93 | |
| 15884 | 94 | PurpleAccount *account; /**< The account. */ |
| 4514 | 95 | |
| 96 | char *who; /**< The person on the other end of the | |
| 97 | transfer. */ | |
| 98 | ||
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
99 | char *message; /**< A message sent with the request */ |
|
4605
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
100 | char *filename; /**< The name sent over the network. */ |
|
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
101 | char *local_filename; /**< The name on the local hard drive. */ |
| 4514 | 102 | size_t size; /**< The size of the file. */ |
| 103 | ||
| 104 | FILE *dest_fp; /**< The destination file pointer. */ | |
| 105 | ||
| 106 | char *remote_ip; /**< The remote IP address. */ | |
| 107 | int local_port; /**< The local port. */ | |
| 108 | int remote_port; /**< The remote port. */ | |
| 109 | ||
| 110 | int fd; /**< The socket file descriptor. */ | |
| 111 | int watcher; /**< Watcher. */ | |
| 112 | ||
| 113 | size_t bytes_sent; /**< The number of bytes sent. */ | |
| 114 | size_t bytes_remaining; /**< The number of bytes remaining. */ | |
|
13599
b6369e541654
[gaim-migrate @ 15984]
Mark Doliner <markdoliner@pidgin.im>
parents:
13009
diff
changeset
|
115 | time_t start_time; /**< When the transfer of data began. */ |
|
b6369e541654
[gaim-migrate @ 15984]
Mark Doliner <markdoliner@pidgin.im>
parents:
13009
diff
changeset
|
116 | time_t end_time; /**< When the transfer of data ended. */ |
| 4514 | 117 | |
|
15280
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
118 | size_t current_buffer_size; /**< This gradually increases for fast |
|
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
119 | network connections. */ |
|
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
120 | |
| 15884 | 121 | PurpleXferStatusType status; /**< File Transfer's status. */ |
| 4538 | 122 | |
| 4514 | 123 | /* I/O operations. */ |
| 124 | struct | |
| 125 | { | |
| 15884 | 126 | void (*init)(PurpleXfer *xfer); |
| 127 | void (*request_denied)(PurpleXfer *xfer); | |
| 128 | void (*start)(PurpleXfer *xfer); | |
| 129 | void (*end)(PurpleXfer *xfer); | |
| 130 | void (*cancel_send)(PurpleXfer *xfer); | |
| 131 | void (*cancel_recv)(PurpleXfer *xfer); | |
| 132 | gssize (*read)(guchar **buffer, PurpleXfer *xfer); | |
| 133 | gssize (*write)(const guchar *buffer, size_t size, PurpleXfer *xfer); | |
| 134 | void (*ack)(PurpleXfer *xfer, const guchar *buffer, size_t size); | |
| 4514 | 135 | |
| 136 | } ops; | |
| 137 | ||
| 15884 | 138 | PurpleXferUiOps *ui_ops; /**< UI-specific operations. */ |
| 4514 | 139 | void *ui_data; /**< UI-specific data. */ |
| 140 | ||
| 141 | void *data; /**< prpl-specific data. */ | |
| 142 | }; | |
| 143 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
144 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
145 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
146 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
147 | |
| 4514 | 148 | /**************************************************************************/ |
| 149 | /** @name File Transfer API */ | |
| 150 | /**************************************************************************/ | |
| 151 | /*@{*/ | |
| 152 | ||
| 153 | /** | |
| 154 | * Creates a new file transfer handle. | |
| 7805 | 155 | * This is called by prpls. |
| 156 | * The handle starts with a ref count of 1, and this reference | |
| 157 | * is owned by the core. The prpl normally does not need to | |
| 15884 | 158 | * purple_xfer_ref or unref. |
| 4514 | 159 | * |
| 160 | * @param account The account sending or receiving the file. | |
| 161 | * @param type The type of file transfer. | |
| 162 | * @param who The name of the remote user. | |
| 163 | * | |
| 164 | * @return A file transfer handle. | |
| 165 | */ | |
| 15884 | 166 | PurpleXfer *purple_xfer_new(PurpleAccount *account, |
| 167 | PurpleXferType type, const char *who); | |
| 4514 | 168 | |
| 169 | /** | |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
170 | * Returns all xfers |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
171 | * |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
172 | * @return all current xfers with refs |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
173 | */ |
| 15884 | 174 | GList *purple_xfers_get_all(void); |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
175 | |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
176 | /** |
| 15884 | 177 | * Increases the reference count on a PurpleXfer. |
| 178 | * Please call purple_xfer_unref later. | |
| 4514 | 179 | * |
| 7805 | 180 | * @param xfer A file transfer handle. |
| 4514 | 181 | */ |
| 15884 | 182 | void purple_xfer_ref(PurpleXfer *xfer); |
| 7805 | 183 | |
| 184 | /** | |
| 15884 | 185 | * Decreases the reference count on a PurpleXfer. |
| 186 | * If the reference reaches 0, purple_xfer_destroy (an internal function) | |
| 7805 | 187 | * will destroy the xfer. It calls the ui destroy cb first. |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8585
diff
changeset
|
188 | * Since the core keeps a ref on the xfer, only an erroneous call to |
| 7805 | 189 | * this function will destroy the xfer while still in use. |
| 190 | * | |
| 191 | * @param xfer A file transfer handle. | |
| 192 | */ | |
| 15884 | 193 | void purple_xfer_unref(PurpleXfer *xfer); |
| 4514 | 194 | |
| 195 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
196 | * Requests confirmation for a file transfer from the user. If receiving |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
197 | * a file which is known at this point, this requests user to accept and |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
198 | * save the file. If the filename is unknown (not set) this only requests user |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
199 | * to accept the file transfer. In this case protocol must call this function |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
200 | * again once the filename is available. |
| 4514 | 201 | * |
| 202 | * @param xfer The file transfer to request confirmation on. | |
| 203 | */ | |
| 15884 | 204 | void purple_xfer_request(PurpleXfer *xfer); |
| 4514 | 205 | |
| 206 | /** | |
| 207 | * Called if the user accepts the file transfer request. | |
| 208 | * | |
| 209 | * @param xfer The file transfer. | |
| 210 | * @param filename The filename. | |
| 211 | */ | |
| 15884 | 212 | void purple_xfer_request_accepted(PurpleXfer *xfer, const char *filename); |
| 4514 | 213 | |
| 214 | /** | |
| 215 | * Called if the user rejects the file transfer request. | |
| 216 | * | |
| 217 | * @param xfer The file transfer. | |
| 218 | */ | |
| 15884 | 219 | void purple_xfer_request_denied(PurpleXfer *xfer); |
| 4514 | 220 | |
| 221 | /** | |
| 222 | * Returns the type of file transfer. | |
| 223 | * | |
| 224 | * @param xfer The file transfer. | |
| 225 | * | |
| 226 | * @return The type of the file transfer. | |
| 227 | */ | |
| 15884 | 228 | PurpleXferType purple_xfer_get_type(const PurpleXfer *xfer); |
| 4514 | 229 | |
| 230 | /** | |
| 231 | * Returns the account the file transfer is using. | |
| 232 | * | |
| 233 | * @param xfer The file transfer. | |
| 234 | * | |
| 235 | * @return The account. | |
| 236 | */ | |
| 15884 | 237 | PurpleAccount *purple_xfer_get_account(const PurpleXfer *xfer); |
| 4514 | 238 | |
| 239 | /** | |
|
17852
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
240 | * Returns the name of the remote user. |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
241 | * |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
242 | * @param xfer The file transfer. |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
243 | * |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
244 | * @return The name of the remote user. |
|
20940
925d3d68b3af
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20889
diff
changeset
|
245 | * |
|
925d3d68b3af
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20889
diff
changeset
|
246 | * @since 2.1.0 |
|
17852
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
247 | */ |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
248 | const char *purple_xfer_get_remote_user(const PurpleXfer *xfer); |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
249 | |
|
174c0d122a79
Add new function purple_xfer_get_remote_user.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
250 | /** |
| 7805 | 251 | * Returns the status of the xfer. |
| 252 | * | |
| 253 | * @param xfer The file transfer. | |
| 254 | * | |
| 255 | * @return The status. | |
| 256 | */ | |
| 15884 | 257 | PurpleXferStatusType purple_xfer_get_status(const PurpleXfer *xfer); |
| 7805 | 258 | |
| 259 | /** | |
| 7738 | 260 | * Returns true if the file transfer was canceled. |
| 261 | * | |
| 262 | * @param xfer The file transfer. | |
| 263 | * | |
| 264 | * @return Whether or not the transfer was canceled. | |
| 265 | */ | |
| 15884 | 266 | gboolean purple_xfer_is_canceled(const PurpleXfer *xfer); |
| 7738 | 267 | |
| 268 | /** | |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
269 | * Returns the completed state for a file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
270 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
271 | * @param xfer The file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
272 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
273 | * @return The completed state. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
274 | */ |
| 15884 | 275 | gboolean purple_xfer_is_completed(const PurpleXfer *xfer); |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
276 | |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
277 | /** |
| 4514 | 278 | * Returns the name of the file being sent or received. |
| 279 | * | |
| 280 | * @param xfer The file transfer. | |
| 281 | * | |
| 282 | * @return The filename. | |
| 283 | */ | |
| 15884 | 284 | const char *purple_xfer_get_filename(const PurpleXfer *xfer); |
| 4514 | 285 | |
| 286 | /** | |
| 287 | * Returns the file's destination filename, | |
| 288 | * | |
| 289 | * @param xfer The file transfer. | |
| 290 | * | |
| 291 | * @return The destination filename. | |
| 292 | */ | |
| 15884 | 293 | const char *purple_xfer_get_local_filename(const PurpleXfer *xfer); |
| 4514 | 294 | |
| 295 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
296 | * Returns the number of bytes sent (or received) so far. |
| 4514 | 297 | * |
| 298 | * @param xfer The file transfer. | |
| 299 | * | |
| 300 | * @return The number of bytes sent. | |
| 301 | */ | |
| 15884 | 302 | size_t purple_xfer_get_bytes_sent(const PurpleXfer *xfer); |
| 4514 | 303 | |
| 304 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
305 | * Returns the number of bytes remaining to send or receive. |
| 4514 | 306 | * |
| 307 | * @param xfer The file transfer. | |
| 308 | * | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
309 | * @return The number of bytes remaining. |
| 4514 | 310 | */ |
| 15884 | 311 | size_t purple_xfer_get_bytes_remaining(const PurpleXfer *xfer); |
| 4514 | 312 | |
| 313 | /** | |
| 314 | * Returns the size of the file being sent or received. | |
| 315 | * | |
| 316 | * @param xfer The file transfer. | |
| 7805 | 317 | * |
| 4514 | 318 | * @return The total size of the file. |
| 319 | */ | |
| 15884 | 320 | size_t purple_xfer_get_size(const PurpleXfer *xfer); |
| 4514 | 321 | |
| 322 | /** | |
| 323 | * Returns the current percentage of progress of the transfer. | |
| 324 | * | |
| 325 | * This is a number between 0 (0%) and 1 (100%). | |
| 326 | * | |
| 327 | * @param xfer The file transfer. | |
| 328 | * | |
| 329 | * @return The percentage complete. | |
| 330 | */ | |
| 15884 | 331 | double purple_xfer_get_progress(const PurpleXfer *xfer); |
| 4514 | 332 | |
| 333 | /** | |
| 334 | * Returns the local port number in the file transfer. | |
| 335 | * | |
| 336 | * @param xfer The file transfer. | |
| 337 | * | |
| 338 | * @return The port number on this end. | |
| 339 | */ | |
| 15884 | 340 | unsigned int purple_xfer_get_local_port(const PurpleXfer *xfer); |
| 4514 | 341 | |
| 342 | /** | |
| 343 | * Returns the remote IP address in the file transfer. | |
| 344 | * | |
| 345 | * @param xfer The file transfer. | |
| 346 | * | |
| 347 | * @return The IP address on the other end. | |
| 348 | */ | |
| 15884 | 349 | const char *purple_xfer_get_remote_ip(const PurpleXfer *xfer); |
| 4514 | 350 | |
| 351 | /** | |
| 352 | * Returns the remote port number in the file transfer. | |
| 353 | * | |
| 354 | * @param xfer The file transfer. | |
| 355 | * | |
| 356 | * @return The port number on the other end. | |
| 357 | */ | |
| 15884 | 358 | unsigned int purple_xfer_get_remote_port(const PurpleXfer *xfer); |
| 4514 | 359 | |
| 360 | /** | |
|
22338
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
361 | * Returns the time the transfer of a file started. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
362 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
363 | * @param xfer The file transfer. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
364 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
365 | * @return The time when the transfer started. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
366 | * @since 2.4.0 |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
367 | */ |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
368 | time_t purple_xfer_get_start_time(const PurpleXfer *xfer); |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
369 | |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
370 | /** |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
371 | * Returns the time the transfer of a file ended. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
372 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
373 | * @param xfer The file transfer. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
374 | * |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
375 | * @return The time when the transfer ended. |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
376 | * @since 2.4.0 |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
377 | */ |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
378 | time_t purple_xfer_get_end_time(const PurpleXfer *xfer); |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
379 | |
|
d6a489105624
Add accessor and update finch to not touch the internals of PurpleXfer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20940
diff
changeset
|
380 | /** |
| 4538 | 381 | * Sets the completed state for the file transfer. |
| 382 | * | |
| 383 | * @param xfer The file transfer. | |
| 384 | * @param completed The completed state. | |
| 385 | */ | |
| 15884 | 386 | void purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed); |
| 4538 | 387 | |
| 388 | /** | |
| 4514 | 389 | * Sets the filename for the file transfer. |
| 390 | * | |
| 391 | * @param xfer The file transfer. | |
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
392 | * @param message The message. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
393 | */ |
| 15884 | 394 | void purple_xfer_set_message(PurpleXfer *xfer, const char *message); |
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
395 | |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
396 | /** |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
397 | * Sets the filename for the file transfer. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
398 | * |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
399 | * @param xfer The file transfer. |
| 4514 | 400 | * @param filename The filename. |
| 401 | */ | |
| 15884 | 402 | void purple_xfer_set_filename(PurpleXfer *xfer, const char *filename); |
| 4514 | 403 | |
| 404 | /** | |
|
4605
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
405 | * Sets the local filename for the file transfer. |
| 4514 | 406 | * |
| 407 | * @param xfer The file transfer. | |
| 408 | * @param filename The filename | |
| 409 | */ | |
| 15884 | 410 | void purple_xfer_set_local_filename(PurpleXfer *xfer, const char *filename); |
| 4514 | 411 | |
| 412 | /** | |
| 413 | * Sets the size of the file in a file transfer. | |
| 414 | * | |
| 415 | * @param xfer The file transfer. | |
| 416 | * @param size The size of the file. | |
| 417 | */ | |
| 15884 | 418 | void purple_xfer_set_size(PurpleXfer *xfer, size_t size); |
| 4514 | 419 | |
| 420 | /** | |
|
15322
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
421 | * Sets the current working position in the active file transfer. This |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
422 | * can be used to jump backward in the file if the protocol detects |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
423 | * that some bit of data needs to be resent or has been sent twice. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
424 | * |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
425 | * It's used for pausing and resuming an oscar file transfer. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
426 | * |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
427 | * @param xfer The file transfer. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
428 | * @param bytes_sent The new current position in the file. If we're |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
429 | * sending a file then this is the byte that we will |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
430 | * send. If we're receiving a file, this is the |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
431 | * next byte that we expect to receive. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
432 | */ |
| 15884 | 433 | void purple_xfer_set_bytes_sent(PurpleXfer *xfer, size_t bytes_sent); |
|
15322
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
434 | |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
435 | /** |
| 4514 | 436 | * Returns the UI operations structure for a file transfer. |
| 437 | * | |
| 438 | * @param xfer The file transfer. | |
| 439 | * | |
| 440 | * @return The UI operations structure. | |
| 441 | */ | |
| 15884 | 442 | PurpleXferUiOps *purple_xfer_get_ui_ops(const PurpleXfer *xfer); |
| 4514 | 443 | |
| 444 | /** | |
| 445 | * Sets the read function for the file transfer. | |
| 446 | * | |
| 447 | * @param xfer The file transfer. | |
| 448 | * @param fnc The read function. | |
| 449 | */ | |
| 15884 | 450 | void purple_xfer_set_read_fnc(PurpleXfer *xfer, |
| 451 | gssize (*fnc)(guchar **, PurpleXfer *)); | |
| 4514 | 452 | |
| 453 | /** | |
| 454 | * Sets the write function for the file transfer. | |
| 455 | * | |
| 456 | * @param xfer The file transfer. | |
| 457 | * @param fnc The write function. | |
| 458 | */ | |
| 15884 | 459 | void purple_xfer_set_write_fnc(PurpleXfer *xfer, |
| 460 | gssize (*fnc)(const guchar *, size_t, PurpleXfer *)); | |
| 4514 | 461 | |
| 462 | /** | |
| 463 | * Sets the acknowledge function for the file transfer. | |
| 464 | * | |
| 465 | * @param xfer The file transfer. | |
| 466 | * @param fnc The acknowledge function. | |
| 467 | */ | |
| 15884 | 468 | void purple_xfer_set_ack_fnc(PurpleXfer *xfer, |
| 469 | void (*fnc)(PurpleXfer *, const guchar *, size_t)); | |
| 4514 | 470 | |
| 471 | /** | |
| 7805 | 472 | * Sets the function to be called if the request is denied. |
| 473 | * | |
| 474 | * @param xfer The file transfer. | |
| 475 | * @param fnc The request denied prpl callback. | |
| 476 | */ | |
| 15884 | 477 | void purple_xfer_set_request_denied_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 7805 | 478 | |
| 479 | /** | |
| 4514 | 480 | * Sets the transfer initialization function for the file transfer. |
| 481 | * | |
| 15884 | 482 | * This function is required, and must call purple_xfer_start() with |
| 4514 | 483 | * the necessary parameters. This will be called if the file transfer |
| 484 | * is accepted by the user. | |
| 485 | * | |
| 486 | * @param xfer The file transfer. | |
| 487 | * @param fnc The transfer initialization function. | |
| 488 | */ | |
| 15884 | 489 | void purple_xfer_set_init_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 4514 | 490 | |
| 491 | /** | |
| 492 | * Sets the start transfer function for the file transfer. | |
| 493 | * | |
| 494 | * @param xfer The file transfer. | |
| 495 | * @param fnc The start transfer function. | |
| 496 | */ | |
| 15884 | 497 | void purple_xfer_set_start_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 4514 | 498 | |
| 499 | /** | |
| 500 | * Sets the end transfer function for the file transfer. | |
| 501 | * | |
| 502 | * @param xfer The file transfer. | |
| 503 | * @param fnc The end transfer function. | |
| 504 | */ | |
| 15884 | 505 | void purple_xfer_set_end_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 4514 | 506 | |
| 507 | /** | |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
508 | * Sets the cancel send function for the file transfer. |
| 4514 | 509 | * |
| 510 | * @param xfer The file transfer. | |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
511 | * @param fnc The cancel send function. |
| 4514 | 512 | */ |
| 15884 | 513 | void purple_xfer_set_cancel_send_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
514 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
515 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
516 | * Sets the cancel receive function for the file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
517 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
518 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
519 | * @param fnc The cancel receive function. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
520 | */ |
| 15884 | 521 | void purple_xfer_set_cancel_recv_fnc(PurpleXfer *xfer, void (*fnc)(PurpleXfer *)); |
| 4514 | 522 | |
| 523 | /** | |
| 524 | * Reads in data from a file transfer stream. | |
| 525 | * | |
| 526 | * @param xfer The file transfer. | |
| 527 | * @param buffer The buffer that will be created to contain the data. | |
| 528 | * | |
| 8231 | 529 | * @return The number of bytes read, or -1. |
| 4514 | 530 | */ |
| 15884 | 531 | gssize purple_xfer_read(PurpleXfer *xfer, guchar **buffer); |
| 4514 | 532 | |
| 533 | /** | |
| 534 | * Writes data to a file transfer stream. | |
| 535 | * | |
| 536 | * @param xfer The file transfer. | |
| 537 | * @param buffer The buffer to read the data from. | |
| 538 | * @param size The number of bytes to write. | |
| 539 | * | |
| 8231 | 540 | * @return The number of bytes written, or -1. |
| 4514 | 541 | */ |
| 15884 | 542 | gssize purple_xfer_write(PurpleXfer *xfer, const guchar *buffer, gsize size); |
| 4514 | 543 | |
| 544 | /** | |
| 545 | * Starts a file transfer. | |
| 546 | * | |
| 547 | * Either @a fd must be specified <i>or</i> @a ip and @a port on a | |
| 548 | * file receive transfer. On send, @a fd must be specified, and | |
| 549 | * @a ip and @a port are ignored. | |
| 550 | * | |
| 551 | * @param xfer The file transfer. | |
| 552 | * @param fd The file descriptor for the socket. | |
| 553 | * @param ip The IP address to connect to. | |
| 554 | * @param port The port to connect to. | |
| 555 | */ | |
| 15884 | 556 | void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, |
| 4514 | 557 | unsigned int port); |
| 558 | ||
| 559 | /** | |
| 560 | * Ends a file transfer. | |
| 561 | * | |
| 562 | * @param xfer The file transfer. | |
| 563 | */ | |
| 15884 | 564 | void purple_xfer_end(PurpleXfer *xfer); |
| 4514 | 565 | |
| 566 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
567 | * Adds a new file transfer to the list of file transfers. Call this only |
| 15884 | 568 | * if you are not using purple_xfer_start. |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
569 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
570 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
571 | */ |
| 15884 | 572 | void purple_xfer_add(PurpleXfer *xfer); |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
573 | |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
574 | /** |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
575 | * Cancels a file transfer on the local end. |
| 4514 | 576 | * |
| 577 | * @param xfer The file transfer. | |
| 578 | */ | |
| 15884 | 579 | void purple_xfer_cancel_local(PurpleXfer *xfer); |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
580 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
581 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
582 | * Cancels a file transfer from the remote end. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
583 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
584 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
585 | */ |
| 15884 | 586 | void purple_xfer_cancel_remote(PurpleXfer *xfer); |
| 4514 | 587 | |
| 588 | /** | |
| 589 | * Displays a file transfer-related error message. | |
| 590 | * | |
| 15884 | 591 | * This is a wrapper around purple_notify_error(), which automatically |
| 10654 | 592 | * specifies a title ("File transfer to <i>user</i> failed" or |
| 593 | * "File Transfer from <i>user</i> failed"). | |
| 4514 | 594 | * |
| 10654 | 595 | * @param type The type of file transfer. |
| 596 | * @param account The account sending or receiving the file. | |
| 597 | * @param who The user on the other end of the transfer. | |
| 598 | * @param msg The message to display. | |
| 4514 | 599 | */ |
| 15884 | 600 | void purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, const char *msg); |
| 4514 | 601 | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
602 | /** |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
603 | * Updates file transfer progress. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
604 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
605 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
606 | */ |
| 15884 | 607 | void purple_xfer_update_progress(PurpleXfer *xfer); |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
608 | |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
609 | /** |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
610 | * Displays a file transfer-related message in the conversation window |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
611 | * |
| 15884 | 612 | * This is a wrapper around purple_conversation_write |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
613 | * |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
614 | * @param xfer The file transfer to which this message relates. |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
615 | * @param message The message to display. |
|
11129
c986d8566843
[gaim-migrate @ 13185]
Mark Doliner <markdoliner@pidgin.im>
parents:
11084
diff
changeset
|
616 | * @param is_error Is this an error message?. |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
617 | */ |
| 15884 | 618 | void purple_xfer_conversation_write(PurpleXfer *xfer, char *message, gboolean is_error); |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
619 | |
|
6263
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
620 | /*@}*/ |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
621 | |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
622 | /**************************************************************************/ |
| 4514 | 623 | /** @name UI Registration Functions */ |
| 624 | /**************************************************************************/ | |
| 625 | /*@{*/ | |
| 626 | ||
| 627 | /** | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
628 | * Returns the handle to the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
629 | * |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
630 | * @return The handle |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
631 | */ |
| 15884 | 632 | void *purple_xfers_get_handle(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
633 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
634 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
635 | * Initializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
636 | */ |
| 15884 | 637 | void purple_xfers_init(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
638 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
639 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
640 | * Uninitializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
641 | */ |
| 15884 | 642 | void purple_xfers_uninit(void); |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
643 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
644 | /** |
| 15884 | 645 | * Sets the UI operations structure to be used in all purple file transfers. |
| 4514 | 646 | * |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6269
diff
changeset
|
647 | * @param ops The UI operations structure. |
| 4514 | 648 | */ |
| 15884 | 649 | void purple_xfers_set_ui_ops(PurpleXferUiOps *ops); |
| 4514 | 650 | |
| 651 | /** | |
| 15884 | 652 | * Returns the UI operations structure to be used in all purple file transfers. |
| 4514 | 653 | * |
| 654 | * @return The UI operations structure. | |
| 655 | */ | |
| 15884 | 656 | PurpleXferUiOps *purple_xfers_get_ui_ops(void); |
| 4514 | 657 | |
| 658 | /*@}*/ | |
| 659 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
660 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
661 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
662 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
663 | |
| 15884 | 664 | #endif /* _PURPLE_FT_H_ */ |