annotate src/protocols/sametime/meanwhile/mw_srvc_ft.h @ 11943:0110fc7c6a8a

[gaim-migrate @ 14234] Bringing things up to date with the last Meanwhile release, 0.5.0 and the last gaim-meanwhile plugin release, 1.2.5 (which should be the last plugin release against oldstatus, if all goes well with HEAD and no major bugs crop up) It builds, so that's a start. The status bits that have been empty since the first import of the sametime stuff are still empty, but I'm going to try and fill those in tomorrow. I've decided to try and start using HEAD actively, to encourage me to get this freaking prpl fully functional. committer: Tailor Script <tailor@pidgin.im>
author Christopher O'Brien <siege@pidgin.im>
date Wed, 02 Nov 2005 03:39:03 +0000
parents 3ef77720e577
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10969
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
1
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
2 /*
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
3 Meanwhile - Unofficial Lotus Sametime Community Client Library
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
4 Copyright (C) 2004 Christopher (siege) O'Brien
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
5
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
6 This library is free software; you can redistribute it and/or
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
7 modify it under the terms of the GNU Library General Public
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
8 License as published by the Free Software Foundation; either
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
9 version 2 of the License, or (at your option) any later version.
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
10
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
11 This library is distributed in the hope that it will be useful,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
14 Library General Public License for more details.
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
15
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
16 You should have received a copy of the GNU Library General Public
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
17 License along with this library; if not, write to the Free
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
19 */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
20
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
21
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
22 #ifndef _MW_SRVC_FT_H
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
23 #define _MW_SRVC_FT_H
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
24
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
25
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
26 #include "mw_common.h"
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
27
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
28
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
29 /** @file mw_srvc_ft.h
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
30
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
31 A file transfer is a simple way to get large chunks of binary data
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
32 from one client to another.
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
33 */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
34
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
35
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
36 /** @struct mwServiceFileTransfer
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
37 File transfer service
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
38 */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
39 struct mwServiceFileTransfer;
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
40
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
41
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
42 /** @struct mwFileTransfer
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
43 A single file trasfer session
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
44 */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
45 struct mwFileTransfer;
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
46
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
47
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
48 #define mwService_FILE_TRANSFER 0x00000038
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
49
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
50
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
51 enum mwFileTransferState {
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
52 mwFileTransfer_NEW, /**< file transfer is not open */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
53 mwFileTransfer_PENDING, /**< file transfer is opening */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
54 mwFileTransfer_OPEN, /**< file transfer is open */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
55 mwFileTransfer_CANCEL_LOCAL,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
56 mwFileTransfer_CANCEL_REMOTE,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
57 mwFileTransfer_DONE,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
58 mwFileTransfer_ERROR, /**< error in file transfer */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
59 mwFileTransfer_UNKNOWN, /**< unknown state */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
60 };
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
61
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
62
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
63 #define mwFileTransfer_isState(ft, state) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
64 (mwFileTransfer_getState(ft) == (state))
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
65
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
66 #define mwFileTransfer_isNew(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
67 mwFileTransfer_isState((ft), mwFileTransfer_NEW)
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
68
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
69 #define mwFileTransfer_isPending(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
70 mwFileTransfer_isState((ft), mwFileTransfer_PENDING)
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
71
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
72 #define mwFileTransfer_isOpen(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
73 mwFileTransfer_isState((ft), mwFileTransfer_OPEN)
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
74
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
75 #define mwFileTransfer_isDone(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
76 mwFileTransfer_isState((ft), mwFileTransfer_DONE)
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
77
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
78 #define mwFileTransfer_isCancelLocal(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
79 mwFileTransfer_isState((ft), mwFileTransfer_CANCEL_LOCAL)
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
80
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
81 #define mwFileTransfer_isCancelRemote(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
82 mwFileTransfer_isState((ft), mwFileTransfer_CANCEL_REMOTE)
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
83
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
84
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
85 enum mwFileTranferCode {
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
86 mwFileTransfer_SUCCESS = 0x00000000,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
87 mwFileTransfer_REJECTED = 0x08000606,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
88 };
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
89
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
90
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
91 struct mwFileTransferHandler {
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
92
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
93 /** an incoming file transfer has been offered */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
94 void (*ft_offered)(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
95
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
96 /** a file transfer has been fully initiated */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
97 void (*ft_opened)(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
98
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
99 /** a file transfer has been closed. Check the status of the file
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
100 transfer to determine if the transfer was complete or if it had
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
101 been interrupted */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
102 void (*ft_closed)(struct mwFileTransfer *ft, guint32 code);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
103
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
104 /** receive a chunk of a file from an inbound file transfer. */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
105 void (*ft_recv)(struct mwFileTransfer *ft, struct mwOpaque *data);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
106
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
107 /** received an ack for a sent chunk on an outbound file transfer.
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
108 this indicates that a previous call to mwFileTransfer_send has
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
109 reached the target and that the target has responded. */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
110 void (*ft_ack)(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
111
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
112 /** optional. called from mwService_free */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
113 void (*clear)(struct mwServiceFileTransfer *srvc);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
114 };
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
115
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
116
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
117 struct mwServiceFileTransfer *
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
118 mwServiceFileTransfer_new(struct mwSession *session,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
119 struct mwFileTransferHandler *handler);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
120
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
121
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
122 struct mwFileTransferHandler *
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
123 mwServiceFileTransfer_getHandler(struct mwServiceFileTransfer *srvc);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
124
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
125
11943
0110fc7c6a8a [gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents: 10969
diff changeset
126 const GList *
0110fc7c6a8a [gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents: 10969
diff changeset
127 mwServiceFileTransfer_getTransfers(struct mwServiceFileTransfer *srvc);
0110fc7c6a8a [gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents: 10969
diff changeset
128
0110fc7c6a8a [gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents: 10969
diff changeset
129
10969
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
130 struct mwFileTransfer *
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
131 mwFileTransfer_new(struct mwServiceFileTransfer *srvc,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
132 const struct mwIdBlock *who, const char *msg,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
133 const char *filename, guint32 filesize);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
134
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
135
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
136 /** deallocate a file transfer. will call mwFileTransfer_close if
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
137 necessary */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
138 void
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
139 mwFileTransfer_free(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
140
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
141
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
142 /** the status of this file transfer */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
143 enum mwFileTransferState
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
144 mwFileTransfer_getState(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
145
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
146
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
147 struct mwServiceFileTransfer *
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
148 mwFileTransfer_getService(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
149
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
150
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
151 /** the user on the other end of the file transfer */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
152 const struct mwIdBlock *
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
153 mwFileTransfer_getUser(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
154
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
155
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
156 /** the message sent along with an offered file transfer */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
157 const char *
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
158 mwFileTransfer_getMessage(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
159
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
160
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
161 /** the publicized file name. Not necessarily related to any actual
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
162 file on either system */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
163 const char *
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
164 mwFileTransfer_getFileName(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
165
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
166
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
167 /** total bytes intended to be sent/received */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
168 guint32 mwFileTransfer_getFileSize(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
169
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
170
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
171 /** bytes remaining to be received/send */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
172 guint32 mwFileTransfer_getRemaining(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
173
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
174
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
175 /** count of bytes sent/received over this file transfer so far */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
176 #define mwFileTransfer_getSent(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
177 (mwFileTransfer_getFileSize(ft) - mwFileTransfer_getRemaining(ft))
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
178
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
179
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
180 /** initiate an outgoing file transfer */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
181 int mwFileTransfer_offer(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
182
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
183
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
184 /** accept an incoming file transfer */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
185 int mwFileTransfer_accept(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
186
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
187
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
188 /** reject an incoming file transfer */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
189 #define mwFileTransfer_reject(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
190 mwFileTransfer_close((ft), mwFileTransfer_REJECTED)
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
191
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
192
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
193 /** cancel an open file transfer */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
194 #define mwFileTransfer_cancel(ft) \
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
195 mwFileTransfer_close((ft), mwFileTransfer_SUCCESS);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
196
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
197
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
198 /** Close a file transfer. This will trigger the ft_close function of the
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
199 session's handler.
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
200
11943
0110fc7c6a8a [gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents: 10969
diff changeset
201 @see mwFileTransfer_reject
0110fc7c6a8a [gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents: 10969
diff changeset
202 @see mwFileTransfer_cancel
10969
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
203 */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
204 int mwFileTransfer_close(struct mwFileTransfer *ft, guint32 code);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
205
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
206
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
207 /** send a chunk of data over an outbound file transfer. The client at
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
208 the other end of the transfer should respond with an acknowledgement
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
209 message, which can be caught in the service's handler.
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
210
11943
0110fc7c6a8a [gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents: 10969
diff changeset
211 @see mwFileTransferHandler::ft_ack
10969
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
212 */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
213 int mwFileTransfer_send(struct mwFileTransfer *ft,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
214 struct mwOpaque *data);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
215
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
216
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
217 /** acknowledge the receipt of a chunk of data from an inbound file
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
218 transfer. This should be done after every received chunk, or the
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
219 transfer will stall. However, not all clients will wait for an ack
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
220 after sending a chunk before sending the next chunk, so it is
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
221 possible to have the handler's ft_recv function triggered again
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
222 even if no ack was sent.
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
223
11943
0110fc7c6a8a [gaim-migrate @ 14234]
Christopher O'Brien <siege@pidgin.im>
parents: 10969
diff changeset
224 @see mwFileTransferHandler::ft_recv
10969
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
225 */
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
226 int mwFileTransfer_ack(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
227
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
228
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
229 void mwFileTransfer_setClientData(struct mwFileTransfer *ft,
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
230 gpointer data, GDestroyNotify clean);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
231
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
232
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
233 gpointer mwFileTransfer_getClientData(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
234
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
235
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
236 void mwFileTransfer_removeClientData(struct mwFileTransfer *ft);
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
237
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
238
3ef77720e577 [gaim-migrate @ 12790]
Christopher O'Brien <siege@pidgin.im>
parents:
diff changeset
239 #endif