Mercurial > pidgin.yaz
comparison src/ft.h @ 4675:3145c5c45877
[gaim-migrate @ 4986]
Okay, redid the cancel stuff. It may not work too well yet, as it's largely
untested, and will need some testing and bug reporting. The protocols may
not work too well (namely, Oscar), but this will be fixed soon. Note that
that's only for canceling. Any receiving that currently works will continue
to work.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 08 Mar 2003 08:27:02 +0000 |
parents | 4fe88c94c3b4 |
children | 4691c5936c01 |
comparison
equal
deleted
inserted
replaced
4674:7ffe2b64de2d | 4675:3145c5c45877 |
---|---|
24 #define _GAIM_FT_H_ | 24 #define _GAIM_FT_H_ |
25 | 25 |
26 /**************************************************************************/ | 26 /**************************************************************************/ |
27 /** Data Structures */ | 27 /** Data Structures */ |
28 /**************************************************************************/ | 28 /**************************************************************************/ |
29 struct gaim_xfer *xfer; | 29 struct gaim_xfer; |
30 | 30 |
31 /** | 31 /** |
32 * Types of file transfers. | 32 * Types of file transfers. |
33 */ | 33 */ |
34 typedef enum | 34 typedef enum |
50 void (*destroy)(struct gaim_xfer *xfer); | 50 void (*destroy)(struct gaim_xfer *xfer); |
51 void (*request_file)(struct gaim_xfer *xfer); | 51 void (*request_file)(struct gaim_xfer *xfer); |
52 void (*ask_cancel)(struct gaim_xfer *xfer); | 52 void (*ask_cancel)(struct gaim_xfer *xfer); |
53 void (*add_xfer)(struct gaim_xfer *xfer); | 53 void (*add_xfer)(struct gaim_xfer *xfer); |
54 void (*update_progress)(struct gaim_xfer *xfer, double percent); | 54 void (*update_progress)(struct gaim_xfer *xfer, double percent); |
55 void (*cancel)(struct gaim_xfer *xfer); | 55 void (*cancel_local)(struct gaim_xfer *xfer); |
56 void (*cancel_remote)(struct gaim_xfer *xfer); | |
56 }; | 57 }; |
57 | 58 |
58 /** | 59 /** |
59 * A core representation of a file transfer. | 60 * A core representation of a file transfer. |
60 */ | 61 */ |
90 struct | 91 struct |
91 { | 92 { |
92 void (*init)(struct gaim_xfer *xfer); | 93 void (*init)(struct gaim_xfer *xfer); |
93 void (*start)(struct gaim_xfer *xfer); | 94 void (*start)(struct gaim_xfer *xfer); |
94 void (*end)(struct gaim_xfer *xfer); | 95 void (*end)(struct gaim_xfer *xfer); |
95 void (*cancel)(struct gaim_xfer *xfer); | 96 void (*cancel_send)(struct gaim_xfer *xfer); |
97 void (*cancel_recv)(struct gaim_xfer *xfer); | |
96 size_t (*read)(char **buffer, struct gaim_xfer *xfer); | 98 size_t (*read)(char **buffer, struct gaim_xfer *xfer); |
97 size_t (*write)(const char *buffer, size_t size, | 99 size_t (*write)(const char *buffer, size_t size, |
98 struct gaim_xfer *xfer); | 100 struct gaim_xfer *xfer); |
99 void (*ack)(struct gaim_xfer *xfer, const char *buffer, | 101 void (*ack)(struct gaim_xfer *xfer, const char *buffer, |
100 size_t size); | 102 size_t size); |
370 */ | 372 */ |
371 void gaim_xfer_set_end_fnc(struct gaim_xfer *xfer, | 373 void gaim_xfer_set_end_fnc(struct gaim_xfer *xfer, |
372 void (*fnc)(struct gaim_xfer *)); | 374 void (*fnc)(struct gaim_xfer *)); |
373 | 375 |
374 /** | 376 /** |
375 * Sets the cancel transfer function for the file transfer. | 377 * Sets the cancel send function for the file transfer. |
376 * | 378 * |
377 * @param xfer The file transfer. | 379 * @param xfer The file transfer. |
378 * @param fnc The cancel transfer function. | 380 * @param fnc The cancel send function. |
379 */ | 381 */ |
380 void gaim_xfer_set_cancel_fnc(struct gaim_xfer *xfer, | 382 void gaim_xfer_set_cancel_send_fnc(struct gaim_xfer *xfer, |
381 void (*fnc)(struct gaim_xfer *)); | 383 void (*fnc)(struct gaim_xfer *)); |
384 | |
385 /** | |
386 * Sets the cancel receive function for the file transfer. | |
387 * | |
388 * @param xfer The file transfer. | |
389 * @param fnc The cancel receive function. | |
390 */ | |
391 void gaim_xfer_set_cancel_recv_fnc(struct gaim_xfer *xfer, | |
392 void (*fnc)(struct gaim_xfer *)); | |
382 | 393 |
383 /** | 394 /** |
384 * Reads in data from a file transfer stream. | 395 * Reads in data from a file transfer stream. |
385 * | 396 * |
386 * @param xfer The file transfer. | 397 * @param xfer The file transfer. |
423 * @param xfer The file transfer. | 434 * @param xfer The file transfer. |
424 */ | 435 */ |
425 void gaim_xfer_end(struct gaim_xfer *xfer); | 436 void gaim_xfer_end(struct gaim_xfer *xfer); |
426 | 437 |
427 /** | 438 /** |
428 * Cancels a file transfer. | 439 * Cancels a file transfer on the local end. |
429 * | 440 * |
430 * @param xfer The file transfer. | 441 * @param xfer The file transfer. |
431 */ | 442 */ |
432 void gaim_xfer_cancel(struct gaim_xfer *xfer); | 443 void gaim_xfer_cancel_local(struct gaim_xfer *xfer); |
444 | |
445 /** | |
446 * Cancels a file transfer from the remote end. | |
447 * | |
448 * @param xfer The file transfer. | |
449 */ | |
450 void gaim_xfer_cancel_remote(struct gaim_xfer *xfer); | |
433 | 451 |
434 /** | 452 /** |
435 * Displays a file transfer-related error message. | 453 * Displays a file transfer-related error message. |
436 * | 454 * |
437 * This is a wrapper around do_error_dialog(), which automatically | 455 * This is a wrapper around do_error_dialog(), which automatically |