epoc32/include/obexserver.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/obexserver.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/obexserver.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,693 @@
     1.4 -obexserver.h
     1.5 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +
    1.21 +
    1.22 +/**
    1.23 + @file
    1.24 + @publishedAll
    1.25 + @released
    1.26 +*/
    1.27 +
    1.28 +#ifndef __OBEXSERVER_H
    1.29 +#define __OBEXSERVER_H
    1.30 +
    1.31 +#include <obextypes.h>
    1.32 +#include <obex/internal/obextransportconstants.h>
    1.33 +#include <obexbase.h>
    1.34 +
    1.35 +class TObexTransportInfo;
    1.36 +class CObexServerRequestPacketEngine;
    1.37 +class CObexPacketSignaller;
    1.38 +class MObexReadActivityObserver;
    1.39 +
    1.40 +/** OBEX server.
    1.41 +
    1.42 +CObexServer provides a framework for servicing OBEX requests from remote clients. 
    1.43 +It is designed to be able to act as either a "default" application (in IrDA 
    1.44 +terms, registering on the IrDA:OBEX IAS class), or as a application specific 
    1.45 +server (registering itself on a private IAS class). 
    1.46 +
    1.47 +You implement service-specific behaviour by providing a MObexServerNotify 
    1.48 +interface implementation to the server object. The server calls the interface's 
    1.49 +functions to provide notification of server events, which specific implementations 
    1.50 +can process (or ignore) as appropriate.
    1.51 +
    1.52 +This class is not designed for user derivation. 
    1.53 +
    1.54 +@publishedAll
    1.55 +@released
    1.56 +*/
    1.57 +NONSHARABLE_CLASS(CObexServer) : public CObex
    1.58 +	{
    1.59 +	// CObexServer is friends with the core Server State Machine class so
    1.60 +	// that it can access the CObex::ControlledTransportDown() method
    1.61 +	friend class CObexServerStateMachine;
    1.62 +
    1.63 +	// CObexServer is friends with the TObexServerStateObexConnecting class so
    1.64 +	// that it can access the CObex::SetConnectState(TConnectState aNewState) method
    1.65 +	friend class TObexServerStateObexConnecting;
    1.66 +	
    1.67 +	// CObexServer is friends with the Server Request Packet Engine so that
    1.68 +	// it can NULL the iServerRequestPacketEngine pointer ready for another 
    1.69 +	// extension interface 
    1.70 +	friend class CObexServerRequestPacketEngine;
    1.71 +		
    1.72 +public:
    1.73 +	/**
    1.74 +	@publishedAll
    1.75 +	@released
    1.76 +	
    1.77 +	The target header checking to apply to incoming connection requests.  Defaults to
    1.78 +	EIfPresent.
    1.79 +	@see CObexServer::SetTargetChecking
    1.80 +	*/
    1.81 +	enum TTargetChecking
    1.82 +		{
    1.83 +		ENoChecking,	/** Allow all target headers to connect. */
    1.84 +		EIfPresent,		/** Only check target header in response to receiving one. Allows all clients
    1.85 +							specifying an Inbox service to connect. */
    1.86 +		EAlways,		/** Strict checking. Only allow connections if target header matches or no header
    1.87 +							received and none expected. */
    1.88 +		};
    1.89 +
    1.90 +	IMPORT_C static CObexServer* NewL(TObexProtocolInfo& aObexProtocolInfoPtr);
    1.91 +	IMPORT_C static CObexServer* NewL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy);
    1.92 +	IMPORT_C static CObexServer* NewL(TObexTransportInfo& aObexTransportInfo);
    1.93 +	IMPORT_C ~CObexServer();
    1.94 +	IMPORT_C TInt Start(MObexServerNotify* aOwner);
    1.95 +	IMPORT_C TInt Start(MObexServerNotifyAsync* aOwner);
    1.96 +	IMPORT_C void Stop();
    1.97 +	IMPORT_C TBool IsStarted();
    1.98 +	IMPORT_C TOperation CurrentOperation() const;
    1.99 +	void SetCurrentOperation(const TOperation aOperation);	// used internally by state machine
   1.100 +	IMPORT_C void SetChallengeL(const TDesC& aPassword);
   1.101 +	IMPORT_C void ResetChallenge();
   1.102 +	IMPORT_C void UserPasswordL( const TDesC& aPassword); 
   1.103 +	IMPORT_C void SetTargetChecking(TTargetChecking aChecking);
   1.104 +	IMPORT_C TInt SetPutFinalResponseHeaders(CObexHeaderSet* aHeaderSet);
   1.105 +	IMPORT_C TInt RequestIndicationCallback(CObexBaseObject* aObject);
   1.106 +    IMPORT_C TInt RequestIndicationCallbackWithError(TObexResponse aResponseCode);
   1.107 +    IMPORT_C TInt RequestIndicationCallbackWithError(TInt aErrorCode);
   1.108 +    IMPORT_C TInt RequestCompleteIndicationCallback(TObexResponse aResponseCode);
   1.109 +    IMPORT_C TInt RequestCompleteIndicationCallback(TInt aErrorCode);
   1.110 +    // @publishedPartner
   1.111 +	IMPORT_C TInt PacketHeaders(CObexHeaderSet*& aHeaderSet);
   1.112 +	IMPORT_C TInt PacketHeaders(CObexHeaderSet*& aHeaderSet, MObexHeaderCheck& aHeaderCheck);
   1.113 +	IMPORT_C void SetReadActivityObserver(MObexReadActivityObserver* aObserver);
   1.114 +	// @internalTechnology
   1.115 +	IMPORT_C TAny* ExtensionInterfaceL(TUid aUid);
   1.116 +	IMPORT_C const TObexTransportInfo* TransportInfo() const;
   1.117 +
   1.118 +public:
   1.119 +	// Called from CObexNotifyExtendServer
   1.120 +	void SignalPacketProcessEvent(TObexPacketProcessEvent aEvent);
   1.121 +	
   1.122 +	// Unexported functions used by the Server state machine
   1.123 +	TBool CheckObjectForConnectionId(CObexBaseObject& aObject);
   1.124 +	TBool CheckPacketForConnectionId(CObexPacket& aObject);
   1.125 +
   1.126 +private:
   1.127 +	CObexServer();
   1.128 +	void ConstructL(TObexTransportInfo& aObexTransportInfo);
   1.129 +	TInt AcceptConnection();
   1.130 +	// Implementation of CObex Events
   1.131 +	virtual void OnPacketReceive(CObexPacket& aPacket);
   1.132 +	virtual void OnError(TInt aError);
   1.133 +	virtual void OnTransportUp();
   1.134 +	virtual void OnTransportDown();
   1.135 +
   1.136 +public:
   1.137 +	// These three functions need to be public so the Server state machine can use them
   1.138 +	// However ParseConnectPacket cannot be moved as it is a virtual function (from CObex)
   1.139 +	TInt PrepareConnectPacket(CObexPacket& aPacket);	
   1.140 +	TInt PrepareErroredConnectPacket(CObexPacket& aPacket);
   1.141 +	void SignalReadActivity();
   1.142 +	TInt ParseConnectPacket(CObexPacket& aPacket);
   1.143 +
   1.144 +private:
   1.145 +	TInt AddConnectionIDHeader(CObexPacket& aPacket);
   1.146 +	TInt PrepareFinalChallResponse(CObexPacket& aPacket, TConnectState& aNextState);
   1.147 +	void CheckTarget(TConnectState& aNextState, TInt& aRetVal);
   1.148 +	void ResetConnectionID();
   1.149 +	void SetConnectionID(TUint32 aConnectionID);
   1.150 +	TUint32 ConnectionID();
   1.151 +	void CheckServerAppResponseCode(TObexOpcode aOpcode, TObexResponse aResponse);
   1.152 +	TInt DoPacketHeaders(CObexHeaderSet*& aHeaderSet, MObexHeaderCheck* aHeaderCheck);
   1.153 +
   1.154 +private:
   1.155 +	MObexServerNotifyAsync* iOwner;
   1.156 +	TBool iEnabled;
   1.157 +	TBool iSpecDone;
   1.158 +	TBool iTargetReceived;
   1.159 +	TTargetChecking iTargetChecking;
   1.160 +	TUint32 iConnectionID;
   1.161 +	TBool iConnectionIdSet;
   1.162 +	CObexHeader*	iHeader;
   1.163 +	CObexServerStateMachine* iStateMachine;
   1.164 +	CObexServerNotifySyncWrapper* iSyncWrapper;
   1.165 +	CObexServerRequestPacketEngine* iServerRequestPacketEngine;
   1.166 +	CObexPacketSignaller* iPacketProcessSignaller;
   1.167 +	};
   1.168 +
   1.169 +
   1.170 +/** OBEX synchronous server notification interface.
   1.171 +
   1.172 +Any service that provides OBEX server functionality must implement one of the two
   1.173 +server observer classes -- this one or MObexServerNotifyAsync.
   1.174 +
   1.175 +The CObexServer object handles the protocol side of an OBEX server session, 
   1.176 +while this class provides the server policy for a particular session.
   1.177 +
   1.178 +PUT and GET requests are handled synchronously, with the implementer returning a
   1.179 +CObexBufObject which will be processed immediately.
   1.180 +
   1.181 +@publishedAll
   1.182 +@released
   1.183 +@see MObexServerNotifyAsync
   1.184 +@see CObexServer
   1.185 +*/
   1.186 +class MObexServerNotify
   1.187 +	{
   1.188 +public:
   1.189 +	/**
   1.190 +	 Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is.
   1.191 +	 @param aInterface UID of the interface to return
   1.192 +	 @param aObject the container for another interface as specified by aInterface
   1.193 +	 */
   1.194 +	IMPORT_C virtual void MOSN_ExtensionInterfaceL(TUid aInterface, void*& aObject);
   1.195 +
   1.196 +	/** Called if an OBEX protocol error occurs.
   1.197 +	
   1.198 +	It is only called for fatal errors that cause the OBEX connection to terminate. 
   1.199 +	An error that does not terminate the connection, for example the server issuing 
   1.200 +	a semantically valid, but unrecognised command, will not be indicated.
   1.201 +	
   1.202 +	@param aError Error code that describes the OBEX error. OBEX specific error 
   1.203 +	codes are listed from KErrIrObexClientNoDevicesFound. 
   1.204 +	
   1.205 +	@publishedAll
   1.206 +	@released
   1.207 +	*/
   1.208 +	virtual void ErrorIndication(TInt aError) =0;
   1.209 +	
   1.210 +	
   1.211 +	
   1.212 +	/** Called when the underlying transport connection is made from a remote 
   1.213 +	client to the server.
   1.214 +	
   1.215 +	Note that this does not, however, indicate an OBEX connection has been successfully 
   1.216 +	established.
   1.217 +	
   1.218 +	You can define any low-level connection policy here. It is also a good place 
   1.219 +	to set up the local connection information (CObex::LocalInfo()), if any non-defaults 
   1.220 +	are required. 
   1.221 +
   1.222 +	@publishedAll
   1.223 +	@released
   1.224 +	*/
   1.225 +	virtual void TransportUpIndication() =0;
   1.226 +	
   1.227 +	
   1.228 +
   1.229 +	/** Called when the transport connection is dropped (by either party).
   1.230 +	
   1.231 +	It is called whether the OBEX connection was gracefully disconnected or not. 
   1.232 +	The function is the definitive place for disconnection processing.
   1.233 +	
   1.234 +	@publishedAll
   1.235 +	@released
   1.236 +	*/
   1.237 +	virtual void TransportDownIndication() =0;
   1.238 +	
   1.239 +	
   1.240 +	
   1.241 +	/** Called when an OBEX connection is made from a remote client.
   1.242 +	
   1.243 +	Override this function to provide any extra OBEX connection processing.
   1.244 +	Despite this method returning a value, implementers cannot use this to
   1.245 +	refuse the connection attempt.
   1.246 +	
   1.247 +	@param aRemoteInfo Connection information supplied by that remote machine
   1.248 +	@param aInfo Further information about the requested connection (reserved)
   1.249 +	@return Ignored
   1.250 +	
   1.251 +	@publishedAll
   1.252 +	@released
   1.253 +	*/
   1.254 +	virtual TInt ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo) =0;
   1.255 +
   1.256 +
   1.257 +
   1.258 +	/** Called on a (graceful) OBEX disconnection by the client.
   1.259 +	
   1.260 +	Override this to provide any extra processing OBEX disconnection processing.
   1.261 +	
   1.262 +	Note that this indication will not be raised if the remote machine simply 
   1.263 +	drops the transport connection. However, ErrorIndication() will be called 
   1.264 +	if the disconnection is unexpected/ invalid (i.e. another operation was in 
   1.265 +	progress at the time). In all cases, TransportDownIndication() will be called.
   1.266 +	
   1.267 +	@param aInfo Contains information about the disconnection (reserved) 
   1.268 +	
   1.269 +	@publishedAll
   1.270 +	@released
   1.271 +	*/
   1.272 +	virtual void ObexDisconnectIndication(const TDesC8& aInfo) =0;
   1.273 +
   1.274 +
   1.275 +
   1.276 +	/** Called on receipt of the first packet of a (valid) put request. 
   1.277 +	
   1.278 +	It is called before any parsing of the packet is performed, simply to establish 
   1.279 +	whether this server is interested in receiving objects at all.
   1.280 +	
   1.281 +	Note if the returned object cannot be initialised for receiving, ERespInternalError
   1.282 +	is returned to the client.
   1.283 +	
   1.284 +	@return CObexBaseObject-derived object, which the object being put will be 
   1.285 +	parsed into. If this is NULL, ERespForbidden is returned to the client. 
   1.286 +	
   1.287 +	@publishedAll
   1.288 +	@released
   1.289 +	*/
   1.290 +	virtual CObexBufObject* PutRequestIndication() =0;
   1.291 +
   1.292 +
   1.293 +
   1.294 +	/** Called on receipt of every packet of an OBEX PUT operation.
   1.295 +	
   1.296 +	It will always be preceded by a PutRequestIndication(). The object returned 
   1.297 +	by the request indication will be updated to reflect all the information received 
   1.298 +	concerning the object which the client is sending, from packets up to and 
   1.299 +	including the current one. 
   1.300 +	
   1.301 +	You can use this function to provide periodic user notification on the progress 
   1.302 +	of the transfer (noting that the Length attribute may take an arbitrary number 
   1.303 +	of packets to become non-zero, and the constraints on its accuracy). Due to 
   1.304 +	the nature of OBEX operations, where any header attribute can be sent at any 
   1.305 +	point in the transfer, this is also a good place to marshal the details of 
   1.306 +	a received object, and possibly prompt for action on the received object (e.g. 
   1.307 +	renaming on filename clashes).
   1.308 +	
   1.309 +	Note that this function could be hit quite heavily, in proportion to the size 
   1.310 +	of the object transferred. Therefore more consideration should be given to 
   1.311 +	the speed of execution of this function than that of the other indications.
   1.312 +	
   1.313 +	@return KErrNone instructs the server to allow the client to continue the put 
   1.314 +	operation. Any other value cancels the operation with an appropriate OBEX 
   1.315 +	server response code. 
   1.316 +	
   1.317 +	@publishedAll
   1.318 +	@released
   1.319 +	*/
   1.320 +	virtual TInt PutPacketIndication() =0;
   1.321 +
   1.322 +
   1.323 +
   1.324 +	/** Called after the final put packet has been successfully received and parsed. 
   1.325 +	
   1.326 +	Note that there will not necessarily be a call to this function corresponding 
   1.327 +	to each PutRequestIndication() as, if an error occurs while the put is being 
   1.328 +	carried out, ErrorIndication() will be called instead.
   1.329 +	
   1.330 +	Before version 6.1, the return type was void.
   1.331 +
   1.332 +	@return KErrNoneinstructs the remote client that the put completed successfully. 
   1.333 +	Any other value cancels the operation with an appropriate OBEX server response 
   1.334 +	code.
   1.335 +	
   1.336 +	@publishedAll
   1.337 +	@released
   1.338 +	*/
   1.339 +	virtual TInt PutCompleteIndication() =0;
   1.340 +
   1.341 +
   1.342 +
   1.343 +	/** Called when a full get request has been received from the client. 
   1.344 +	
   1.345 +	aRequestedObject holds all the details about the object the remote client 
   1.346 +	has requested. Use this function to analyse the client's request, and return 
   1.347 +	a pointer to the object to be returned to the client, or NULL to return no 
   1.348 +	object. 
   1.349 +	
   1.350 +	If NULL is returned, the server will send ERespForbidden to the client; if 
   1.351 +	an error occurs in returning the object, ERespInternalError is returned, otherwise 
   1.352 +	the returned object is sent back to the client.
   1.353 +	
   1.354 +	@param aRequiredObject Details about the object the remote client has requested
   1.355 +	@return Object to return to the client 
   1.356 +	
   1.357 +	@publishedAll
   1.358 +	@released
   1.359 +	*/
   1.360 +	virtual CObexBufObject* GetRequestIndication(CObexBaseObject *aRequiredObject) =0;
   1.361 +
   1.362 +
   1.363 +
   1.364 +	/** Called for every packet of get reply sent by the server back to the client. 
   1.365 +	
   1.366 +	The function is only called while an object is being sent to the client, not 
   1.367 +	while the client is providing its initial specification for the object it 
   1.368 +	requires. 
   1.369 +	
   1.370 +	You can use this function to provide user notification on the object being 
   1.371 +	sent, and its progress. As with PutPacketIndication(), you should consider 
   1.372 +	that this function might get called often, especially for large objects and 
   1.373 +	small OBEX packet sizes, so the speed of execution here is important.
   1.374 +	
   1.375 +	@return KErrNone to continue sending the object, or any other error code to 
   1.376 +	cancel the operation 
   1.377 +
   1.378 +	@publishedAll
   1.379 +	@released
   1.380 +	*/
   1.381 +	virtual TInt GetPacketIndication() =0;
   1.382 +
   1.383 +
   1.384 +
   1.385 +	/** Called when the final packet of the object has been returned to the client.
   1.386 +	
   1.387 +	Note like PutCompleteIndication(), this function might not be called for each 
   1.388 +	GetRequestIndication(), if the operation is interrupted by an error.
   1.389 +	
   1.390 +	Before version 6.1, the return type was void.
   1.391 +	
   1.392 +	@return KErrNoneinstructs the remote client that the get completed successfully. 
   1.393 +	Any other value cancels the operation with an appropriate OBEX server response 
   1.394 +	code. 
   1.395 +	
   1.396 +	@publishedAll
   1.397 +	@released
   1.398 +	*/
   1.399 +	virtual TInt GetCompleteIndication() =0;
   1.400 +
   1.401 +
   1.402 +
   1.403 +	/** Called when an OBEX SETPATH command is received by the server. 
   1.404 +	
   1.405 +	@param aPathInfo SETPATH command parameters
   1.406 +	@param aInfo Not currently used
   1.407 +	@return System wide error code indicating the success of the setpath command 
   1.408 +	
   1.409 +	@publishedAll
   1.410 +	@released
   1.411 +	*/
   1.412 +	virtual TInt SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo) =0;
   1.413 +
   1.414 +
   1.415 +
   1.416 +	/** Called when an abort packet is received from the client. 
   1.417 +	
   1.418 +	An OBEX abort command simply cancels the current operation, and does not necessarily 
   1.419 +	have to cause the connection to be dropped. On return, a ERespSuccess packet 
   1.420 +	is sent to the client. 
   1.421 +	
   1.422 +	@publishedAll
   1.423 +	@released
   1.424 +	*/
   1.425 +	virtual void AbortIndication() =0;
   1.426 +	};
   1.427 +
   1.428 +
   1.429 +
   1.430 +/** OBEX asynchronous server notification interface.
   1.431 +
   1.432 +Any service that provides OBEX server functionality must implement one of the two
   1.433 +server observer classes -- this one or MObexServerNotify.
   1.434 +
   1.435 +The CObexServer object handles the protocol side of an OBEX server session, 
   1.436 +while this class provides the server policy for a particular session.
   1.437 +
   1.438 +PUT and GET requests are handled asynchronously, with the upcall from the server
   1.439 +being followed at some stage in the future by a call to CObexServer::RequestIndicationComplete
   1.440 +to trigger processing.
   1.441 +
   1.442 +@publishedAll
   1.443 +@released
   1.444 +@see MObexServerNotify
   1.445 +@see CObexServer
   1.446 +*/
   1.447 +class MObexServerNotifyAsync
   1.448 +	{
   1.449 +public:
   1.450 +
   1.451 +	/**
   1.452 + 	 Returns a null aObject if the extension is not implemented, or a pointer to another
   1.453 + 	 interface if it is.
   1.454 +	 @param aInterface UID of the interface to return
   1.455 +	 @param aObject the container for another interface as specified by aInterface
   1.456 +	 */
   1.457 +	IMPORT_C virtual void MOSNA_ExtensionInterfaceL(TUid aInterface, void*& aObject);		
   1.458 +
   1.459 +
   1.460 +
   1.461 +	/** Called if an OBEX protocol error occurs.
   1.462 +	
   1.463 +	It is only called for fatal errors that cause the OBEX connection to terminate. 
   1.464 +	An error that does not terminate the connection, for example the server issuing 
   1.465 +	a semantically valid, but unrecognised command, will not be indicated.
   1.466 +	
   1.467 +	@param aError Error code that describes the OBEX error. OBEX specific error 
   1.468 +	codes are listed from KErrIrObexClientNoDevicesFound. 
   1.469 +	
   1.470 +	@publishedAll
   1.471 +	@released
   1.472 +	*/
   1.473 +	virtual void ErrorIndication(TInt aError) =0;
   1.474 +	
   1.475 +
   1.476 +	
   1.477 +	/** Called when the underlying transport connection is made from a remote 
   1.478 +	client to the server.
   1.479 +	
   1.480 +	Note that this does not, however, indicate an OBEX connection has been successfully 
   1.481 +	established.
   1.482 +	
   1.483 +	You can define any low-level connection policy here. It is also a good place 
   1.484 +	to set up the local connection information (CObex::LocalInfo()), if any non-defaults 
   1.485 +	are required. 
   1.486 +
   1.487 +	@publishedAll
   1.488 +	@released
   1.489 +	*/
   1.490 +	virtual void TransportUpIndication() =0;
   1.491 +	
   1.492 +	
   1.493 +	
   1.494 +	/** Called when the transport connection is dropped (by either party).
   1.495 +	
   1.496 +	It is called whether the OBEX connection was gracefully disconnected or not. 
   1.497 +	The function is the definitive place for disconnection processing.
   1.498 +	
   1.499 +	@publishedAll
   1.500 +	@released
   1.501 +	*/
   1.502 +	virtual void TransportDownIndication() =0;
   1.503 +	
   1.504 +	
   1.505 +	
   1.506 +	/** Called when an OBEX connection is made from a remote client.
   1.507 +	
   1.508 +	Override this function to provide any extra OBEX connection processing.
   1.509 +	
   1.510 +	@param aRemoteInfo Connection information supplied by that remote machine
   1.511 +	@param aInfo Further information about the requested connection (reserved)
   1.512 +
   1.513 +	@publishedAll
   1.514 +	@released
   1.515 +	*/
   1.516 +	virtual void ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo) =0;
   1.517 +
   1.518 +
   1.519 +
   1.520 +	/** Called on a (graceful) OBEX disconnection by the client.
   1.521 +	
   1.522 +	Override this to provide any extra processing OBEX disconnection processing.
   1.523 +	
   1.524 +	Note that this indication will not be raised if the remote machine simply
   1.525 +	drops the transport connection. However, ErrorIndication() will be called 
   1.526 +	if the disconnection is unexpected/ invalid (i.e. another operation was in 
   1.527 +	progress at the time). In all cases, TransportDownIndication() will be called.
   1.528 +	
   1.529 +	@param aInfo Contains information about the disconnection (reserved) 
   1.530 +	
   1.531 +	@publishedAll
   1.532 +	@released
   1.533 +	*/
   1.534 +	virtual void ObexDisconnectIndication(const TDesC8& aInfo) =0;
   1.535 +
   1.536 +
   1.537 +
   1.538 +	/** Called on receipt of the first packet of a (valid) put request. 
   1.539 +	
   1.540 +	It is called before any parsing of the packet is performed, simply to establish 
   1.541 +	whether this server is interested in receiving objects at all.
   1.542 +	
   1.543 +	Following this notification, the server will wait for a call to
   1.544 +	CObexServer::RequestIndicationCallback supplying a CObexBaseObject derived
   1.545 +	object to receive into or a response code specifying the error.
   1.546 +	
   1.547 +	@publishedAll
   1.548 +	@released
   1.549 +	*/
   1.550 +	virtual void PutRequestIndication() =0;
   1.551 +
   1.552 +
   1.553 +
   1.554 +	/** Called on receipt of every packet of an OBEX PUT operation.
   1.555 +	
   1.556 +	It will always be preceded by a PutRequestIndication(). The object returned 
   1.557 +	by the request indication will be updated to reflect all the information received 
   1.558 +	concerning the object which the client is sending, from packets up to and 
   1.559 +	including the current one. 
   1.560 +	
   1.561 +	You can use this function to provide periodic user notification on the progress 
   1.562 +	of the transfer (noting that the Length attribute may take an arbitrary number 
   1.563 +	of packets to become non-zero, and the constraints on its accuracy). Due to 
   1.564 +	the nature of OBEX operations, where any header attribute can be sent at any 
   1.565 +	point in the transfer, this is also a good place to marshal the details of 
   1.566 +	a received object, and possibly prompt for action on the received object (e.g. 
   1.567 +	renaming on filename clashes).
   1.568 +	
   1.569 +	Note that this function could be hit quite heavily, in proportion to the size 
   1.570 +	of the object transferred. Therefore more consideration should be given to 
   1.571 +	the speed of execution of this function than that of the other indications.
   1.572 +	
   1.573 +	@return KErrNone instructs the server to allow the client to continue the put 
   1.574 +	operation. Any other value cancels the operation with an appropriate OBEX 
   1.575 +	server response code. 
   1.576 +	
   1.577 +	@publishedAll
   1.578 +	@released
   1.579 +	*/
   1.580 +	virtual TInt PutPacketIndication() =0;
   1.581 +
   1.582 +
   1.583 +
   1.584 +	/** Called after the final put packet has been successfully received and parsed. 
   1.585 +	
   1.586 +	Note that there will not necessarily be a call to this function corresponding 
   1.587 +	to each PutRequestIndication() as, if an error occurs while the put is being 
   1.588 +	carried out, ErrorIndication() will be called instead.
   1.589 +	
   1.590 +	Following this notification, the server will wait for a call to
   1.591 +	CObexServer::RequestCompleteIndicationCallback supplying a Obex response code.
   1.592 +
   1.593 +	@publishedAll
   1.594 +	@released
   1.595 +	*/
   1.596 +	virtual void PutCompleteIndication() =0;
   1.597 +
   1.598 +
   1.599 +
   1.600 +	/** Called when a full get request has been received from the client. 
   1.601 +	
   1.602 +	aRequestedObject holds all the details about the object the remote client 
   1.603 +	has requested. Use this function to analyse the client's request, and return 
   1.604 +	a pointer to the object to be returned to the client, or NULL to return no 
   1.605 +	object. 
   1.606 +	
   1.607 +	Following this notification, the server will wait for a call to
   1.608 +	CObexServer::RequestIndicationCallback supplying a CObexBaseObject derived
   1.609 +	object to send to the client or a response code specifying the error.
   1.610 +
   1.611 +	@param aRequiredObject Details about the object the remote client has requested
   1.612 +	
   1.613 +	@publishedAll
   1.614 +	@released
   1.615 +	*/
   1.616 +	virtual void GetRequestIndication(CObexBaseObject* aRequiredObject) =0;
   1.617 +
   1.618 +
   1.619 +
   1.620 +	/** Called for every packet of get reply sent by the server back to the client. 
   1.621 +	
   1.622 +	The function is only called while an object is being sent to the client, not 
   1.623 +	while the client is providing its initial specification for the object it 
   1.624 +	requires. 
   1.625 +	
   1.626 +	You can use this function to provide user notification on the object being 
   1.627 +	sent, and its progress. As with PutPacketIndication(), you should consider 
   1.628 +	that this function might get called often, especially for large objects and 
   1.629 +	small OBEX packet sizes, so the speed of execution here is important.
   1.630 +	
   1.631 +	@return KErrNone to continue sending the object, or any other error code to 
   1.632 +	cancel the operation
   1.633 +	
   1.634 +	@publishedAll
   1.635 +	@released
   1.636 +	*/
   1.637 +	virtual TInt GetPacketIndication() =0;
   1.638 +
   1.639 +
   1.640 +
   1.641 +	/** Called when the final packet of the object has been returned to the client.
   1.642 +	
   1.643 +	Note like PutCompleteIndication(), this function might not be called for each
   1.644 +	GetRequestIndication(), if the operation is interrupted by an error.
   1.645 +	
   1.646 +	Following this notification, the server will wait for a call to
   1.647 +	CObexServer::RequestCompleteIndicationCallback supplying a Obex response code.
   1.648 +
   1.649 +	@publishedAll
   1.650 +	@released
   1.651 +	*/
   1.652 +	virtual void GetCompleteIndication() =0;
   1.653 +
   1.654 +
   1.655 +
   1.656 +	/** Called when an OBEX SETPATH command is received by the server. 
   1.657 +	
   1.658 +	Following this notification, the server will wait for a call to
   1.659 +	CObexServer::RequestCompleteIndicationCallback supplying a Obex response code.
   1.660 +	
   1.661 +	@param aPathInfo SETPATH command parameters
   1.662 +	@param aInfo Not currently used
   1.663 +
   1.664 +	@publishedAll
   1.665 +	@released
   1.666 +	*/
   1.667 +	virtual void SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo) =0;
   1.668 +
   1.669 +
   1.670 +
   1.671 +	/** Called when an abort packet is received from the client. 
   1.672 +	
   1.673 +	An OBEX abort command simply cancels the current operation, and does not necessarily 
   1.674 +	have to cause the connection to be dropped. On return, a ERespSuccess packet 
   1.675 +	is sent to the client. 
   1.676 +	
   1.677 +	@publishedAll
   1.678 +	@released
   1.679 +	*/
   1.680 +	virtual void AbortIndication() =0;
   1.681 +	
   1.682 +	
   1.683 +	
   1.684 +	/** Cancel an asynchronous callback request (ie. PutRequest/GetRequest/PutComplete/GetComplete/SetPath 
   1.685 +		notification).
   1.686 +	
   1.687 +	Note that ignoring this call will lead to a panic when the indication callback function
   1.688 +	is called.
   1.689 +
   1.690 +	@publishedAll
   1.691 +	@released
   1.692 +	*/
   1.693 +	virtual void CancelIndicationCallback() =0;
   1.694 +	};
   1.695 +
   1.696 +
   1.697 +#endif	// __OBEXSERVER_H