|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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: test cdl_api |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <ecam.h> |
|
22 #include <cdlrefs.h> |
|
23 #include <stringloader.h> |
|
24 #include <testdomcdl.rsg> |
|
25 |
|
26 #include "testdomcdl.hrh" |
|
27 #include "testdomcdl.h" |
|
28 |
|
29 //CONSTANTS |
|
30 const TInt KTwo = 2; |
|
31 const TInt KThree = 3; |
|
32 // ============================ MEMBER FUNCTIONS =============================== |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CTestDomCdl::TestCIRefL |
|
36 // ----------------------------------------------------------------------------- |
|
37 // |
|
38 TInt CTestDomCdl::TestCIRefL( CStifItemParser& /*aItem*/ ) |
|
39 { |
|
40 TUid testUid = { 0x174657FC }; |
|
41 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
42 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
43 CCdlInstance* inst = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
44 CleanupStack::PushL( inst ); |
|
45 STIF_ASSERT_NOT_NULL( inst ); |
|
46 inst->Ref(); |
|
47 CleanupStack::PopAndDestroy( KTwo ); |
|
48 return KErrNone; |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CTestDomCdl::TestCISubLayerL |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 TInt CTestDomCdl::TestCISubLayerL( CStifItemParser& /*aItem*/ ) |
|
56 { |
|
57 TUid testUid = { 0x174657FC }; |
|
58 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
59 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
60 CCdlInstance* inst = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
61 CleanupStack::PushL( inst ); |
|
62 STIF_ASSERT_NOT_NULL( inst ); |
|
63 inst->SubLayer(); |
|
64 CleanupStack::PopAndDestroy( KTwo ); |
|
65 return KErrNone; |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // CTestDomCdl::TestCILastAccessedRefL |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 TInt CTestDomCdl::TestCILastAccessedRefL( CStifItemParser& /*aItem*/ ) |
|
73 { |
|
74 TUid testUid = { 0x174657FC }; |
|
75 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
76 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
77 CCdlInstance* inst = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
78 CleanupStack::PushL( inst ); |
|
79 STIF_ASSERT_NOT_NULL( inst ); |
|
80 inst->LastAccessedRef(); |
|
81 CleanupStack::PopAndDestroy( KTwo ); |
|
82 return KErrNone; |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CTestDomCdl::TestCIFileNameRelativeToLastAccessedInstanceL |
|
87 // ----------------------------------------------------------------------------- |
|
88 // |
|
89 TInt CTestDomCdl::TestCIFileNameRelativeToLastAccessedInstanceL( CStifItemParser& /*aItem*/ ) |
|
90 { |
|
91 TFileName filename; |
|
92 TUid testUid = { 0x174657FC }; |
|
93 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
94 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
95 CCdlInstance* inst = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
96 CleanupStack::PushL( inst ); |
|
97 STIF_ASSERT_NOT_NULL( inst ); |
|
98 inst->FileNameRelativeToLastAccessedInstance( filename ); |
|
99 CleanupStack::PopAndDestroy( KTwo ); |
|
100 return KErrNone; |
|
101 } |
|
102 |
|
103 // ----------------------------------------------------------------------------- |
|
104 // CTestDomCdl::TestCIoperatorL |
|
105 // ----------------------------------------------------------------------------- |
|
106 // |
|
107 TInt CTestDomCdl::TestCIoperatorL( CStifItemParser& /*aItem*/ ) |
|
108 { |
|
109 TUid testUid = { 0x174657FC }; |
|
110 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
111 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
112 CCdlInstance* inst = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
113 CleanupStack::PushL( inst ); |
|
114 STIF_ASSERT_NOT_NULL( inst ); |
|
115 CCdlInstance* instother = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
116 CleanupStack::PushL( instother ); |
|
117 TBool flag = *inst == *instother; |
|
118 STIF_ASSERT_TRUE( flag ); |
|
119 CleanupStack::PopAndDestroy( KThree ); |
|
120 return KErrNone; |
|
121 } |
|
122 // ----------------------------------------------------------------------------- |
|
123 // CTestDomCdl::TestCINewL |
|
124 // ----------------------------------------------------------------------------- |
|
125 // |
|
126 TInt CTestDomCdl::TestCINewL( CStifItemParser& /*aItem*/ ) |
|
127 { |
|
128 TUid testUid = { 0x174657FC }; |
|
129 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
130 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
131 CCdlInstance* inst = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
132 CleanupStack::PushL( inst ); |
|
133 STIF_ASSERT_NOT_NULL( inst ); |
|
134 CleanupStack::PopAndDestroy( KTwo ); |
|
135 return KErrNone; |
|
136 } |
|
137 |
|
138 // ----------------------------------------------------------------------------- |
|
139 // CTestDomCdl::TestCINewLCL |
|
140 // ----------------------------------------------------------------------------- |
|
141 // |
|
142 TInt CTestDomCdl::TestCINewLCL( CStifItemParser& /*aItem*/ ) |
|
143 { |
|
144 TUid testUid = { 0x174657FC }; |
|
145 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
146 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
147 CCdlInstance* inst = CCdlInstance::NewLC( newRefs->Ref( 0 ), &face ); |
|
148 STIF_ASSERT_NOT_NULL( inst ); |
|
149 CleanupStack::PopAndDestroy( KTwo ); |
|
150 return KErrNone; |
|
151 } |
|
152 |
|
153 // ----------------------------------------------------------------------------- |
|
154 // CTestDomCdl::TestCIGetDataL |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 TInt CTestDomCdl::TestCIGetDataL( CStifItemParser& /*aItem*/ ) |
|
158 { |
|
159 TUid testUid = { 0x174657FC }; |
|
160 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
161 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
162 CCdlInstance* inst = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
163 CleanupStack::PushL( inst ); |
|
164 STIF_ASSERT_NOT_NULL( inst ); |
|
165 TInt cdlApiId = 0; |
|
166 inst->GetData( cdlApiId ); |
|
167 CleanupStack::PopAndDestroy( KTwo ); |
|
168 return KErrNone; |
|
169 } |
|
170 |
|
171 // ----------------------------------------------------------------------------- |
|
172 // CTestDomCdl::TestCIGetFunctionL |
|
173 // ----------------------------------------------------------------------------- |
|
174 // |
|
175 TInt CTestDomCdl::TestCIGetFunctionL( CStifItemParser& /*aItem*/ ) |
|
176 { |
|
177 TUid testUid = { 0x174657FC }; |
|
178 CCdlRefs* newRefs = CdlEngine::AllAvailableRefsLC(); |
|
179 SCdlInterface face = { 0,0,0,{testUid.iUid},0,0,0,0 }; |
|
180 CCdlInstance* inst = CCdlInstance::NewL( newRefs->Ref( 0 ), &face ); |
|
181 CleanupStack::PushL( inst ); |
|
182 STIF_ASSERT_NOT_NULL( inst ); |
|
183 TInt cdlApiId = 0; |
|
184 inst->GetFunction( cdlApiId ); |
|
185 CleanupStack::PopAndDestroy( KTwo ); |
|
186 return KErrNone; |
|
187 } |
|
188 |
|
189 // ----------------------------------------------------------------------------- |
|
190 // CTestDomCdl::TestCUNewLCL |
|
191 // ----------------------------------------------------------------------------- |
|
192 // |
|
193 TInt CTestDomCdl::TestCUNewLCL( CStifItemParser& /*aItem*/ ) |
|
194 { |
|
195 CCdlUids* uids = CCdlUids::NewLC();//push |
|
196 STIF_ASSERT_NOT_NULL( uids ); |
|
197 CleanupStack::PopAndDestroy(); |
|
198 return KErrNone; |
|
199 } |
|
200 |
|
201 // ----------------------------------------------------------------------------- |
|
202 // CTestDomCdl::TestCUCCdlUidsCL |
|
203 // ----------------------------------------------------------------------------- |
|
204 // |
|
205 TInt CTestDomCdl::TestCUCCdlUidsCL( CStifItemParser& /*aItem*/ ) |
|
206 { |
|
207 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
208 CleanupStack::PushL( uids ); |
|
209 STIF_ASSERT_NOT_NULL( uids ); |
|
210 CleanupStack::PopAndDestroy( uids ); |
|
211 return KErrNone; |
|
212 } |
|
213 |
|
214 // ----------------------------------------------------------------------------- |
|
215 // CTestDomCdl::TestCUAddL |
|
216 // ----------------------------------------------------------------------------- |
|
217 // |
|
218 TInt CTestDomCdl::TestCUAddL( CStifItemParser& /*aItem*/ ) |
|
219 { |
|
220 TUid testUid = { 0x5675708D }; |
|
221 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
222 CleanupStack::PushL( uids ); |
|
223 STIF_ASSERT_NOT_NULL( uids ); |
|
224 uids->AddL( testUid ); |
|
225 CleanupStack::PopAndDestroy( uids ); |
|
226 return KErrNone; |
|
227 } |
|
228 |
|
229 // ----------------------------------------------------------------------------- |
|
230 // CTestDomCdl::TestCURemoveL |
|
231 // ----------------------------------------------------------------------------- |
|
232 // |
|
233 TInt CTestDomCdl::TestCURemoveL( CStifItemParser& /*aItem*/ ) |
|
234 { |
|
235 TUid testUid = { 0x5675708D }; |
|
236 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
237 CleanupStack::PushL( uids ); |
|
238 STIF_ASSERT_NOT_NULL( uids ); |
|
239 uids->AddL( testUid ); |
|
240 uids->Remove( testUid ); |
|
241 CleanupStack::PopAndDestroy( uids ); |
|
242 return KErrNone; |
|
243 } |
|
244 |
|
245 // ----------------------------------------------------------------------------- |
|
246 // CTestDomCdl::TestCUAddLUidL |
|
247 // ----------------------------------------------------------------------------- |
|
248 // |
|
249 TInt CTestDomCdl::TestCUAddLUidL( CStifItemParser& /*aItem*/ ) |
|
250 { |
|
251 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
252 CleanupStack::PushL( uids ); |
|
253 STIF_ASSERT_NOT_NULL( uids ); |
|
254 CCdlUids* uids2 = CCdlUids::NewLC();//push |
|
255 uids->AddL( *uids2 ); |
|
256 CleanupStack::PopAndDestroy( KTwo ); |
|
257 return KErrNone; |
|
258 } |
|
259 |
|
260 // ----------------------------------------------------------------------------- |
|
261 // CTestDomCdl::TestCURemoveUidL |
|
262 // ----------------------------------------------------------------------------- |
|
263 // |
|
264 TInt CTestDomCdl::TestCURemoveUidL( CStifItemParser& /*aItem*/ ) |
|
265 { |
|
266 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
267 CleanupStack::PushL( uids ); |
|
268 STIF_ASSERT_NOT_NULL( uids ); |
|
269 CCdlUids* uids2 = CCdlUids::NewLC();//push |
|
270 uids->AddL( *uids2 ); |
|
271 uids->Remove( *uids2 ); |
|
272 CleanupStack::PopAndDestroy( KTwo ); |
|
273 return KErrNone; |
|
274 } |
|
275 |
|
276 // ----------------------------------------------------------------------------- |
|
277 // CTestDomCdl::TestCUFindIndexL |
|
278 // ----------------------------------------------------------------------------- |
|
279 // |
|
280 TInt CTestDomCdl::TestCUFindIndexL( CStifItemParser& /*aItem*/ ) |
|
281 { |
|
282 TUid testUid = { 0x5675708D }; |
|
283 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
284 CleanupStack::PushL( uids ); |
|
285 STIF_ASSERT_NOT_NULL( uids ); |
|
286 uids->FindIndex( testUid ); |
|
287 CleanupStack::PopAndDestroy( uids ); |
|
288 return KErrNone; |
|
289 } |
|
290 |
|
291 // ----------------------------------------------------------------------------- |
|
292 // CTestDomCdl::TestCUIntersectionLCL |
|
293 // ----------------------------------------------------------------------------- |
|
294 // |
|
295 TInt CTestDomCdl::TestCUIntersectionLCL( CStifItemParser& /*aItem*/ ) |
|
296 { |
|
297 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
298 CleanupStack::PushL( uids ); |
|
299 STIF_ASSERT_NOT_NULL( uids ); |
|
300 CCdlUids* uids2 = CCdlUids::NewLC();//push |
|
301 uids->IntersectionLC( *uids2 ); |
|
302 CleanupStack::PopAndDestroy( KThree ); |
|
303 return KErrNone; |
|
304 } |
|
305 |
|
306 // ----------------------------------------------------------------------------- |
|
307 // CTestDomCdl::TestCUImportL |
|
308 // ----------------------------------------------------------------------------- |
|
309 // |
|
310 TInt CTestDomCdl::TestCUImportL( CStifItemParser& /*aItem*/ ) |
|
311 { |
|
312 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
313 CleanupStack::PushL( uids ); |
|
314 STIF_ASSERT_NOT_NULL( uids ); |
|
315 TBuf8<10> buf; |
|
316 uids->ImportL( buf ); |
|
317 CleanupStack::PopAndDestroy(); |
|
318 return KErrNone; |
|
319 } |
|
320 |
|
321 // ----------------------------------------------------------------------------- |
|
322 // CTestDomCdl::TestCUExportL |
|
323 // ----------------------------------------------------------------------------- |
|
324 // |
|
325 TInt CTestDomCdl::TestCUExportL( CStifItemParser& /*aItem*/ ) |
|
326 { |
|
327 CCdlUids* uids = new( ELeave )CCdlUids(); |
|
328 CleanupStack::PushL( uids ); |
|
329 STIF_ASSERT_NOT_NULL( uids ); |
|
330 TBuf8<10> buf; |
|
331 uids->ImportL( buf ); |
|
332 uids->Export(); |
|
333 CleanupStack::PopAndDestroy(); |
|
334 return KErrNone; |
|
335 } |
|
336 |
|
337 // ----------------------------------------------------------------------------- |
|
338 // CTestDomCdl::TestCNNewLCL |
|
339 // ----------------------------------------------------------------------------- |
|
340 // |
|
341 TInt CTestDomCdl::TestCNNewLCL( CStifItemParser& /*aItem*/ ) |
|
342 { |
|
343 CCdlNames* names = CCdlNames::NewLC();//push |
|
344 STIF_ASSERT_NOT_NULL( names ); |
|
345 CleanupStack::PopAndDestroy(); |
|
346 return KErrNone; |
|
347 } |
|
348 |
|
349 // ----------------------------------------------------------------------------- |
|
350 // CTestDomCdl::TestCNCCdlNamesL |
|
351 // ----------------------------------------------------------------------------- |
|
352 // |
|
353 TInt CTestDomCdl::TestCNCCdlNamesL( CStifItemParser& /*aItem*/ ) |
|
354 { |
|
355 CCdlNames* names = new( ELeave )CCdlNames(); |
|
356 CleanupStack::PushL( names ); |
|
357 STIF_ASSERT_NOT_NULL( names ); |
|
358 CleanupStack::PopAndDestroy(); |
|
359 return KErrNone; |
|
360 } |
|
361 |
|
362 // ----------------------------------------------------------------------------- |
|
363 // CTestDomCdl::TestCNFindIndexL |
|
364 // ----------------------------------------------------------------------------- |
|
365 // |
|
366 TInt CTestDomCdl::TestCNFindIndexL( CStifItemParser& /*aItem*/ ) |
|
367 { |
|
368 TFileName fileName; |
|
369 CCdlNames* names = new( ELeave )CCdlNames(); |
|
370 CleanupStack::PushL( names ); |
|
371 STIF_ASSERT_NOT_NULL( names ); |
|
372 names->FindIndex( fileName ); |
|
373 CleanupStack::PopAndDestroy(); |
|
374 return KErrNone; |
|
375 } |
|
376 |
|
377 // ----------------------------------------------------------------------------- |
|
378 // CTestDomCdl::TestCNAddL |
|
379 // ----------------------------------------------------------------------------- |
|
380 // |
|
381 TInt CTestDomCdl::TestCNAddL( CStifItemParser& /*aItem*/ ) |
|
382 { |
|
383 TFileName fileName; |
|
384 CCdlNames* names = new( ELeave )CCdlNames(); |
|
385 CleanupStack::PushL( names ); |
|
386 STIF_ASSERT_NOT_NULL( names ); |
|
387 names->AddL( fileName ); |
|
388 CleanupStack::PopAndDestroy(); |
|
389 return KErrNone; |
|
390 } |
|
391 |
|
392 // ----------------------------------------------------------------------------- |
|
393 // CTestDomCdl::TestCNImportL |
|
394 // ----------------------------------------------------------------------------- |
|
395 // |
|
396 TInt CTestDomCdl::TestCNImportL( CStifItemParser& /*aItem*/ ) |
|
397 { |
|
398 CCdlNames* names = new( ELeave )CCdlNames(); |
|
399 CleanupStack::PushL( names ); |
|
400 STIF_ASSERT_NOT_NULL( names ); |
|
401 HBufC8* buf8 = HBufC8::NewMaxLC( 32 );//push |
|
402 TPtr8 ptr = buf8->Des(); |
|
403 TChar theChar = 0; |
|
404 ptr.Zero(); |
|
405 ptr.AppendFill( theChar, 8 ); |
|
406 names->ImportL( *buf8 ); |
|
407 CleanupStack::PopAndDestroy( KTwo ); |
|
408 return KErrNone; |
|
409 } |
|
410 |
|
411 // ----------------------------------------------------------------------------- |
|
412 // CTestDomCdl::TestCNExportL |
|
413 // ----------------------------------------------------------------------------- |
|
414 // |
|
415 TInt CTestDomCdl::TestCNExportL( CStifItemParser& /*aItem*/ ) |
|
416 { |
|
417 CCdlNames* names = new( ELeave )CCdlNames(); |
|
418 CleanupStack::PushL( names ); |
|
419 STIF_ASSERT_NOT_NULL( names ); |
|
420 HBufC8* buf8 = HBufC8::NewMaxLC( 32 );//push |
|
421 TPtr8 ptr = buf8->Des(); |
|
422 TChar theChar = 0; |
|
423 ptr.Zero(); |
|
424 ptr.AppendFill( theChar, 8 ); |
|
425 names->ImportL( *buf8 ); |
|
426 names->ExportL(); |
|
427 CleanupStack::PopAndDestroy( KTwo ); |
|
428 return KErrNone; |
|
429 } |
|
430 |
|
431 // ----------------------------------------------------------------------------- |
|
432 // CTestDomCdl::TestCNExportLCL |
|
433 // ----------------------------------------------------------------------------- |
|
434 // |
|
435 TInt CTestDomCdl::TestCNExportLCL( CStifItemParser& /*aItem*/ ) |
|
436 { |
|
437 CCdlNames* names = new( ELeave )CCdlNames(); |
|
438 CleanupStack::PushL( names ); |
|
439 STIF_ASSERT_NOT_NULL( names ); |
|
440 HBufC8* buf8 = HBufC8::NewMaxLC( 32 );//push |
|
441 TPtr8 ptr = buf8->Des(); |
|
442 TChar theChar = 0; |
|
443 ptr.Zero(); |
|
444 ptr.AppendFill( theChar, 8 ); |
|
445 names->ImportL( *buf8 ); |
|
446 names->ExportLC(); |
|
447 CleanupStack::PopAndDestroy( KThree ); |
|
448 return KErrNone; |
|
449 } |
|
450 |
|
451 // ----------------------------------------------------------------------------- |
|
452 // CTestDomCdl::TestCCOHandleCustomisationChangeL |
|
453 // ----------------------------------------------------------------------------- |
|
454 // |
|
455 TInt CTestDomCdl::TestCCOHandleCustomisationChangeL( CStifItemParser& /*aItem*/ ) |
|
456 { |
|
457 MCdlChangeObserver obser; |
|
458 CCdlUids* uids = CCdlUids::NewLC();//push |
|
459 obser.HandleCustomisationChangeL( *uids ); |
|
460 CleanupStack::PopAndDestroy( uids ); |
|
461 return KErrNone; |
|
462 } |
|
463 |
|
464 // ----------------------------------------------------------------------------- |
|
465 // CTestDomCdl::TestCCOHandleAvailableRefsChangeL |
|
466 // ----------------------------------------------------------------------------- |
|
467 // |
|
468 TInt CTestDomCdl::TestCCOHandleAvailableRefsChangeL( CStifItemParser& /*aItem*/ ) |
|
469 { |
|
470 MCdlChangeObserver obser; |
|
471 CCdlUids* uids = CCdlUids::NewLC();//push |
|
472 obser.HandleAvailableRefsChangeL(); |
|
473 CleanupStack::PopAndDestroy( uids ); |
|
474 return KErrNone; |
|
475 } |
|
476 |
|
477 // ----------------------------------------------------------------------------- |
|
478 // CTestDomCdl::TestCEIsCdlEngineCreated |
|
479 // ----------------------------------------------------------------------------- |
|
480 // |
|
481 TInt CTestDomCdl::TestCEIsCdlEngineCreated( CStifItemParser& /*aItem*/ ) |
|
482 { |
|
483 CdlEngine::IsCdlEngineCreated(); |
|
484 return KErrNone; |
|
485 } |
|
486 |
|
487 // ----------------------------------------------------------------------------- |
|
488 // CTestDomCdl::TestCECreateCdlEngineL |
|
489 // ----------------------------------------------------------------------------- |
|
490 // |
|
491 TInt CTestDomCdl::TestCECreateCdlEngineL( CStifItemParser& /*aItem*/ ) |
|
492 { |
|
493 CdlEngine::CreateCdlEngineL(); |
|
494 return KErrNone; |
|
495 } |
|
496 |
|
497 // ----------------------------------------------------------------------------- |
|
498 // CTestDomCdl::TestCEStartGlobalCustomisationL |
|
499 // ----------------------------------------------------------------------------- |
|
500 // |
|
501 TInt CTestDomCdl::TestCEStartGlobalCustomisationL( CStifItemParser& /*aItem*/ ) |
|
502 { |
|
503 CdlEngine::StartGlobalCustomisationL(); |
|
504 return KErrNone; |
|
505 } |
|
506 |
|
507 // ----------------------------------------------------------------------------- |
|
508 // CTestDomCdl::TestCEGetDataL |
|
509 // ----------------------------------------------------------------------------- |
|
510 // |
|
511 TInt CTestDomCdl::TestCEGetDataL( CStifItemParser& /*aItem*/ ) |
|
512 { |
|
513 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
514 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
515 CdlEngine::LoadCustomisationL( cdlref ); |
|
516 CdlEngine::GetData( cdlref.iUid, 0 ); |
|
517 CleanupStack::PopAndDestroy( cdlRef2 ); |
|
518 return KErrNone; |
|
519 } |
|
520 |
|
521 // ----------------------------------------------------------------------------- |
|
522 // CTestDomCdl::TestCEGetFunctionL |
|
523 // ----------------------------------------------------------------------------- |
|
524 // |
|
525 TInt CTestDomCdl::TestCEGetFunctionL( CStifItemParser& /*aItem*/ ) |
|
526 { |
|
527 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
528 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
529 CdlEngine::LoadCustomisationL( cdlref ); |
|
530 CdlEngine::GetFunction( cdlref.iUid, 0 ); |
|
531 CleanupStack::PopAndDestroy( cdlRef2 ); |
|
532 return KErrNone; |
|
533 } |
|
534 |
|
535 // ----------------------------------------------------------------------------- |
|
536 // CTestDomCdl::TestCEIsCustomisationStarted |
|
537 // ----------------------------------------------------------------------------- |
|
538 // |
|
539 TInt CTestDomCdl::TestCEIsCustomisationStarted( CStifItemParser& /*aItem*/ ) |
|
540 { |
|
541 TUid testUid = { 0x5675708D }; |
|
542 SCdlInterface sCdlI; |
|
543 sCdlI.iUid = testUid; |
|
544 CdlEngine::IsCustomisationStarted( &sCdlI ); |
|
545 return KErrNone; |
|
546 } |
|
547 |
|
548 // ----------------------------------------------------------------------------- |
|
549 // CTestDomCdl::TestCERequireCustomisationL |
|
550 // ----------------------------------------------------------------------------- |
|
551 // |
|
552 TInt CTestDomCdl::TestCERequireCustomisationL( CStifItemParser& /*aItem*/ ) |
|
553 { |
|
554 TUid testUid = { 0x5675708D }; |
|
555 SCdlInterface sCdlI; |
|
556 sCdlI.iUid = testUid; |
|
557 CdlEngine::RequireCustomisationL( &sCdlI ); |
|
558 return KErrNone; |
|
559 } |
|
560 // ----------------------------------------------------------------------------- |
|
561 // CTestDomCdl::TestCELoadCustomisationL |
|
562 // ----------------------------------------------------------------------------- |
|
563 // |
|
564 TInt CTestDomCdl::TestCELoadCustomisationL( CStifItemParser& /*aItem*/ ) |
|
565 { |
|
566 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
567 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
568 CdlEngine::LoadCustomisationL( cdlref ); |
|
569 CleanupStack::PopAndDestroy( cdlRef2 ); |
|
570 return KErrNone; |
|
571 } |
|
572 |
|
573 // ----------------------------------------------------------------------------- |
|
574 // CTestDomCdl::TestCECustomisationInstanceL |
|
575 // ----------------------------------------------------------------------------- |
|
576 // |
|
577 TInt CTestDomCdl::TestCECustomisationInstanceL( CStifItemParser& /*aItem*/ ) |
|
578 { |
|
579 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
580 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
581 CdlEngine::LoadCustomisationL( cdlref ); |
|
582 CdlEngine::CustomisationInstance( cdlref.iUid ); |
|
583 CleanupStack::PopAndDestroy( cdlRef2 ); |
|
584 return KErrNone; |
|
585 } |
|
586 // |
|
587 |
|
588 // ----------------------------------------------------------------------------- |
|
589 // CTestDomCdl::TestCESetCustomisationChangeObserverL |
|
590 // ----------------------------------------------------------------------------- |
|
591 // |
|
592 TInt CTestDomCdl::TestCESetCustomisationChangeObserverL( CStifItemParser& /*aItem*/ ) |
|
593 { |
|
594 TUid testUid = { 0x5675708D }; |
|
595 CTestDomCdlEngineObserver* obser = new( ELeave )CTestDomCdlEngineObserver(); |
|
596 CleanupStack::PushL( obser ); |
|
597 CdlEngine::SetCustomisationChangeObserverL( obser, testUid ); |
|
598 CleanupStack::PopAndDestroy(); |
|
599 return KErrNone; |
|
600 } |
|
601 |
|
602 // ----------------------------------------------------------------------------- |
|
603 // CTestDomCdl::TestCELastAccessedRefL |
|
604 // ----------------------------------------------------------------------------- |
|
605 // |
|
606 TInt CTestDomCdl::TestCELastAccessedRefL( CStifItemParser& /*aItem*/ ) |
|
607 { |
|
608 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
609 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
610 CdlEngine::LoadCustomisationL( cdlref ); |
|
611 CdlEngine::LastAccessedRef( cdlref.iUid ); |
|
612 CleanupStack::PopAndDestroy( cdlRef2 ); |
|
613 return KErrNone; |
|
614 } |
|
615 |
|
616 // ----------------------------------------------------------------------------- |
|
617 // CTestDomCdl::TestCEFileNameRelativeToLastAccessedInstanceL |
|
618 // ----------------------------------------------------------------------------- |
|
619 // |
|
620 TInt CTestDomCdl::TestCEFileNameRelativeToLastAccessedInstanceL( CStifItemParser& /*aItem*/ ) |
|
621 { |
|
622 TFileName FileName; |
|
623 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
624 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
625 CdlEngine::LoadCustomisationL( cdlref ); |
|
626 CdlEngine::FileNameRelativeToLastAccessedInstance( cdlref.iUid ,FileName ); |
|
627 CleanupStack::PopAndDestroy( cdlRef2 ); |
|
628 return KErrNone; |
|
629 } |
|
630 |
|
631 // ----------------------------------------------------------------------------- |
|
632 // CTestDomCdl::TestCELastApiIdL |
|
633 // ----------------------------------------------------------------------------- |
|
634 // |
|
635 TInt CTestDomCdl::TestCELastApiIdL( CStifItemParser& /*aItem*/ ) |
|
636 { |
|
637 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
638 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
639 CdlEngine::LoadCustomisationL( cdlref ); |
|
640 CdlEngine::LastApiId(); |
|
641 CleanupStack::PopAndDestroy( cdlRef2 ); |
|
642 return KErrNone; |
|
643 } |
|
644 |
|
645 // ----------------------------------------------------------------------------- |
|
646 // CTestDomCdl::TestCEFindInstancesLCL |
|
647 // ----------------------------------------------------------------------------- |
|
648 // |
|
649 TInt CTestDomCdl::TestCEFindInstancesLCL( CStifItemParser& /*aItem*/ ) |
|
650 { |
|
651 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
652 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
653 CdlEngine::LoadCustomisationL( cdlref ); |
|
654 CdlEngine::FindInstancesLC( cdlref.iUid ); |
|
655 CleanupStack::PopAndDestroy( KTwo ); |
|
656 return KErrNone; |
|
657 } |
|
658 |
|
659 // ----------------------------------------------------------------------------- |
|
660 // CTestDomCdl::TestCEFileContentsLCL |
|
661 // ----------------------------------------------------------------------------- |
|
662 // |
|
663 TInt CTestDomCdl::TestCEFileContentsLCL( CStifItemParser& /*aItem*/ ) |
|
664 { |
|
665 TFileName FileName; |
|
666 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
667 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
668 CdlEngine::LoadCustomisationL( cdlref ); |
|
669 CdlEngine::FileNameRelativeToLastAccessedInstance( cdlref.iUid, FileName ); |
|
670 CdlEngine::FileContentsLC( FileName );//push |
|
671 CleanupStack::PopAndDestroy( KTwo ); |
|
672 return KErrNone; |
|
673 } |
|
674 |
|
675 // ----------------------------------------------------------------------------- |
|
676 // CTestDomCdl::TestCEFindCustomisationFilesLCL |
|
677 // ----------------------------------------------------------------------------- |
|
678 // |
|
679 TInt CTestDomCdl::TestCEFindCustomisationFilesLCL( CStifItemParser& /*aItem*/ ) |
|
680 { |
|
681 // TFileName FileName; |
|
682 // CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
683 // TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
684 // |
|
685 // CdlEngine::LoadCustomisationL( cdlref ); |
|
686 // CdlEngine::FileNameRelativeToLastAccessedInstance( cdlref.iUid, FileName ); |
|
687 // CdlEngine::FileContentsLC( FileName );//push |
|
688 // CdlEngine::FindCustomisationFilesLC(); |
|
689 // CleanupStack::PopAndDestroy( KThree ); |
|
690 return KErrNone; |
|
691 } |
|
692 |
|
693 // ----------------------------------------------------------------------------- |
|
694 // CTestDomCdl::TestCEAllAvailableRefsLCL |
|
695 // ----------------------------------------------------------------------------- |
|
696 // |
|
697 TInt CTestDomCdl::TestCEAllAvailableRefsLCL( CStifItemParser& /*aItem*/ ) |
|
698 { |
|
699 CCdlRefs* cdlRef2 = CdlEngine::AllAvailableRefsLC();//push |
|
700 TCdlRef cdlref = cdlRef2->Ref( 0 ); |
|
701 CdlEngine::LoadCustomisationL( cdlref ); |
|
702 CdlEngine::AllAvailableRefsLC(); |
|
703 CleanupStack::PopAndDestroy( KTwo ); |
|
704 return KErrNone; |
|
705 } |
|
706 |
|
707 // ----------------------------------------------------------------------------- |
|
708 // CTestDomCdl::TestCESetAvailableRefsChangeObserverL |
|
709 // ----------------------------------------------------------------------------- |
|
710 // |
|
711 TInt CTestDomCdl::TestCESetAvailableRefsChangeObserverL( CStifItemParser& /*aItem*/ ) |
|
712 { |
|
713 CTestDomCdlEngineObserver* obser = new( ELeave )CTestDomCdlEngineObserver(); |
|
714 CleanupStack::PushL( obser ); |
|
715 CdlEngine::SetAvailableRefsChangeObserverL( obser ); |
|
716 CleanupStack::PopAndDestroy( obser ); |
|
717 return KErrNone; |
|
718 } |
|
719 |
|
720 // ----------------------------------------------------------------------------- |
|
721 // CTestDomCdl::TestCESetLocalStateL |
|
722 // ----------------------------------------------------------------------------- |
|
723 // |
|
724 TInt CTestDomCdl::TestCESetLocalStateL( CStifItemParser& /*aItem*/ ) |
|
725 { |
|
726 TUid testUid = { 0x5675708D }; |
|
727 CCdlRefs* cdlRef = CdlEngine::FindInstancesLC( testUid );//push |
|
728 CdlEngine::SetLocalStateL( *cdlRef ); |
|
729 CleanupStack::PopAndDestroy( cdlRef ); |
|
730 return KErrNone; |
|
731 } |
|
732 |
|
733 // ----------------------------------------------------------------------------- |
|
734 // CTestDomCdl::TestCESetGlobalStateL |
|
735 // ----------------------------------------------------------------------------- |
|
736 // |
|
737 TInt CTestDomCdl::TestCESetGlobalStateL( CStifItemParser& /*aItem*/ ) |
|
738 { |
|
739 TUid testUid = { 0x5675708D }; |
|
740 CCdlRefs* cdlRef = CdlEngine::FindInstancesLC( testUid );//push |
|
741 CdlEngine::SetGlobalStateL( *cdlRef ); |
|
742 CleanupStack::PopAndDestroy( cdlRef ); |
|
743 return KErrNone; |
|
744 } |
|
745 |
|
746 // ----------------------------------------------------------------------------- |
|
747 // CTestDomCdl::TestCELocalStateLCL |
|
748 // ----------------------------------------------------------------------------- |
|
749 // |
|
750 TInt CTestDomCdl::TestCELocalStateLCL( CStifItemParser& /*aItem*/ ) |
|
751 { |
|
752 CCdlUids* uids = CCdlUids::NewLC();//push |
|
753 CCdlRefs* cdlRef3 = CdlEngine::LocalStateLC( *uids );//push |
|
754 CleanupStack::PopAndDestroy( KTwo ); |
|
755 return KErrNone; |
|
756 } |
|
757 |
|
758 // ----------------------------------------------------------------------------- |
|
759 // CTestDomCdl::TestCEGlobalStateLCL |
|
760 // ----------------------------------------------------------------------------- |
|
761 // |
|
762 TInt CTestDomCdl::TestCEGlobalStateLCL( CStifItemParser& /*aItem*/ ) |
|
763 { |
|
764 CCdlUids* uids = CCdlUids::NewLC();//push |
|
765 CCdlRefs* cdlRef3 = CdlEngine::GlobalStateLC( *uids );//push |
|
766 CleanupStack::PopAndDestroy( KTwo ); |
|
767 return KErrNone; |
|
768 } |
|
769 // ----------------------------------------------------------------------------- |
|
770 // CTestDomCdl::TestCEEnableGlobalCustomisationL |
|
771 // ----------------------------------------------------------------------------- |
|
772 // |
|
773 TInt CTestDomCdl::TestCEEnableGlobalCustomisationL( CStifItemParser& /*aItem*/ ) |
|
774 { |
|
775 CCdlUids* uids = CCdlUids::NewLC();//push |
|
776 CdlEngine::EnableGlobalCustomisationL( *uids , ETrue); |
|
777 CleanupStack::PopAndDestroy( uids ); |
|
778 return KErrNone; |
|
779 } |
|
780 |
|
781 // ----------------------------------------------------------------------------- |
|
782 // CTestDomCdl::TestCECompareNames |
|
783 // ----------------------------------------------------------------------------- |
|
784 // |
|
785 TInt CTestDomCdl::TestCECompareNames( CStifItemParser& /*aItem*/ ) |
|
786 { |
|
787 TBuf<10> lift; |
|
788 TBuf<10> right; |
|
789 CdlEngine::CompareNames( lift, right ); |
|
790 return KErrNone; |
|
791 } |
|
792 |
|
793 |
|
794 // [End of File] |
|
795 |
|
796 |