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