Wed, 13 Dec 2006 10:11:31 +0000
[gaim-migrate @ 17983]
Move away from using MSG_PEEK when recv'ing data over oscar sockets.
It's possible this was causing problems with a small number of
Windows users? People seem to frown pretty heavily upon MSG_PEEK
in general, for some reason.
| 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 |
| 4514 | 4 | * |
| 5 | * gaim | |
| 6 | * | |
| 8046 | 7 | * Gaim is the legal property of its developers, whose names are too numerous |
| 8 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 | * source distribution. | |
| 8231 | 10 | * |
| 4514 | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
|
15000
7ffcbf905ded
[gaim-migrate @ 17710]
Daniel Atallah <datallah@pidgin.im>
parents:
14254
diff
changeset
|
24 | * |
|
7ffcbf905ded
[gaim-migrate @ 17710]
Daniel Atallah <datallah@pidgin.im>
parents:
14254
diff
changeset
|
25 | * @see @ref xfer-signals |
| 4514 | 26 | */ |
| 27 | #ifndef _GAIM_FT_H_ | |
| 28 | #define _GAIM_FT_H_ | |
| 29 | ||
| 30 | /**************************************************************************/ | |
| 31 | /** Data Structures */ | |
| 32 | /**************************************************************************/ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
33 | typedef struct _GaimXfer GaimXfer; |
| 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 | { | |
| 45 | GAIM_XFER_UNKNOWN = 0, /**< Unknown file transfer type. */ | |
| 46 | GAIM_XFER_SEND, /**< File sending. */ | |
| 47 | GAIM_XFER_RECEIVE /**< File receiving. */ | |
| 48 | ||
| 49 | } GaimXferType; | |
| 50 | ||
| 7805 | 51 | /** |
| 52 | * The different states of the xfer. | |
| 53 | */ | |
| 7738 | 54 | typedef enum |
| 55 | { | |
| 7805 | 56 | GAIM_XFER_STATUS_UNKNOWN = 0, /**< Unknown, the xfer may be null. */ |
| 57 | GAIM_XFER_STATUS_NOT_STARTED, /**< It hasn't started yet. */ | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
58 | GAIM_XFER_STATUS_ACCEPTED, /**< Receive accepted, but destination file not selected yet */ |
| 7805 | 59 | GAIM_XFER_STATUS_STARTED, /**< gaim_xfer_start has been called. */ |
| 60 | GAIM_XFER_STATUS_DONE, /**< The xfer completed successfully. */ | |
| 61 | GAIM_XFER_STATUS_CANCEL_LOCAL, /**< The xfer was canceled by us. */ | |
|
7887
4b2925a88897
[gaim-migrate @ 8545]
Mark Doliner <markdoliner@pidgin.im>
parents:
7820
diff
changeset
|
62 | GAIM_XFER_STATUS_CANCEL_REMOTE /**< The xfer was canceled by the other end, or we couldn't connect. */ |
| 7805 | 63 | } GaimXferStatusType; |
| 7738 | 64 | |
| 4514 | 65 | /** |
| 66 | * File transfer UI operations. | |
| 67 | * | |
| 68 | * Any UI representing a file transfer must assign a filled-out | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
69 | * GaimXferUiOps structure to the gaim_xfer. |
| 4514 | 70 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
71 | typedef struct |
| 4514 | 72 | { |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
73 | void (*new_xfer)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
74 | void (*destroy)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
75 | void (*add_xfer)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
76 | void (*update_progress)(GaimXfer *xfer, double percent); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
77 | void (*cancel_local)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
78 | void (*cancel_remote)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
79 | |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
80 | } GaimXferUiOps; |
| 4514 | 81 | |
| 82 | /** | |
| 83 | * A core representation of a file transfer. | |
| 84 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
85 | struct _GaimXfer |
| 4514 | 86 | { |
|
7887
4b2925a88897
[gaim-migrate @ 8545]
Mark Doliner <markdoliner@pidgin.im>
parents:
7820
diff
changeset
|
87 | guint ref; /**< The reference count. */ |
| 4514 | 88 | GaimXferType type; /**< The type of transfer. */ |
| 89 | ||
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
90 | GaimAccount *account; /**< The account. */ |
| 4514 | 91 | |
| 92 | char *who; /**< The person on the other end of the | |
| 93 | transfer. */ | |
| 94 | ||
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
95 | char *message; /**< A message sent with the request */ |
|
4605
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
96 | char *filename; /**< The name sent over the network. */ |
|
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
97 | char *local_filename; /**< The name on the local hard drive. */ |
| 4514 | 98 | size_t size; /**< The size of the file. */ |
| 99 | ||
| 100 | FILE *dest_fp; /**< The destination file pointer. */ | |
| 101 | ||
| 102 | char *remote_ip; /**< The remote IP address. */ | |
| 103 | int local_port; /**< The local port. */ | |
| 104 | int remote_port; /**< The remote port. */ | |
| 105 | ||
| 106 | int fd; /**< The socket file descriptor. */ | |
| 107 | int watcher; /**< Watcher. */ | |
| 108 | ||
| 109 | size_t bytes_sent; /**< The number of bytes sent. */ | |
| 110 | size_t bytes_remaining; /**< The number of bytes remaining. */ | |
|
13599
b6369e541654
[gaim-migrate @ 15984]
Mark Doliner <markdoliner@pidgin.im>
parents:
13009
diff
changeset
|
111 | time_t start_time; /**< When the transfer of data began. */ |
|
b6369e541654
[gaim-migrate @ 15984]
Mark Doliner <markdoliner@pidgin.im>
parents:
13009
diff
changeset
|
112 | time_t end_time; /**< When the transfer of data ended. */ |
| 4514 | 113 | |
| 7805 | 114 | GaimXferStatusType status; /**< File Transfer's status. */ |
| 4538 | 115 | |
| 4514 | 116 | /* I/O operations. */ |
| 117 | struct | |
| 118 | { | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
119 | void (*init)(GaimXfer *xfer); |
| 7805 | 120 | void (*request_denied)(GaimXfer *xfer); |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
121 | void (*start)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
122 | void (*end)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
123 | void (*cancel_send)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
124 | void (*cancel_recv)(GaimXfer *xfer); |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
125 | gssize (*read)(guchar **buffer, GaimXfer *xfer); |
|
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
126 | gssize (*write)(const guchar *buffer, size_t size, GaimXfer *xfer); |
|
11159
76ef02141bcb
[gaim-migrate @ 13246]
Mark Doliner <markdoliner@pidgin.im>
parents:
11129
diff
changeset
|
127 | void (*ack)(GaimXfer *xfer, const guchar *buffer, size_t size); |
| 4514 | 128 | |
| 129 | } ops; | |
| 130 | ||
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
131 | GaimXferUiOps *ui_ops; /**< UI-specific operations. */ |
| 4514 | 132 | void *ui_data; /**< UI-specific data. */ |
| 133 | ||
| 134 | void *data; /**< prpl-specific data. */ | |
| 135 | }; | |
| 136 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
137 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
138 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
139 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
140 | |
| 4514 | 141 | /**************************************************************************/ |
| 142 | /** @name File Transfer API */ | |
| 143 | /**************************************************************************/ | |
| 144 | /*@{*/ | |
| 145 | ||
| 146 | /** | |
| 147 | * Creates a new file transfer handle. | |
| 7805 | 148 | * This is called by prpls. |
| 149 | * The handle starts with a ref count of 1, and this reference | |
| 150 | * is owned by the core. The prpl normally does not need to | |
| 151 | * gaim_xfer_ref or unref. | |
| 4514 | 152 | * |
| 153 | * @param account The account sending or receiving the file. | |
| 154 | * @param type The type of file transfer. | |
| 155 | * @param who The name of the remote user. | |
| 156 | * | |
| 157 | * @return A file transfer handle. | |
| 158 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
159 | GaimXfer *gaim_xfer_new(GaimAccount *account, |
| 4514 | 160 | GaimXferType type, const char *who); |
| 161 | ||
| 162 | /** | |
| 7805 | 163 | * Increases the reference count on a GaimXfer. |
| 164 | * Please call gaim_xfer_unref later. | |
| 4514 | 165 | * |
| 7805 | 166 | * @param xfer A file transfer handle. |
| 4514 | 167 | */ |
| 7805 | 168 | void gaim_xfer_ref(GaimXfer *xfer); |
| 169 | ||
| 170 | /** | |
| 171 | * Decreases the reference count on a GaimXfer. | |
| 172 | * If the reference reaches 0, gaim_xfer_destroy (an internal function) | |
| 173 | * 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
|
174 | * Since the core keeps a ref on the xfer, only an erroneous call to |
| 7805 | 175 | * this function will destroy the xfer while still in use. |
| 176 | * | |
| 177 | * @param xfer A file transfer handle. | |
| 178 | */ | |
| 179 | void gaim_xfer_unref(GaimXfer *xfer); | |
| 4514 | 180 | |
| 181 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
182 | * Requests confirmation for a file transfer from the user. If receiving |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
183 | * 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
|
184 | * 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
|
185 | * 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
|
186 | * again once the filename is available. |
| 4514 | 187 | * |
| 188 | * @param xfer The file transfer to request confirmation on. | |
| 189 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
190 | void gaim_xfer_request(GaimXfer *xfer); |
| 4514 | 191 | |
| 192 | /** | |
| 193 | * Called if the user accepts the file transfer request. | |
| 194 | * | |
| 195 | * @param xfer The file transfer. | |
| 196 | * @param filename The filename. | |
| 197 | */ | |
| 7805 | 198 | void gaim_xfer_request_accepted(GaimXfer *xfer, const char *filename); |
| 4514 | 199 | |
| 200 | /** | |
| 201 | * Called if the user rejects the file transfer request. | |
| 202 | * | |
| 203 | * @param xfer The file transfer. | |
| 204 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
205 | void gaim_xfer_request_denied(GaimXfer *xfer); |
| 4514 | 206 | |
| 207 | /** | |
| 208 | * Returns the type of file transfer. | |
| 209 | * | |
| 210 | * @param xfer The file transfer. | |
| 211 | * | |
| 212 | * @return The type of the file transfer. | |
| 213 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
214 | GaimXferType gaim_xfer_get_type(const GaimXfer *xfer); |
| 4514 | 215 | |
| 216 | /** | |
| 217 | * Returns the account the file transfer is using. | |
| 218 | * | |
| 219 | * @param xfer The file transfer. | |
| 220 | * | |
| 221 | * @return The account. | |
| 222 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
223 | GaimAccount *gaim_xfer_get_account(const GaimXfer *xfer); |
| 4514 | 224 | |
| 225 | /** | |
| 7805 | 226 | * Returns the status of the xfer. |
| 227 | * | |
| 228 | * @param xfer The file transfer. | |
| 229 | * | |
| 230 | * @return The status. | |
| 231 | */ | |
| 232 | GaimXferStatusType gaim_xfer_get_status(const GaimXfer *xfer); | |
| 233 | ||
| 234 | /** | |
| 7738 | 235 | * Returns true if the file transfer was canceled. |
| 236 | * | |
| 237 | * @param xfer The file transfer. | |
| 238 | * | |
| 239 | * @return Whether or not the transfer was canceled. | |
| 240 | */ | |
| 7805 | 241 | gboolean gaim_xfer_is_canceled(const GaimXfer *xfer); |
| 7738 | 242 | |
| 243 | /** | |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
244 | * Returns the completed state for a file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
245 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
246 | * @param xfer The file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
247 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
248 | * @return The completed state. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
249 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
250 | gboolean gaim_xfer_is_completed(const GaimXfer *xfer); |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
251 | |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
252 | /** |
| 4514 | 253 | * Returns the name of the file being sent or received. |
| 254 | * | |
| 255 | * @param xfer The file transfer. | |
| 256 | * | |
| 257 | * @return The filename. | |
| 258 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
259 | const char *gaim_xfer_get_filename(const GaimXfer *xfer); |
| 4514 | 260 | |
| 261 | /** | |
| 262 | * Returns the file's destination filename, | |
| 263 | * | |
| 264 | * @param xfer The file transfer. | |
| 265 | * | |
| 266 | * @return The destination filename. | |
| 267 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
268 | const char *gaim_xfer_get_local_filename(const GaimXfer *xfer); |
| 4514 | 269 | |
| 270 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
271 | * Returns the number of bytes sent (or received) so far. |
| 4514 | 272 | * |
| 273 | * @param xfer The file transfer. | |
| 274 | * | |
| 275 | * @return The number of bytes sent. | |
| 276 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
277 | size_t gaim_xfer_get_bytes_sent(const GaimXfer *xfer); |
| 4514 | 278 | |
| 279 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
280 | * Returns the number of bytes remaining to send or receive. |
| 4514 | 281 | * |
| 282 | * @param xfer The file transfer. | |
| 283 | * | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
284 | * @return The number of bytes remaining. |
| 4514 | 285 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
286 | size_t gaim_xfer_get_bytes_remaining(const GaimXfer *xfer); |
| 4514 | 287 | |
| 288 | /** | |
| 289 | * Returns the size of the file being sent or received. | |
| 290 | * | |
| 291 | * @param xfer The file transfer. | |
| 7805 | 292 | * |
| 4514 | 293 | * @return The total size of the file. |
| 294 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
295 | size_t gaim_xfer_get_size(const GaimXfer *xfer); |
| 4514 | 296 | |
| 297 | /** | |
| 298 | * Returns the current percentage of progress of the transfer. | |
| 299 | * | |
| 300 | * This is a number between 0 (0%) and 1 (100%). | |
| 301 | * | |
| 302 | * @param xfer The file transfer. | |
| 303 | * | |
| 304 | * @return The percentage complete. | |
| 305 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
306 | double gaim_xfer_get_progress(const GaimXfer *xfer); |
| 4514 | 307 | |
| 308 | /** | |
| 309 | * Returns the local port number in the file transfer. | |
| 310 | * | |
| 311 | * @param xfer The file transfer. | |
| 312 | * | |
| 313 | * @return The port number on this end. | |
| 314 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
315 | unsigned int gaim_xfer_get_local_port(const GaimXfer *xfer); |
| 4514 | 316 | |
| 317 | /** | |
| 318 | * Returns the remote IP address in the file transfer. | |
| 319 | * | |
| 320 | * @param xfer The file transfer. | |
| 321 | * | |
| 322 | * @return The IP address on the other end. | |
| 323 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
324 | const char *gaim_xfer_get_remote_ip(const GaimXfer *xfer); |
| 4514 | 325 | |
| 326 | /** | |
| 327 | * Returns the remote port number in the file transfer. | |
| 328 | * | |
| 329 | * @param xfer The file transfer. | |
| 330 | * | |
| 331 | * @return The port number on the other end. | |
| 332 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
333 | unsigned int gaim_xfer_get_remote_port(const GaimXfer *xfer); |
| 4514 | 334 | |
| 335 | /** | |
| 4538 | 336 | * Sets the completed state for the file transfer. |
| 337 | * | |
| 338 | * @param xfer The file transfer. | |
| 339 | * @param completed The completed state. | |
| 340 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
341 | void gaim_xfer_set_completed(GaimXfer *xfer, gboolean completed); |
| 4538 | 342 | |
| 343 | /** | |
| 4514 | 344 | * Sets the filename for the file transfer. |
| 345 | * | |
| 346 | * @param xfer The file transfer. | |
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
347 | * @param message The message. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
348 | */ |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
349 | void gaim_xfer_set_message(GaimXfer *xfer, const char *message); |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
350 | |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
351 | /** |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
352 | * Sets the filename for the file transfer. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
353 | * |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
354 | * @param xfer The file transfer. |
| 4514 | 355 | * @param filename The filename. |
| 356 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
357 | void gaim_xfer_set_filename(GaimXfer *xfer, const char *filename); |
| 4514 | 358 | |
| 359 | /** | |
|
4605
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
360 | * Sets the local filename for the file transfer. |
| 4514 | 361 | * |
| 362 | * @param xfer The file transfer. | |
| 363 | * @param filename The filename | |
| 364 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
365 | void gaim_xfer_set_local_filename(GaimXfer *xfer, const char *filename); |
| 4514 | 366 | |
| 367 | /** | |
| 368 | * Sets the size of the file in a file transfer. | |
| 369 | * | |
| 370 | * @param xfer The file transfer. | |
| 371 | * @param size The size of the file. | |
| 372 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
373 | void gaim_xfer_set_size(GaimXfer *xfer, size_t size); |
| 4514 | 374 | |
| 375 | /** | |
| 376 | * Returns the UI operations structure for a file transfer. | |
| 377 | * | |
| 378 | * @param xfer The file transfer. | |
| 379 | * | |
| 380 | * @return The UI operations structure. | |
| 381 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
382 | GaimXferUiOps *gaim_xfer_get_ui_ops(const GaimXfer *xfer); |
| 4514 | 383 | |
| 384 | /** | |
| 385 | * Sets the read function for the file transfer. | |
| 386 | * | |
| 387 | * @param xfer The file transfer. | |
| 388 | * @param fnc The read function. | |
| 389 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
390 | void gaim_xfer_set_read_fnc(GaimXfer *xfer, |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
391 | gssize (*fnc)(guchar **, GaimXfer *)); |
| 4514 | 392 | |
| 393 | /** | |
| 394 | * Sets the write function for the file transfer. | |
| 395 | * | |
| 396 | * @param xfer The file transfer. | |
| 397 | * @param fnc The write function. | |
| 398 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
399 | void gaim_xfer_set_write_fnc(GaimXfer *xfer, |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
400 | gssize (*fnc)(const guchar *, size_t, GaimXfer *)); |
| 4514 | 401 | |
| 402 | /** | |
| 403 | * Sets the acknowledge function for the file transfer. | |
| 404 | * | |
| 405 | * @param xfer The file transfer. | |
| 406 | * @param fnc The acknowledge function. | |
| 407 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
408 | void gaim_xfer_set_ack_fnc(GaimXfer *xfer, |
|
11159
76ef02141bcb
[gaim-migrate @ 13246]
Mark Doliner <markdoliner@pidgin.im>
parents:
11129
diff
changeset
|
409 | void (*fnc)(GaimXfer *, const guchar *, size_t)); |
| 4514 | 410 | |
| 411 | /** | |
| 7805 | 412 | * Sets the function to be called if the request is denied. |
| 413 | * | |
| 414 | * @param xfer The file transfer. | |
| 415 | * @param fnc The request denied prpl callback. | |
| 416 | */ | |
| 417 | void gaim_xfer_set_request_denied_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); | |
| 418 | ||
| 419 | /** | |
| 4514 | 420 | * Sets the transfer initialization function for the file transfer. |
| 421 | * | |
| 422 | * This function is required, and must call gaim_xfer_start() with | |
| 423 | * the necessary parameters. This will be called if the file transfer | |
| 424 | * is accepted by the user. | |
| 425 | * | |
| 426 | * @param xfer The file transfer. | |
| 427 | * @param fnc The transfer initialization function. | |
| 428 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
429 | void gaim_xfer_set_init_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
| 4514 | 430 | |
| 431 | /** | |
| 432 | * Sets the start transfer function for the file transfer. | |
| 433 | * | |
| 434 | * @param xfer The file transfer. | |
| 435 | * @param fnc The start transfer function. | |
| 436 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
437 | void gaim_xfer_set_start_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
| 4514 | 438 | |
| 439 | /** | |
| 440 | * Sets the end transfer function for the file transfer. | |
| 441 | * | |
| 442 | * @param xfer The file transfer. | |
| 443 | * @param fnc The end transfer function. | |
| 444 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
445 | void gaim_xfer_set_end_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
| 4514 | 446 | |
| 447 | /** | |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
448 | * Sets the cancel send function for the file transfer. |
| 4514 | 449 | * |
| 450 | * @param xfer The file transfer. | |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
451 | * @param fnc The cancel send function. |
| 4514 | 452 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
453 | void gaim_xfer_set_cancel_send_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
454 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
455 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
456 | * Sets the cancel receive function for the file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
457 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
458 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
459 | * @param fnc The cancel receive function. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
460 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
461 | void gaim_xfer_set_cancel_recv_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
| 4514 | 462 | |
| 463 | /** | |
| 464 | * Reads in data from a file transfer stream. | |
| 465 | * | |
| 466 | * @param xfer The file transfer. | |
| 467 | * @param buffer The buffer that will be created to contain the data. | |
| 468 | * | |
| 8231 | 469 | * @return The number of bytes read, or -1. |
| 4514 | 470 | */ |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
471 | gssize gaim_xfer_read(GaimXfer *xfer, guchar **buffer); |
| 4514 | 472 | |
| 473 | /** | |
| 474 | * Writes data to a file transfer stream. | |
| 475 | * | |
| 476 | * @param xfer The file transfer. | |
| 477 | * @param buffer The buffer to read the data from. | |
| 478 | * @param size The number of bytes to write. | |
| 479 | * | |
| 8231 | 480 | * @return The number of bytes written, or -1. |
| 4514 | 481 | */ |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
482 | gssize gaim_xfer_write(GaimXfer *xfer, const guchar *buffer, gsize size); |
| 4514 | 483 | |
| 484 | /** | |
| 485 | * Starts a file transfer. | |
| 486 | * | |
| 487 | * Either @a fd must be specified <i>or</i> @a ip and @a port on a | |
| 488 | * file receive transfer. On send, @a fd must be specified, and | |
| 489 | * @a ip and @a port are ignored. | |
| 490 | * | |
| 491 | * @param xfer The file transfer. | |
| 492 | * @param fd The file descriptor for the socket. | |
| 493 | * @param ip The IP address to connect to. | |
| 494 | * @param port The port to connect to. | |
| 495 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
496 | void gaim_xfer_start(GaimXfer *xfer, int fd, const char *ip, |
| 4514 | 497 | unsigned int port); |
| 498 | ||
| 499 | /** | |
| 500 | * Ends a file transfer. | |
| 501 | * | |
| 502 | * @param xfer The file transfer. | |
| 503 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
504 | void gaim_xfer_end(GaimXfer *xfer); |
| 4514 | 505 | |
| 506 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
507 | * Adds a new file transfer to the list of file transfers. Call this only |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
508 | * if you are not using gaim_xfer_start. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
509 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
510 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
511 | */ |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
512 | void gaim_xfer_add(GaimXfer *xfer); |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
513 | |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
514 | /** |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
515 | * Cancels a file transfer on the local end. |
| 4514 | 516 | * |
| 517 | * @param xfer The file transfer. | |
| 518 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
519 | void gaim_xfer_cancel_local(GaimXfer *xfer); |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
520 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
521 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
522 | * Cancels a file transfer from the remote end. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
523 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
524 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
525 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
526 | void gaim_xfer_cancel_remote(GaimXfer *xfer); |
| 4514 | 527 | |
| 528 | /** | |
| 529 | * Displays a file transfer-related error message. | |
| 530 | * | |
|
5499
3490d628be1d
[gaim-migrate @ 5895]
Christian Hammond <chipx86@chipx86.com>
parents:
5495
diff
changeset
|
531 | * This is a wrapper around gaim_notify_error(), which automatically |
| 10654 | 532 | * specifies a title ("File transfer to <i>user</i> failed" or |
| 533 | * "File Transfer from <i>user</i> failed"). | |
| 4514 | 534 | * |
| 10654 | 535 | * @param type The type of file transfer. |
| 536 | * @param account The account sending or receiving the file. | |
| 537 | * @param who The user on the other end of the transfer. | |
| 538 | * @param msg The message to display. | |
| 4514 | 539 | */ |
| 10654 | 540 | void gaim_xfer_error(GaimXferType type, GaimAccount *account, const char *who, const char *msg); |
| 4514 | 541 | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
542 | /** |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
543 | * Updates file transfer progress. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
544 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
545 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
546 | */ |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
547 | void gaim_xfer_update_progress(GaimXfer *xfer); |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
548 | |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
549 | /** |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
550 | * Displays a file transfer-related message in the conversation window |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
551 | * |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
552 | * This is a wrapper around gaim_conversation_write |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
553 | * |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
554 | * @param xfer The file transfer to which this message relates. |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
555 | * @param message The message to display. |
|
11129
c986d8566843
[gaim-migrate @ 13185]
Mark Doliner <markdoliner@pidgin.im>
parents:
11084
diff
changeset
|
556 | * @param is_error Is this an error message?. |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
557 | */ |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
558 | void gaim_xfer_conversation_write(GaimXfer *xfer, char *message, gboolean is_error); |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
559 | |
|
6263
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
560 | /*@}*/ |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
561 | |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
562 | /**************************************************************************/ |
| 4514 | 563 | /** @name UI Registration Functions */ |
| 564 | /**************************************************************************/ | |
| 565 | /*@{*/ | |
| 566 | ||
| 567 | /** | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
568 | * Returns the handle to the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
569 | * |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
570 | * @return The handle |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
571 | */ |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
572 | void *gaim_xfers_get_handle(void); |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
573 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
574 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
575 | * Initializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
576 | */ |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
577 | void gaim_xfers_init(void); |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
578 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
579 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
580 | * Uninitializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
581 | */ |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
582 | void gaim_xfers_uninit(void); |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
583 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
584 | /** |
| 4514 | 585 | * Sets the UI operations structure to be used in all gaim file transfers. |
| 586 | * | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6269
diff
changeset
|
587 | * @param ops The UI operations structure. |
| 4514 | 588 | */ |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
589 | void gaim_xfers_set_ui_ops(GaimXferUiOps *ops); |
| 4514 | 590 | |
| 591 | /** | |
| 592 | * Returns the UI operations structure to be used in all gaim file transfers. | |
| 593 | * | |
| 594 | * @return The UI operations structure. | |
| 595 | */ | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
596 | GaimXferUiOps *gaim_xfers_get_ui_ops(void); |
| 4514 | 597 | |
| 598 | /*@}*/ | |
| 599 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
600 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
601 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
602 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
603 | |
| 4514 | 604 | #endif /* _GAIM_FT_H_ */ |