Sun, 15 Apr 2007 02:10:37 +0000
propagate from branch 'im.pidgin.gaim' (head b2836a24d81e7a1bd1d21b3aea8794b094391344)
to branch 'im.pidgin.rlaager.merging.soc-msnp13-to-svn18164' (head 463b4fa9f067b279f843520d95a822adc86a0a1b)
| 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 | { |
|
15280
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
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 | |
|
15280
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
114 | size_t current_buffer_size; /**< This gradually increases for fast |
|
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
115 | network connections. */ |
|
9df6112da532
[gaim-migrate @ 18008]
Mark Doliner <markdoliner@pidgin.im>
parents:
15000
diff
changeset
|
116 | |
| 7805 | 117 | GaimXferStatusType status; /**< File Transfer's status. */ |
| 4538 | 118 | |
| 4514 | 119 | /* I/O operations. */ |
| 120 | struct | |
| 121 | { | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
122 | void (*init)(GaimXfer *xfer); |
| 7805 | 123 | void (*request_denied)(GaimXfer *xfer); |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
124 | void (*start)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
125 | void (*end)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
126 | void (*cancel_send)(GaimXfer *xfer); |
|
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
127 | void (*cancel_recv)(GaimXfer *xfer); |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
128 | gssize (*read)(guchar **buffer, GaimXfer *xfer); |
|
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
129 | gssize (*write)(const guchar *buffer, size_t size, GaimXfer *xfer); |
|
11159
76ef02141bcb
[gaim-migrate @ 13246]
Mark Doliner <markdoliner@pidgin.im>
parents:
11129
diff
changeset
|
130 | void (*ack)(GaimXfer *xfer, const guchar *buffer, size_t size); |
| 4514 | 131 | |
| 132 | } ops; | |
| 133 | ||
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
134 | GaimXferUiOps *ui_ops; /**< UI-specific operations. */ |
| 4514 | 135 | void *ui_data; /**< UI-specific data. */ |
| 136 | ||
| 137 | void *data; /**< prpl-specific data. */ | |
| 138 | }; | |
| 139 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
140 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
141 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
142 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
143 | |
| 4514 | 144 | /**************************************************************************/ |
| 145 | /** @name File Transfer API */ | |
| 146 | /**************************************************************************/ | |
| 147 | /*@{*/ | |
| 148 | ||
| 149 | /** | |
| 150 | * Creates a new file transfer handle. | |
| 7805 | 151 | * This is called by prpls. |
| 152 | * The handle starts with a ref count of 1, and this reference | |
| 153 | * is owned by the core. The prpl normally does not need to | |
| 154 | * gaim_xfer_ref or unref. | |
| 4514 | 155 | * |
| 156 | * @param account The account sending or receiving the file. | |
| 157 | * @param type The type of file transfer. | |
| 158 | * @param who The name of the remote user. | |
| 159 | * | |
| 160 | * @return A file transfer handle. | |
| 161 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
162 | GaimXfer *gaim_xfer_new(GaimAccount *account, |
| 4514 | 163 | GaimXferType type, const char *who); |
| 164 | ||
| 165 | /** | |
| 7805 | 166 | * Increases the reference count on a GaimXfer. |
| 167 | * Please call gaim_xfer_unref later. | |
| 4514 | 168 | * |
| 7805 | 169 | * @param xfer A file transfer handle. |
| 4514 | 170 | */ |
| 7805 | 171 | void gaim_xfer_ref(GaimXfer *xfer); |
| 172 | ||
| 173 | /** | |
| 174 | * Decreases the reference count on a GaimXfer. | |
| 175 | * If the reference reaches 0, gaim_xfer_destroy (an internal function) | |
| 176 | * 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
|
177 | * Since the core keeps a ref on the xfer, only an erroneous call to |
| 7805 | 178 | * this function will destroy the xfer while still in use. |
| 179 | * | |
| 180 | * @param xfer A file transfer handle. | |
| 181 | */ | |
| 182 | void gaim_xfer_unref(GaimXfer *xfer); | |
| 4514 | 183 | |
| 184 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
185 | * Requests confirmation for a file transfer from the user. If receiving |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
186 | * 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
|
187 | * 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
|
188 | * 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
|
189 | * again once the filename is available. |
| 4514 | 190 | * |
| 191 | * @param xfer The file transfer to request confirmation on. | |
| 192 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
193 | void gaim_xfer_request(GaimXfer *xfer); |
| 4514 | 194 | |
| 195 | /** | |
| 196 | * Called if the user accepts the file transfer request. | |
| 197 | * | |
| 198 | * @param xfer The file transfer. | |
| 199 | * @param filename The filename. | |
| 200 | */ | |
| 7805 | 201 | void gaim_xfer_request_accepted(GaimXfer *xfer, const char *filename); |
| 4514 | 202 | |
| 203 | /** | |
| 204 | * Called if the user rejects the file transfer request. | |
| 205 | * | |
| 206 | * @param xfer The file transfer. | |
| 207 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
208 | void gaim_xfer_request_denied(GaimXfer *xfer); |
| 4514 | 209 | |
| 210 | /** | |
| 211 | * Returns the type of file transfer. | |
| 212 | * | |
| 213 | * @param xfer The file transfer. | |
| 214 | * | |
| 215 | * @return The type of the file transfer. | |
| 216 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
217 | GaimXferType gaim_xfer_get_type(const GaimXfer *xfer); |
| 4514 | 218 | |
| 219 | /** | |
| 220 | * Returns the account the file transfer is using. | |
| 221 | * | |
| 222 | * @param xfer The file transfer. | |
| 223 | * | |
| 224 | * @return The account. | |
| 225 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
226 | GaimAccount *gaim_xfer_get_account(const GaimXfer *xfer); |
| 4514 | 227 | |
| 228 | /** | |
| 7805 | 229 | * Returns the status of the xfer. |
| 230 | * | |
| 231 | * @param xfer The file transfer. | |
| 232 | * | |
| 233 | * @return The status. | |
| 234 | */ | |
| 235 | GaimXferStatusType gaim_xfer_get_status(const GaimXfer *xfer); | |
| 236 | ||
| 237 | /** | |
| 7738 | 238 | * Returns true if the file transfer was canceled. |
| 239 | * | |
| 240 | * @param xfer The file transfer. | |
| 241 | * | |
| 242 | * @return Whether or not the transfer was canceled. | |
| 243 | */ | |
| 7805 | 244 | gboolean gaim_xfer_is_canceled(const GaimXfer *xfer); |
| 7738 | 245 | |
| 246 | /** | |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
247 | * Returns the completed state for a file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
248 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
249 | * @param xfer The file transfer. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
250 | * |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
251 | * @return The completed state. |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
252 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
253 | gboolean gaim_xfer_is_completed(const GaimXfer *xfer); |
|
4539
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
254 | |
|
44671e1ce14e
[gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents:
4538
diff
changeset
|
255 | /** |
| 4514 | 256 | * Returns the name of the file being sent or received. |
| 257 | * | |
| 258 | * @param xfer The file transfer. | |
| 259 | * | |
| 260 | * @return The filename. | |
| 261 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
262 | const char *gaim_xfer_get_filename(const GaimXfer *xfer); |
| 4514 | 263 | |
| 264 | /** | |
| 265 | * Returns the file's destination filename, | |
| 266 | * | |
| 267 | * @param xfer The file transfer. | |
| 268 | * | |
| 269 | * @return The destination filename. | |
| 270 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
271 | const char *gaim_xfer_get_local_filename(const GaimXfer *xfer); |
| 4514 | 272 | |
| 273 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
274 | * Returns the number of bytes sent (or received) so far. |
| 4514 | 275 | * |
| 276 | * @param xfer The file transfer. | |
| 277 | * | |
| 278 | * @return The number of bytes sent. | |
| 279 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
280 | size_t gaim_xfer_get_bytes_sent(const GaimXfer *xfer); |
| 4514 | 281 | |
| 282 | /** | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
283 | * Returns the number of bytes remaining to send or receive. |
| 4514 | 284 | * |
| 285 | * @param xfer The file transfer. | |
| 286 | * | |
|
13009
12ef9f229961
[gaim-migrate @ 15362]
Daniel Atallah <datallah@pidgin.im>
parents:
12151
diff
changeset
|
287 | * @return The number of bytes remaining. |
| 4514 | 288 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
289 | size_t gaim_xfer_get_bytes_remaining(const GaimXfer *xfer); |
| 4514 | 290 | |
| 291 | /** | |
| 292 | * Returns the size of the file being sent or received. | |
| 293 | * | |
| 294 | * @param xfer The file transfer. | |
| 7805 | 295 | * |
| 4514 | 296 | * @return The total size of the file. |
| 297 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
298 | size_t gaim_xfer_get_size(const GaimXfer *xfer); |
| 4514 | 299 | |
| 300 | /** | |
| 301 | * Returns the current percentage of progress of the transfer. | |
| 302 | * | |
| 303 | * This is a number between 0 (0%) and 1 (100%). | |
| 304 | * | |
| 305 | * @param xfer The file transfer. | |
| 306 | * | |
| 307 | * @return The percentage complete. | |
| 308 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
309 | double gaim_xfer_get_progress(const GaimXfer *xfer); |
| 4514 | 310 | |
| 311 | /** | |
| 312 | * Returns the local port number in the file transfer. | |
| 313 | * | |
| 314 | * @param xfer The file transfer. | |
| 315 | * | |
| 316 | * @return The port number on this end. | |
| 317 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
318 | unsigned int gaim_xfer_get_local_port(const GaimXfer *xfer); |
| 4514 | 319 | |
| 320 | /** | |
| 321 | * Returns the remote IP address in the file transfer. | |
| 322 | * | |
| 323 | * @param xfer The file transfer. | |
| 324 | * | |
| 325 | * @return The IP address on the other end. | |
| 326 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
327 | const char *gaim_xfer_get_remote_ip(const GaimXfer *xfer); |
| 4514 | 328 | |
| 329 | /** | |
| 330 | * Returns the remote port number in the file transfer. | |
| 331 | * | |
| 332 | * @param xfer The file transfer. | |
| 333 | * | |
| 334 | * @return The port number on the other end. | |
| 335 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
336 | unsigned int gaim_xfer_get_remote_port(const GaimXfer *xfer); |
| 4514 | 337 | |
| 338 | /** | |
| 4538 | 339 | * Sets the completed state for the file transfer. |
| 340 | * | |
| 341 | * @param xfer The file transfer. | |
| 342 | * @param completed The completed state. | |
| 343 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
344 | void gaim_xfer_set_completed(GaimXfer *xfer, gboolean completed); |
| 4538 | 345 | |
| 346 | /** | |
| 4514 | 347 | * Sets the filename for the file transfer. |
| 348 | * | |
| 349 | * @param xfer The file transfer. | |
|
9933
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
350 | * @param message The message. |
|
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 | void gaim_xfer_set_message(GaimXfer *xfer, const char *message); |
|
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 | /** |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
355 | * Sets the filename for the file transfer. |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
356 | * |
|
61bd3fadbfe6
[gaim-migrate @ 10825]
Dave West <kat@users.sourceforge.net>
parents:
9511
diff
changeset
|
357 | * @param xfer The file transfer. |
| 4514 | 358 | * @param filename The filename. |
| 359 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
360 | void gaim_xfer_set_filename(GaimXfer *xfer, const char *filename); |
| 4514 | 361 | |
| 362 | /** | |
|
4605
67526771e679
[gaim-migrate @ 4892]
Mark Doliner <markdoliner@pidgin.im>
parents:
4595
diff
changeset
|
363 | * Sets the local filename for the file transfer. |
| 4514 | 364 | * |
| 365 | * @param xfer The file transfer. | |
| 366 | * @param filename The filename | |
| 367 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
368 | void gaim_xfer_set_local_filename(GaimXfer *xfer, const char *filename); |
| 4514 | 369 | |
| 370 | /** | |
| 371 | * Sets the size of the file in a file transfer. | |
| 372 | * | |
| 373 | * @param xfer The file transfer. | |
| 374 | * @param size The size of the file. | |
| 375 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
376 | void gaim_xfer_set_size(GaimXfer *xfer, size_t size); |
| 4514 | 377 | |
| 378 | /** | |
|
15322
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
379 | * Sets the current working position in the active file transfer. This |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
380 | * 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
|
381 | * 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
|
382 | * |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
383 | * It's used for pausing and resuming an oscar file transfer. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
384 | * |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
385 | * @param xfer The file transfer. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
386 | * @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
|
387 | * sending a file then this is the byte that we will |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
388 | * send. If we're receiving a file, this is the |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
389 | * next byte that we expect to receive. |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
390 | */ |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
391 | void gaim_xfer_set_bytes_sent(GaimXfer *xfer, size_t bytes_sent); |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
392 | |
|
cd268e368bc1
[gaim-migrate @ 18050]
Mark Doliner <markdoliner@pidgin.im>
parents:
15280
diff
changeset
|
393 | /** |
| 4514 | 394 | * Returns the UI operations structure for a file transfer. |
| 395 | * | |
| 396 | * @param xfer The file transfer. | |
| 397 | * | |
| 398 | * @return The UI operations structure. | |
| 399 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
400 | GaimXferUiOps *gaim_xfer_get_ui_ops(const GaimXfer *xfer); |
| 4514 | 401 | |
| 402 | /** | |
| 403 | * Sets the read function for the file transfer. | |
| 404 | * | |
| 405 | * @param xfer The file transfer. | |
| 406 | * @param fnc The read function. | |
| 407 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
408 | void gaim_xfer_set_read_fnc(GaimXfer *xfer, |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
409 | gssize (*fnc)(guchar **, GaimXfer *)); |
| 4514 | 410 | |
| 411 | /** | |
| 412 | * Sets the write function for the file transfer. | |
| 413 | * | |
| 414 | * @param xfer The file transfer. | |
| 415 | * @param fnc The write function. | |
| 416 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
417 | void gaim_xfer_set_write_fnc(GaimXfer *xfer, |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
418 | gssize (*fnc)(const guchar *, size_t, GaimXfer *)); |
| 4514 | 419 | |
| 420 | /** | |
| 421 | * Sets the acknowledge function for the file transfer. | |
| 422 | * | |
| 423 | * @param xfer The file transfer. | |
| 424 | * @param fnc The acknowledge function. | |
| 425 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
426 | void gaim_xfer_set_ack_fnc(GaimXfer *xfer, |
|
11159
76ef02141bcb
[gaim-migrate @ 13246]
Mark Doliner <markdoliner@pidgin.im>
parents:
11129
diff
changeset
|
427 | void (*fnc)(GaimXfer *, const guchar *, size_t)); |
| 4514 | 428 | |
| 429 | /** | |
| 7805 | 430 | * Sets the function to be called if the request is denied. |
| 431 | * | |
| 432 | * @param xfer The file transfer. | |
| 433 | * @param fnc The request denied prpl callback. | |
| 434 | */ | |
| 435 | void gaim_xfer_set_request_denied_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); | |
| 436 | ||
| 437 | /** | |
| 4514 | 438 | * Sets the transfer initialization function for the file transfer. |
| 439 | * | |
| 440 | * This function is required, and must call gaim_xfer_start() with | |
| 441 | * the necessary parameters. This will be called if the file transfer | |
| 442 | * is accepted by the user. | |
| 443 | * | |
| 444 | * @param xfer The file transfer. | |
| 445 | * @param fnc The transfer initialization function. | |
| 446 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
447 | void gaim_xfer_set_init_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
| 4514 | 448 | |
| 449 | /** | |
| 450 | * Sets the start transfer function for the file transfer. | |
| 451 | * | |
| 452 | * @param xfer The file transfer. | |
| 453 | * @param fnc The start transfer function. | |
| 454 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
455 | void gaim_xfer_set_start_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
| 4514 | 456 | |
| 457 | /** | |
| 458 | * Sets the end transfer function for the file transfer. | |
| 459 | * | |
| 460 | * @param xfer The file transfer. | |
| 461 | * @param fnc The end transfer function. | |
| 462 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
463 | void gaim_xfer_set_end_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
| 4514 | 464 | |
| 465 | /** | |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
466 | * Sets the cancel send function for the file transfer. |
| 4514 | 467 | * |
| 468 | * @param xfer The file transfer. | |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
469 | * @param fnc The cancel send function. |
| 4514 | 470 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
471 | 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
|
472 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
473 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
474 | * Sets the cancel receive function for the file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
475 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
476 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
477 | * @param fnc The cancel receive function. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
478 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
479 | void gaim_xfer_set_cancel_recv_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *)); |
| 4514 | 480 | |
| 481 | /** | |
| 482 | * Reads in data from a file transfer stream. | |
| 483 | * | |
| 484 | * @param xfer The file transfer. | |
| 485 | * @param buffer The buffer that will be created to contain the data. | |
| 486 | * | |
| 8231 | 487 | * @return The number of bytes read, or -1. |
| 4514 | 488 | */ |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
489 | gssize gaim_xfer_read(GaimXfer *xfer, guchar **buffer); |
| 4514 | 490 | |
| 491 | /** | |
| 492 | * Writes data to a file transfer stream. | |
| 493 | * | |
| 494 | * @param xfer The file transfer. | |
| 495 | * @param buffer The buffer to read the data from. | |
| 496 | * @param size The number of bytes to write. | |
| 497 | * | |
| 8231 | 498 | * @return The number of bytes written, or -1. |
| 4514 | 499 | */ |
|
12151
8002bb57756b
[gaim-migrate @ 14452]
Richard Laager <rlaager@pidgin.im>
parents:
12150
diff
changeset
|
500 | gssize gaim_xfer_write(GaimXfer *xfer, const guchar *buffer, gsize size); |
| 4514 | 501 | |
| 502 | /** | |
| 503 | * Starts a file transfer. | |
| 504 | * | |
| 505 | * Either @a fd must be specified <i>or</i> @a ip and @a port on a | |
| 506 | * file receive transfer. On send, @a fd must be specified, and | |
| 507 | * @a ip and @a port are ignored. | |
| 508 | * | |
| 509 | * @param xfer The file transfer. | |
| 510 | * @param fd The file descriptor for the socket. | |
| 511 | * @param ip The IP address to connect to. | |
| 512 | * @param port The port to connect to. | |
| 513 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
514 | void gaim_xfer_start(GaimXfer *xfer, int fd, const char *ip, |
| 4514 | 515 | unsigned int port); |
| 516 | ||
| 517 | /** | |
| 518 | * Ends a file transfer. | |
| 519 | * | |
| 520 | * @param xfer The file transfer. | |
| 521 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
522 | void gaim_xfer_end(GaimXfer *xfer); |
| 4514 | 523 | |
| 524 | /** | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
525 | * 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
|
526 | * if you are not using gaim_xfer_start. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
527 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
528 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
529 | */ |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
530 | void gaim_xfer_add(GaimXfer *xfer); |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
531 | |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
532 | /** |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
533 | * Cancels a file transfer on the local end. |
| 4514 | 534 | * |
| 535 | * @param xfer The file transfer. | |
| 536 | */ | |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
537 | void gaim_xfer_cancel_local(GaimXfer *xfer); |
|
4675
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
538 | |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
539 | /** |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
540 | * Cancels a file transfer from the remote end. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
541 | * |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
542 | * @param xfer The file transfer. |
|
8e0a7b537ca2
[gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents:
4605
diff
changeset
|
543 | */ |
|
6240
0390b27fe09d
[gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
544 | void gaim_xfer_cancel_remote(GaimXfer *xfer); |
| 4514 | 545 | |
| 546 | /** | |
| 547 | * Displays a file transfer-related error message. | |
| 548 | * | |
|
5499
3490d628be1d
[gaim-migrate @ 5895]
Christian Hammond <chipx86@chipx86.com>
parents:
5495
diff
changeset
|
549 | * This is a wrapper around gaim_notify_error(), which automatically |
| 10654 | 550 | * specifies a title ("File transfer to <i>user</i> failed" or |
| 551 | * "File Transfer from <i>user</i> failed"). | |
| 4514 | 552 | * |
| 10654 | 553 | * @param type The type of file transfer. |
| 554 | * @param account The account sending or receiving the file. | |
| 555 | * @param who The user on the other end of the transfer. | |
| 556 | * @param msg The message to display. | |
| 4514 | 557 | */ |
| 10654 | 558 | void gaim_xfer_error(GaimXferType type, GaimAccount *account, const char *who, const char *msg); |
| 4514 | 559 | |
|
8585
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
560 | /** |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
561 | * Updates file transfer progress. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
562 | * |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
563 | * @param xfer The file transfer. |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
564 | */ |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
565 | void gaim_xfer_update_progress(GaimXfer *xfer); |
|
23db71a2d432
[gaim-migrate @ 9335]
Pekka Riikonen <priikone@silcnet.org>
parents:
8231
diff
changeset
|
566 | |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
567 | /** |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
568 | * Displays a file transfer-related message in the conversation window |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
569 | * |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
570 | * This is a wrapper around gaim_conversation_write |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
571 | * |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
572 | * @param xfer The file transfer to which this message relates. |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
573 | * @param message The message to display. |
|
11129
c986d8566843
[gaim-migrate @ 13185]
Mark Doliner <markdoliner@pidgin.im>
parents:
11084
diff
changeset
|
574 | * @param is_error Is this an error message?. |
|
11084
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
575 | */ |
|
b6acee973833
[gaim-migrate @ 13103]
Jonathan Clark <ardentlygnarly@users.sourceforge.net>
parents:
10654
diff
changeset
|
576 | 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
|
577 | |
|
6263
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
578 | /*@}*/ |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
579 | |
|
6fec763a314c
[gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents:
6241
diff
changeset
|
580 | /**************************************************************************/ |
| 4514 | 581 | /** @name UI Registration Functions */ |
| 582 | /**************************************************************************/ | |
| 583 | /*@{*/ | |
| 584 | ||
| 585 | /** | |
|
11281
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
586 | * Returns the handle to the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
587 | * |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
588 | * @return The handle |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
589 | */ |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
590 | void *gaim_xfers_get_handle(void); |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
591 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
592 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
593 | * Initializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
594 | */ |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
595 | void gaim_xfers_init(void); |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
596 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
597 | /** |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
598 | * Uninitializes the file transfer subsystem |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
599 | */ |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
600 | void gaim_xfers_uninit(void); |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
601 | |
|
a5cda37a16be
[gaim-migrate @ 13478]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11159
diff
changeset
|
602 | /** |
| 4514 | 603 | * Sets the UI operations structure to be used in all gaim file transfers. |
| 604 | * | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6269
diff
changeset
|
605 | * @param ops The UI operations structure. |
| 4514 | 606 | */ |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
607 | void gaim_xfers_set_ui_ops(GaimXferUiOps *ops); |
| 4514 | 608 | |
| 609 | /** | |
| 610 | * Returns the UI operations structure to be used in all gaim file transfers. | |
| 611 | * | |
| 612 | * @return The UI operations structure. | |
| 613 | */ | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
614 | GaimXferUiOps *gaim_xfers_get_ui_ops(void); |
| 4514 | 615 | |
| 616 | /*@}*/ | |
| 617 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
618 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
619 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
620 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
621 | |
| 4514 | 622 | #endif /* _GAIM_FT_H_ */ |