williamr@2: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: /** williamr@2: @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: #ifndef __OBEXSERVER_H williamr@2: #define __OBEXSERVER_H williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: class TObexTransportInfo; williamr@2: class CObexServerRequestPacketEngine; williamr@2: class CObexPacketSignaller; williamr@2: class MObexReadActivityObserver; williamr@2: williamr@2: /** OBEX server. williamr@2: williamr@2: CObexServer provides a framework for servicing OBEX requests from remote clients. williamr@2: It is designed to be able to act as either a "default" application (in IrDA williamr@2: terms, registering on the IrDA:OBEX IAS class), or as a application specific williamr@2: server (registering itself on a private IAS class). williamr@2: williamr@2: You implement service-specific behaviour by providing a MObexServerNotify williamr@2: interface implementation to the server object. The server calls the interface's williamr@2: functions to provide notification of server events, which specific implementations williamr@2: can process (or ignore) as appropriate. williamr@2: williamr@2: This class is not designed for user derivation. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: NONSHARABLE_CLASS(CObexServer) : public CObex williamr@2: { williamr@2: // CObexServer is friends with the core Server State Machine class so williamr@2: // that it can access the CObex::ControlledTransportDown() method williamr@2: friend class CObexServerStateMachine; williamr@2: williamr@2: // CObexServer is friends with the TObexServerStateObexConnecting class so williamr@2: // that it can access the CObex::SetConnectState(TConnectState aNewState) method williamr@2: friend class TObexServerStateObexConnecting; williamr@2: williamr@2: // CObexServer is friends with the Server Request Packet Engine so that williamr@2: // it can NULL the iServerRequestPacketEngine pointer ready for another williamr@2: // extension interface williamr@2: friend class CObexServerRequestPacketEngine; williamr@2: williamr@2: public: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: The target header checking to apply to incoming connection requests. Defaults to williamr@2: EIfPresent. williamr@2: @see CObexServer::SetTargetChecking williamr@2: */ williamr@2: enum TTargetChecking williamr@2: { williamr@2: ENoChecking, /** Allow all target headers to connect. */ williamr@2: EIfPresent, /** Only check target header in response to receiving one. Allows all clients williamr@2: specifying an Inbox service to connect. */ williamr@2: EAlways, /** Strict checking. Only allow connections if target header matches or no header williamr@2: received and none expected. */ williamr@2: }; williamr@2: williamr@2: IMPORT_C static CObexServer* NewL(TObexProtocolInfo& aObexProtocolInfoPtr); williamr@2: IMPORT_C static CObexServer* NewL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy); williamr@2: IMPORT_C static CObexServer* NewL(TObexTransportInfo& aObexTransportInfo); williamr@4: ~CObexServer(); williamr@2: IMPORT_C TInt Start(MObexServerNotify* aOwner); williamr@2: IMPORT_C TInt Start(MObexServerNotifyAsync* aOwner); williamr@2: IMPORT_C void Stop(); williamr@2: IMPORT_C TBool IsStarted(); williamr@2: IMPORT_C TOperation CurrentOperation() const; williamr@2: void SetCurrentOperation(const TOperation aOperation); // used internally by state machine williamr@2: IMPORT_C void SetChallengeL(const TDesC& aPassword); williamr@2: IMPORT_C void ResetChallenge(); williamr@2: IMPORT_C void UserPasswordL( const TDesC& aPassword); williamr@2: IMPORT_C void SetTargetChecking(TTargetChecking aChecking); williamr@2: IMPORT_C TInt SetPutFinalResponseHeaders(CObexHeaderSet* aHeaderSet); williamr@2: IMPORT_C TInt RequestIndicationCallback(CObexBaseObject* aObject); williamr@2: IMPORT_C TInt RequestIndicationCallbackWithError(TObexResponse aResponseCode); williamr@2: IMPORT_C TInt RequestIndicationCallbackWithError(TInt aErrorCode); williamr@2: IMPORT_C TInt RequestCompleteIndicationCallback(TObexResponse aResponseCode); williamr@2: IMPORT_C TInt RequestCompleteIndicationCallback(TInt aErrorCode); williamr@4: williamr@2: IMPORT_C TInt PacketHeaders(CObexHeaderSet*& aHeaderSet); williamr@2: IMPORT_C TInt PacketHeaders(CObexHeaderSet*& aHeaderSet, MObexHeaderCheck& aHeaderCheck); williamr@2: IMPORT_C void SetReadActivityObserver(MObexReadActivityObserver* aObserver); williamr@4: williamr@2: IMPORT_C TAny* ExtensionInterfaceL(TUid aUid); williamr@2: IMPORT_C const TObexTransportInfo* TransportInfo() const; williamr@2: williamr@2: public: williamr@2: // Called from CObexNotifyExtendServer williamr@4: void SignalPacketProcessEvent(TInt aEvent); williamr@2: williamr@2: // Unexported functions used by the Server state machine williamr@2: TBool CheckObjectForConnectionId(CObexBaseObject& aObject); williamr@2: TBool CheckPacketForConnectionId(CObexPacket& aObject); williamr@2: williamr@2: private: williamr@2: CObexServer(); williamr@2: void ConstructL(TObexTransportInfo& aObexTransportInfo); williamr@2: TInt AcceptConnection(); williamr@2: // Implementation of CObex Events williamr@2: virtual void OnPacketReceive(CObexPacket& aPacket); williamr@2: virtual void OnError(TInt aError); williamr@2: virtual void OnTransportUp(); williamr@2: virtual void OnTransportDown(); williamr@2: williamr@2: public: williamr@2: // These three functions need to be public so the Server state machine can use them williamr@2: // However ParseConnectPacket cannot be moved as it is a virtual function (from CObex) williamr@2: TInt PrepareConnectPacket(CObexPacket& aPacket); williamr@2: TInt PrepareErroredConnectPacket(CObexPacket& aPacket); williamr@2: void SignalReadActivity(); williamr@2: TInt ParseConnectPacket(CObexPacket& aPacket); williamr@2: williamr@2: private: williamr@2: TInt AddConnectionIDHeader(CObexPacket& aPacket); williamr@2: TInt PrepareFinalChallResponse(CObexPacket& aPacket, TConnectState& aNextState); williamr@2: void CheckTarget(TConnectState& aNextState, TInt& aRetVal); williamr@2: void ResetConnectionID(); williamr@2: void SetConnectionID(TUint32 aConnectionID); williamr@2: TUint32 ConnectionID(); williamr@2: void CheckServerAppResponseCode(TObexOpcode aOpcode, TObexResponse aResponse); williamr@2: TInt DoPacketHeaders(CObexHeaderSet*& aHeaderSet, MObexHeaderCheck* aHeaderCheck); williamr@2: williamr@2: private: williamr@2: MObexServerNotifyAsync* iOwner; williamr@2: TBool iEnabled; williamr@2: TBool iSpecDone; williamr@2: TBool iTargetReceived; williamr@2: TTargetChecking iTargetChecking; williamr@2: TUint32 iConnectionID; williamr@2: TBool iConnectionIdSet; williamr@2: CObexHeader* iHeader; williamr@2: CObexServerStateMachine* iStateMachine; williamr@2: CObexServerNotifySyncWrapper* iSyncWrapper; williamr@2: CObexServerRequestPacketEngine* iServerRequestPacketEngine; williamr@2: CObexPacketSignaller* iPacketProcessSignaller; williamr@2: }; williamr@2: williamr@2: williamr@2: /** OBEX synchronous server notification interface. williamr@2: williamr@2: Any service that provides OBEX server functionality must implement one of the two williamr@2: server observer classes -- this one or MObexServerNotifyAsync. williamr@2: williamr@2: The CObexServer object handles the protocol side of an OBEX server session, williamr@2: while this class provides the server policy for a particular session. williamr@2: williamr@2: PUT and GET requests are handled synchronously, with the implementer returning a williamr@2: CObexBufObject which will be processed immediately. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see MObexServerNotifyAsync williamr@2: @see CObexServer williamr@2: */ williamr@2: class MObexServerNotify williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is. williamr@2: @param aInterface UID of the interface to return williamr@2: @param aObject the container for another interface as specified by aInterface williamr@2: */ williamr@2: IMPORT_C virtual void MOSN_ExtensionInterfaceL(TUid aInterface, void*& aObject); williamr@2: williamr@2: /** Called if an OBEX protocol error occurs. williamr@2: williamr@2: It is only called for fatal errors that cause the OBEX connection to terminate. williamr@2: An error that does not terminate the connection, for example the server issuing williamr@2: a semantically valid, but unrecognised command, will not be indicated. williamr@2: williamr@2: @param aError Error code that describes the OBEX error. OBEX specific error williamr@2: codes are listed from KErrIrObexClientNoDevicesFound. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void ErrorIndication(TInt aError) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when the underlying transport connection is made from a remote williamr@2: client to the server. williamr@2: williamr@2: Note that this does not, however, indicate an OBEX connection has been successfully williamr@2: established. williamr@2: williamr@2: You can define any low-level connection policy here. It is also a good place williamr@2: to set up the local connection information (CObex::LocalInfo()), if any non-defaults williamr@2: are required. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void TransportUpIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when the transport connection is dropped (by either party). williamr@2: williamr@2: It is called whether the OBEX connection was gracefully disconnected or not. williamr@2: The function is the definitive place for disconnection processing. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void TransportDownIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when an OBEX connection is made from a remote client. williamr@2: williamr@2: Override this function to provide any extra OBEX connection processing. williamr@2: Despite this method returning a value, implementers cannot use this to williamr@2: refuse the connection attempt. williamr@2: williamr@2: @param aRemoteInfo Connection information supplied by that remote machine williamr@2: @param aInfo Further information about the requested connection (reserved) williamr@2: @return Ignored williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual TInt ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called on a (graceful) OBEX disconnection by the client. williamr@2: williamr@2: Override this to provide any extra processing OBEX disconnection processing. williamr@2: williamr@2: Note that this indication will not be raised if the remote machine simply williamr@2: drops the transport connection. However, ErrorIndication() will be called williamr@2: if the disconnection is unexpected/ invalid (i.e. another operation was in williamr@2: progress at the time). In all cases, TransportDownIndication() will be called. williamr@2: williamr@2: @param aInfo Contains information about the disconnection (reserved) williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void ObexDisconnectIndication(const TDesC8& aInfo) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called on receipt of the first packet of a (valid) put request. williamr@2: williamr@2: It is called before any parsing of the packet is performed, simply to establish williamr@2: whether this server is interested in receiving objects at all. williamr@2: williamr@2: Note if the returned object cannot be initialised for receiving, ERespInternalError williamr@2: is returned to the client. williamr@2: williamr@2: @return CObexBaseObject-derived object, which the object being put will be williamr@2: parsed into. If this is NULL, ERespForbidden is returned to the client. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual CObexBufObject* PutRequestIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called on receipt of every packet of an OBEX PUT operation. williamr@2: williamr@2: It will always be preceded by a PutRequestIndication(). The object returned williamr@2: by the request indication will be updated to reflect all the information received williamr@2: concerning the object which the client is sending, from packets up to and williamr@2: including the current one. williamr@2: williamr@2: You can use this function to provide periodic user notification on the progress williamr@2: of the transfer (noting that the Length attribute may take an arbitrary number williamr@2: of packets to become non-zero, and the constraints on its accuracy). Due to williamr@2: the nature of OBEX operations, where any header attribute can be sent at any williamr@2: point in the transfer, this is also a good place to marshal the details of williamr@2: a received object, and possibly prompt for action on the received object (e.g. williamr@2: renaming on filename clashes). williamr@2: williamr@2: Note that this function could be hit quite heavily, in proportion to the size williamr@2: of the object transferred. Therefore more consideration should be given to williamr@2: the speed of execution of this function than that of the other indications. williamr@2: williamr@2: @return KErrNone instructs the server to allow the client to continue the put williamr@2: operation. Any other value cancels the operation with an appropriate OBEX williamr@2: server response code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual TInt PutPacketIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called after the final put packet has been successfully received and parsed. williamr@2: williamr@2: Note that there will not necessarily be a call to this function corresponding williamr@2: to each PutRequestIndication() as, if an error occurs while the put is being williamr@2: carried out, ErrorIndication() will be called instead. williamr@2: williamr@2: Before version 6.1, the return type was void. williamr@2: williamr@2: @return KErrNoneinstructs the remote client that the put completed successfully. williamr@2: Any other value cancels the operation with an appropriate OBEX server response williamr@2: code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual TInt PutCompleteIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when a full get request has been received from the client. williamr@2: williamr@2: aRequestedObject holds all the details about the object the remote client williamr@2: has requested. Use this function to analyse the client's request, and return williamr@2: a pointer to the object to be returned to the client, or NULL to return no williamr@2: object. williamr@2: williamr@2: If NULL is returned, the server will send ERespForbidden to the client; if williamr@2: an error occurs in returning the object, ERespInternalError is returned, otherwise williamr@2: the returned object is sent back to the client. williamr@2: williamr@2: @param aRequiredObject Details about the object the remote client has requested williamr@2: @return Object to return to the client williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual CObexBufObject* GetRequestIndication(CObexBaseObject *aRequiredObject) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called for every packet of get reply sent by the server back to the client. williamr@2: williamr@2: The function is only called while an object is being sent to the client, not williamr@2: while the client is providing its initial specification for the object it williamr@2: requires. williamr@2: williamr@2: You can use this function to provide user notification on the object being williamr@2: sent, and its progress. As with PutPacketIndication(), you should consider williamr@2: that this function might get called often, especially for large objects and williamr@2: small OBEX packet sizes, so the speed of execution here is important. williamr@2: williamr@2: @return KErrNone to continue sending the object, or any other error code to williamr@2: cancel the operation williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual TInt GetPacketIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when the final packet of the object has been returned to the client. williamr@2: williamr@2: Note like PutCompleteIndication(), this function might not be called for each williamr@2: GetRequestIndication(), if the operation is interrupted by an error. williamr@2: williamr@2: Before version 6.1, the return type was void. williamr@2: williamr@2: @return KErrNoneinstructs the remote client that the get completed successfully. williamr@2: Any other value cancels the operation with an appropriate OBEX server response williamr@2: code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual TInt GetCompleteIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when an OBEX SETPATH command is received by the server. williamr@2: williamr@2: @param aPathInfo SETPATH command parameters williamr@2: @param aInfo Not currently used williamr@2: @return System wide error code indicating the success of the setpath command williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual TInt SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when an abort packet is received from the client. williamr@2: williamr@2: An OBEX abort command simply cancels the current operation, and does not necessarily williamr@2: have to cause the connection to be dropped. On return, a ERespSuccess packet williamr@2: is sent to the client. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void AbortIndication() =0; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: /** OBEX asynchronous server notification interface. williamr@2: williamr@2: Any service that provides OBEX server functionality must implement one of the two williamr@2: server observer classes -- this one or MObexServerNotify. williamr@2: williamr@2: The CObexServer object handles the protocol side of an OBEX server session, williamr@2: while this class provides the server policy for a particular session. williamr@2: williamr@2: PUT and GET requests are handled asynchronously, with the upcall from the server williamr@2: being followed at some stage in the future by a call to CObexServer::RequestIndicationComplete williamr@2: to trigger processing. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see MObexServerNotify williamr@2: @see CObexServer williamr@2: */ williamr@2: class MObexServerNotifyAsync williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: Returns a null aObject if the extension is not implemented, or a pointer to another williamr@2: interface if it is. williamr@2: @param aInterface UID of the interface to return williamr@2: @param aObject the container for another interface as specified by aInterface williamr@2: */ williamr@2: IMPORT_C virtual void MOSNA_ExtensionInterfaceL(TUid aInterface, void*& aObject); williamr@2: williamr@2: williamr@2: williamr@2: /** Called if an OBEX protocol error occurs. williamr@2: williamr@2: It is only called for fatal errors that cause the OBEX connection to terminate. williamr@2: An error that does not terminate the connection, for example the server issuing williamr@2: a semantically valid, but unrecognised command, will not be indicated. williamr@2: williamr@2: @param aError Error code that describes the OBEX error. OBEX specific error williamr@2: codes are listed from KErrIrObexClientNoDevicesFound. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void ErrorIndication(TInt aError) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when the underlying transport connection is made from a remote williamr@2: client to the server. williamr@2: williamr@2: Note that this does not, however, indicate an OBEX connection has been successfully williamr@2: established. williamr@2: williamr@2: You can define any low-level connection policy here. It is also a good place williamr@2: to set up the local connection information (CObex::LocalInfo()), if any non-defaults williamr@2: are required. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void TransportUpIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when the transport connection is dropped (by either party). williamr@2: williamr@2: It is called whether the OBEX connection was gracefully disconnected or not. williamr@2: The function is the definitive place for disconnection processing. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void TransportDownIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when an OBEX connection is made from a remote client. williamr@2: williamr@2: Override this function to provide any extra OBEX connection processing. williamr@2: williamr@2: @param aRemoteInfo Connection information supplied by that remote machine williamr@2: @param aInfo Further information about the requested connection (reserved) williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called on a (graceful) OBEX disconnection by the client. williamr@2: williamr@2: Override this to provide any extra processing OBEX disconnection processing. williamr@2: williamr@2: Note that this indication will not be raised if the remote machine simply williamr@2: drops the transport connection. However, ErrorIndication() will be called williamr@2: if the disconnection is unexpected/ invalid (i.e. another operation was in williamr@2: progress at the time). In all cases, TransportDownIndication() will be called. williamr@2: williamr@2: @param aInfo Contains information about the disconnection (reserved) williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void ObexDisconnectIndication(const TDesC8& aInfo) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called on receipt of the first packet of a (valid) put request. williamr@2: williamr@2: It is called before any parsing of the packet is performed, simply to establish williamr@2: whether this server is interested in receiving objects at all. williamr@2: williamr@2: Following this notification, the server will wait for a call to williamr@2: CObexServer::RequestIndicationCallback supplying a CObexBaseObject derived williamr@2: object to receive into or a response code specifying the error. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void PutRequestIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called on receipt of every packet of an OBEX PUT operation. williamr@2: williamr@2: It will always be preceded by a PutRequestIndication(). The object returned williamr@2: by the request indication will be updated to reflect all the information received williamr@2: concerning the object which the client is sending, from packets up to and williamr@2: including the current one. williamr@2: williamr@2: You can use this function to provide periodic user notification on the progress williamr@2: of the transfer (noting that the Length attribute may take an arbitrary number williamr@2: of packets to become non-zero, and the constraints on its accuracy). Due to williamr@2: the nature of OBEX operations, where any header attribute can be sent at any williamr@2: point in the transfer, this is also a good place to marshal the details of williamr@2: a received object, and possibly prompt for action on the received object (e.g. williamr@2: renaming on filename clashes). williamr@2: williamr@2: Note that this function could be hit quite heavily, in proportion to the size williamr@2: of the object transferred. Therefore more consideration should be given to williamr@2: the speed of execution of this function than that of the other indications. williamr@2: williamr@2: @return KErrNone instructs the server to allow the client to continue the put williamr@2: operation. Any other value cancels the operation with an appropriate OBEX williamr@2: server response code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual TInt PutPacketIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called after the final put packet has been successfully received and parsed. williamr@2: williamr@2: Note that there will not necessarily be a call to this function corresponding williamr@2: to each PutRequestIndication() as, if an error occurs while the put is being williamr@2: carried out, ErrorIndication() will be called instead. williamr@2: williamr@2: Following this notification, the server will wait for a call to williamr@2: CObexServer::RequestCompleteIndicationCallback supplying a Obex response code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void PutCompleteIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when a full get request has been received from the client. williamr@2: williamr@2: aRequestedObject holds all the details about the object the remote client williamr@2: has requested. Use this function to analyse the client's request, and return williamr@2: a pointer to the object to be returned to the client, or NULL to return no williamr@2: object. williamr@2: williamr@2: Following this notification, the server will wait for a call to williamr@2: CObexServer::RequestIndicationCallback supplying a CObexBaseObject derived williamr@2: object to send to the client or a response code specifying the error. williamr@2: williamr@2: @param aRequiredObject Details about the object the remote client has requested williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void GetRequestIndication(CObexBaseObject* aRequiredObject) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called for every packet of get reply sent by the server back to the client. williamr@2: williamr@2: The function is only called while an object is being sent to the client, not williamr@2: while the client is providing its initial specification for the object it williamr@2: requires. williamr@2: williamr@2: You can use this function to provide user notification on the object being williamr@2: sent, and its progress. As with PutPacketIndication(), you should consider williamr@2: that this function might get called often, especially for large objects and williamr@2: small OBEX packet sizes, so the speed of execution here is important. williamr@2: williamr@2: @return KErrNone to continue sending the object, or any other error code to williamr@2: cancel the operation williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual TInt GetPacketIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when the final packet of the object has been returned to the client. williamr@2: williamr@2: Note like PutCompleteIndication(), this function might not be called for each williamr@2: GetRequestIndication(), if the operation is interrupted by an error. williamr@2: williamr@2: Following this notification, the server will wait for a call to williamr@2: CObexServer::RequestCompleteIndicationCallback supplying a Obex response code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void GetCompleteIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when an OBEX SETPATH command is received by the server. williamr@2: williamr@2: Following this notification, the server will wait for a call to williamr@2: CObexServer::RequestCompleteIndicationCallback supplying a Obex response code. williamr@2: williamr@2: @param aPathInfo SETPATH command parameters williamr@2: @param aInfo Not currently used williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo) =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Called when an abort packet is received from the client. williamr@2: williamr@2: An OBEX abort command simply cancels the current operation, and does not necessarily williamr@2: have to cause the connection to be dropped. On return, a ERespSuccess packet williamr@2: is sent to the client. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void AbortIndication() =0; williamr@2: williamr@2: williamr@2: williamr@2: /** Cancel an asynchronous callback request (ie. PutRequest/GetRequest/PutComplete/GetComplete/SetPath williamr@2: notification). williamr@2: williamr@2: Note that ignoring this call will lead to a panic when the indication callback function williamr@2: is called. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: virtual void CancelIndicationCallback() =0; williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // __OBEXSERVER_H williamr@4: williamr@4: