Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_so3 / transprt.hxx
blobbbb7e6bd7c3510d18e8d3f969c6ba3003c60121f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transprt.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _TRANSPRT_HXX
32 #define _TRANSPRT_HXX "$Revision: 1.5 $"
34 #ifndef _SOLAR_H
35 #include <tools/solar.h>
36 #endif
38 #ifndef _ERRCODE_HXX
39 #include <tools/errcode.hxx>
40 #endif
42 #ifndef _STREAM_HXX
43 #include <tools/stream.hxx>
44 #endif
46 #ifndef _STRING_HXX
47 #include <tools/string.hxx>
48 #endif
50 #ifndef _BINDING_HXX
51 #include <bf_so3/binding.hxx>
52 #endif
54 #ifndef INCLUDED_SO3DLLAPI_H
55 #include "bf_so3/so3dllapi.h"
56 #endif
58 class DateTime;
60 namespace binfilter {
61 class SvBindingTransport;
62 class SvBindingTransportFactory;
63 class SvBindingTransportCallback;
64 class SvBindingTransportContext;
66 #ifndef COPYCTOR_API
67 #define COPYCTOR_API(C) C (const C&); C& operator= (const C&)
68 #endif
70 /*========================================================================
72 * SvBindingTransport interface.
74 *======================================================================*/
75 class SO3_DLLPUBLIC SvBindingTransport
77 /** Not implemented.
79 SO3_DLLPRIVATE COPYCTOR_API(SvBindingTransport);
81 public:
82 SvBindingTransport (void);
83 virtual ~SvBindingTransport (void);
85 virtual void Start (void) = 0;
86 virtual void Abort (void) = 0;
89 /*========================================================================
91 * SvBindingTransportFactory interface.
93 *======================================================================*/
94 class SO3_DLLPUBLIC SvBindingTransportFactory
96 /** Not implemented.
98 SO3_DLLPRIVATE COPYCTOR_API(SvBindingTransportFactory);
100 public:
101 SvBindingTransportFactory (void);
102 virtual ~SvBindingTransportFactory (void);
104 virtual BOOL HasTransport (
105 const String &rUrl) = 0;
107 virtual SvBindingTransport* CreateTransport (
108 const String &rUrl,
109 SvBindingTransportContext &rCtx,
110 SvBindingTransportCallback *pCallback) = 0;
113 /*========================================================================
115 * SvBindingTransportCallback interface.
117 *======================================================================*/
118 class SO3_DLLPUBLIC SvBindingTransportCallback
120 public:
121 virtual void OnStart (void) = 0;
123 virtual void OnError (ErrCode eErrCode) = 0;
125 virtual void OnMimeAvailable (const String &rMime) = 0;
127 virtual void OnExpiresAvailable (const DateTime &rExpires) = 0;
129 virtual void OnHeaderAvailable (
130 const String &rName, const String &rValue) = 0;
132 virtual void OnDataAvailable (
133 SvStatusCallbackType eType,
134 ULONG nSize, SvLockBytes *pLockBytes) = 0;
136 virtual void OnProgress (
137 ULONG nNow, ULONG nEnd, SvBindStatus eStatus) = 0;
139 virtual void OnRedirect (const String &rUrl) = 0;
142 /*========================================================================
144 * SvBindingTransportContext.
146 *======================================================================*/
147 class SO3_DLLPUBLIC SvBindingTransportContext
149 /** Representation.
151 SvBindAction m_eBindAction;
152 SvBindMode m_eBindMode;
153 StreamMode m_eStrmMode;
154 USHORT m_nPriority;
155 String m_aReferer;
156 String m_aSendMimeType;
157 SvLockBytesRef m_xPostLockBytes;
159 public:
160 virtual ~SvBindingTransportContext (void);
162 /** BindAction.
164 SvBindAction GetBindAction (void) const { return m_eBindAction; }
165 void SetBindAction (SvBindAction eAction) { m_eBindAction = eAction; }
167 /** BindMode.
169 SvBindMode GetBindMode (void) const { return m_eBindMode; }
170 void SetBindMode (SvBindMode eMode) { m_eBindMode = eMode; }
172 /** StreamMode.
174 StreamMode GetStreamMode (void) const { return m_eStrmMode; }
175 void SetStreamMode (StreamMode eMode) { m_eStrmMode = eMode; }
177 /** Priority.
179 USHORT GetPriority (void) const { return m_nPriority; }
180 void SetPriority (USHORT nPriority) { m_nPriority = nPriority; }
182 /** Referer.
184 const String& GetReferer (void) const { return m_aReferer; }
185 void SetReferer (const String &rReferer) { m_aReferer = rReferer; }
187 /** SendMimeType (actions PUT and POST).
189 const String& GetSendMimeType (void) const
191 return m_aSendMimeType;
193 void SetSendMimeType (const String &rSendMimeType)
195 m_aSendMimeType = rSendMimeType;
198 /** PostLockBytes (actions PUT and POST).
200 SvLockBytes* GetPostLockBytes (void) const
202 return m_xPostLockBytes;
204 void SetPostLockBytes (SvLockBytesRef &rxPostLockBytes)
206 m_xPostLockBytes = rxPostLockBytes;
210 /*========================================================================
212 * SvLockBytesFactory interface.
214 *======================================================================*/
215 class SO3_DLLPUBLIC SvLockBytesFactory
217 /** Representation.
219 String m_aWildcard;
221 /** Not implemented.
223 SO3_DLLPRIVATE COPYCTOR_API(SvLockBytesFactory);
225 public:
226 virtual ~SvLockBytesFactory (void);
228 virtual SvLockBytesRef CreateLockBytes (
229 const String &rUrl, String &rMime) = 0;
231 static SvLockBytesFactory* GetFactory (const String &rUrl);
233 const String& GetWildcard (void) const { return m_aWildcard; }
236 /*========================================================================
238 * SfxSimpleLockBytesFactory interface.
240 *======================================================================*/
241 class SO3_DLLPUBLIC SfxSimpleLockBytesFactory :
242 public SvLockBytesFactory, public SvRefBase
244 /** Representation.
246 SvLockBytesRef m_xLockBytes;
247 String m_aMime;
249 static USHORT m_nCounter;
251 /** Not implemented.
253 SO3_DLLPRIVATE COPYCTOR_API(SfxSimpleLockBytesFactory);
255 public:
256 /** Destruction (protected) (SvRefBase).
258 virtual ~SfxSimpleLockBytesFactory (void);
260 public:
261 virtual SvLockBytesRef CreateLockBytes (
262 const String &rUrl, String &rMime);
265 SV_DECL_IMPL_REF(SfxSimpleLockBytesFactory);
267 /*========================================================================
269 * SvLockBytesTransportFactory interface.
271 *======================================================================*/
272 class SO3_DLLPUBLIC SvLockBytesTransportFactory : public SvBindingTransportFactory
274 /** Not implemented.
276 SO3_DLLPRIVATE COPYCTOR_API(SvLockBytesTransportFactory);
278 public:
279 SvLockBytesTransportFactory (void);
280 virtual ~SvLockBytesTransportFactory (void);
282 virtual BOOL HasTransport (
283 const String &rUrl);
285 virtual SvBindingTransport* CreateTransport (
286 const String &rUrl,
287 SvBindingTransportContext &rCtx,
288 SvBindingTransportCallback *pCB);
291 /*========================================================================
293 * CntTransportFactory interface.
295 *======================================================================*/
296 class SO3_DLLPUBLIC CntTransportFactory : public SvBindingTransportFactory
298 /** Not implemented.
300 SO3_DLLPRIVATE COPYCTOR_API(CntTransportFactory);
302 public:
303 CntTransportFactory (void);
304 virtual ~CntTransportFactory (void);
306 virtual BOOL HasTransport (
307 const String &rUrl);
309 virtual SvBindingTransport* CreateTransport (
310 const String &rUrl,
311 SvBindingTransportContext &rCtx,
312 SvBindingTransportCallback *pCB);
315 /*========================================================================
317 * The End.
319 *======================================================================*/
323 #endif /* _TRANSPRT_HXX */