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 "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Callback interface for service consumers
21 #ifndef M_SEN_SERVICE_CONSUMER_H
22 #define M_SEN_SERVICE_CONSUMER_H
24 const TUid KSenInterfaceUidFilesObserver = { 0x101F9742 }; // MSenFilesObserver
25 const TUid KSenInterfaceUidCoBrandingObserver = { 0x10282C6C }; // MSenCoBrandingObserver
26 const TUid KSenInterfaceUidAlrObserver = { 0x10282C6D }; // MMobilityProtocolResp
27 const TUid KSenInterfaceUidUserinfoProvider = { 0x10282C6E }; // MSenUserInfoProvider
28 const TUid KSenInterfaceUidAuthenticationProvider = { 0x10282C6F }; // MSenAuthenticationProvider
29 const TUid KSenInterfaceUidHostletConsumer = { 0xE760F697 }; // MSenAuthenticationProvider
35 * Callback interface for service consumers
37 class MSenServiceConsumer
44 * Callback, which is invoked when a message is received from invoked service.
45 * Inside this method, it is guarenteed, that the TxnId() getter provided by
46 * CSenServiceConnection class will return valid transaction ID. This allows
47 * one to map the ID of sent request, returned from CSenServiceConnection::SendL
48 * with the response that is provided in this callback.
49 * @param aMessage incoming message.
51 virtual void HandleMessageL(const TDesC8& aMessage) = 0;
54 * Callback, which is invoked when an error message is received from invoked service.
55 * Inside this method, it is guarenteed, that the TxnId() getter provided by
56 * CSenServiceConnection class will return valid transaction ID. This allows
57 * one to map the ID of sent request, returned from CSenServiceConnection::SendL
58 * with the response that is provided in this callback.
59 * @param aErrorCode is the error code (negative number)
60 * Error codes are some of the following:
61 * KErrSenNotInitialized Connection hasn't been initialized.
62 * KErrConnectionInitializing Connection is still initializing.
63 * KErrSubmitting Submitting a message failed,
64 * e.g. tried to send a NULL message.
65 * KErrConnectionExpired Connection has expired and needs to be
67 * KErrSenSoapFault A SOAP fault occurred, aErrorMessage should
68 * contain more detailed information.
69 * KErrSenInternal Internal error in Web Services
71 * KErrUnknown An unexpected major error has occurred
72 * and cause is unknown.
73 * Other possible error codes can be HTTP error codes or
74 * system-wide Symbian error codes.
75 * @param aErrorMessage contains the error message data; with SOAP based services,
76 * possibly a SOAP fault as XML.
78 virtual void HandleErrorL(const TInt aErrorCode,
79 const TDesC8& aErrorMessage) = 0;
82 * This method is called when the status of the connection
83 * to the service changes.
84 * @param aStatus is connection state indicator, which
85 * could be specified by the actual service invocation framework
86 * implementation. The following status codes are possible for
87 * any installed framework:
88 * KSenConnectionStatusNew Connection is being initialized, but not yet ready.
89 * KSenConnectionStatusReady Connection is ready to be used. For example, SubmitL()
90 * and SendL() methods (depending of framework) are in
92 * KSenConnectionStatusExpired Connection is expired. Typically, a new connection
93 * needs next to be initialized in order to communicate
94 * with the underlying service behind this service
97 virtual void SetStatus(const TInt aStatus) = 0;
101 * Callback interface for transfer progress observer. Typically,
102 * this interface is implemented by applications that want to
103 * monitor how many bytes (of a file, request, or response) have
104 * been sent or received during a transaction. Callback is thus
105 * often integrated to progress bar implementations in UI layer.
106 * Note: UID of this interface is KSenInterfaceUidFilesObserver.
108 class MSenFilesObserver
112 * This method is called when new part of BLOB is sent or received.
114 * @param aTxnId Transaction ID.
115 * @param aIncoming ETrue if it is incoming BLOB, EFalse if outgoing.
116 * @param aMessage SOAP message for incoming messages with BLOBs.
117 * @param aCid CID of current BLOB.
118 * @param aProgress Count of sent/received BLOB bytes.
120 virtual void TransferProgress( TInt aTxnId,
122 const TDesC8& aMessage,
126 class MSenHostletConsumer
129 virtual void SetConnectionId( TInt aConnectionId ) = 0;
132 * Callback interface for extended consumer interface.
133 * When this interface is provided to service connection as constructor
134 * argument, the service connection (web services stack) can later on
135 * query for a variety of different interfaces, extensions, from the
136 * application. Each extension (interface) is has unique identifier (UID).
138 class MSenExtendedConsumerInterface
142 * Service connection calls this method several times, passing a different
143 * UID per each call. If application wants to provide particular interface
144 * to service connection (web services stack), it needs to return a pointer
145 * to such M-class as a return value of this method. For any interface, that
146 * application has not implemented, it is supposed to return NULL.
147 * @param aUID is the unique identifier of some interface
148 * @return value should be a valid (void) pointer to any interface implemented
149 * by the application. NULL signalizes that application does not provide interface
152 inline virtual TAny* GetInterfaceByUid( TUid /* aUID */ ) { return NULL; };
155 #endif // M_SEN_SERVICE_CONSUMER_H