|
1 /* |
|
2 * Copyright (c) 2006 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: Contains CNcdProviderProxy class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef NCD_PROVIDER_PROXY_H |
|
20 #define NCD_PROVIDER_PROXY_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 #include "ncdinterfacebaseproxy.h" |
|
26 #include "ncdprovider.h" |
|
27 #include "ncdproviderpcclientsupport.h" |
|
28 #include "ncddebuginformation.h" |
|
29 #include "catalogsbaseimpl.h" |
|
30 |
|
31 class MCatalogsClientServer; |
|
32 class CNcdNodeManagerProxy; |
|
33 class CNcdPurchaseHistoryProxy; |
|
34 class CNcdOperationManagerProxy; |
|
35 class MNcdFileDownloadOperation; |
|
36 class MNcdFileDownloadOperationObserver; |
|
37 class CNcdSubscriptionManagerProxy; |
|
38 class CNcdFavoriteManagerProxy; |
|
39 class CCatalogsAsyncMediator; |
|
40 class CNcdCreateAccessPointOperationProxy; |
|
41 class CNcdServerReportManagerProxy; |
|
42 |
|
43 /** |
|
44 * Class to used in testing of provider |
|
45 * |
|
46 * |
|
47 * |
|
48 * @lib ?library |
|
49 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
50 */ |
|
51 class CNcdProviderProxy : public CNcdInterfaceBaseProxy, |
|
52 public MNcdProvider, |
|
53 public MNcdProviderPcClientSupport, |
|
54 public MNcdDebugInformation |
|
55 { |
|
56 public: |
|
57 |
|
58 static CNcdProviderProxy* NewL( MCatalogsClientServer& aSession, |
|
59 TInt aHandle ); |
|
60 |
|
61 static CNcdProviderProxy* NewLC( MCatalogsClientServer& aSession, |
|
62 TInt aHandle ); |
|
63 |
|
64 /** |
|
65 * Destructor |
|
66 * Releases node manager and operation manager proxies until they |
|
67 * are destroyed. |
|
68 */ |
|
69 virtual ~CNcdProviderProxy(); |
|
70 |
|
71 /** |
|
72 * Initiates callback to MNcdProviderObserver::ExpirationInformationReceived |
|
73 */ |
|
74 void ExpirationCallback( RCatalogsArray< MNcdNode >& aExpiredNodes ); |
|
75 |
|
76 /** |
|
77 * @return CNcdOperationManagerProxy& |
|
78 */ |
|
79 CNcdOperationManagerProxy& OperationManager(); |
|
80 |
|
81 /** |
|
82 * @return CNcdServerReportManagerProxy& |
|
83 */ |
|
84 CNcdServerReportManagerProxy& ServerReportManager(); |
|
85 |
|
86 |
|
87 public: // MNcdProvider |
|
88 |
|
89 /** |
|
90 * @see MNcdProvider::SetObserver |
|
91 */ |
|
92 virtual void SetObserver( MNcdProviderObserver* aObserver ); |
|
93 |
|
94 /** |
|
95 * @see MNcdProvider::RootNodeL |
|
96 */ |
|
97 virtual MNcdNode* RootNodeL(); |
|
98 |
|
99 /** |
|
100 * @see MNcdProvider::Operations |
|
101 */ |
|
102 virtual RCatalogsArray<MNcdOperation> OperationsL() const; |
|
103 |
|
104 /** |
|
105 * @see MNcdProvider::PurchaseHistoryL |
|
106 */ |
|
107 virtual MNcdPurchaseHistory* PurchaseHistoryL() const; |
|
108 |
|
109 /** |
|
110 * @see MNcdProvider::SubscriptionsL |
|
111 */ |
|
112 virtual MNcdSubscriptionManager* SubscriptionsL() const; |
|
113 |
|
114 /** |
|
115 * @see MNcdProvider::AddConfigurationL |
|
116 */ |
|
117 virtual void AddConfigurationL( const MNcdKeyValuePair& aConfiguration ); |
|
118 |
|
119 /** |
|
120 * @see MNcdProvider::RemoveConfigurationL |
|
121 */ |
|
122 virtual void RemoveConfigurationL( const TDesC& aKey ); |
|
123 |
|
124 /** |
|
125 * @see MNcdProvider::ConfigurationsL |
|
126 */ |
|
127 virtual RPointerArray< CNcdKeyValuePair > ConfigurationsL() const; |
|
128 |
|
129 /** |
|
130 * @see MNcdProvider::NodeL |
|
131 */ |
|
132 virtual MNcdNode* NodeL( const TDesC& aNameSpaceId, |
|
133 const TDesC& aNodeId ) const; |
|
134 |
|
135 /** |
|
136 * @see MNcdProvider::NodeL( const MNcdPurchaseDetails& aDetails ) |
|
137 */ |
|
138 virtual MNcdNode* NodeL( const MNcdPurchaseDetails& aDetails ) const; |
|
139 |
|
140 /** |
|
141 * @see MNcdProvider::SchemeNodeL |
|
142 */ |
|
143 virtual MNcdNode* SchemeNodeL( const TDesC& aNameSpaceId, |
|
144 const TDesC& aEntityId, |
|
145 const TDesC& aServerUri, |
|
146 TNcdSchemeNodeType aType, |
|
147 TBool aRemoveOnDisconnect, |
|
148 TBool aForceCreate ) const; |
|
149 |
|
150 |
|
151 /** |
|
152 * @see MNcdProvider::SetStringLocalizer |
|
153 */ |
|
154 virtual void SetStringLocalizer( MNcdClientLocalizer& aLocalizer ); |
|
155 |
|
156 |
|
157 /** |
|
158 * @see MNcdProvider::DownloadFileL |
|
159 */ |
|
160 virtual MNcdFileDownloadOperation* DownloadFileL( const TDesC& aUri, |
|
161 const TDesC& aTargetFileName, |
|
162 MNcdFileDownloadOperationObserver& aObserver ); |
|
163 |
|
164 |
|
165 /** |
|
166 * @see MNcdProvider::SetDefaultConnectionMethodL() |
|
167 */ |
|
168 virtual void SetDefaultConnectionMethodL( |
|
169 const TNcdConnectionMethod& aAccessPointId ); |
|
170 |
|
171 /** |
|
172 * @see MNcdProvider::ClearSearchResultsL() |
|
173 */ |
|
174 virtual void ClearSearchResultsL(); |
|
175 |
|
176 /** |
|
177 * @see MNCdProvider::ClearCacheL() |
|
178 */ |
|
179 virtual void ClearCacheL( TRequestStatus& aStatus ); |
|
180 |
|
181 |
|
182 /** |
|
183 * @see MNcdProvider::IsSimChangedL() |
|
184 */ |
|
185 virtual TBool IsSimChangedL(); |
|
186 |
|
187 /** |
|
188 * @see MNcdProvider::IsFixedAp() |
|
189 */ |
|
190 virtual TBool IsFixedApL(); |
|
191 |
|
192 |
|
193 public: // from MNcdProviderPcClientSupport |
|
194 |
|
195 /** |
|
196 * @see MNcdProviderPcClientSupport::DownloadAndInstallRightsObjectL() |
|
197 */ |
|
198 virtual MNcdRightsObjectOperation* DownloadAndInstallRightsObjectL( |
|
199 MNcdRightsObjectOperationObserver& aObserver, |
|
200 const TDesC& aDownloadUri, |
|
201 const TDesC& aMimeType, |
|
202 const TNcdConnectionMethod& aConnectionMethod ); |
|
203 |
|
204 /** |
|
205 * @see MNcdProviderPcClientSupport::CreateAccessPointL() |
|
206 */ |
|
207 virtual MNcdCreateAccessPointOperation* CreateAccessPointL( |
|
208 const TDesC& aAccessPointData, |
|
209 MNcdCreateAccessPointOperationObserver& aObserver ); |
|
210 |
|
211 |
|
212 /** |
|
213 * @see MNcdProviderPcClientSupport::SendHttpRequestL() |
|
214 */ |
|
215 virtual MNcdSendHttpRequestOperation* SendHttpRequestL( |
|
216 const TDesC8& aUri, |
|
217 const TDesC8& aRequest, |
|
218 const TNcdConnectionMethod& aConnectionMethod, |
|
219 MNcdSendHttpRequestOperationObserver& aObserver ); |
|
220 |
|
221 public: // from MNcdDebugInformation |
|
222 |
|
223 /** |
|
224 * @see MNcdDebugInformation::ClientId(). |
|
225 */ |
|
226 virtual HBufC* ClientIdL(); |
|
227 |
|
228 |
|
229 /** |
|
230 * @see MNcdDebugInformation::EngineTypeL() |
|
231 */ |
|
232 virtual HBufC* EngineTypeL(); |
|
233 |
|
234 /** |
|
235 * @see MNcdDebugInformation::EngineVersionL() |
|
236 */ |
|
237 virtual HBufC* EngineVersionL(); |
|
238 |
|
239 |
|
240 /** |
|
241 * @see MNcdDebugInformation::EngineProvisioningL() |
|
242 */ |
|
243 virtual HBufC* EngineProvisioningL(); |
|
244 |
|
245 |
|
246 /** |
|
247 * @see MNcdDebugInformation::EngineUidL() |
|
248 */ |
|
249 virtual HBufC* EngineUidL(); |
|
250 |
|
251 protected: |
|
252 |
|
253 CNcdProviderProxy( MCatalogsClientServer& aSession, |
|
254 TInt aHandle ); |
|
255 |
|
256 |
|
257 /** |
|
258 * Calls the ConstructL of the parent class. |
|
259 * Also, uses CreateNodeManagerL and CreateOperationManagerL |
|
260 * to create managers. |
|
261 */ |
|
262 virtual void ConstructL(); |
|
263 |
|
264 /** |
|
265 * CreateNodeManagerL |
|
266 * ConstructL will use this function to create the manager. |
|
267 * If a child class implements this function then it is called |
|
268 * instead. |
|
269 */ |
|
270 virtual void CreateNodeManagerL(); |
|
271 |
|
272 /** |
|
273 * CreatePurchaseHistoryL |
|
274 * ConstructL will use this function to create the purchase history. |
|
275 * If a child class implements this function then it is called |
|
276 * instead. |
|
277 */ |
|
278 virtual void CreatePurchaseHistoryL(); |
|
279 |
|
280 /** |
|
281 * CreateOperationManagerL |
|
282 * ConstructL will use this function to create the manager. |
|
283 * If a child class implements this function then it is called |
|
284 * instead. |
|
285 */ |
|
286 virtual void CreateOperationManagerL(); |
|
287 |
|
288 /** |
|
289 * CreateSubscriptionManagerL |
|
290 * ConstructL will use this function to create the manager. |
|
291 * If a child class implements this function then it is called |
|
292 * instead. |
|
293 */ |
|
294 virtual void CreateSubscriptionManagerL(); |
|
295 |
|
296 /** |
|
297 * CreateFavoriteManagerL |
|
298 * ConstructL will use this function to create the manager. |
|
299 * If a child class implements this function then it is called |
|
300 * instead. |
|
301 */ |
|
302 virtual void CreateFavoriteManagerL(); |
|
303 |
|
304 /** |
|
305 * CreateServerReportManagerL |
|
306 * ConstructL will use this function to create the manager. |
|
307 * If a child class implements this function then it is called |
|
308 * instead. |
|
309 */ |
|
310 virtual void CreateServerReportManagerL(); |
|
311 |
|
312 |
|
313 HBufC* GetInfoFromProviderL( TInt aInfoIndex ); |
|
314 |
|
315 |
|
316 void InternalizeFavoriteManagerL(); |
|
317 |
|
318 static TInt InternalizeFavoriteManager( TAny* aProvider ); |
|
319 |
|
320 private: |
|
321 |
|
322 // Prevent if not implemented |
|
323 CNcdProviderProxy( const CNcdProviderProxy& aObject ); |
|
324 CNcdProviderProxy& operator =( const CNcdProviderProxy& aObject ); |
|
325 |
|
326 |
|
327 private: // data |
|
328 |
|
329 CNcdNodeManagerProxy* iNodeManager; |
|
330 CNcdPurchaseHistoryProxy* iPurchaseHistory; |
|
331 CNcdOperationManagerProxy* iOperationManager; |
|
332 CNcdSubscriptionManagerProxy* iSubscriptionManager; |
|
333 CNcdFavoriteManagerProxy* iFavoriteManager; |
|
334 CNcdServerReportManagerProxy* iServerReportManager; |
|
335 |
|
336 MNcdProviderObserver* iObserver; |
|
337 |
|
338 /** |
|
339 * Client localizer, not own. |
|
340 */ |
|
341 MNcdClientLocalizer* iClientLocalizer; |
|
342 |
|
343 |
|
344 // Buffer for returning data from asynchronous requests |
|
345 TBuf8<1> iReturnBuf; |
|
346 |
|
347 CCatalogsAsyncMediator* iAsyncMediator; |
|
348 |
|
349 }; |
|
350 |
|
351 #endif // NCD_PROVIDER_PROXY_H |