williamr@2: /* williamr@2: * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Callback interface for service consumers williamr@2: * williamr@2: */ williamr@2: williamr@2: #ifndef M_SEN_SERVICE_CONSUMER_H williamr@2: #define M_SEN_SERVICE_CONSUMER_H williamr@2: williamr@2: const TUid KSenInterfaceUidFilesObserver = { 0x101F9742 }; // MSenFilesObserver williamr@2: const TUid KSenInterfaceUidAuthenticationProvider = { 0x10282C6F }; // MSenAuthenticationProvider williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Callback interface for service consumers williamr@2: */ williamr@2: class MSenServiceConsumer williamr@2: { williamr@2: public: williamr@2: williamr@2: // New functions williamr@2: williamr@2: /** williamr@2: * Callback, which is invoked when a message is received from invoked service. williamr@2: * Inside this method, it is guarenteed, that the TxnId() getter provided by williamr@2: * CSenServiceConnection class will return valid transaction ID. This allows williamr@2: * one to map the ID of sent request, returned from CSenServiceConnection::SendL williamr@2: * with the response that is provided in this callback. williamr@2: * @param aMessage incoming message. williamr@2: */ williamr@2: virtual void HandleMessageL(const TDesC8& aMessage) = 0; williamr@2: williamr@2: /** williamr@2: * Callback, which is invoked when an error message is received from invoked service. williamr@2: * Inside this method, it is guarenteed, that the TxnId() getter provided by williamr@2: * CSenServiceConnection class will return valid transaction ID. This allows williamr@2: * one to map the ID of sent request, returned from CSenServiceConnection::SendL williamr@2: * with the response that is provided in this callback. williamr@2: * @param aErrorCode is the error code (negative number) williamr@2: * Error codes are some of the following: williamr@2: * KErrSenNotInitialized Connection hasn't been initialized. williamr@2: * KErrConnectionInitializing Connection is still initializing. williamr@2: * KErrSubmitting Submitting a message failed, williamr@2: * e.g. tried to send a NULL message. williamr@2: * KErrConnectionExpired Connection has expired and needs to be williamr@2: * renewed. williamr@2: * KErrSenSoapFault A SOAP fault occurred, aErrorMessage should williamr@2: * contain more detailed information. williamr@2: * KErrSenInternal Internal error in Web Services williamr@2: * framework williamr@2: * KErrUnknown An unexpected major error has occurred williamr@2: * and cause is unknown. williamr@2: * Other possible error codes can be HTTP error codes or williamr@2: * system-wide Symbian error codes. williamr@2: * @param aErrorMessage contains the error message data; with SOAP based services, williamr@2: * possibly a SOAP fault as XML. williamr@2: */ williamr@2: virtual void HandleErrorL(const TInt aErrorCode, williamr@2: const TDesC8& aErrorMessage) = 0; williamr@2: williamr@2: /** williamr@2: * This method is called when the status of the connection williamr@2: * to the service changes. williamr@2: * @param aStatus is connection state indicator, which williamr@2: * could be specified by the actual service invocation framework williamr@2: * implementation. The following status codes are possible for williamr@2: * any installed framework: williamr@2: * KSenConnectionStatusNew Connection is being initialized, but not yet ready. williamr@2: * KSenConnectionStatusReady Connection is ready to be used. For example, SubmitL() williamr@2: * and SendL() methods (depending of framework) are in williamr@2: * invocable state. williamr@2: * KSenConnectionStatusExpired Connection is expired. Typically, a new connection williamr@2: * needs next to be initialized in order to communicate williamr@2: * with the underlying service behind this service williamr@2: * connection. williamr@2: */ williamr@2: virtual void SetStatus(const TInt aStatus) = 0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Callback interface for trnsfer progress observer williamr@2: */ williamr@2: class MSenFilesObserver williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * This method is called when new part of BLOB is sent or received. williamr@2: * williamr@2: * @param aTxnId Transaction ID. williamr@2: * @param aIncoming ETrue if it is incoming BLOB, EFalse if outgoing. williamr@2: * @param aMessage SOAP message for incoming messages with BLOBs. williamr@2: * @param aCid CID of current BLOB. williamr@2: * @param aProgress Count of sent/received BLOB bytes. williamr@2: */ williamr@2: virtual void TransferProgress(TInt aTxnId, TBool aIncoming, const TDesC8& aMessage, williamr@2: const TDesC8& aCid, TInt aProgress) = 0; williamr@2: }; williamr@2: class MSenExtendedConsumerInterface williamr@2: { williamr@2: public: williamr@2: inline virtual TAny* GetInterfaceByUid( TUid /* aUID */ ) { return NULL; }; williamr@2: }; williamr@2: williamr@2: #endif // M_SEN_SERVICE_CONSUMER_H williamr@2: williamr@2: // End of File