|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implements WV engine access services interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCAIMPSACCESSCLIENT_H |
|
21 #define CCAIMPSACCESSCLIENT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "MCAImpsAccessClient.h" |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * Implements MCAImpsAccessClient. |
|
30 * Forwards requests to RImpsAccessClient |
|
31 * |
|
32 * @lib CAAdapter.dll |
|
33 * @since 1.2 |
|
34 */ |
|
35 class CCAImpsAccessClient : public CBase, public MCAImpsAccessClient |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 */ |
|
42 static CCAImpsAccessClient* NewL( RImpsEng& aImpsEng ); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 ~CCAImpsAccessClient(); |
|
48 |
|
49 private: |
|
50 |
|
51 /** |
|
52 * C++ default constructor. |
|
53 */ |
|
54 CCAImpsAccessClient( RImpsEng& aImpsEng ); |
|
55 |
|
56 public: // Functions from base classes |
|
57 |
|
58 // INITILIZATION AND CONNECT |
|
59 |
|
60 /** |
|
61 * Registers the listener object for Access events and connects to |
|
62 * the Symbian OS Server. |
|
63 * @since 1.2 |
|
64 * @param aObserver The observer. |
|
65 * @param aPriority Observer priority. Refer to CActive priority. |
|
66 */ |
|
67 virtual void RegisterL( |
|
68 MImpsAccessHandler2* aObserver, |
|
69 TInt aPriority = 0 ); |
|
70 |
|
71 /** |
|
72 * Unregisters the listener object and disconnects from the server. |
|
73 * @since 1.2 |
|
74 */ |
|
75 virtual void Unregister(); |
|
76 |
|
77 /** |
|
78 * @see MCAImpsAccessClient |
|
79 */ |
|
80 TInt NumberOfSessionsL( TImpsCspIdentifier& aCspId ); |
|
81 |
|
82 // ACCESS SERVICES |
|
83 |
|
84 /** |
|
85 * @see MCAImpsAccessClient |
|
86 */ |
|
87 TInt LoginL( TImpsCspIdentifier aCspId, |
|
88 const TDesC& aPsw, |
|
89 const TDesC& aClientId, |
|
90 TUint32 aAP, |
|
91 const TDesC* aKey1 = NULL, |
|
92 const TDesC* aKey2 = NULL ); |
|
93 |
|
94 /** |
|
95 * @see MCAImpsAccessClient |
|
96 */ |
|
97 TInt LogoutL(); |
|
98 |
|
99 /** |
|
100 * Register an error event observer. |
|
101 * If this is not registered then a client does not |
|
102 * receive error events from WV engine. |
|
103 * An application may implement only one HandleErrorL method |
|
104 * and give pointer to it in each WV client instance. |
|
105 * @since 1.2 |
|
106 * @param aObs error event observer |
|
107 */ |
|
108 void RegisterErrorObserverL( MImpsErrorHandler2& aObs ); |
|
109 |
|
110 /** |
|
111 * Registers the service status change observer. |
|
112 * This can be called any time |
|
113 * @since 1.2 |
|
114 * @param aObs status observer implementation. Ownership NOT transferred. |
|
115 */ |
|
116 void RegisterStatusObserverL( MImpsStatusHandler2* aObs ); |
|
117 |
|
118 /** |
|
119 * Unregisters an error observer. |
|
120 * Forwards the call to WV Engine always |
|
121 * This method is not necessary if unregister of the particular |
|
122 * client has been executed (Unregister). |
|
123 * @since 1.2 |
|
124 */ |
|
125 void UnregisterErrorObserverL(); |
|
126 |
|
127 /** |
|
128 * Unregisters the service status change observer. |
|
129 * Forwards the call to WV Engine always |
|
130 * This method is not necessary if unregister of the particular |
|
131 * client type has been executed (Unregister). |
|
132 * @since 1.2 |
|
133 */ |
|
134 void UnregisterStatusObserverL(); |
|
135 |
|
136 /** |
|
137 * Internal use only. |
|
138 * Error observer accessor |
|
139 * @since 1.2 |
|
140 * @return error observer pointer. Ownership NOT transferred. |
|
141 */ |
|
142 MImpsErrorHandler2* ErrorHandler() const; |
|
143 |
|
144 /** |
|
145 * Internal use only. |
|
146 * Status observer accessor. This is missing from WV Engine. Introduced for consistency. |
|
147 * @since 1.2 |
|
148 * @return Status observer pointer. Ownership NOT transferred. |
|
149 */ |
|
150 MImpsStatusHandler2* StatusHandler() const; |
|
151 |
|
152 /** |
|
153 * Available services accessor |
|
154 * Notice that there are no services in NOT_LOGGED state, i.e. |
|
155 * before login has been executed successfully from any client. |
|
156 * @since 1.2 |
|
157 * @param aServices Service tree having all supported features and functions. |
|
158 */ |
|
159 void GetServicesL( TImpsServices& aServices ); |
|
160 |
|
161 /** |
|
162 * Returns actual WV Engine interface class pointer which is registered. |
|
163 * @since 1.2 |
|
164 * @return RImpsAccessClient pointer which is registered and can be used. |
|
165 * Ownership NOT transferred. |
|
166 */ |
|
167 RImpsAccessClient2* InterfaceL(); |
|
168 |
|
169 private: // Data |
|
170 |
|
171 // WV Engine access interface. |
|
172 RImpsAccessClient2 iClient; |
|
173 |
|
174 // Indicator if we are doing lazy initialization with WV Engine. |
|
175 TBool iLazyInitialization; |
|
176 |
|
177 // Indicator if we have registered WV Engine interface. |
|
178 TBool iRegistered; |
|
179 |
|
180 // Store priority if we are doing lazy initialization. |
|
181 TInt iPriority; |
|
182 |
|
183 // Used to store operation ID of LoginStatus if we don't start WV Engine but we answer back to UI. |
|
184 TInt iStatusId; |
|
185 |
|
186 // CIdle class which is used to call back to UI if we don't start WV Engine. Owns. |
|
187 CIdle *iCIdle; |
|
188 |
|
189 // Access observer, stored in lazy initialization. Doesn't own. |
|
190 MImpsAccessHandler2* iAccessHandler; |
|
191 |
|
192 // Status observer, stored in lazy initialization. Doesn't own. |
|
193 MImpsStatusHandler2* iStatusHandler; |
|
194 |
|
195 // Error observer, stored in lazy initialization. Doesn't own. |
|
196 MImpsErrorHandler2* iErrorHandler; |
|
197 |
|
198 // Reference to IMPS engine server session instance. |
|
199 RImpsEng& iImpsEng; |
|
200 }; |
|
201 |
|
202 #endif // MCAIMPSACCESSCLIENT_H |
|
203 |
|
204 // End of File |