annotate src/ft.h @ 6354:76af8c066f8c

[gaim-migrate @ 6853] Typo. Er, yeah. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 02 Aug 2003 04:59:35 +0000
parents 0a902bd3e170
children 41120df7ed94
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file ft.h The file transfer interface
5034
4691c5936c01 [gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents: 4675
diff changeset
3 * @ingroup core
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 * Copyright (C) 2002-2003, Christian Hammond <chipx86@gnupdate.org>
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * (at your option) any later version.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * GNU General Public License for more details.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 #ifndef _GAIM_FT_H_
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #define _GAIM_FT_H_
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 /**************************************************************************/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 /** Data Structures */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 /**************************************************************************/
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
29 typedef struct _GaimXfer GaimXfer;
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5563
diff changeset
31 #include "account.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5563
diff changeset
32
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 * Types of file transfers.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 typedef enum
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 {
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 GAIM_XFER_UNKNOWN = 0, /**< Unknown file transfer type. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 GAIM_XFER_SEND, /**< File sending. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 GAIM_XFER_RECEIVE /**< File receiving. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 } GaimXferType;
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 * File transfer UI operations.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 * Any UI representing a file transfer must assign a filled-out
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
48 * GaimXferUiOps structure to the gaim_xfer.
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
50 typedef struct
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 {
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
52 void (*new_xfer)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
53 void (*destroy)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
54 void (*request_file)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
55 void (*ask_cancel)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
56 void (*add_xfer)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
57 void (*update_progress)(GaimXfer *xfer, double percent);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
58 void (*cancel_local)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
59 void (*cancel_remote)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
60
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
61 } GaimXferUiOps;
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 * A core representation of a file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
66 struct _GaimXfer
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 {
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 GaimXferType type; /**< The type of transfer. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
70 GaimAccount *account; /**< The account. */
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 char *who; /**< The person on the other end of the
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 transfer. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74
4605
4fe88c94c3b4 [gaim-migrate @ 4892]
Mark Doliner <mark@kingant.net>
parents: 4595
diff changeset
75 char *filename; /**< The name sent over the network. */
4fe88c94c3b4 [gaim-migrate @ 4892]
Mark Doliner <mark@kingant.net>
parents: 4595
diff changeset
76 char *local_filename; /**< The name on the local hard drive. */
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 size_t size; /**< The size of the file. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 FILE *dest_fp; /**< The destination file pointer. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 char *local_ip; /**< The local IP address. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 char *remote_ip; /**< The remote IP address. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 int local_port; /**< The local port. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 int remote_port; /**< The remote port. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 int fd; /**< The socket file descriptor. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 int watcher; /**< Watcher. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 size_t bytes_sent; /**< The number of bytes sent. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 size_t bytes_remaining; /**< The number of bytes remaining. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91
4538
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
92 gboolean completed; /**< File Transfer is completed. */
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
93
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 /* I/O operations. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 struct
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 {
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
97 void (*init)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
98 void (*start)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
99 void (*end)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
100 void (*cancel_send)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
101 void (*cancel_recv)(GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
102 size_t (*read)(char **buffer, GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
103 size_t (*write)(const char *buffer, size_t size, GaimXfer *xfer);
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
104 void (*ack)(GaimXfer *xfer, const char *buffer, size_t size);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 } ops;
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
108 GaimXferUiOps *ui_ops; /**< UI-specific operations. */
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 void *ui_data; /**< UI-specific data. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 void *data; /**< prpl-specific data. */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112 };
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
114 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
115 extern "C" {
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
116 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
117
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 /**************************************************************************/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 /** @name File Transfer API */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 /**************************************************************************/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 /*@{*/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 * Creates a new file transfer handle.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 * @param account The account sending or receiving the file.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 * @param type The type of file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128 * @param who The name of the remote user.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 * @return A file transfer handle.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
132 GaimXfer *gaim_xfer_new(GaimAccount *account,
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 GaimXferType type, const char *who);
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136 * Destroys a file transfer handle.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 * @param xfer The file transfer to destroy.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
140 void gaim_xfer_destroy(GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 * Requests confirmation for a file transfer from the user.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 * @param xfer The file transfer to request confirmation on.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
147 void gaim_xfer_request(GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150 * Called if the user accepts the file transfer request.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 * @param filename The filename.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
155 void gaim_xfer_request_accepted(GaimXfer *xfer, char *filename);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158 * Called if the user rejects the file transfer request.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
159 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
160 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
161 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
162 void gaim_xfer_request_denied(GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
163
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 * Returns the type of file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
167 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
168 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
169 * @return The type of the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
171 GaimXferType gaim_xfer_get_type(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174 * Returns the account the file transfer is using.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
177 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 * @return The account.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
180 GaimAccount *gaim_xfer_get_account(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
182 /**
4539
05476ef20d58 [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
183 * Returns the completed state for a file transfer.
05476ef20d58 [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
184 *
05476ef20d58 [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
185 * @param xfer The file transfer.
05476ef20d58 [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
186 *
05476ef20d58 [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
187 * @return The completed state.
05476ef20d58 [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
188 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
189 gboolean gaim_xfer_is_completed(const GaimXfer *xfer);
4539
05476ef20d58 [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
190
05476ef20d58 [gaim-migrate @ 4818]
Christian Hammond <chipx86@chipx86.com>
parents: 4538
diff changeset
191 /**
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
192 * Returns the name of the file being sent or received.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
193 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
194 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
195 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
196 * @return The filename.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
197 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
198 const char *gaim_xfer_get_filename(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201 * Returns the file's destination filename,
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
202 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
203 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
204 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
205 * @return The destination filename.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
206 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
207 const char *gaim_xfer_get_local_filename(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
208
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
209 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
210 * Returns the number of bytes sent so far.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
211 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
212 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
213 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
214 * @return The number of bytes sent.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
215 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
216 size_t gaim_xfer_get_bytes_sent(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
217
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
218 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
219 * Returns the number of bytes received so far.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
220 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
221 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
222 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
223 * @return The number of bytes received.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
224 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
225 size_t gaim_xfer_get_bytes_remaining(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
226
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
227 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
228 * Returns the size of the file being sent or received.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
229 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
230 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
231 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
232 * @return The total size of the file.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
233 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
234 size_t gaim_xfer_get_size(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
235
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
236 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
237 * Returns the current percentage of progress of the transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
238 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
239 * This is a number between 0 (0%) and 1 (100%).
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
240 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
241 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
242 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
243 * @return The percentage complete.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
244 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
245 double gaim_xfer_get_progress(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
246
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
247 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
248 * Returns the local IP address in the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
249 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
250 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
251 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
252 * @return The IP address on this end.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
253 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
254 const char *gaim_xfer_get_local_ip(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
255
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
256 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
257 * Returns the local port number in the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
258 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
259 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
260 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
261 * @return The port number on this end.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
262 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
263 unsigned int gaim_xfer_get_local_port(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
264
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
265 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
266 * Returns the remote IP address in the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
267 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
268 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
269 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
270 * @return The IP address on the other end.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
271 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
272 const char *gaim_xfer_get_remote_ip(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
273
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
274 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
275 * Returns the remote port number in the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
276 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
277 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
278 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
279 * @return The port number on the other end.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
280 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
281 unsigned int gaim_xfer_get_remote_port(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
282
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
283 /**
4538
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
284 * Sets the completed state for the file transfer.
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
285 *
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
286 * @param xfer The file transfer.
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
287 * @param completed The completed state.
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
288 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
289 void gaim_xfer_set_completed(GaimXfer *xfer, gboolean completed);
4538
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
290
009e206f260c [gaim-migrate @ 4817]
Nathan Walp <nwalp@pidgin.im>
parents: 4518
diff changeset
291 /**
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
292 * Sets the filename for the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
293 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
294 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
295 * @param filename The filename.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
296 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
297 void gaim_xfer_set_filename(GaimXfer *xfer, const char *filename);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
298
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
299 /**
4605
4fe88c94c3b4 [gaim-migrate @ 4892]
Mark Doliner <mark@kingant.net>
parents: 4595
diff changeset
300 * Sets the local filename for the file transfer.
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
301 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
302 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
303 * @param filename The filename
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
304 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
305 void gaim_xfer_set_local_filename(GaimXfer *xfer, const char *filename);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
306
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
307 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
308 * Sets the size of the file in a file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
309 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
310 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
311 * @param size The size of the file.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
312 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
313 void gaim_xfer_set_size(GaimXfer *xfer, size_t size);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
314
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
315 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
316 * Returns the UI operations structure for a file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
317 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
318 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
319 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
320 * @return The UI operations structure.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
321 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
322 GaimXferUiOps *gaim_xfer_get_ui_ops(const GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
323
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
324 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
325 * Sets the read function for the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
326 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
327 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
328 * @param fnc The read function.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
329 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
330 void gaim_xfer_set_read_fnc(GaimXfer *xfer,
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
331 size_t (*fnc)(char **, GaimXfer *));
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
332
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
333 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
334 * Sets the write function for the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
335 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
336 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
337 * @param fnc The write function.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
338 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
339 void gaim_xfer_set_write_fnc(GaimXfer *xfer,
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
340 size_t (*fnc)(const char *, size_t, GaimXfer *));
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
341
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
342 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
343 * Sets the acknowledge function for the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
344 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
345 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
346 * @param fnc The acknowledge function.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
347 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
348 void gaim_xfer_set_ack_fnc(GaimXfer *xfer,
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
349 void (*fnc)(GaimXfer *, const char *, size_t));
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
350
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
351 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
352 * Sets the transfer initialization function for the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
353 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
354 * This function is required, and must call gaim_xfer_start() with
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
355 * the necessary parameters. This will be called if the file transfer
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
356 * is accepted by the user.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
357 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
358 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
359 * @param fnc The transfer initialization function.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
360 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
361 void gaim_xfer_set_init_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
362
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
363 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
364 * Sets the start transfer function for the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
365 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
366 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
367 * @param fnc The start transfer function.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
368 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
369 void gaim_xfer_set_start_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
370
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
371 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
372 * Sets the end transfer function for the file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
373 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
374 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
375 * @param fnc The end transfer function.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
376 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
377 void gaim_xfer_set_end_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
378
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
379 /**
4675
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
380 * Sets the cancel send function for the file transfer.
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
381 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
382 * @param xfer The file transfer.
4675
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
383 * @param fnc The cancel send function.
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
384 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
385 void gaim_xfer_set_cancel_send_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
4675
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
386
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
387 /**
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
388 * Sets the cancel receive function for the file transfer.
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
389 *
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
390 * @param xfer The file transfer.
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
391 * @param fnc The cancel receive function.
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
392 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
393 void gaim_xfer_set_cancel_recv_fnc(GaimXfer *xfer, void (*fnc)(GaimXfer *));
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
394
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
395 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
396 * Reads in data from a file transfer stream.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
397 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
398 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
399 * @param buffer The buffer that will be created to contain the data.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
400 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
401 * @return The number of bytes read.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
402 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
403 size_t gaim_xfer_read(GaimXfer *xfer, char **buffer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
404
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
405 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
406 * Writes data to a file transfer stream.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
407 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
408 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
409 * @param buffer The buffer to read the data from.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
410 * @param size The number of bytes to write.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
411 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
412 * @return The number of bytes written.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
413 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
414 size_t gaim_xfer_write(GaimXfer *xfer, const char *buffer, size_t size);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
415
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
416 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
417 * Starts a file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
418 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
419 * Either @a fd must be specified <i>or</i> @a ip and @a port on a
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
420 * file receive transfer. On send, @a fd must be specified, and
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
421 * @a ip and @a port are ignored.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
422 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
423 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
424 * @param fd The file descriptor for the socket.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
425 * @param ip The IP address to connect to.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
426 * @param port The port to connect to.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
427 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
428 void gaim_xfer_start(GaimXfer *xfer, int fd, const char *ip,
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
429 unsigned int port);
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
430
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
431 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
432 * Ends a file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
433 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
434 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
435 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
436 void gaim_xfer_end(GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
437
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
438 /**
4675
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
439 * Cancels a file transfer on the local end.
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
440 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
441 * @param xfer The file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
442 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
443 void gaim_xfer_cancel_local(GaimXfer *xfer);
4675
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
444
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
445 /**
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
446 * Cancels a file transfer from the remote end.
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
447 *
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
448 * @param xfer The file transfer.
3145c5c45877 [gaim-migrate @ 4986]
Christian Hammond <chipx86@chipx86.com>
parents: 4605
diff changeset
449 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
450 void gaim_xfer_cancel_remote(GaimXfer *xfer);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
451
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
452 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
453 * Displays a file transfer-related error message.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
454 *
5499
c8afb821df3e [gaim-migrate @ 5895]
Christian Hammond <chipx86@chipx86.com>
parents: 5495
diff changeset
455 * This is a wrapper around gaim_notify_error(), which automatically
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
456 * specifies a title ("File transfer to <i>user</i> aborted" or
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
457 * "File Transfer from <i>user</i> aborted").
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
458 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
459 * @param type The type of file transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
460 * @param who The user on the other end of the transfer.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
461 * @param msg The message to display.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
462 */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
463 void gaim_xfer_error(GaimXferType type, const char *who, const char *msg);
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
464
6263
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
465 /*@}*/
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
466
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
467 /**************************************************************************/
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
468 /** @name File Transfer Subsystem API */
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
469 /**************************************************************************/
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
470 /*@{*/
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
471
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
472 /**
6268
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
473 * Sets the IP address of the local system in preferences.
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
474 *
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
475 * @param ip The local IP address.
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
476 */
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
477 void gaim_xfers_set_local_ip(const char *ip);
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
478
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
479 /**
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
480 * Returns the IP address of the local system set in preferences.
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
481 *
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
482 * @return The local IP address set in preferences.
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
483 */
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
484 const char *gaim_xfers_get_local_ip(void);
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
485
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
486 /**
6263
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
487 * Returns the IP address of the local system.
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
488 *
6269
0a902bd3e170 [gaim-migrate @ 6766]
Christian Hammond <chipx86@chipx86.com>
parents: 6268
diff changeset
489 * @note The returned string is a pointer to a static buffer. If this
0a902bd3e170 [gaim-migrate @ 6766]
Christian Hammond <chipx86@chipx86.com>
parents: 6268
diff changeset
490 * function is called twice, it may be important to make a copy
0a902bd3e170 [gaim-migrate @ 6766]
Christian Hammond <chipx86@chipx86.com>
parents: 6268
diff changeset
491 * of the returned string.
6263
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
492 *
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
493 * @return The local IP address.
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
494 */
6269
0a902bd3e170 [gaim-migrate @ 6766]
Christian Hammond <chipx86@chipx86.com>
parents: 6268
diff changeset
495 const char *gaim_xfers_get_local_system_ip(void);
6268
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
496
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
497 /**
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
498 * Returns the IP address that should be used for the specified account.
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
499 *
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
500 * First, the IP associated with @a account is tried, via a call to
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
501 * gaim_account_get_local_ip().
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
502 *
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
503 * If that IP is not set, the IP set in preferences is tried.
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
504 *
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
505 * If that IP is not set, the system's local IP is tried, via a call to
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
506 * gaim_xfers_get_local_ip().
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
507 *
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
508 * @note The returned IP address must be g_free()'d when no longer
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
509 * in use.
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
510 *
6269
0a902bd3e170 [gaim-migrate @ 6766]
Christian Hammond <chipx86@chipx86.com>
parents: 6268
diff changeset
511 * @note The returned string is a pointer to a static buffer. If this
0a902bd3e170 [gaim-migrate @ 6766]
Christian Hammond <chipx86@chipx86.com>
parents: 6268
diff changeset
512 * function is called twice, it may be important to make a copy
0a902bd3e170 [gaim-migrate @ 6766]
Christian Hammond <chipx86@chipx86.com>
parents: 6268
diff changeset
513 * of the returned string.
6268
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
514 *
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
515 * @return The local IP address to be used.
084e1f6610a8 [gaim-migrate @ 6765]
Christian Hammond <chipx86@chipx86.com>
parents: 6263
diff changeset
516 */
6269
0a902bd3e170 [gaim-migrate @ 6766]
Christian Hammond <chipx86@chipx86.com>
parents: 6268
diff changeset
517 const char *gaim_xfers_get_ip_for_account(const GaimAccount *account);
6263
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
518
6241
9ce44a7f9ae7 [gaim-migrate @ 6735]
Christian Hammond <chipx86@chipx86.com>
parents: 6240
diff changeset
519 /**
9ce44a7f9ae7 [gaim-migrate @ 6735]
Christian Hammond <chipx86@chipx86.com>
parents: 6240
diff changeset
520 * Initializes the file transfer subsystem.
9ce44a7f9ae7 [gaim-migrate @ 6735]
Christian Hammond <chipx86@chipx86.com>
parents: 6240
diff changeset
521 */
6263
3565ee7a5dd3 [gaim-migrate @ 6760]
Christian Hammond <chipx86@chipx86.com>
parents: 6241
diff changeset
522 void gaim_xfers_init(void);
6241
9ce44a7f9ae7 [gaim-migrate @ 6735]
Christian Hammond <chipx86@chipx86.com>
parents: 6240
diff changeset
523
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
524 /*@}*/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
525
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
526 /**************************************************************************/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
527 /** @name UI Registration Functions */
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
528 /**************************************************************************/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
529 /*@{*/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
530
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
531 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
532 * Sets the UI operations structure to be used in all gaim file transfers.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
533 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
534 * @param fnc The function.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
535 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
536 void gaim_set_xfer_ui_ops(GaimXferUiOps *ops);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
537
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
538 /**
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
539 * Returns the UI operations structure to be used in all gaim file transfers.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
540 *
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
541 * @return The UI operations structure.
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
542 */
6240
ac191233b816 [gaim-migrate @ 6734]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
543 GaimXferUiOps *gaim_get_xfer_ui_ops(void);
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
544
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
545 /*@}*/
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
546
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
547 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
548 }
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
549 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
550
4514
7521e29658bc [gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
551 #endif /* _GAIM_FT_H_ */