2 * Thrasher Bird - XMPP transport via libpurple
3 * Copyright (C) 2008 Barracuda Networks, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with Thrasher Bird; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 typedef struct _Thrasher_Xfer_UI_Data
{
24 char* filename
; /* filename to send on network. owned. */
26 char* desc
; /* description/message to send with offer. owned. */
27 } Thrasher_Xfer_UI_Data
;
29 void thrasher_xfer_init(void);
31 // Thrasher bookkeeping
32 void free_id (gpointer id
);
33 size_t get_next_file_transfer_id(void);
34 PurpleXfer
* get_xfer_by_id(guint id
);
35 guint
get_id_by_xfer(PurpleXfer
* xfer
);
36 void thrasher_remove_xfer(PurpleXfer
*xfer
);
37 void thrasher_xfer_destroy(guint id
);
38 int store_xfer(PurpleXfer
*xfer
);
41 void thrasher_xfer_recv_request_cb(PurpleXfer
*xfer
, gpointer data
);
42 void thrasher_xfer_recv_accept_cb(PurpleXfer
*xfer
, gpointer data
);
43 void thrasher_xfer_recv_start_cb(PurpleXfer
*xfer
, gpointer data
);
44 void thrasher_xfer_recv_cancel_cb(PurpleXfer
*xfer
, gpointer data
);
45 void thrasher_xfer_recv_complete_cb(PurpleXfer
*xfer
, gpointer data
);
46 void thrasher_xfer_send_accept_cb(PurpleXfer
*xfer
, gpointer data
);
47 void thrasher_xfer_send_start_cb(PurpleXfer
*xfer
, gpointer data
);
48 void thrasher_xfer_send_cancel_cb(PurpleXfer
*xfer
, gpointer data
);
49 void thrasher_xfer_send_complete_cb(PurpleXfer
*xfer
, gpointer data
);
52 void thrasher_new_xfer(PurpleXfer
*xfer
);
53 void thrasher_destroy_xfer(PurpleXfer
*xfer
);
54 void thrasher_add_xfer(PurpleXfer
*xfer
);
55 void thrasher_update_xfer_progress(PurpleXfer
*xfer
, double percent
);
56 void thrasher_xfer_cancel_local(PurpleXfer
*xfer
);
57 void thrasher_xfer_cancel_remote(PurpleXfer
*xfer
);
58 gssize
thrasher_ui_write(PurpleXfer
*xfer
, const guchar
*buffer
, gssize size
);
59 gssize
thrasher_ui_read(PurpleXfer
*xfer
, guchar
**buffer
, gssize size
);
60 void thrasher_data_not_sent(PurpleXfer
*xfer
, const guchar
*buffer
, gsize size
);
64 void *thrasher_request_file(const char *title
, const char *filename
,
65 gboolean savedialog
, GCallback ok_cb
,
67 PurpleAccount
*account
,
69 PurpleConversation
*conv
,
73 size_t thrasher_send_file(PurpleAccount
*account
,
78 void thrasher_xfer_recv_request_responder(guint id
, guint accept
);
80 // Individual file transfer ops, which we are supposed to always
82 void thrasher_xfer_individual_init(PurpleXfer
*xfer
);
83 void thrasher_xfer_request_denied(PurpleXfer
*xfer
);
84 void thrasher_xfer_start(PurpleXfer
*xfer
);
85 void thrasher_xfer_end(PurpleXfer
*xfer
);
86 void thrasher_xfer_cancel_send(PurpleXfer
*xfer
);
87 void thrasher_xfer_cancel_receive(PurpleXfer
*xfer
);
88 gssize
thrasher_xfer_read(guchar
**buffer
, PurpleXfer
*xfer
);
89 gssize
thrasher_xfer_write(const guchar
*buffer
, size_t size
,
91 void thrasher_xfer_ack(PurpleXfer
*xfer
, const guchar
*buffer
,