meanwhile  1.0.2
mw_srvc_ft.h
Go to the documentation of this file.
1 
2 /*
3  Meanwhile - Unofficial Lotus Sametime Community Client Library
4  Copyright (C) 2004 Christopher (siege) O'Brien
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public
17  License along with this library; if not, write to the Free
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 
21 
22 #ifndef _MW_SRVC_FT_H
23 #define _MW_SRVC_FT_H
24 
25 
33 #include "mw_common.h"
34 
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
45 
46 
50 struct mwFileTransfer;
51 
52 
53 #define mwService_FILE_TRANSFER 0x00000038
54 
55 
65 };
66 
67 
68 #define mwFileTransfer_isState(ft, state) \
69  (mwFileTransfer_getState(ft) == (state))
70 
71 #define mwFileTransfer_isNew(ft) \
72  mwFileTransfer_isState((ft), mwFileTransfer_NEW)
73 
74 #define mwFileTransfer_isPending(ft) \
75  mwFileTransfer_isState((ft), mwFileTransfer_PENDING)
76 
77 #define mwFileTransfer_isOpen(ft) \
78  mwFileTransfer_isState((ft), mwFileTransfer_OPEN)
79 
80 #define mwFileTransfer_isDone(ft) \
81  mwFileTransfer_isState((ft), mwFileTransfer_DONE)
82 
83 #define mwFileTransfer_isCancelLocal(ft) \
84  mwFileTransfer_isState((ft), mwFileTransfer_CANCEL_LOCAL)
85 
86 #define mwFileTransfer_isCancelRemote(ft) \
87  mwFileTransfer_isState((ft), mwFileTransfer_CANCEL_REMOTE)
88 
89 
91  mwFileTransfer_SUCCESS = 0x00000000,
93 };
94 
95 
97 
99  void (*ft_offered)(struct mwFileTransfer *ft);
100 
102  void (*ft_opened)(struct mwFileTransfer *ft);
103 
107  void (*ft_closed)(struct mwFileTransfer *ft, guint32 code);
108 
110  void (*ft_recv)(struct mwFileTransfer *ft, struct mwOpaque *data);
111 
115  void (*ft_ack)(struct mwFileTransfer *ft);
116 
118  void (*clear)(struct mwServiceFileTransfer *srvc);
119 };
120 
121 
122 struct mwServiceFileTransfer *
124  struct mwFileTransferHandler *handler);
125 
126 
127 struct mwFileTransferHandler *
129 
130 
131 const GList *
133 
134 
135 struct mwFileTransfer *
137  const struct mwIdBlock *who, const char *msg,
138  const char *filename, guint32 filesize);
139 
140 
143 void
145 
146 
150 
151 
152 struct mwServiceFileTransfer *
154 
155 
157 const struct mwIdBlock *
159 
160 
162 const char *
164 
165 
168 const char *
170 
171 
173 guint32 mwFileTransfer_getFileSize(struct mwFileTransfer *ft);
174 
175 
177 guint32 mwFileTransfer_getRemaining(struct mwFileTransfer *ft);
178 
179 
181 #define mwFileTransfer_getSent(ft) \
182  (mwFileTransfer_getFileSize(ft) - mwFileTransfer_getRemaining(ft))
183 
184 
186 int mwFileTransfer_offer(struct mwFileTransfer *ft);
187 
188 
190 int mwFileTransfer_accept(struct mwFileTransfer *ft);
191 
192 
194 #define mwFileTransfer_reject(ft) \
195  mwFileTransfer_close((ft), mwFileTransfer_REJECTED)
196 
197 
199 #define mwFileTransfer_cancel(ft) \
200  mwFileTransfer_close((ft), mwFileTransfer_SUCCESS);
201 
202 
209 int mwFileTransfer_close(struct mwFileTransfer *ft, guint32 code);
210 
211 
218 int mwFileTransfer_send(struct mwFileTransfer *ft,
219  struct mwOpaque *data);
220 
221 
231 int mwFileTransfer_ack(struct mwFileTransfer *ft);
232 
233 
235  gpointer data, GDestroyNotify clean);
236 
237 
238 gpointer mwFileTransfer_getClientData(struct mwFileTransfer *ft);
239 
240 
242 
243 
244 #ifdef __cplusplus
245 }
246 #endif
247 
248 
249 #endif /* _MW_SRVC_FT_H */