|
1 /* |
|
2 * Copyright (c) 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 case |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <w32std.h> |
|
20 #include <coecntrl.h> |
|
21 #include <eikenv.h> |
|
22 #include <aknsconstants.h> |
|
23 #include <aknsdrawutils.h> |
|
24 #include <aknsimageattributedata.h> |
|
25 |
|
26 #include <aknseffectanim.h> |
|
27 #include <aknsitemdef.h> |
|
28 #include <aknspkgid.h> |
|
29 #include <aknspointerstore.h> |
|
30 #include <aknsrendererwrapper.h> |
|
31 #include <aknsskinuid.h> |
|
32 #include <aknssrvchunklookup.h> |
|
33 #include <aknssrvclient.h> |
|
34 #include <aknssrvskininformationpkg.h> |
|
35 |
|
36 #include "bctestdomskincase.h" |
|
37 #include "bctestdomfntlaycontainer.h" |
|
38 #include "bctestdomfntlay.hrh" |
|
39 |
|
40 class CAknsEffectAnimObserver : public CBase ,public MAknsEffectAnimObserver |
|
41 { |
|
42 void AnimFrameReady( TInt aError, TInt aAnimId ); |
|
43 } ; |
|
44 |
|
45 void CAknsEffectAnimObserver::AnimFrameReady( TInt aError, TInt /* aAnimId */ ) |
|
46 { |
|
47 TBuf<16> strError; |
|
48 _LIT( KTxtError, "CAknsEffectAnim Error :" ); |
|
49 strError.Append( KTxtError ); |
|
50 strError.AppendNum( aError ) ; |
|
51 RDebug::Print( strError ); |
|
52 } |
|
53 |
|
54 // ======== MEMBER FUNCTIONS ======== |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // Symbian 2nd static Constructor |
|
58 // --------------------------------------------------------------------------- |
|
59 // |
|
60 |
|
61 CBCTestDomSkinCase* CBCTestDomSkinCase::NewL( ) |
|
62 { |
|
63 CBCTestDomSkinCase* self = new( ELeave ) CBCTestDomSkinCase(); |
|
64 CleanupStack::PushL( self ); |
|
65 self->ConstructL(); |
|
66 CleanupStack::Pop( self ); |
|
67 return self; |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // C++ default constructor |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 CBCTestDomSkinCase::CBCTestDomSkinCase() |
|
75 { |
|
76 } |
|
77 |
|
78 // --------------------------------------------------------------------------- |
|
79 // Destructor |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 CBCTestDomSkinCase::~CBCTestDomSkinCase() |
|
83 { |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // Symbian 2nd Constructor |
|
88 // --------------------------------------------------------------------------- |
|
89 // |
|
90 void CBCTestDomSkinCase::ConstructL() |
|
91 { |
|
92 BuildScriptL(); |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // CBCTestDomSkinCase::BuildScriptL |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 void CBCTestDomSkinCase::BuildScriptL() |
|
100 { |
|
101 // Add script as your need. |
|
102 AddTestL( DELAY(1), |
|
103 LeftCBA, REP(Down,1), LeftCBA, LeftCBA, |
|
104 LeftCBA, REP(Down,1), LeftCBA, REP(Down,1), LeftCBA, |
|
105 LeftCBA, REP(Down,1), LeftCBA, REP(Down,2), LeftCBA, |
|
106 LeftCBA, REP(Down,1), LeftCBA, REP(Down,3), LeftCBA, |
|
107 LeftCBA, REP(Down,1), LeftCBA, REP(Down,4), LeftCBA, |
|
108 LeftCBA, REP(Down,1), LeftCBA, REP(Down,5), LeftCBA, |
|
109 LeftCBA, REP(Down,1), LeftCBA, REP(Down,6), LeftCBA, |
|
110 LeftCBA, REP(Down,1), LeftCBA, REP(Down,7), LeftCBA, |
|
111 LeftCBA, REP(Down,1), LeftCBA, REP(Down,8), LeftCBA, |
|
112 TEND ); |
|
113 } |
|
114 |
|
115 // --------------------------------------------------------------------------- |
|
116 // CBCTestDomSkinCase::RunL |
|
117 // --------------------------------------------------------------------------- |
|
118 // |
|
119 void CBCTestDomSkinCase::RunL( TInt aCmd ) |
|
120 { |
|
121 if ( aCmd < EBCTestDomCmdOutline04 || aCmd > EBCTestDomCmdOutline12 ) |
|
122 { |
|
123 return; |
|
124 } |
|
125 switch ( aCmd ) |
|
126 { |
|
127 case EBCTestDomCmdOutline04: //AknsEffectAnim.h 22 |
|
128 { |
|
129 TestEffectAnimL(); |
|
130 break; |
|
131 } |
|
132 case EBCTestDomCmdOutline05: //AknsItemDef.h |
|
133 { |
|
134 TestItemDefL(); |
|
135 break; |
|
136 } |
|
137 case EBCTestDomCmdOutline06: //AknsItemDef.h |
|
138 { |
|
139 TestItemDef2L(); |
|
140 break; |
|
141 } |
|
142 case EBCTestDomCmdOutline07: //AknsPkgID.h 3 |
|
143 { |
|
144 TestPkgIDL(); |
|
145 break; |
|
146 } |
|
147 case EBCTestDomCmdOutline08: //AknsPointerStore.h 3 |
|
148 { |
|
149 TestPointerStoreL(); |
|
150 break; |
|
151 } |
|
152 case EBCTestDomCmdOutline09: //AknsRendererWrapper.h 1 |
|
153 { |
|
154 TestRendererWrapperL(); |
|
155 break; |
|
156 } |
|
157 case EBCTestDomCmdOutline10: //AknsSrvChunkLookup.h |
|
158 { |
|
159 TestSrvChunkLookupL(); |
|
160 break; |
|
161 } |
|
162 case EBCTestDomCmdOutline11: //AknsSrvClient.h 25 |
|
163 { |
|
164 TestSrvClientL(); |
|
165 break; |
|
166 } |
|
167 case EBCTestDomCmdOutline12: //AknsSrvSkinInformationPkg.h 15 |
|
168 { |
|
169 TestSrvSkinInformationPkgL(); |
|
170 break; |
|
171 } |
|
172 default: |
|
173 break; |
|
174 } |
|
175 } |
|
176 |
|
177 // --------------------------------------------------------------------------- |
|
178 // CBCTestDomSkinCase::TestEffectAnimL |
|
179 // --------------------------------------------------------------------------- |
|
180 // |
|
181 void CBCTestDomSkinCase::TestEffectAnimL()//AknsEffectAnim.h 22 |
|
182 { |
|
183 CAknsEffectAnimObserver* observer = |
|
184 new (ELeave) CAknsEffectAnimObserver(); |
|
185 CleanupStack::PushL( observer ); |
|
186 CAknsEffectAnim* effictAnim = CAknsEffectAnim::NewL( observer ); |
|
187 CleanupStack::PushL( effictAnim ); |
|
188 _LIT( KTxtNewL, "CAknsEffectAnim::NewL" ); |
|
189 AssertTrueL( ETrue, KTxtNewL ); |
|
190 |
|
191 TBool isSuc = effictAnim->ConstructFromSkinL( |
|
192 KAknsIIDQgnIndiTpDialler );// |
|
193 _LIT( KTxtConstructFromSkinL, |
|
194 "CAknsEffectAnim::ConstructFromSkinL" ); |
|
195 AssertTrueL( ETrue, KTxtConstructFromSkinL ); |
|
196 |
|
197 TInt ret = effictAnim->Start(); |
|
198 _LIT( KTxtStart, "CAknsEffectAnim::Start" ); |
|
199 AssertTrueL( ETrue, KTxtStart ); |
|
200 |
|
201 ret = effictAnim->Pause(); |
|
202 _LIT( KTxtPause, "CAknsEffectAnim::Pause" ); |
|
203 AssertTrueL( ETrue, KTxtPause ); |
|
204 |
|
205 ret = effictAnim->Continue(); |
|
206 _LIT( KTxtContinue, "CAknsEffectAnim::Continue" ); |
|
207 AssertTrueL( ETrue, KTxtContinue ); |
|
208 |
|
209 ret = effictAnim->Stop(); |
|
210 _LIT( KTxtStop, "CAknsEffectAnim::Stop" ); |
|
211 AssertTrueL( ETrue, KTxtStop ); |
|
212 |
|
213 ret = effictAnim->State(); |
|
214 _LIT( KTxtState, "CAknsEffectAnim::State" ); |
|
215 AssertTrueL( ETrue, KTxtState ); |
|
216 |
|
217 CFbsBitGc* fbsBitgc = CFbsBitGc::NewL(); |
|
218 CleanupStack::PushL( fbsBitgc ); |
|
219 isSuc = effictAnim->Render( *fbsBitgc, TRect( 50, 50, 10, 10 ) ); |
|
220 _LIT( KTxtRender, "CAknsEffectAnim::Render" ); |
|
221 AssertTrueL( ETrue, KTxtRender ); |
|
222 |
|
223 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
224 isSuc = effictAnim->Render( gc, TRect( 50, 50, 10, 10 ) ); |
|
225 _LIT( KTxtRender2, "CAknsEffectAnim::Render2" ); |
|
226 AssertTrueL( ETrue, KTxtRender2 ); |
|
227 |
|
228 CBitmapContext& bitmapGc = gc; |
|
229 isSuc = effictAnim->Render( bitmapGc, TRect( 50, 50, 10, 10 ) ); |
|
230 _LIT( KTxtRender3, "CAknsEffectAnim::Render3" ); |
|
231 AssertTrueL( ETrue, KTxtRender3 ); |
|
232 |
|
233 const CFbsBitmap* fbcBitmap = effictAnim->OutputRgb(); |
|
234 _LIT( KTxtOutputRgb, "CAknsEffectAnim::OutputRgb" ); |
|
235 AssertTrueL (ETrue, KTxtOutputRgb ); |
|
236 |
|
237 fbcBitmap = effictAnim->OutputAlpha(); |
|
238 _LIT( KTxtOutputAlpha, "CAknsEffectAnim::OutputAlpha" ); |
|
239 AssertTrueL( ETrue, KTxtOutputAlpha ); |
|
240 |
|
241 TSize minSize = effictAnim->MinimumSize(); |
|
242 _LIT( KTxtMinimumSize, "CAknsEffectAnim::MinimumSize" ); |
|
243 AssertTrueL( ETrue, KTxtMinimumSize ); |
|
244 |
|
245 minSize = effictAnim->Size(); |
|
246 _LIT( KTxtSize, "CAknsEffectAnim::Size" ); |
|
247 AssertTrueL( ETrue, KTxtSize ); |
|
248 |
|
249 isSuc = effictAnim->NeedsInputLayer(); |
|
250 _LIT( KTxtNeedsInputLayer, "CAknsEffectAnim::NeedsInputLayer" ); |
|
251 AssertTrueL( ETrue, KTxtNeedsInputLayer ); |
|
252 |
|
253 effictAnim->BeginConfigInputLayersL( TSize( 10, 20 ), EFalse ); |
|
254 _LIT( KTxtBeginConfigInputLayersL, |
|
255 "CAknsEffectAnim::BeginConfigInputLayersL" ); |
|
256 AssertTrueL( ETrue, KTxtBeginConfigInputLayersL ); |
|
257 |
|
258 CFbsBitGc* fbGc = effictAnim->InputRgbGc(); |
|
259 _LIT( KTxtInputRgbGc, "CAknsEffectAnim::InputRgbGc" ); |
|
260 AssertTrueL( ETrue, KTxtInputRgbGc ); |
|
261 |
|
262 fbGc = effictAnim->InputAlphaGc(); |
|
263 _LIT( KTxtInputAlphaGc, "CAknsEffectAnim::InputAlphaGc" ); |
|
264 AssertTrueL( ETrue, KTxtInputAlphaGc ); |
|
265 |
|
266 effictAnim->EndConfigInputLayersL(); |
|
267 _LIT( KTxtEndConfigInputLayersL, |
|
268 "CAknsEffectAnim::EndConfigInputLayersL" ); |
|
269 AssertTrueL( ETrue, KTxtEndConfigInputLayersL ); |
|
270 |
|
271 ret = effictAnim->UpdateOutput(); |
|
272 _LIT( KTxtUpdateOutput, "CAknsEffectAnim::UpdateOutput" ); |
|
273 AssertTrueL( ETrue, KTxtUpdateOutput ); |
|
274 |
|
275 effictAnim->SetIdling( 5 ); |
|
276 _LIT( KTxtSetIdling, "CAknsEffectAnim::SetIdling" ); |
|
277 AssertTrueL( ETrue, KTxtSetIdling ); |
|
278 |
|
279 TBool isidling = effictAnim->IsIdling(); |
|
280 _LIT( KTxtIsIdling, "CAknsEffectAnim::IsIdling" ); |
|
281 AssertTrueL( ETrue, KTxtIsIdling ); |
|
282 |
|
283 |
|
284 CleanupStack::PopAndDestroy( fbsBitgc ); |
|
285 CleanupStack::PopAndDestroy( effictAnim ); |
|
286 _LIT( KTxtDelete, "CAknsEffectAnim::~CAknsEffectAnim" ); |
|
287 AssertTrueL( ETrue, KTxtDelete ); |
|
288 |
|
289 CleanupStack::PopAndDestroy( observer ); |
|
290 } |
|
291 |
|
292 // --------------------------------------------------------------------------- |
|
293 // CBCTestDomSkinCase::TestItemDefL |
|
294 // --------------------------------------------------------------------------- |
|
295 // |
|
296 void CBCTestDomSkinCase::TestItemDefL() //AknsItemDef.h |
|
297 { |
|
298 //CAknsItemDef |
|
299 CAknsItemDef* itemDef = CAknsItemDef::NewL( |
|
300 KAknsIIDQgnIndiTpDialler ); |
|
301 CleanupStack::PushL( itemDef ); |
|
302 _LIT( KTxtNewL, "CAknsItemDef::NewL" ); |
|
303 AssertTrueL( ETrue, KTxtNewL ); |
|
304 |
|
305 TAknsItemType itemType = itemDef->Type(); |
|
306 _LIT (KTxtType, "CAknsItemDef::Type" ); |
|
307 AssertTrueL( ETrue, KTxtType ); |
|
308 |
|
309 TAknsItemID itemID = itemDef->ID(); |
|
310 _LIT( KTxtID, "CAknsItemDef::ID" ); |
|
311 AssertTrueL( ETrue, KTxtID ); |
|
312 |
|
313 TInt ret = CAknsItemDef::LinearOrder( *itemDef, *itemDef ); |
|
314 _LIT( KTxtLinearOrder, "CAknsItemDef::LinearOrder" ); |
|
315 AssertTrueL( ETrue, KTxtLinearOrder ); |
|
316 |
|
317 CleanupStack::PopAndDestroy( itemDef ); |
|
318 _LIT( KTxtDelete, "CAknsItemDef::~CAknsItemDef" ); |
|
319 AssertTrueL( ETrue, KTxtDelete ); |
|
320 |
|
321 //CAknsImageItemDef |
|
322 CAknsImageItemDef* imageItemDef = |
|
323 CAknsImageItemDef::NewL( KAknsIIDQgnIndiTpDialler ); |
|
324 CleanupStack::PushL (imageItemDef ); |
|
325 _LIT( KTxtImageNewL, "CAknsImageItemDef::NewL" ); |
|
326 AssertTrueL( ETrue, KTxtImageNewL ); |
|
327 |
|
328 TAknsImageAttributeData attributeData; |
|
329 imageItemDef->SetAttributesL( attributeData ); |
|
330 _LIT( KTxtSetAttributesL, "CAknsImageItemDef::SetAttributesL" ); |
|
331 AssertTrueL( ETrue, KTxtSetAttributesL ); |
|
332 |
|
333 const TAknsImageAttributeData* attriData = |
|
334 imageItemDef->Attributes(); |
|
335 _LIT( KTxtAttributes, "CAknsImageItemDef::Attributes" ); |
|
336 AssertTrueL( ETrue, KTxtAttributes ); |
|
337 |
|
338 CleanupStack::PopAndDestroy( imageItemDef ); |
|
339 |
|
340 //CAknsBitmapItemDef |
|
341 _LIT( KTxtFilename, "\\resource\\apps\\BCTestDomfntlay.mbm" ); |
|
342 CAknsBitmapItemDef* bitmapItemDef = |
|
343 CAknsBitmapItemDef::NewL( |
|
344 KAknsIIDQgnIndiTpDialler, KTxtFilename, 1 ); |
|
345 CleanupStack::PushL( bitmapItemDef ); |
|
346 _LIT( KTxtBitmapNewL ,"CAknsBitmapItemDef::NewL" ); |
|
347 AssertTrueL( ETrue, KTxtBitmapNewL ); |
|
348 |
|
349 CAknsBitmapItemDef* bitmapItemDef2 = |
|
350 CAknsBitmapItemDef::NewL( KAknsIIDQgnIndiTpDialler ); |
|
351 CleanupStack::PushL( bitmapItemDef2 ); |
|
352 _LIT( KTxtBitmapNewL2, "CAknsBitmapItemDef::NewL2" ); |
|
353 AssertTrueL( ETrue, KTxtBitmapNewL2 ); |
|
354 CleanupStack::PopAndDestroy( bitmapItemDef2 ); |
|
355 |
|
356 _LIT( KFileName, "abc.bmp" ); |
|
357 bitmapItemDef->SetFilename( KFileName ); |
|
358 _LIT( KTxtSetFilename, "CAknsBitmapItemDef::SetFilename" ); |
|
359 AssertTrueL( ETrue, KTxtSetFilename ); |
|
360 |
|
361 bitmapItemDef->SetFilenameL( KFileName ); |
|
362 _LIT( KTxtSetFilenameL, "CAknsBitmapItemDef::SetFilenameL" ); |
|
363 AssertTrueL( ETrue, KTxtSetFilenameL ); |
|
364 |
|
365 const TDesC& filename = bitmapItemDef->Filename(); |
|
366 _LIT( KTxtBitmapFilename, "CAknsBitmapItemDef::Filename" ); |
|
367 AssertTrueL( ETrue, KTxtBitmapFilename ); |
|
368 |
|
369 bitmapItemDef->SetIndex( 1 ); |
|
370 _LIT( KTxtSetIndex, "CAknsBitmapItemDef::Filename" ); |
|
371 AssertTrueL( ETrue, KTxtSetIndex ); |
|
372 |
|
373 TInt index = bitmapItemDef->Index(); |
|
374 _LIT( KTxtIndex, "CAknsBitmapItemDef::Index" ); |
|
375 AssertTrueL( ETrue, KTxtIndex ); |
|
376 |
|
377 CleanupStack::PopAndDestroy( bitmapItemDef ); |
|
378 |
|
379 //CAknsMaskedBitmapItemDef |
|
380 CAknsMaskedBitmapItemDef* mbItemDef = |
|
381 CAknsMaskedBitmapItemDef::NewL( |
|
382 KAknsIIDQgnIndiTpDialler, KTxtFilename, 1, 2 ); |
|
383 CleanupStack::PushL( mbItemDef ); |
|
384 _LIT( KTxtMbitmapNewL ,"CAknsMaskedBitmapItemDef::NewL" ); |
|
385 AssertTrueL( ETrue, KTxtMbitmapNewL ); |
|
386 |
|
387 CAknsMaskedBitmapItemDef* mbItemDef2 = |
|
388 CAknsMaskedBitmapItemDef::NewL( KAknsIIDQgnIndiTpDialler ); |
|
389 CleanupStack::PushL( mbItemDef2 ); |
|
390 _LIT( KTxtMbitmapNewL2, "CAknsMaskedBitmapItemDef::NewL2" ); |
|
391 AssertTrueL( ETrue, KTxtMbitmapNewL2 ); |
|
392 CleanupStack::PopAndDestroy( mbItemDef2 ); |
|
393 |
|
394 mbItemDef->SetMaskIndex( 2 ); |
|
395 _LIT( KTxtSetMaskIndex, "CAknsMaskedBitmapItemDef::SetMaskIndex" ); |
|
396 AssertTrueL( ETrue, KTxtSetMaskIndex ); |
|
397 |
|
398 TInt mIndex = mbItemDef->MaskIndex(); |
|
399 _LIT( KTxtMaskIndex, "CAknsMaskedBitmapItemDef::MaskIndex" ); |
|
400 AssertTrueL( ETrue, KTxtMaskIndex ); |
|
401 |
|
402 CleanupStack::PopAndDestroy( mbItemDef ); |
|
403 |
|
404 //CAknsColorTableItemDef |
|
405 TAknsColorTableEntry ctEntry; |
|
406 ctEntry.iIndex = 8 ; |
|
407 CAknsColorTableItemDef* ctItemDef = CAknsColorTableItemDef::NewL( |
|
408 KAknsIIDQgnIndiTpDialler,1,&ctEntry); |
|
409 CleanupStack::PushL( ctItemDef ); |
|
410 _LIT( KTxtCtNewL ,"CAknsColorTableItemDef::NewL" ); |
|
411 AssertTrueL( ETrue, KTxtCtNewL ); |
|
412 |
|
413 CAknsColorTableItemDef* ctItemDef2 = |
|
414 CAknsColorTableItemDef::NewL( KAknsIIDQgnIndiTpDialler ); |
|
415 CleanupStack::PushL( ctItemDef2 ); |
|
416 _LIT( KTxtCtNewL2, "CAknsColorTableItemDef::NewL2" ); |
|
417 AssertTrueL( ETrue, KTxtCtNewL2 ); |
|
418 CleanupStack::PopAndDestroy( ctItemDef2 ); |
|
419 |
|
420 TAknsColorTableEntry ctSetEntry; |
|
421 ctSetEntry.iIndex = 18 ; |
|
422 ctItemDef->SetColors( 1, &ctSetEntry ); |
|
423 _LIT( KTxtSetColors, "CAknsColorTableItemDef::SetColors" ); |
|
424 AssertTrueL( ETrue, KTxtSetColors ); |
|
425 |
|
426 ctItemDef->SetColorsL( 1, &ctSetEntry ); |
|
427 _LIT( KTxtSetColorsL, "CAknsColorTableItemDef::SetColorsL" ); |
|
428 AssertTrueL( ETrue, KTxtSetColorsL ); |
|
429 |
|
430 const TAknsColorTableEntry* colorTabEntry = ctItemDef->Colors(); |
|
431 _LIT( KTxtColors, "CAknsColorTableItemDef::Colors" ); |
|
432 AssertTrueL( ETrue, KTxtColors ); |
|
433 |
|
434 TInt counter = ctItemDef->NumberOfColors(); |
|
435 _LIT( KTxtNumberOfColors, |
|
436 "CAknsColorTableItemDef::NumberOfColors" ); |
|
437 AssertTrueL( ETrue, KTxtNumberOfColors ); |
|
438 |
|
439 CleanupStack::PopAndDestroy( ctItemDef ); |
|
440 |
|
441 //CAknsImageTableItemDef |
|
442 TAknsItemID itemId; |
|
443 itemId.Set( KAknsIIDQgnPropSetAppsLoc ); |
|
444 CAknsImageTableItemDef* itItemDef = CAknsImageTableItemDef::NewL( |
|
445 KAknsIIDQgnIndiTpDialler,1,&itemId); |
|
446 CleanupStack::PushL( itItemDef ); |
|
447 _LIT( KTxtItNewL ,"CAknsImageTableItemDef::NewL" ); |
|
448 AssertTrueL( ETrue, KTxtItNewL ); |
|
449 |
|
450 CAknsImageTableItemDef* itItemDef2 = |
|
451 CAknsImageTableItemDef::NewL( KAknsIIDQgnIndiTpDialler ); |
|
452 CleanupStack::PushL( itItemDef2 ); |
|
453 _LIT( KTxtItNewL2, "CAknsImageTableItemDef::NewL2" ); |
|
454 AssertTrueL( ETrue, KTxtItNewL2 ); |
|
455 CleanupStack::PopAndDestroy( itItemDef2 ); |
|
456 |
|
457 itItemDef->SetImages( 1, &itemId ); |
|
458 _LIT( KTxtSetImages, "CAknsImageTableItemDef::SetImages" ); |
|
459 AssertTrueL( ETrue, KTxtSetImages ); |
|
460 |
|
461 itItemDef->SetImagesL( 1, &itemId ); |
|
462 _LIT( KTxtSetImagesL, "CAknsImageTableItemDef::SetImagesL" ); |
|
463 AssertTrueL( ETrue, KTxtSetImagesL ); |
|
464 |
|
465 const TAknsItemID* imgItemID = itItemDef->Images(); |
|
466 _LIT( KTxtImages, "CAknsImageTableItemDef::Images" ); |
|
467 AssertTrueL( ETrue, KTxtImages ); |
|
468 |
|
469 TInt numImage = itItemDef->NumberOfImages(); |
|
470 _LIT( KTxtNumberOfImages, |
|
471 "CAknsImageTableItemDef::NumberOfImages" ); |
|
472 AssertTrueL( ETrue, KTxtNumberOfImages ); |
|
473 |
|
474 CleanupStack::PopAndDestroy( itItemDef ); |
|
475 } |
|
476 |
|
477 // --------------------------------------------------------------------------- |
|
478 // CBCTestDomSkinCase::TestItemDef2L |
|
479 // --------------------------------------------------------------------------- |
|
480 // |
|
481 void CBCTestDomSkinCase::TestItemDef2L() //AknsItemDef.h |
|
482 { |
|
483 //CAknsBmpAnimItemDef 13 |
|
484 TAknsItemID itemId; |
|
485 itemId.Set( KAknsIIDQgnPropSetAppsLoc ); |
|
486 TAknsBmpAnimFrameInfo frameInfo; |
|
487 frameInfo.iTime = 100; |
|
488 frameInfo.iPosX = 50; |
|
489 frameInfo.iPosY = 50; |
|
490 CAknsBmpAnimItemDef* bmpAnimDef = CAknsBmpAnimItemDef::NewL( |
|
491 KAknsIIDQgnIndiTpDialler, 1, &itemId, &frameInfo ); |
|
492 CleanupStack::PushL( bmpAnimDef ); |
|
493 _LIT( KTxtbmpAnimNewL ,"CAknsBmpAnimItemDef::NewL" ); |
|
494 AssertTrueL( ETrue, KTxtbmpAnimNewL ); |
|
495 |
|
496 CAknsBmpAnimItemDef* bmpAnimDef2 = |
|
497 CAknsBmpAnimItemDef::NewL( KAknsIIDQgnIndiTpDialler ); |
|
498 CleanupStack::PushL( bmpAnimDef2 ); |
|
499 _LIT( KTxtKTxtbmpAnimNewL2, "CAknsBmpAnimItemDef::NewL2" ); |
|
500 AssertTrueL( ETrue, KTxtKTxtbmpAnimNewL2 ); |
|
501 CleanupStack::PopAndDestroy( bmpAnimDef2 ); |
|
502 |
|
503 bmpAnimDef->SetFrameInfos( &frameInfo ); |
|
504 _LIT( KTxtSetFrameInfos, "CAknsBmpAnimItemDef::SetFrameInfos" ); |
|
505 AssertTrueL( ETrue, KTxtSetFrameInfos ); |
|
506 |
|
507 bmpAnimDef->SetFrameInfosL( &frameInfo ); |
|
508 _LIT( KTxtSetFrameInfosL, "CAknsBmpAnimItemDef::SetFrameInfosL" ); |
|
509 AssertTrueL( ETrue, KTxtSetFrameInfosL ); |
|
510 |
|
511 const TAknsBmpAnimFrameInfo* bmpFrameInfo = |
|
512 bmpAnimDef->FrameInfos(); |
|
513 _LIT( KTxtFrameInfos, "CAknsBmpAnimItemDef::FrameInfos" ); |
|
514 AssertTrueL( ETrue, KTxtFrameInfos ); |
|
515 |
|
516 bmpAnimDef->SetLastFrameBackground( ETrue ); |
|
517 _LIT( KTxtSetLastFrameBackground, |
|
518 "CAknsBmpAnimItemDef::SetLastFrameBackground" ); |
|
519 AssertTrueL( ETrue, KTxtSetLastFrameBackground ); |
|
520 |
|
521 TBool lastFrame = bmpAnimDef->LastFrameBackground(); |
|
522 _LIT( KTxtLastFrameBackground, |
|
523 "CAknsBmpAnimItemDef::LastFrameBackground" ); |
|
524 AssertTrueL( ETrue, KTxtLastFrameBackground ); |
|
525 |
|
526 bmpAnimDef->SetFrameInterval( 8 ); |
|
527 _LIT( KTxtSetFrameInterval, |
|
528 "CAknsBmpAnimItemDef::SetFrameInterval" ); |
|
529 AssertTrueL( ETrue, KTxtSetFrameInterval ); |
|
530 |
|
531 TInt16 frameinter = bmpAnimDef->FrameInterval(); |
|
532 _LIT( KTxtFrameInterval, "CAknsBmpAnimItemDef::FrameInterval" ); |
|
533 AssertTrueL( ETrue, KTxtFrameInterval ); |
|
534 |
|
535 bmpAnimDef->SetPlayMode( 1 ); |
|
536 _LIT( KTxtSetPlayMode, "CAknsBmpAnimItemDef::SetPlayMode" ); |
|
537 AssertTrueL( ETrue, KTxtSetPlayMode ); |
|
538 |
|
539 TInt playMode = bmpAnimDef->PlayMode(); |
|
540 _LIT( KTxtPlayMode, "CAknsBmpAnimItemDef::PlayMode" ); |
|
541 AssertTrueL( ETrue, KTxtPlayMode ); |
|
542 |
|
543 bmpAnimDef->SetFlash( EFalse ); |
|
544 _LIT( KTxtSetFlash, "CAknsBmpAnimItemDef::SetFlash" ); |
|
545 AssertTrueL( ETrue, KTxtSetFlash ); |
|
546 |
|
547 TBool isFlash = bmpAnimDef->Flash(); |
|
548 _LIT( KTxtFlash, "CAknsBmpAnimItemDef::Flash" ); |
|
549 AssertTrueL( ETrue, KTxtFlash ); |
|
550 |
|
551 CleanupStack::PopAndDestroy( bmpAnimDef ); |
|
552 |
|
553 //CAknsStringItemDef 3 |
|
554 CAknsStringItemDef* strItemDef = CAknsStringItemDef::NewL( |
|
555 KAknsIIDQgnIndiTpDialler ) ; |
|
556 CleanupStack::PushL( strItemDef ); |
|
557 _LIT( KTxtStrNewL, "CAknsStringItemDef::NewL" ); |
|
558 AssertTrueL( ETrue, KTxtStrNewL ); |
|
559 |
|
560 _LIT( KString, "abcde" ); |
|
561 strItemDef->SetStringL( KString ); |
|
562 _LIT( KTxtSetStringL, "CAknsStringItemDef::SetStringL" ); |
|
563 AssertTrueL( ETrue, KTxtSetStringL ); |
|
564 |
|
565 const TDesC& string = strItemDef->String(); |
|
566 _LIT( KTxtString, "CAknsStringItemDef::String" ); |
|
567 AssertTrueL( ETrue, KTxtString ); |
|
568 |
|
569 CleanupStack::PopAndDestroy( strItemDef ); |
|
570 |
|
571 //CAknsEffectParamDef 13 |
|
572 CAknsEffectParamDef* paramDef = CAknsEffectParamDef::NewL(); |
|
573 CleanupStack::PushL( paramDef ); |
|
574 _LIT( KTxtParamNewL, "CAknsEffectParamDef::NewL" ); |
|
575 AssertTrueL( ETrue, KTxtParamNewL ); |
|
576 |
|
577 paramDef->SetType( 1 ); |
|
578 _LIT( KTxtSetType, "CAknsEffectParamDef::SetType" ); |
|
579 AssertTrueL( ETrue, KTxtSetType ); |
|
580 |
|
581 TUint32 paramType = paramDef->GetType(); |
|
582 _LIT( KTxtGetType, "CAknsEffectParamDef::GetType" ); |
|
583 AssertTrueL( ETrue, KTxtGetType ); |
|
584 |
|
585 _LIT( kTxtName, "wxyz" ); |
|
586 paramDef->SetNameL( kTxtName ); |
|
587 _LIT( KTxtSetNameL, "CAknsEffectParamDef::SetNameL" ); |
|
588 AssertTrueL( ETrue, KTxtSetNameL ); |
|
589 |
|
590 const TDesC* paramType2 = paramDef->GetName(); |
|
591 _LIT( KTxtGetName, "CAknsEffectParamDef::GetName" ); |
|
592 AssertTrueL( ETrue, KTxtGetName ); |
|
593 |
|
594 paramDef->SetValue( 1 ); |
|
595 _LIT( KTxtSetValue ,"CAknsEffectParamDef::SetValue" ); |
|
596 AssertTrueL( ETrue, KTxtSetValue ); |
|
597 |
|
598 _LIT( kTxtValue, "abcd" ); |
|
599 paramDef->SetValueL( kTxtValue ); |
|
600 _LIT( KTxtSetValueL, "CAknsEffectParamDef::SetValueL" ); |
|
601 AssertTrueL( ETrue, KTxtSetValueL ); |
|
602 |
|
603 paramDef->SetValueL( kTxtValue, 1, 2 ); |
|
604 _LIT( KTxtSetValueL2, "CAknsEffectParamDef::SetValueL2" ); |
|
605 AssertTrueL( ETrue, KTxtSetValueL2 ); |
|
606 |
|
607 TUint32 paramNumber = paramDef->GetNumber(); |
|
608 _LIT( KTxtGetNumber, "CAknsEffectParamDef::GetNumber" ); |
|
609 AssertTrueL( ETrue, KTxtGetNumber ); |
|
610 |
|
611 const TDesC* paramString = paramDef->GetString(); |
|
612 _LIT( KTxtGetString, "CAknsEffectParamDef::GetString" ); |
|
613 AssertTrueL( ETrue, KTxtGetString ); |
|
614 |
|
615 const TDesC* fileName = paramDef->GetFilename(); |
|
616 _LIT( KTxtGetFilename, "CAknsEffectParamDef::GetFilename" ); |
|
617 AssertTrueL( ETrue, KTxtGetFilename ); |
|
618 |
|
619 TUint32 bmIndex = paramDef->GetBitmapIndex(); |
|
620 _LIT( KTxtGetBitmapIndex, "CAknsEffectParamDef::GetBitmapIndex" ); |
|
621 AssertTrueL( ETrue, KTxtGetBitmapIndex ); |
|
622 |
|
623 TUint32 maskIndex = paramDef->GetMaskIndex(); |
|
624 _LIT( KTxtGetMaskIndex, "CAknsEffectParamDef::GetMaskIndex" ); |
|
625 AssertTrueL( ETrue, KTxtGetMaskIndex ); |
|
626 |
|
627 CleanupStack::PopAndDestroy( paramDef ); |
|
628 |
|
629 //CAknsEffectItemDef 7 |
|
630 CAknsEffectItemDef* effItemDef = CAknsEffectItemDef::NewL(); |
|
631 CleanupStack::PushL( effItemDef ); |
|
632 _LIT( KTxtEfNewL, "CAknsEffectItemDef::NewL" ); |
|
633 AssertTrueL( ETrue, KTxtEfNewL ); |
|
634 |
|
635 TUid efUid = { 0x1818518 }; |
|
636 effItemDef->SetEffectUid( efUid ); |
|
637 _LIT( KTxtSetEffectUid, "CAknsEffectItemDef::SetEffectUid" ); |
|
638 AssertTrueL( ETrue, KTxtSetEffectUid ); |
|
639 |
|
640 TUid effectUid = effItemDef->EffectUid(); |
|
641 _LIT( KTxtEffectUid, "CAknsEffectItemDef::EffectUid" ); |
|
642 AssertTrueL( ETrue, KTxtEffectUid ); |
|
643 |
|
644 CAknsEffectParamDef* efffectParDef = CAknsEffectParamDef::NewL(); |
|
645 CleanupStack::PushL( efffectParDef ); |
|
646 effItemDef->AddParameterL( efffectParDef ); |
|
647 CleanupStack::Pop(); |
|
648 _LIT( KTxtAddParameterL, "CAknsEffectItemDef::AddParameterL" ); |
|
649 AssertTrueL( ETrue, KTxtAddParameterL ); |
|
650 |
|
651 CAknsEffectParamDef* effParmDef = effItemDef->GetParameter( 0 ); |
|
652 _LIT( KTxtGetParameter, "CAknsEffectItemDef::GetParameter" ); |
|
653 AssertTrueL( ETrue, KTxtGetParameter ); |
|
654 |
|
655 TInt parmCount = effItemDef->ParameterCount(); |
|
656 _LIT( KTxtParameterCount, "CAknsEffectItemDef::ParameterCount" ); |
|
657 AssertTrueL( ETrue, KTxtParameterCount ); |
|
658 |
|
659 effItemDef->SetLayerIndexesAndModes( 1, 2, 3, 4, 5, 6 ); |
|
660 _LIT( KTxtSetLayerIndexesAndModes, |
|
661 "CAknsEffectItemDef::SetLayerIndexesAndModes" ); |
|
662 AssertTrueL( ETrue, KTxtSetLayerIndexesAndModes ); |
|
663 |
|
664 CleanupStack::PopAndDestroy( effItemDef ); |
|
665 |
|
666 //CAknsEffectQueueItemDef 6 |
|
667 CAknsEffectQueueItemDef* effQueueDef = |
|
668 CAknsEffectQueueItemDef::NewL( KAknsIIDQgnIndiTpDialler ); |
|
669 CleanupStack::PushL( effQueueDef ); |
|
670 _LIT( KTxtQueueNewL, "CAknsEffectQueueItemDef::NewL" ); |
|
671 AssertTrueL( ETrue, KTxtQueueNewL ); |
|
672 |
|
673 |
|
674 CAknsEffectItemDef* effItemDef2 = CAknsEffectItemDef::NewL(); |
|
675 CleanupStack::PushL( effItemDef2 ); |
|
676 effQueueDef->AddEffectL( effItemDef2 ); |
|
677 CleanupStack::Pop(effItemDef2); |
|
678 _LIT( KTxtAddEffectL, "CAknsEffectQueueItemDef::AddEffectL" ); |
|
679 AssertTrueL( ETrue, KTxtAddEffectL ); |
|
680 |
|
681 const CAknsEffectItemDef* effItemDef3 = |
|
682 effQueueDef->GetEffect( 0 ); |
|
683 _LIT( KTxtGetEffect, "CAknsEffectQueueItemDef::GetEffect" ); |
|
684 AssertTrueL( ETrue, KTxtGetEffect ); |
|
685 |
|
686 TUint32 effCount = effQueueDef->EffectCount(); |
|
687 _LIT( KTxtEffectCount, "CAknsEffectQueueItemDef::EffectCount" ); |
|
688 AssertTrueL( ETrue, KTxtEffectCount ); |
|
689 |
|
690 |
|
691 effQueueDef->SetLayerIndexesAndModes( 1, 2, 3, 4 ); |
|
692 _LIT( KTxtSetIndexesAndModes, |
|
693 "CAknsEffectQueueItemDef::SetLayerIndexesAndModes" ); |
|
694 AssertTrueL( ETrue, KTxtSetIndexesAndModes ); |
|
695 |
|
696 TAknsItemID itemQueueId; |
|
697 itemQueueId.Set( KAknsIIDQgnPropSetAppsLoc ); |
|
698 effQueueDef->SetReference( itemQueueId ); |
|
699 _LIT( KTxtSetReference, "CAknsEffectQueueItemDef::SetReference" ); |
|
700 AssertTrueL( ETrue, KTxtSetReference ); |
|
701 |
|
702 CleanupStack::PopAndDestroy(effQueueDef); |
|
703 |
|
704 //CAknsSizeBoundParamDef 5 |
|
705 CAknsSizeBoundParamDef* boundParamDef = |
|
706 CAknsSizeBoundParamDef::NewL(); |
|
707 CleanupStack::PushL( boundParamDef ); |
|
708 _LIT( KTxtBoundNewL, "CAknsSizeBoundParamDef::NewL" ); |
|
709 AssertTrueL( ETrue, KTxtBoundNewL ); |
|
710 |
|
711 _LIT( KTxtBoundName,"abcd"); |
|
712 boundParamDef->SetDataL( KTxtBoundName, 1, 1 ); |
|
713 _LIT( KTxtSetDataL, "CAknsSizeBoundParamDef::SetDataL" ); |
|
714 AssertTrueL( ETrue, KTxtSetDataL ); |
|
715 |
|
716 const TDesC* boundName = boundParamDef->Name(); |
|
717 _LIT( KTxtSizeName, "CAknsSizeBoundParamDef::Name" ); |
|
718 AssertTrueL( ETrue, KTxtSizeName ); |
|
719 |
|
720 TUint32 boundValueId = boundParamDef->AnimationValueId(); |
|
721 _LIT( KTxtAnimationValueId, |
|
722 "CAknsSizeBoundParamDef::AnimationValueId" ); |
|
723 AssertTrueL( ETrue, KTxtAnimationValueId ); |
|
724 |
|
725 TUint32 boundParamFlags = boundParamDef->ParamFlags(); |
|
726 _LIT( KTxtParamFlags, "CAknsSizeBoundParamDef::ParamFlags" ); |
|
727 AssertTrueL( ETrue, KTxtParamFlags ); |
|
728 |
|
729 CleanupStack::PopAndDestroy( boundParamDef ); |
|
730 |
|
731 //CAknsNamedReferenceDef 4 |
|
732 CAknsNamedReferenceDef* nameRefDef = |
|
733 CAknsNamedReferenceDef::NewL(); |
|
734 CleanupStack::PushL( nameRefDef ); |
|
735 _LIT( KTxtNameNewL, "CAknsNamedReferenceDef::NewL" ); |
|
736 AssertTrueL( ETrue, KTxtNameNewL ); |
|
737 |
|
738 _LIT( KTxtNameRef,"abcd"); |
|
739 nameRefDef->SetDataL( KTxtNameRef, 1 ); |
|
740 _LIT( KTxtRefSetDataL, "CAknsNamedReferenceDef::SetDataL" ); |
|
741 AssertTrueL( ETrue, KTxtRefSetDataL ); |
|
742 |
|
743 const TDesC* nameRef = nameRefDef->Name(); |
|
744 _LIT( KTxtrefName, "CAknsNamedReferenceDef::Name" ); |
|
745 AssertTrueL( ETrue, KTxtrefName ); |
|
746 |
|
747 TUint32 refValueId = nameRefDef->AnimationValueId(); |
|
748 _LIT( KTxtRefAnimationValueId, |
|
749 "CAknsNamedReferenceDef::AnimationValueId" ); |
|
750 AssertTrueL( ETrue, KTxtRefAnimationValueId ); |
|
751 |
|
752 CleanupStack::PopAndDestroy( nameRefDef ); |
|
753 |
|
754 //CAknsTimingModelDef 6 |
|
755 CAknsTimingModelDef* timModelDef = CAknsTimingModelDef::NewL(); |
|
756 CleanupStack::PushL( timModelDef ); |
|
757 _LIT( KTxtModelNewL, "CAknsTimingModelDef::NewL" ); |
|
758 AssertTrueL( ETrue, KTxtModelNewL ); |
|
759 |
|
760 TUid timeUid = { 0x518 }; |
|
761 timModelDef->SetTimingModelUid( timeUid ); |
|
762 _LIT( KTxtSetTimingModelUid, |
|
763 "CAknsTimingModelDef::SetTimingModelUid" ); |
|
764 AssertTrueL( ETrue, KTxtSetTimingModelUid ); |
|
765 |
|
766 TUid timeUid2 = timModelDef->TimingModelUid(); |
|
767 _LIT( KTxtTimingModelUid, |
|
768 "CAknsTimingModelDef::TimingModelUid" ); |
|
769 AssertTrueL( ETrue, KTxtTimingModelUid ); |
|
770 |
|
771 CAknsEffectParamDef* effParmDef3 = CAknsEffectParamDef::NewL(); |
|
772 CleanupStack::PushL( effParmDef3 ); |
|
773 timModelDef->AddParameterL( effParmDef3 ); |
|
774 CleanupStack::Pop( effParmDef3 ); |
|
775 _LIT( KTxtTimeAddParameterL, |
|
776 "CAknsTimingModelDef::AddParameterL" ); |
|
777 AssertTrueL( ETrue, KTxtTimeAddParameterL ); |
|
778 |
|
779 CAknsEffectParamDef* effParmDef2 = timModelDef->Parameter( 0 ); |
|
780 _LIT( KTxtTimeParameter, "CAknsTimingModelDef::Parameter" ); |
|
781 AssertTrueL( ETrue, KTxtTimeParameter ); |
|
782 |
|
783 TInt paramCount = timModelDef->ParameterCount(); |
|
784 _LIT( KTxtTimeParameterCount, |
|
785 "CAknsTimingModelDef::ParameterCount" ); |
|
786 AssertTrueL( ETrue, KTxtTimeParameterCount ); |
|
787 |
|
788 CleanupStack::PopAndDestroy( timModelDef ); |
|
789 |
|
790 //CAknsAnimationValueDef 8 |
|
791 CAknsAnimationValueDef* aniValueDef = |
|
792 CAknsAnimationValueDef::NewL(); |
|
793 CleanupStack::PushL( aniValueDef ); |
|
794 _LIT( KTxtaniNewL, "CAknsAnimationValueDef::NewL" ); |
|
795 AssertTrueL( ETrue, KTxtaniNewL ); |
|
796 |
|
797 TUid aniUid = { 0x519 }; |
|
798 aniValueDef->SetAnimationValueUid( aniUid ); |
|
799 _LIT( KTxtSetAnimationValueUid, |
|
800 "CAknsAnimationValueDef::SetAnimationValueUid" ); |
|
801 AssertTrueL( ETrue, KTxtSetAnimationValueUid ); |
|
802 |
|
803 TUid aniUid2 = aniValueDef->AnimationValueUid(); |
|
804 _LIT( KTxtAnimationValueUid, |
|
805 "CAknsAnimationValueDef::AnimationValueUid" ); |
|
806 AssertTrueL( ETrue, KTxtAnimationValueUid ); |
|
807 |
|
808 aniValueDef->SetTimingModelId( 1 ); |
|
809 _LIT( KTxtSetTimingModelId, |
|
810 "CAknsAnimationValueDef::SetTimingModelId" ); |
|
811 AssertTrueL( ETrue, KTxtSetTimingModelId ); |
|
812 |
|
813 TUint32 aniModelId = aniValueDef->TimingModelId(); |
|
814 _LIT( KTxtTimingModelId, |
|
815 "CAknsAnimationValueDef::TimingModelId" ); |
|
816 AssertTrueL( ETrue, KTxtTimingModelId ); |
|
817 |
|
818 CAknsEffectParamDef* aniParmDef = CAknsEffectParamDef::NewL(); |
|
819 CleanupStack::PushL(aniParmDef); |
|
820 aniValueDef->AddParameterL( aniParmDef ); |
|
821 CleanupStack::Pop( aniParmDef ); |
|
822 _LIT( KTxtAniAddParameterL, |
|
823 "CAknsAnimationValueDef::AddParameterL" ); |
|
824 AssertTrueL( ETrue, KTxtAniAddParameterL ); |
|
825 |
|
826 CAknsEffectParamDef* aniParmDef2 = aniValueDef->Parameter( 0 ); |
|
827 _LIT( KTxtAniParameter, |
|
828 "CAknsAnimationValueDef::Parameter" ); |
|
829 AssertTrueL( ETrue, KTxtAniParameter ); |
|
830 |
|
831 TInt aniParmCount = aniValueDef->ParameterCount(); |
|
832 _LIT( KTxtAniParameterCount, |
|
833 "CAknsAnimationValueDef::ParameterCount" ); |
|
834 AssertTrueL( ETrue, KTxtAniParameterCount ); |
|
835 |
|
836 |
|
837 CleanupStack::PopAndDestroy( aniValueDef ); |
|
838 |
|
839 //CAknsAnimationCommandItemDef 4 |
|
840 CAknsAnimationCommandItemDef* aniCmdDef = |
|
841 CAknsAnimationCommandItemDef::NewL(); |
|
842 CleanupStack::PushL( aniCmdDef ); |
|
843 _LIT( KTxtaniCmdNewL, "CAknsAnimationCommandItemDef::NewL" ); |
|
844 AssertTrueL( ETrue, KTxtaniCmdNewL ); |
|
845 |
|
846 CAknsNamedReferenceDef* namedRefDef = |
|
847 CAknsNamedReferenceDef::NewL(); |
|
848 CleanupStack::PushL( namedRefDef ); |
|
849 aniCmdDef->AddNamedReferenceL( namedRefDef ); |
|
850 CleanupStack::Pop( namedRefDef ); |
|
851 _LIT( KTxtAddNamedReferenceL, |
|
852 "CAknsAnimationCommandItemDef::AddNamedReferenceL" ); |
|
853 AssertTrueL( ETrue, KTxtAddNamedReferenceL ); |
|
854 |
|
855 CAknsNamedReferenceDef* nameRefDef2 = |
|
856 aniCmdDef->NamedReference( 0 ); |
|
857 _LIT( KTxtNamedReference, |
|
858 "CAknsAnimationCommandItemDef::NamedReference" ); |
|
859 AssertTrueL( ETrue, KTxtNamedReference ); |
|
860 |
|
861 TInt namedRefCount = aniCmdDef->NamedReferenceCount(); |
|
862 _LIT( KTxtNamedReferenceCount, |
|
863 "CAknsAnimationCommandItemDef::NamedReferenceCount" ); |
|
864 AssertTrueL( ETrue, KTxtNamedReferenceCount ); |
|
865 |
|
866 |
|
867 CleanupStack::PopAndDestroy( aniCmdDef ); |
|
868 |
|
869 //CAknsAnimationItemDef 21 |
|
870 CAknsAnimationItemDef* aniItemDef = |
|
871 CAknsAnimationItemDef::NewL( KAknsIIDQgnIndiTpDialler ); |
|
872 CleanupStack::PushL( aniItemDef ); |
|
873 _LIT( KTxtAniItemNewL, "CAknsAnimationItemDef::NewL" ); |
|
874 AssertTrueL( ETrue, KTxtAniItemNewL ); |
|
875 |
|
876 aniItemDef->SetLayerIndexesAndModes( 1, 2, 3, 4 ); |
|
877 _LIT( KTxtAniItemSetLayerModes, |
|
878 "CAknsAnimationItemDef::SetLayerIndexesAndModes" ); |
|
879 AssertTrueL( ETrue, KTxtAniItemSetLayerModes ); |
|
880 |
|
881 aniItemDef->SetMinInterval( 8 ); |
|
882 _LIT( KTxtAniItemSetMinInterval, |
|
883 "CAknsAnimationItemDef::SetMinInterval" ); |
|
884 AssertTrueL( ETrue, KTxtAniItemSetMinInterval ); |
|
885 |
|
886 TUint32 aniMiniInterval = aniItemDef->MinInterval(); |
|
887 _LIT( KTxtAniItemMinInterval, |
|
888 "CAknsAnimationItemDef::MinInterval" ); |
|
889 AssertTrueL( ETrue, KTxtAniItemMinInterval ); |
|
890 |
|
891 aniItemDef->SetMorphing( ETrue ); |
|
892 _LIT( KTxtSetMorphing, "CAknsAnimationItemDef::SetMorphing" ); |
|
893 AssertTrueL( ETrue, KTxtSetMorphing ); |
|
894 |
|
895 TBool morphing = aniItemDef->Morphing(); |
|
896 _LIT( KTxtMorphing, "CAknsAnimationItemDef::Morphing" ); |
|
897 AssertTrueL( ETrue, KTxtMorphing ); |
|
898 |
|
899 CAknsEffectItemDef* aniItemEffItemDef = |
|
900 CAknsEffectItemDef::NewL(); |
|
901 CleanupStack::PushL( aniItemEffItemDef ); |
|
902 aniItemDef->AddPreprocessCommandL( aniItemEffItemDef ); |
|
903 CleanupStack::Pop( aniItemEffItemDef ); |
|
904 _LIT( KTxtAddPreprocessCommandL, |
|
905 "CAknsAnimationItemDef::AddPreprocessCommandL" ); |
|
906 AssertTrueL( ETrue, KTxtAddPreprocessCommandL ); |
|
907 |
|
908 CAknsEffectItemDef* aniItemEffItemDef2 = |
|
909 aniItemDef->PreprocessCommand( 0 ); |
|
910 _LIT( KTxtPreprocessCommand, |
|
911 "CAknsAnimationItemDef::PreprocessCommand" ); |
|
912 AssertTrueL( ETrue, KTxtPreprocessCommand ); |
|
913 |
|
914 TInt prepCmdCount = aniItemDef->PreprocessCommandCount(); |
|
915 _LIT( KTxtPreprocessCommandCount, |
|
916 "CAknsAnimationItemDef::PreprocessCommandCount" ); |
|
917 AssertTrueL( ETrue, KTxtPreprocessCommandCount ); |
|
918 |
|
919 CAknsAnimationCommandItemDef* aniCommandDef = |
|
920 CAknsAnimationCommandItemDef::NewL(); |
|
921 CleanupStack::PushL( aniCommandDef ); |
|
922 aniItemDef->AddAnimationCommandItemL( aniCommandDef ); |
|
923 CleanupStack::Pop( aniCommandDef ); |
|
924 _LIT( KTxtAddAnimationCommandItemL, |
|
925 "CAknsAnimationItemDef::AddAnimationCommandItemL" ); |
|
926 AssertTrueL( ETrue, KTxtAddAnimationCommandItemL ); |
|
927 |
|
928 CAknsAnimationCommandItemDef* aniCommandDef2 = |
|
929 aniItemDef->AnimationCommandItem( 0 ); |
|
930 _LIT( KTxtAnimationCommandItem, |
|
931 "CAknsAnimationItemDef::AnimationCommandItem" ); |
|
932 AssertTrueL( ETrue, KTxtAnimationCommandItem ); |
|
933 |
|
934 TInt aniCmdItemCount = aniItemDef->AnimationCommandItemCount(); |
|
935 _LIT( KTxtAnimationCommandItemCount, |
|
936 "CAknsAnimationItemDef::AnimationCommandItemCount" ); |
|
937 AssertTrueL( ETrue, KTxtAnimationCommandItemCount ); |
|
938 |
|
939 CAknsAnimationValueDef* animationValueDef = |
|
940 CAknsAnimationValueDef::NewL(); |
|
941 CleanupStack::PushL( animationValueDef ); |
|
942 aniItemDef->AddAnimationValueL( animationValueDef ); |
|
943 CleanupStack::Pop( animationValueDef ); |
|
944 _LIT( KTxtAAddAnimationValueL, |
|
945 "CAknsAnimationItemDef::AddAnimationValueL" ); |
|
946 AssertTrueL( ETrue, KTxtAAddAnimationValueL ); |
|
947 |
|
948 CAknsAnimationValueDef* aniValueDef2 = |
|
949 aniItemDef->AnimationValue( 0 ); |
|
950 _LIT( KTxtAnimationValue, |
|
951 "CAknsAnimationItemDef::AnimationValue" ); |
|
952 AssertTrueL( ETrue, KTxtAnimationValue ); |
|
953 |
|
954 TInt aniValueCount = aniItemDef->AnimationValueCount(); |
|
955 _LIT( KTxtAnimationValueCount, |
|
956 "CAknsAnimationItemDef::AnimationValueCount" ); |
|
957 AssertTrueL( ETrue, KTxtAnimationValueCount ); |
|
958 |
|
959 CAknsTimingModelDef* aniTimingModeDef = |
|
960 CAknsTimingModelDef::NewL(); |
|
961 CleanupStack::PushL( aniTimingModeDef ); |
|
962 aniItemDef->AddTimingModelL( aniTimingModeDef ); |
|
963 CleanupStack::Pop( aniTimingModeDef ); |
|
964 _LIT( KTxtAddTimingModelL, |
|
965 "CAknsAnimationItemDef::AddTimingModelL" ); |
|
966 AssertTrueL( ETrue, KTxtAddTimingModelL ); |
|
967 |
|
968 CAknsTimingModelDef* aniTimingModeDef2 = |
|
969 aniItemDef->TimingModel( 0 ); |
|
970 _LIT( KTxtTimingModel, |
|
971 "CAknsAnimationItemDef::TimingModel" ); |
|
972 AssertTrueL( ETrue, KTxtTimingModel ); |
|
973 |
|
974 TInt aniTimingModelCount = aniItemDef->TimingModelCount(); |
|
975 _LIT( KTxtTimingModelCount, |
|
976 "CAknsAnimationItemDef::TimingModelCount" ); |
|
977 AssertTrueL( ETrue, KTxtTimingModelCount ); |
|
978 |
|
979 CAknsSizeBoundParamDef* aniSizeBoundDef = |
|
980 CAknsSizeBoundParamDef::NewL(); |
|
981 CleanupStack::PushL( aniSizeBoundDef ); |
|
982 aniItemDef->AddSizeBoundParamL( aniSizeBoundDef ); |
|
983 CleanupStack::Pop( aniSizeBoundDef ); |
|
984 _LIT( KTxtAddSizeBoundParamL, |
|
985 "CAknsAnimationItemDef::AddSizeBoundParamL" ); |
|
986 AssertTrueL( ETrue, KTxtAddSizeBoundParamL ); |
|
987 |
|
988 CAknsSizeBoundParamDef* aniSizeBoundDef2 = |
|
989 aniItemDef->SizeBoundParam( 0 ); |
|
990 _LIT( KTxtSizeBoundParam, |
|
991 "CAknsAnimationItemDef::SizeBoundParam" ); |
|
992 AssertTrueL( ETrue, KTxtSizeBoundParam ); |
|
993 |
|
994 TInt aniSizeBoundCount = aniItemDef->SizeBoundParamCount(); |
|
995 _LIT( KTxtSizeBoundParamCount, |
|
996 "CAknsAnimationItemDef::SizeBoundParamCount" ); |
|
997 AssertTrueL( ETrue, KTxtSizeBoundParamCount ); |
|
998 |
|
999 |
|
1000 CleanupStack::PopAndDestroy( aniItemDef ); |
|
1001 } |
|
1002 |
|
1003 // --------------------------------------------------------------------------- |
|
1004 // CBCTestDomSkinCase::TestPkgIDL |
|
1005 // --------------------------------------------------------------------------- |
|
1006 // |
|
1007 void CBCTestDomSkinCase::TestPkgIDL()//AknsPkgID.h 3 |
|
1008 { |
|
1009 TAknsPkgID pgkId; |
|
1010 _LIT( KTxtContent, "123456" ); |
|
1011 pgkId.SetFromDesL( KTxtContent ); |
|
1012 _LIT( KTxtSetFromDesL, "TAknsPkgID::SetFromDesL" ); |
|
1013 AssertTrueL( ETrue, KTxtSetFromDesL ); |
|
1014 |
|
1015 TBuf<32> targetContext; |
|
1016 pgkId.CopyToDes( targetContext ); |
|
1017 _LIT( KTxtCopyToDes, "TAknsPkgID::CopyToDes" ); |
|
1018 AssertTrueL( ETrue, KTxtCopyToDes ); |
|
1019 |
|
1020 //specially handle this,because this API need very long time |
|
1021 RAknsSrvSession srvSession; |
|
1022 CleanupClosePushL( srvSession ); |
|
1023 User::LeaveIfError( srvSession.Connect() ); |
|
1024 |
|
1025 CDesCArray* array = new (ELeave) CDesC16ArrayFlat( 5 ); |
|
1026 CleanupStack::PushL( array ); |
|
1027 _LIT( KTxtAaa, "aaaa.bmp" ); |
|
1028 array->AppendL( KTxtAaa ); |
|
1029 _LIT( KTxtBbb, "bbbb.bmp" ); |
|
1030 array->AppendL( KTxtBbb ); |
|
1031 |
|
1032 TInt ret = srvSession.SetSlideSetWallpaper( *array ); |
|
1033 _LIT( KTxtSetSlideSetWallpaper, |
|
1034 "RAknsSrvSession::SetSlideSetWallpaper" ); |
|
1035 AssertTrueL( ETrue, KTxtSetSlideSetWallpaper ); |
|
1036 |
|
1037 CleanupStack::PopAndDestroy( array ); |
|
1038 CleanupStack::Pop(); // Pop srvSession |
|
1039 srvSession.Close(); |
|
1040 } |
|
1041 |
|
1042 // --------------------------------------------------------------------------- |
|
1043 // CBCTestDomSkinCase::TestPointerStoreL |
|
1044 // --------------------------------------------------------------------------- |
|
1045 // |
|
1046 void CBCTestDomSkinCase::TestPointerStoreL()//AknsPointerStore.h 3 |
|
1047 { |
|
1048 TInt pointerKey( 1 ); |
|
1049 TInt pointerValue( 2 ); |
|
1050 AknsPointerStore::StorePointerL( &pointerKey, &pointerValue ); |
|
1051 _LIT( KTxtStorePointerL, "AknsPointerStore::StorePointerL" ); |
|
1052 AssertTrueL( ETrue, KTxtStorePointerL ); |
|
1053 |
|
1054 TAny* pointer = AknsPointerStore::RetrievePointer( &pointerKey ); |
|
1055 _LIT( KTxtRetrievePointer, "AknsPointerStore::RetrievePointer" ); |
|
1056 AssertTrueL( ETrue, KTxtRetrievePointer ); |
|
1057 |
|
1058 AknsPointerStore::RemovePointer( &pointerKey ); |
|
1059 _LIT( KTxtRemovePointer, "AknsPointerStore::RemovePointer" ); |
|
1060 AssertTrueL( ETrue, KTxtRemovePointer ); |
|
1061 } |
|
1062 |
|
1063 // --------------------------------------------------------------------------- |
|
1064 // CBCTestDomSkinCase::TestRendererWrapperL |
|
1065 // --------------------------------------------------------------------------- |
|
1066 // |
|
1067 void CBCTestDomSkinCase::TestRendererWrapperL() //AknsRendererWrapper.h 1 |
|
1068 { |
|
1069 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
1070 |
|
1071 CFbsBitmap* OutRGB = NULL; |
|
1072 CFbsBitmap* OutAlpha = NULL; |
|
1073 TRect rect( TPoint( 5, 5 ), TSize( 50, 20 ) ); |
|
1074 CleanupStack::PushL( OutRGB ); |
|
1075 CleanupStack::PushL( OutAlpha ); |
|
1076 AknsRendererWrapper::RenderScalableItemL( |
|
1077 skin, KAknsIIDQsnBgScreen, OutRGB, OutAlpha, rect, NULL, NULL ); |
|
1078 _LIT( KTxtRenderScalableItemL, |
|
1079 "AknsRendererWrapper::RenderScalableItemL" ); |
|
1080 AssertTrueL( ETrue, KTxtRenderScalableItemL ); |
|
1081 CleanupStack::Pop(); |
|
1082 delete OutAlpha; |
|
1083 CleanupStack::Pop(); |
|
1084 delete OutRGB; |
|
1085 } |
|
1086 |
|
1087 // --------------------------------------------------------------------------- |
|
1088 // CBCTestDomSkinCase::TestSrvChunkLookupL |
|
1089 // --------------------------------------------------------------------------- |
|
1090 // |
|
1091 void CBCTestDomSkinCase::TestSrvChunkLookupL()//AknsSrvChunkLookup.h |
|
1092 { |
|
1093 RAknsSrvSession srvSession; |
|
1094 CleanupClosePushL( srvSession ); |
|
1095 User::LeaveIfError( srvSession.Connect() ); |
|
1096 CAknsSrvChunkLookup* srvChunkLookup = |
|
1097 srvSession.CreateChunkLookupL(); |
|
1098 CleanupStack::PushL( srvChunkLookup ); |
|
1099 |
|
1100 TInt morphing( 0 ); |
|
1101 CFbsBitmap* bitmap = NULL; |
|
1102 CFbsBitmap* maskBitmap = NULL; |
|
1103 CleanupStack::PushL( bitmap ); |
|
1104 CleanupStack::PushL( maskBitmap ); |
|
1105 srvChunkLookup->LookupAndCreateScalableItemL( |
|
1106 KAknsIIDQgnIndiTpDialler, 1, TSize( 50, 50 ), |
|
1107 bitmap, maskBitmap, morphing ); |
|
1108 _LIT( KTxtLookupAndCreateScalableItemL, |
|
1109 "CAknsSrvChunkLookup::LookupAndCreateScalableItemL" ); |
|
1110 AssertTrueL( ETrue, KTxtLookupAndCreateScalableItemL ); |
|
1111 CleanupStack::Pop(); // Pop maskBitmap |
|
1112 delete maskBitmap; |
|
1113 CleanupStack::Pop(); // Pop bitmap |
|
1114 delete bitmap; |
|
1115 |
|
1116 CAknsItemDef* itemDef = NULL; |
|
1117 itemDef = srvChunkLookup->LookupAndCreateDefL( |
|
1118 KAknsIIDQgnIndiTpDialler ); |
|
1119 CleanupStack::PushL( itemDef ); |
|
1120 _LIT( KTxtLookupAndCreateDefL, |
|
1121 "CAknsSrvChunkLookup::LookupAndCreateDefL" ); |
|
1122 AssertTrueL( ETrue, KTxtLookupAndCreateDefL ); |
|
1123 |
|
1124 srvChunkLookup->BeginRender(); |
|
1125 _LIT( KTxtBeginRender, "CAknsSrvChunkLookup::BeginRender" ); |
|
1126 AssertTrueL( ETrue, KTxtBeginRender ); |
|
1127 |
|
1128 srvChunkLookup->EndRender(); |
|
1129 _LIT( KTxtEndRender, "CAknsSrvChunkLookup::EndRender" ); |
|
1130 AssertTrueL( ETrue, KTxtEndRender ); |
|
1131 |
|
1132 CleanupStack::PopAndDestroy( itemDef ); |
|
1133 CleanupStack::PopAndDestroy( srvChunkLookup ); |
|
1134 CleanupStack::Pop();// Pop srvSession |
|
1135 srvSession.Close(); |
|
1136 } |
|
1137 |
|
1138 // --------------------------------------------------------------------------- |
|
1139 // CBCTestDomSkinCase::TestSrvClientL |
|
1140 // --------------------------------------------------------------------------- |
|
1141 // |
|
1142 void CBCTestDomSkinCase::TestSrvClientL()//AknsSrvClient.h 25 |
|
1143 { |
|
1144 RAknsSrvSession srvSession; |
|
1145 CleanupClosePushL( srvSession ); |
|
1146 _LIT( KTxtRAknsSrvSession, "RAknsSrvSession::RAknsSrvSession" ); |
|
1147 AssertTrueL( ETrue, KTxtRAknsSrvSession ); |
|
1148 |
|
1149 TInt ret; |
|
1150 User::LeaveIfError( srvSession.Connect() ); |
|
1151 _LIT( KTxtConnect, "RAknsSrvSession::Connect" ); |
|
1152 AssertTrueL( ETrue, KTxtConnect ); |
|
1153 |
|
1154 srvSession.EnableSkinChangeNotify(); |
|
1155 _LIT( KTxtEnableSkinChangeNotify, |
|
1156 "RAknsSrvSession::EnableSkinChangeNotify" ); |
|
1157 AssertTrueL( ETrue, KTxtEnableSkinChangeNotify ); |
|
1158 |
|
1159 srvSession.ClientError( 0 ); |
|
1160 _LIT( KTxtClientError, |
|
1161 "RAknsSrvSession::ClientError" ); |
|
1162 AssertTrueL( ETrue, KTxtClientError ); |
|
1163 |
|
1164 ret = srvSession.SetAllDefinitionSets( KAknsPIDS60DefaultSkin ); |
|
1165 _LIT( KTxtSetAllDefinitionSets, |
|
1166 "RAknsSrvSession::SetAllDefinitionSets" ); |
|
1167 AssertTrueL( ETrue, KTxtSetAllDefinitionSets ); |
|
1168 |
|
1169 CArrayPtr<CAknsSrvSkinInformationPkg>* skinInfoPgks = |
|
1170 srvSession.EnumerateSkinPackagesL(); |
|
1171 CleanupStack::PushL( skinInfoPgks ); |
|
1172 _LIT( KTxtEnumerateSkinPackagesL, |
|
1173 "RAknsSrvSession::EnumerateSkinPackagesL" ); |
|
1174 AssertTrueL( ETrue, KTxtEnumerateSkinPackagesL ); |
|
1175 |
|
1176 CAknsSrvChunkLookup* srvChunkLookup = |
|
1177 srvSession.CreateChunkLookupL(); |
|
1178 CleanupStack::PushL( srvChunkLookup ); |
|
1179 _LIT( KTxtCreateChunkLookupL, |
|
1180 "RAknsSrvSession::CreateChunkLookupL" ); |
|
1181 AssertTrueL( ETrue, KTxtCreateChunkLookupL ); |
|
1182 |
|
1183 _LIT( KTxtFilename, "\\resource\\apps\\aaaa.mbm" ); |
|
1184 ret = srvSession.SetIdleWallpaper(KTxtFilename); |
|
1185 _LIT( KTxtSetIdleWallpaper, |
|
1186 "RAknsSrvSession::SetIdleWallpaper" ); |
|
1187 AssertTrueL( ETrue, KTxtSetIdleWallpaper ); |
|
1188 |
|
1189 TSize scalableSize( 20, 20 ); |
|
1190 CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap(); |
|
1191 CleanupStack::PushL( bitmap ); |
|
1192 ret = srvSession.StoreScalableGraphics( |
|
1193 KAknsIIDQgnIndiTpDialler, 1, scalableSize, bitmap, NULL ); |
|
1194 _LIT( KTxtStoreScalableGraphics, |
|
1195 "RAknsSrvSession::StoreScalableGraphics" ); |
|
1196 AssertTrueL( ETrue, KTxtStoreScalableGraphics ); |
|
1197 |
|
1198 ret = srvSession.CopySkin( KAknsPIDSkin6, |
|
1199 EAknsSrvPhone, EAknsSrvMMC ); |
|
1200 _LIT( KTxtCopySkin, |
|
1201 "RAknsSrvSession::CopySkin" ); |
|
1202 AssertTrueL( ETrue, KTxtCopySkin ); |
|
1203 |
|
1204 TInt fileHandle( 0 ); |
|
1205 ret = srvSession.OpenBitmapFile( KTxtFilename, fileHandle ); |
|
1206 _LIT( KTxtOpenBitmapFile, |
|
1207 "RAknsSrvSession::OpenBitmapFile" ); |
|
1208 AssertTrueL( ETrue, KTxtOpenBitmapFile ); |
|
1209 |
|
1210 ret = srvSession.OpenInifile( KAknsPIDSkin6, |
|
1211 EAknsSrvPhone, fileHandle, EFalse ); |
|
1212 _LIT( KTxtOpenInifile, |
|
1213 "RAknsSrvSession::OpenInifile" ); |
|
1214 AssertTrueL( ETrue, KTxtOpenInifile ); |
|
1215 |
|
1216 |
|
1217 _LIT(KTxtSource,"abcd"); |
|
1218 _LIT(KTxtTarget,"efgh"); |
|
1219 ret = srvSession.CopySoundFile( KTxtSource, KTxtTarget ); |
|
1220 _LIT( KTxtCopySoundFile, |
|
1221 "RAknsSrvSession::CopySoundFile" ); |
|
1222 AssertTrueL( ETrue, KTxtCopySoundFile ); |
|
1223 |
|
1224 // |
|
1225 TSize wallSize(-1,-1); |
|
1226 CFbsBitmap* wallBitmap = NULL; |
|
1227 CFbsBitmap* wallmaskBitmap = NULL; |
|
1228 _LIT( KTxtDecodeFinename, "aaaa.svg" ); |
|
1229 CleanupStack::PushL( wallBitmap ); |
|
1230 CleanupStack::PushL( wallmaskBitmap ); |
|
1231 srvSession.DecodeWallpaperImageL( KTxtDecodeFinename, |
|
1232 wallSize, wallBitmap, wallmaskBitmap ); |
|
1233 _LIT( KTxtDecodeWallpaperImageL, |
|
1234 "RAknsSrvSession::DecodeWallpaperImageL" ); |
|
1235 AssertTrueL( ETrue, KTxtDecodeWallpaperImageL ); |
|
1236 CleanupStack::Pop();// Pop wallmaskBitmap; |
|
1237 delete wallmaskBitmap; |
|
1238 CleanupStack::Pop();// Pop wallBitmap; |
|
1239 delete wallBitmap; |
|
1240 |
|
1241 TInt imageFileHandle( 0 ); |
|
1242 ret = srvSession.OpenImageInifile( |
|
1243 EAknsSrvInifileSSWP, imageFileHandle ); |
|
1244 _LIT( KTxtOpenImageInifile, |
|
1245 "RAknsSrvSession::OpenImageInifile" ); |
|
1246 AssertTrueL( ETrue, KTxtOpenImageInifile ); |
|
1247 //release file handle |
|
1248 RFile imageFile; |
|
1249 imageFile.AdoptFromServer( ret, imageFileHandle ); |
|
1250 imageFile.Close(); |
|
1251 |
|
1252 srvSession.FreeUnnecessaryLayoutBitmaps( EAknsSrcScrModeNone ); |
|
1253 _LIT( KTxtFreeUnnecessaryLayoutBitmaps, |
|
1254 "RAknsSrvSession::FreeUnnecessaryLayoutBitmaps" ); |
|
1255 AssertTrueL( ETrue, KTxtFreeUnnecessaryLayoutBitmaps ); |
|
1256 |
|
1257 ret = srvSession.DeleteSkin( KAknsPIDSkin6, EAknsSrvPhone ); |
|
1258 _LIT( KTxtDeleteSkin, |
|
1259 "RAknsSrvSession::DeleteSkin" ); |
|
1260 AssertTrueL( ETrue, KTxtDeleteSkin ); |
|
1261 |
|
1262 ret = srvSession.ClearScalableGraphics(); |
|
1263 _LIT( KTxtClearScalableGraphics, |
|
1264 "RAknsSrvSession::ClearScalableGraphics" ); |
|
1265 AssertTrueL( ETrue, KTxtClearScalableGraphics ); |
|
1266 |
|
1267 srvSession.DisableSkinChangeNotify(); |
|
1268 _LIT( KTxtDisableSkinChangeNotify, |
|
1269 "RAknsSrvSession::DisableSkinChangeNotify" ); |
|
1270 AssertTrueL( ETrue, KTxtDisableSkinChangeNotify ); |
|
1271 |
|
1272 TInt skinCount = skinInfoPgks->Count(); |
|
1273 for ( TInt i=0; i < skinCount; i++) |
|
1274 delete ( *skinInfoPgks )[i]; |
|
1275 |
|
1276 CleanupStack::PopAndDestroy ( bitmap ); |
|
1277 CleanupStack::PopAndDestroy( srvChunkLookup ); |
|
1278 CleanupStack::PopAndDestroy( skinInfoPgks ); |
|
1279 |
|
1280 CleanupStack::Pop(); // Pop srvSession |
|
1281 srvSession.Close(); |
|
1282 _LIT( KTxtClose, "RAknsSrvSession::Close" ); |
|
1283 AssertTrueL( ETrue, KTxtClose ); |
|
1284 } |
|
1285 |
|
1286 // --------------------------------------------------------------------------- |
|
1287 // CBCTestDomSkinCase::TestSrvSkinInformationPkgL |
|
1288 // --------------------------------------------------------------------------- |
|
1289 // |
|
1290 void CBCTestDomSkinCase::TestSrvSkinInformationPkgL() //AknsSrvSkinInformationPkg.h 15 |
|
1291 { |
|
1292 RAknsSrvSession srvSession; |
|
1293 CleanupClosePushL( srvSession ); |
|
1294 User::LeaveIfError( srvSession.Connect() ); |
|
1295 CArrayPtr<CAknsSrvSkinInformationPkg>* skinInfoPgks = |
|
1296 srvSession.EnumerateSkinPackagesL(); |
|
1297 CleanupStack::PushL( skinInfoPgks ); |
|
1298 |
|
1299 CAknsSrvSkinInformationPkg* srvSkinInfoPgk = |
|
1300 ( *skinInfoPgks )[0]; |
|
1301 |
|
1302 TAknsPkgID pkgId = srvSkinInfoPgk->PID(); |
|
1303 _LIT( KTxtPID, "RAknsSrvSession::PID" ); |
|
1304 AssertTrueL( ETrue, KTxtPID ); |
|
1305 |
|
1306 TDesC& direct = srvSkinInfoPgk->Directory(); |
|
1307 _LIT( KTxtDirectory, "RAknsSrvSession::Directory" ); |
|
1308 AssertTrueL( ETrue, KTxtDirectory ); |
|
1309 |
|
1310 TDesC& iniFileDirect = srvSkinInfoPgk->IniFileDirectory(); |
|
1311 _LIT( KTxtIniFileDirectory, |
|
1312 "RAknsSrvSession::IniFileDirectory" ); |
|
1313 AssertTrueL( ETrue, KTxtIniFileDirectory ); |
|
1314 |
|
1315 TDesC& skinName = srvSkinInfoPgk->Name(); |
|
1316 _LIT( KTxtName, "RAknsSrvSession::Name" ); |
|
1317 AssertTrueL( ETrue, KTxtName ); |
|
1318 |
|
1319 TDesC& idleStateWall = |
|
1320 srvSkinInfoPgk->IdleStateWallPaperImageFileName(); |
|
1321 _LIT( KTxtIdleStateWallPaperImageFileName, |
|
1322 "RAknsSrvSession::IdleStateWallPaperImageFileName" ); |
|
1323 AssertTrueL( ETrue, KTxtIdleStateWallPaperImageFileName ); |
|
1324 |
|
1325 TDesC& pinboarWallPaper = |
|
1326 srvSkinInfoPgk->PinboarWallPaperImageFileName(); |
|
1327 _LIT( KTxtPinboarWallPaperImageFileName, |
|
1328 "RAknsSrvSession::PinboarWallPaperImageFileName" ); |
|
1329 AssertTrueL( ETrue, KTxtPinboarWallPaperImageFileName ); |
|
1330 |
|
1331 TInt ret = srvSkinInfoPgk->IdleStateWallPaperImageIndex(); |
|
1332 _LIT( KTxtIdleStateWallPaperImageIndex, |
|
1333 "RAknsSrvSession::IdleStateWallPaperImageIndex" ); |
|
1334 AssertTrueL( ETrue, KTxtIdleStateWallPaperImageIndex ); |
|
1335 |
|
1336 ret = srvSkinInfoPgk->PinboardWallPaperImageIndex(); |
|
1337 _LIT( KTxtPinboardWallPaperImageIndex, |
|
1338 "RAknsSrvSession::PinboardWallPaperImageIndex" ); |
|
1339 AssertTrueL( ETrue, KTxtPinboardWallPaperImageIndex ); |
|
1340 |
|
1341 TBool isDel = srvSkinInfoPgk->IsDeletable(); |
|
1342 _LIT( KTxtIsDeletable, "RAknsSrvSession::IsDeletable" ); |
|
1343 AssertTrueL( ETrue, KTxtIsDeletable ); |
|
1344 |
|
1345 TBool isCopy = srvSkinInfoPgk->IsCopyable(); |
|
1346 _LIT( KTxtIsCopyable, "RAknsSrvSession::IsCopyable" ); |
|
1347 AssertTrueL( ETrue, KTxtIsCopyable ); |
|
1348 |
|
1349 TAknsPkgID colorPid = srvSkinInfoPgk->ColorSchemePID(); |
|
1350 _LIT( KTxtColorSchemePID, "RAknsSrvSession::ColorSchemePID" ); |
|
1351 AssertTrueL( ETrue, KTxtColorSchemePID ); |
|
1352 |
|
1353 TBool hasIconset = srvSkinInfoPgk->HasIconset(); |
|
1354 _LIT( KTxtHasIconset, "RAknsSrvSession::HasIconset" ); |
|
1355 AssertTrueL( ETrue, KTxtHasIconset ); |
|
1356 |
|
1357 TAknsSkinSrvSkinProtectionType protectType = |
|
1358 srvSkinInfoPgk->ProtectionType(); |
|
1359 _LIT( KTxtProtectionType, "RAknsSrvSession::ProtectionType" ); |
|
1360 AssertTrueL( ETrue, KTxtProtectionType ); |
|
1361 |
|
1362 TBool isCorrupt = srvSkinInfoPgk->IsCorrupted(); |
|
1363 _LIT( KTxtIsCorrupted, "RAknsSrvSession::IsCorrupted" ); |
|
1364 AssertTrueL( ETrue, KTxtIsCorrupted ); |
|
1365 |
|
1366 TDesC& fullName = srvSkinInfoPgk->FullName(); |
|
1367 _LIT( KTxtFullName, "RAknsSrvSession::FullName" ); |
|
1368 AssertTrueL( ETrue, KTxtFullName ); |
|
1369 |
|
1370 TInt skinCount = skinInfoPgks->Count(); |
|
1371 for ( TInt i=0; i < skinCount; i++ ) |
|
1372 delete ( *skinInfoPgks )[i]; |
|
1373 |
|
1374 CleanupStack::PopAndDestroy( skinInfoPgks ); |
|
1375 CleanupStack::Pop(); // Pop srvSession |
|
1376 srvSession.Close(); |
|
1377 } |