2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * 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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Callback interface for service consumers
18 #ifndef M_SEN_SERVICE_CONSUMER_H
19 #define M_SEN_SERVICE_CONSUMER_H
21 const TUid KSenInterfaceUidFilesObserver = { 0x101F9742 }; // MSenFilesObserver
22 const TUid KSenInterfaceUidAuthenticationProvider = { 0x10282C6F }; // MSenAuthenticationProvider
26 * Callback interface for service consumers
28 class MSenServiceConsumer
35 * Callback, which is invoked when a message is received from invoked service.
36 * Inside this method, it is guarenteed, that the TxnId() getter provided by
37 * CSenServiceConnection class will return valid transaction ID. This allows
38 * one to map the ID of sent request, returned from CSenServiceConnection::SendL
39 * with the response that is provided in this callback.
40 * @param aMessage incoming message.
42 virtual void HandleMessageL(const TDesC8& aMessage) = 0;
45 * Callback, which is invoked when an error message is received from invoked service.
46 * Inside this method, it is guarenteed, that the TxnId() getter provided by
47 * CSenServiceConnection class will return valid transaction ID. This allows
48 * one to map the ID of sent request, returned from CSenServiceConnection::SendL
49 * with the response that is provided in this callback.
50 * @param aErrorCode is the error code (negative number)
51 * Error codes are some of the following:
52 * KErrSenNotInitialized Connection hasn't been initialized.
53 * KErrConnectionInitializing Connection is still initializing.
54 * KErrSubmitting Submitting a message failed,
55 * e.g. tried to send a NULL message.
56 * KErrConnectionExpired Connection has expired and needs to be
58 * KErrSenSoapFault A SOAP fault occurred, aErrorMessage should
59 * contain more detailed information.
60 * KErrSenInternal Internal error in Web Services
62 * KErrUnknown An unexpected major error has occurred
63 * and cause is unknown.
64 * Other possible error codes can be HTTP error codes or
65 * system-wide Symbian error codes.
66 * @param aErrorMessage contains the error message data; with SOAP based services,
67 * possibly a SOAP fault as XML.
69 virtual void HandleErrorL(const TInt aErrorCode,
70 const TDesC8& aErrorMessage) = 0;
73 * This method is called when the status of the connection
74 * to the service changes.
75 * @param aStatus is connection state indicator, which
76 * could be specified by the actual service invocation framework
77 * implementation. The following status codes are possible for
78 * any installed framework:
79 * KSenConnectionStatusNew Connection is being initialized, but not yet ready.
80 * KSenConnectionStatusReady Connection is ready to be used. For example, SubmitL()
81 * and SendL() methods (depending of framework) are in
83 * KSenConnectionStatusExpired Connection is expired. Typically, a new connection
84 * needs next to be initialized in order to communicate
85 * with the underlying service behind this service
88 virtual void SetStatus(const TInt aStatus) = 0;
92 * Callback interface for trnsfer progress observer
94 class MSenFilesObserver
98 * This method is called when new part of BLOB is sent or received.
100 * @param aTxnId Transaction ID.
101 * @param aIncoming ETrue if it is incoming BLOB, EFalse if outgoing.
102 * @param aMessage SOAP message for incoming messages with BLOBs.
103 * @param aCid CID of current BLOB.
104 * @param aProgress Count of sent/received BLOB bytes.
106 virtual void TransferProgress(TInt aTxnId, TBool aIncoming, const TDesC8& aMessage,
107 const TDesC8& aCid, TInt aProgress) = 0;
109 class MSenExtendedConsumerInterface
112 inline virtual TAny* GetInterfaceByUid( TUid /* aUID */ ) { return NULL; };
115 #endif // M_SEN_SERVICE_CONSUMER_H