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