|
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: test case for popup list box classes |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <eikenv.h> |
|
20 #include <eikapp.h> |
|
21 |
|
22 #include "bctestlistpopupcase.h" |
|
23 #include "bctestlistcontainer.h" |
|
24 #include "bctestlist.hrh" |
|
25 #include <bctestlist.rsg> |
|
26 #include <bctestlist.mbg> |
|
27 |
|
28 _LIT( KPopupCreate1, "Create CAknSinglePopupMenuStyleListBox" ); |
|
29 _LIT( KPopupCreate2, "Create CAknSingleGraphicPopupMenuStyleListBox" ); |
|
30 _LIT( KPopupCreate3, "Create CAknSingleGraphicBtPopupMenuStyleListBox" ); |
|
31 _LIT( KPopupCreate4, "Create CAknSingleHeadingPopupMenuStyleListBox" ); |
|
32 _LIT( KPopupCreate5, "Create CAknSingleGraphicHeadingPopupMenuStyleListBox" ); |
|
33 _LIT( KPopupCreate6, "Create CAknDoublePopupMenuStyleListBox" ); |
|
34 _LIT( KPopupCreate7, "Create CAknSinglePopupSubmenuStyleListBox" ); |
|
35 _LIT( KPopupCreate8, "Create CAknDoubleLargeGraphicPopupMenuStyleListBox" ); |
|
36 _LIT( KPopupCreate9, "Create CAknDouble2PopupMenuStyleListBox" ); |
|
37 _LIT( KPopupCreate10, "Create CAknSingle2GraphicPopupMenuStyleListBox" ); |
|
38 _LIT( KPopupCreate11, "Create CAknDoubleGraphicPopupMenuStyleListBox" ); |
|
39 _LIT( KPopupCreate12, "Create CAknSetStyleListBox" ); |
|
40 _LIT( KSetConstructWithWindow, "CAknSetStyleListBox::ConstructWithWindowL" ); |
|
41 _LIT( KPopupCreate13, "Create CAknFormGraphicStyleListBox" ); |
|
42 _LIT( KFormGraphicConstructWithWindow, "CAknFormGraphicStyleListBox::ConstructWithWindowL" ); |
|
43 _LIT( KPopupCreate14, "Create CAknFormGraphicWideStyleListBox" ); |
|
44 |
|
45 _LIT( KSinglePopupMenuTest1, "CAknSinglePopupMenuStyleListBox::SizeChanged" ); |
|
46 _LIT( KSinglePopupMenuTest2, "CAknSinglePopupMenuStyleListBox::MinimumSize" ); |
|
47 _LIT( KSinglePopupMenuTest3, "CAknSinglePopupMenuStyleListBox::HandlePointerEventL" ); |
|
48 |
|
49 _LIT( KSingleGraphicPopupMenuTest1, "CAknSingleGraphicPopupMenuStyleListBox::SizeChanged" ); |
|
50 _LIT( KSingleGraphicPopupMenuTest2, "CAknSingleGraphicPopupMenuStyleListBox::MinimumSize" ); |
|
51 _LIT( KSingleGraphicPopupMenuTest3, "CAknSingleGraphicPopupMenuStyleListBox::HandlePointerEventL" ); |
|
52 |
|
53 _LIT( KSingleGraphicBtPopupMenuTest1, "CAknSingleGraphicBtPopupMenuStyleListBox::SizeChanged" ); |
|
54 _LIT( KSingleGraphicBtPopupMenuTest2, "CAknSingleGraphicBtPopupMenuStyleListBox::HandlePointerEventL" ); |
|
55 |
|
56 _LIT( KSingleHeadingPopupMenuTest1, "CAknSingleHeadingPopupMenuStyleListBox::SizeChanged" ); |
|
57 _LIT( KSingleHeadingPopupMenuTest2, "CAknSingleHeadingPopupMenuStyleListBox::MinimumSize" ); |
|
58 _LIT( KSingleHeadingPopupMenuTest3, "CAknSingleHeadingPopupMenuStyleListBox::HandlePointerEventL" ); |
|
59 |
|
60 _LIT( KSingleGraphicHeadingPopupMenuTest1, "CAknSingleGraphicHeadingPopupMenuStyleListBox::SizeChanged" ); |
|
61 _LIT( KSingleGraphicHeadingPopupMenuTest2, "CAknSingleGraphicHeadingPopupMenuStyleListBox::MinimumSize" ); |
|
62 _LIT( KSingleGraphicHeadingPopupMenuTest3, "CAknSingleGraphicHeadingPopupMenuStyleListBox::HandlePointerEventL" ); |
|
63 |
|
64 _LIT( KDoublePopupMenuTest1, "CAknDoublePopupMenuStyleListBox::SizeChanged" ); |
|
65 _LIT( KDoublePopupMenuTest2, "CAknDoublePopupMenuStyleListBox::MinimumSize" ); |
|
66 _LIT( KDoublePopupMenuTest3, "CAknDoublePopupMenuStyleListBox::HandlePointerEventL" ); |
|
67 |
|
68 _LIT( KSinglePopupSubMenuTest1, "CAknSinglePopupSubmenuStyleListBox::SizeChanged" ); |
|
69 _LIT( KSinglePopupSubMenuTest2, "CAknSinglePopupSubmenuStyleListBox::MinimumSize" ); |
|
70 _LIT( KSinglePopupSubMenuTest3, "CAknSinglePopupSubmenuStyleListBox::HandlePointerEventL" ); |
|
71 |
|
72 _LIT( KDoubleLargeGraphicPopupMenuTest1, "CAknDoubleLargeGraphicPopupMenuStyleListBox::SizeChanged" ); |
|
73 _LIT( KDoubleLargeGraphicPopupMenuTest2, "CAknDoubleLargeGraphicPopupMenuStyleListBox::MinimumSize" ); |
|
74 _LIT( KDoubleLargeGraphicPopupMenuTest3, "CAknDoubleLargeGraphicPopupMenuStyleListBox::HandlePointerEventL" ); |
|
75 |
|
76 _LIT( KDouble2PopupMenuTest1, "CAknDouble2PopupMenuStyleListBox::SizeChanged" ); |
|
77 _LIT( KDouble2PopupMenuTest2, "CAknDouble2PopupMenuStyleListBox::MinimumSize" ); |
|
78 _LIT( KDouble2PopupMenuTest3, "CAknDouble2PopupMenuStyleListBox::HandlePointerEventL" ); |
|
79 |
|
80 _LIT( KSingle2GraphicPopupMenuTest1, "CAknSingle2GraphicPopupMenuStyleListBox::SizeChanged" ); |
|
81 _LIT( KSingle2GraphicPopupMenuTest2, "CAknSingle2GraphicPopupMenuStyleListBox::MinimumSize" ); |
|
82 _LIT( KSingle2GraphicPopupMenuTest3, "CAknSingle2GraphicPopupMenuStyleListBox::HandlePointerEventL" ); |
|
83 |
|
84 _LIT( KDoubleGraphicPopupMenuTest1, "CAknDoubleGraphicPopupMenuStyleListBox::SizeChanged" ); |
|
85 _LIT( KDoubleGraphicPopupMenuTest2, "CAknDoubleGraphicPopupMenuStyleListBox::MinimumSize" ); |
|
86 _LIT( KDoubleGraphicPopupMenuTest3, "CAknDoubleGraphicPopupMenuStyleListBox::HandlePointerEventL" ); |
|
87 |
|
88 _LIT( KSetTest1, "CAknSetStyleListBox::SizeChanged" ); |
|
89 _LIT( KSetTest2, "CAknSetStyleListBox::MinimumSize" ); |
|
90 _LIT( KSetTest3, "CAknSetStyleListBox::HandlePointerEventL" ); |
|
91 _LIT( KSetTest4, "CAknSetStyleListBox::MopSupplyObject" ); |
|
92 _LIT( KSetTest5, "CAknSetStyleListBox::Draw with empty list" ); |
|
93 _LIT( KSetTest6, "CAknSetStyleListBox::Draw with item" ); |
|
94 |
|
95 _LIT( KFormGraphicTest1, "CAknFormGraphicStyleListBox::SizeChanged" ); |
|
96 _LIT( KFormGraphicTest2, "CAknFormGraphicStyleListBox::MinimumSize" ); |
|
97 _LIT( KFormGraphicTest3, "CAknFormGraphicStyleListBox::AdjustRectHeightToWholeNumberOfItems" ); |
|
98 _LIT( KFormGraphicTest4, "CAknFormGraphicStyleListBox::HandlePointerEventL" ); |
|
99 |
|
100 _LIT( KFormGraphicWideTest1, "CAknFormGraphicWideStyleListBox::SizeChanged" ); |
|
101 _LIT( KFormGraphicWideTest2, "CAknFormGraphicWideStyleListBox::MinimumSize" ); |
|
102 _LIT( KFormGraphicWideTest3, "CAknFormGraphicWideStyleListBox::HandlePointerEventL" ); |
|
103 |
|
104 // ======== MEMBER FUNCTIONS ======== |
|
105 |
|
106 // --------------------------------------------------------------------------- |
|
107 // Symbian 2nd static Constructor |
|
108 // --------------------------------------------------------------------------- |
|
109 // |
|
110 CBCTestListPopupCase* CBCTestListPopupCase::NewL( |
|
111 CBCTestListContainer* aContainer, CEikonEnv* aEikEnv ) |
|
112 { |
|
113 CBCTestListPopupCase* self = new( ELeave ) CBCTestListPopupCase( |
|
114 aContainer, aEikEnv ); |
|
115 CleanupStack::PushL( self ); |
|
116 self->ConstructL(); |
|
117 CleanupStack::Pop( self ); |
|
118 return self; |
|
119 } |
|
120 |
|
121 // --------------------------------------------------------------------------- |
|
122 // C++ default constructor |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 CBCTestListPopupCase::CBCTestListPopupCase( CBCTestListContainer* aContainer, |
|
126 CEikonEnv* aEikEnv ) |
|
127 : CBCTestListBaseCase( aContainer, aEikEnv ) |
|
128 { |
|
129 } |
|
130 |
|
131 // --------------------------------------------------------------------------- |
|
132 // Destructor |
|
133 // --------------------------------------------------------------------------- |
|
134 // |
|
135 CBCTestListPopupCase::~CBCTestListPopupCase() |
|
136 { |
|
137 } |
|
138 |
|
139 // --------------------------------------------------------------------------- |
|
140 // Symbian 2nd Constructor |
|
141 // --------------------------------------------------------------------------- |
|
142 // |
|
143 void CBCTestListPopupCase::ConstructL() |
|
144 { |
|
145 BuildScriptL(); |
|
146 } |
|
147 |
|
148 // --------------------------------------------------------------------------- |
|
149 // CBCTestListPopupCase::BuildScriptL |
|
150 // --------------------------------------------------------------------------- |
|
151 // |
|
152 void CBCTestListPopupCase::BuildScriptL() |
|
153 { |
|
154 for ( TInt i=0; i <= EBCTestCmdOutline39 - EBCTestCmdOutline26; i++ ) |
|
155 { |
|
156 AddTestL( LeftCBA, REP( Down, 3 ), KeyOK, TEND ); |
|
157 AddTestL( REP( Down, i ), KeyOK, TEND ); |
|
158 } |
|
159 } |
|
160 |
|
161 // --------------------------------------------------------------------------- |
|
162 // CBCTestListPopupCase::RunL |
|
163 // --------------------------------------------------------------------------- |
|
164 // |
|
165 void CBCTestListPopupCase::RunL( TInt aCmd ) |
|
166 { |
|
167 if ( aCmd < EBCTestCmdOutline26 || |
|
168 aCmd > EBCTestCmdOutline39 ) |
|
169 { |
|
170 return; |
|
171 } |
|
172 iOutlineId = aCmd; |
|
173 ReleaseCase(); |
|
174 PrepareCaseL( aCmd ); |
|
175 TestPopupListL( aCmd ); |
|
176 } |
|
177 |
|
178 // --------------------------------------------------------------------------- |
|
179 // CBCTestListPopupCase::PrepareCaseL |
|
180 // --------------------------------------------------------------------------- |
|
181 // |
|
182 void CBCTestListPopupCase::PrepareCaseL( TInt aCmd ) |
|
183 { |
|
184 TInt flags = EAknListBoxSelectionList | EAknListBoxViewerFlags; |
|
185 TBool useGraphics( EFalse ); |
|
186 |
|
187 switch ( aCmd ) |
|
188 { |
|
189 case EBCTestCmdOutline26: |
|
190 { |
|
191 iListBox = new( ELeave ) CBCTestSinglePopupMenuStyleListBox(); |
|
192 AssertNotNullL( iListBox, KPopupCreate1 ); |
|
193 } |
|
194 break; |
|
195 case EBCTestCmdOutline27: |
|
196 { |
|
197 iListBox = new( ELeave ) CBCTestSingleGraphicPopupMenuStyleListBox(); |
|
198 AssertNotNullL( iListBox, KPopupCreate2 ); |
|
199 } |
|
200 break; |
|
201 case EBCTestCmdOutline28: |
|
202 { |
|
203 iListBox = new( ELeave ) CAknSingleGraphicBtPopupMenuStyleListBox(); |
|
204 AssertNotNullL( iListBox, KPopupCreate3 ); |
|
205 } |
|
206 break; |
|
207 case EBCTestCmdOutline29: |
|
208 { |
|
209 iListBox = new( ELeave ) CAknSingleHeadingPopupMenuStyleListBox(); |
|
210 AssertNotNullL( iListBox, KPopupCreate4 ); |
|
211 } |
|
212 break; |
|
213 case EBCTestCmdOutline30: |
|
214 { |
|
215 iListBox = new( ELeave ) CAknSingleGraphicHeadingPopupMenuStyleListBox(); |
|
216 AssertNotNullL( iListBox, KPopupCreate5 ); |
|
217 } |
|
218 break; |
|
219 case EBCTestCmdOutline31: |
|
220 { |
|
221 iListBox = new( ELeave ) CAknDoublePopupMenuStyleListBox(); |
|
222 AssertNotNullL( iListBox, KPopupCreate6 ); |
|
223 } |
|
224 break; |
|
225 case EBCTestCmdOutline32: |
|
226 { |
|
227 iListBox = new( ELeave ) CAknSinglePopupSubmenuStyleListBox(); |
|
228 AssertNotNullL( iListBox, KPopupCreate7 ); |
|
229 } |
|
230 break; |
|
231 case EBCTestCmdOutline33: |
|
232 { |
|
233 iListBox = new( ELeave ) CAknDoubleLargeGraphicPopupMenuStyleListBox(); |
|
234 AssertNotNullL( iListBox, KPopupCreate8 ); |
|
235 } |
|
236 break; |
|
237 case EBCTestCmdOutline34: |
|
238 { |
|
239 iListBox = new( ELeave ) CAknDouble2PopupMenuStyleListBox(); |
|
240 AssertNotNullL( iListBox, KPopupCreate9 ); |
|
241 } |
|
242 break; |
|
243 case EBCTestCmdOutline35: |
|
244 { |
|
245 iListBox = new( ELeave ) CBCTestSingle2GraphicPopupMenuStyleListBox(); |
|
246 AssertNotNullL( iListBox, KPopupCreate10 ); |
|
247 } |
|
248 break; |
|
249 case EBCTestCmdOutline36: |
|
250 { |
|
251 iListBox = new( ELeave ) CBCTestDoubleGraphicPopupMenuStyleListBox(); |
|
252 AssertNotNullL( iListBox, KPopupCreate11 ); |
|
253 } |
|
254 break; |
|
255 case EBCTestCmdOutline37: |
|
256 { |
|
257 useGraphics = ETrue; |
|
258 iListBox = new( ELeave ) CAknSetStyleListBox(); |
|
259 AssertNotNullL( iListBox, KPopupCreate12 ); |
|
260 CAknSetStyleListBox* listbox = |
|
261 static_cast<CAknSetStyleListBox*>( iListBox ); |
|
262 listbox->ConstructWithWindowL( iContainer, flags ); |
|
263 AssertTrueL( ETrue, KSetConstructWithWindow ); |
|
264 } |
|
265 break; |
|
266 case EBCTestCmdOutline38: |
|
267 { |
|
268 useGraphics = ETrue; |
|
269 iListBox = new( ELeave ) CAknFormGraphicStyleListBox(); |
|
270 AssertNotNullL( iListBox, KPopupCreate13 ); |
|
271 CAknFormGraphicStyleListBox* listbox = |
|
272 static_cast<CAknFormGraphicStyleListBox*>( iListBox ); |
|
273 listbox->ConstructWithWindowL( iContainer, flags ); |
|
274 AssertTrueL( ETrue, KFormGraphicConstructWithWindow ); |
|
275 } |
|
276 break; |
|
277 case EBCTestCmdOutline39: |
|
278 { |
|
279 useGraphics = ETrue; |
|
280 iListBox = new( ELeave ) CAknFormGraphicWideStyleListBox(); |
|
281 AssertNotNullL( iListBox, KPopupCreate14 ); |
|
282 CAknFormGraphicWideStyleListBox* listbox = |
|
283 static_cast<CAknFormGraphicWideStyleListBox*>( iListBox ); |
|
284 listbox->ConstructWithWindowL( iContainer, flags ); |
|
285 } |
|
286 break; |
|
287 |
|
288 default: |
|
289 break; |
|
290 } |
|
291 |
|
292 if ( iListBox ) |
|
293 { |
|
294 |
|
295 if ( aCmd < EBCTestCmdOutline37 ) |
|
296 { |
|
297 SetListBoxFromInnerDescriptionL( iListBox ); |
|
298 } |
|
299 |
|
300 if ( useGraphics ) |
|
301 { |
|
302 SetGraphicIconL( iListBox ); |
|
303 } |
|
304 |
|
305 iContainer->SetControl( iListBox ); |
|
306 } |
|
307 } |
|
308 |
|
309 // --------------------------------------------------------------------------- |
|
310 // CBCTestListPopupCase::ReleaseCase |
|
311 // --------------------------------------------------------------------------- |
|
312 // |
|
313 void CBCTestListPopupCase::ReleaseCase() |
|
314 { |
|
315 iContainer->ResetControl(); |
|
316 iListBox = NULL; |
|
317 } |
|
318 |
|
319 // --------------------------------------------------------------------------- |
|
320 // CBCTestListPopupCase::TestPopupListL |
|
321 // --------------------------------------------------------------------------- |
|
322 // |
|
323 void CBCTestListPopupCase::TestPopupListL( TInt aCmd ) |
|
324 { |
|
325 if ( !iListBox ) |
|
326 { |
|
327 return; |
|
328 } |
|
329 TPointerEvent event; |
|
330 event.iType = TPointerEvent::EButton1Down; |
|
331 event.iModifiers = 0; |
|
332 TPoint eventPos(0, 30); |
|
333 event.iPosition = eventPos; |
|
334 event.iParentPosition = eventPos; |
|
335 |
|
336 TSize size; |
|
337 switch ( aCmd ) |
|
338 { |
|
339 case EBCTestCmdOutline26: |
|
340 { |
|
341 CBCTestSinglePopupMenuStyleListBox* listbox = |
|
342 static_cast<CBCTestSinglePopupMenuStyleListBox*>( iListBox ); |
|
343 listbox->SizeChanged(); |
|
344 AssertTrueL( ETrue, KSinglePopupMenuTest1 ); |
|
345 size = listbox->MinimumSize(); |
|
346 AssertTrueL( ETrue, KSinglePopupMenuTest2 ); |
|
347 listbox->TestHandlePointerEventL( event ); |
|
348 AssertTrueL( ETrue, KSinglePopupMenuTest3 ); |
|
349 } |
|
350 break; |
|
351 case EBCTestCmdOutline27: |
|
352 { |
|
353 CBCTestSingleGraphicPopupMenuStyleListBox* listbox = |
|
354 static_cast<CBCTestSingleGraphicPopupMenuStyleListBox*>( iListBox ); |
|
355 listbox->SizeChanged(); |
|
356 AssertTrueL( ETrue, KSingleGraphicPopupMenuTest1 ); |
|
357 size = listbox->MinimumSize(); |
|
358 AssertTrueL( ETrue, KSingleGraphicPopupMenuTest2 ); |
|
359 listbox->TestHandlePointerEventL( event ); |
|
360 AssertTrueL( ETrue, KSingleGraphicPopupMenuTest3 ); |
|
361 } |
|
362 break; |
|
363 case EBCTestCmdOutline28: |
|
364 { |
|
365 CAknSingleGraphicBtPopupMenuStyleListBox* listbox = |
|
366 static_cast<CAknSingleGraphicBtPopupMenuStyleListBox*>( iListBox ); |
|
367 listbox->SizeChanged(); |
|
368 AssertTrueL( ETrue, KSingleGraphicBtPopupMenuTest1 ); |
|
369 listbox->HandlePointerEventL( event ); |
|
370 AssertTrueL( ETrue, KSingleGraphicBtPopupMenuTest2 ); |
|
371 } |
|
372 break; |
|
373 case EBCTestCmdOutline29: |
|
374 { |
|
375 CAknSingleHeadingPopupMenuStyleListBox* listbox = |
|
376 static_cast<CAknSingleHeadingPopupMenuStyleListBox*>( iListBox ); |
|
377 listbox->SizeChanged(); |
|
378 AssertTrueL( ETrue, KSingleHeadingPopupMenuTest1 ); |
|
379 size = listbox->MinimumSize(); |
|
380 AssertTrueL( ETrue, KSingleHeadingPopupMenuTest2 ); |
|
381 listbox->HandlePointerEventL( event ); |
|
382 AssertTrueL( ETrue, KSingleHeadingPopupMenuTest3 ); |
|
383 } |
|
384 break; |
|
385 case EBCTestCmdOutline30: |
|
386 { |
|
387 CAknSingleGraphicHeadingPopupMenuStyleListBox* listbox = |
|
388 static_cast<CAknSingleGraphicHeadingPopupMenuStyleListBox*>( iListBox ); |
|
389 listbox->SizeChanged(); |
|
390 AssertTrueL( ETrue, KSingleGraphicHeadingPopupMenuTest1 ); |
|
391 size = listbox->MinimumSize(); |
|
392 AssertTrueL( ETrue, KSingleGraphicHeadingPopupMenuTest2 ); |
|
393 listbox->HandlePointerEventL( event ); |
|
394 AssertTrueL( ETrue, KSingleGraphicHeadingPopupMenuTest3 ); |
|
395 } |
|
396 break; |
|
397 case EBCTestCmdOutline31: |
|
398 { |
|
399 CAknDoublePopupMenuStyleListBox* listbox = |
|
400 static_cast<CAknDoublePopupMenuStyleListBox*>( iListBox ); |
|
401 listbox->SizeChanged(); |
|
402 AssertTrueL( ETrue, KDoublePopupMenuTest1 ); |
|
403 size = listbox->MinimumSize(); |
|
404 AssertTrueL( ETrue, KDoublePopupMenuTest2 ); |
|
405 listbox->HandlePointerEventL( event ); |
|
406 AssertTrueL( ETrue, KDoublePopupMenuTest3 ); |
|
407 } |
|
408 break; |
|
409 case EBCTestCmdOutline32: |
|
410 { |
|
411 CAknSinglePopupSubmenuStyleListBox* listbox = |
|
412 static_cast<CAknSinglePopupSubmenuStyleListBox*>( iListBox ); |
|
413 listbox->SizeChanged(); |
|
414 AssertTrueL( ETrue, KSinglePopupSubMenuTest1 ); |
|
415 size = listbox->MinimumSize(); |
|
416 AssertTrueL( ETrue, KSinglePopupSubMenuTest2 ); |
|
417 listbox->HandlePointerEventL( event ); |
|
418 AssertTrueL( ETrue, KSinglePopupSubMenuTest3 ); |
|
419 } |
|
420 break; |
|
421 case EBCTestCmdOutline33: |
|
422 { |
|
423 CAknDoubleLargeGraphicPopupMenuStyleListBox* listbox = |
|
424 static_cast<CAknDoubleLargeGraphicPopupMenuStyleListBox*>( iListBox ); |
|
425 listbox->SizeChanged(); |
|
426 AssertTrueL( ETrue, KDoubleLargeGraphicPopupMenuTest1 ); |
|
427 size = listbox->MinimumSize(); |
|
428 AssertTrueL( ETrue, KDoubleLargeGraphicPopupMenuTest2 ); |
|
429 listbox->HandlePointerEventL( event ); |
|
430 AssertTrueL( ETrue, KDoubleLargeGraphicPopupMenuTest3 ); |
|
431 } |
|
432 break; |
|
433 case EBCTestCmdOutline34: |
|
434 { |
|
435 CAknDouble2PopupMenuStyleListBox* listbox = |
|
436 static_cast<CAknDouble2PopupMenuStyleListBox*>( iListBox ); |
|
437 listbox->SizeChanged(); |
|
438 AssertTrueL( ETrue, KDouble2PopupMenuTest1 ); |
|
439 size = listbox->MinimumSize(); |
|
440 AssertTrueL( ETrue, KDouble2PopupMenuTest2 ); |
|
441 listbox->HandlePointerEventL( event ); |
|
442 AssertTrueL( ETrue, KDouble2PopupMenuTest3 ); |
|
443 } |
|
444 break; |
|
445 case EBCTestCmdOutline35: |
|
446 { |
|
447 CBCTestSingle2GraphicPopupMenuStyleListBox* listbox = |
|
448 static_cast<CBCTestSingle2GraphicPopupMenuStyleListBox*>( iListBox ); |
|
449 listbox->SizeChanged(); |
|
450 AssertTrueL( ETrue, KSingle2GraphicPopupMenuTest1 ); |
|
451 size = listbox->MinimumSize(); |
|
452 AssertTrueL( ETrue, KSingle2GraphicPopupMenuTest2 ); |
|
453 listbox->TestHandlePointerEventL( event ); |
|
454 AssertTrueL( ETrue, KSingle2GraphicPopupMenuTest3 ); |
|
455 } |
|
456 break; |
|
457 case EBCTestCmdOutline36: |
|
458 { |
|
459 CBCTestDoubleGraphicPopupMenuStyleListBox* listbox = |
|
460 static_cast<CBCTestDoubleGraphicPopupMenuStyleListBox*>( iListBox ); |
|
461 AssertTrueL( ETrue, KDoubleGraphicPopupMenuTest1 ); |
|
462 size = listbox->MinimumSize(); |
|
463 AssertTrueL( ETrue, KDoubleGraphicPopupMenuTest2 ); |
|
464 listbox->TestHandlePointerEventL( event ); |
|
465 AssertTrueL( ETrue, KDoubleGraphicPopupMenuTest3 ); |
|
466 } |
|
467 break; |
|
468 case EBCTestCmdOutline37: |
|
469 { |
|
470 CAknSetStyleListBox* listbox = |
|
471 static_cast<CAknSetStyleListBox*>( iListBox ); |
|
472 listbox->EnableExtendedDrawingL(); |
|
473 listbox->SetRect( iContainer->Rect() ); |
|
474 listbox->SizeChanged(); |
|
475 AssertTrueL( ETrue, KSetTest1 ); |
|
476 size = listbox->MinimumSize(); |
|
477 AssertTrueL( ETrue, KSetTest2 ); |
|
478 listbox->HandlePointerEventL( event ); |
|
479 AssertTrueL( ETrue, KSetTest3 ); |
|
480 |
|
481 TTypeUid typeId( iEikEnv->EikAppUi()->Application()->AppDllUid().iUid ); |
|
482 TTypeUid::Ptr uidPtr = listbox->MopSupplyObject( typeId ); |
|
483 AssertTrueL( ETrue, KSetTest4 ); |
|
484 listbox->Draw( iContainer->Rect() ); |
|
485 AssertTrueL( ETrue, KSetTest5 ); |
|
486 CDesCArray* textArray = iEikEnv->ReadDesCArrayResourceL( |
|
487 R_BCTESTLIST_ITEM_SINGLE_NUMBER ); |
|
488 if ( textArray ) |
|
489 { |
|
490 listbox->Model()->SetItemTextArray( textArray ); |
|
491 listbox->Model()->SetOwnershipType( ELbmOwnsItemArray ); |
|
492 } |
|
493 listbox->Draw( iContainer->Rect() ); |
|
494 AssertTrueL( ETrue, KSetTest6 ); |
|
495 } |
|
496 break; |
|
497 case EBCTestCmdOutline38: |
|
498 { |
|
499 CAknFormGraphicStyleListBox* listbox = |
|
500 static_cast<CAknFormGraphicStyleListBox*>( iListBox ); |
|
501 listbox->SizeChanged(); |
|
502 AssertTrueL( ETrue, KFormGraphicTest1 ); |
|
503 size = listbox->MinimumSize(); |
|
504 AssertTrueL( ETrue, KFormGraphicTest2 ); |
|
505 TRect rect = iContainer->Rect(); |
|
506 TInt height = listbox->AdjustRectHeightToWholeNumberOfItems( rect ); |
|
507 AssertTrueL( ETrue, KFormGraphicTest3 ); |
|
508 listbox->HandlePointerEventL( event ); |
|
509 AssertTrueL( ETrue, KFormGraphicTest4 ); |
|
510 } |
|
511 break; |
|
512 case EBCTestCmdOutline39: |
|
513 { |
|
514 CAknFormGraphicWideStyleListBox* listbox = |
|
515 static_cast<CAknFormGraphicWideStyleListBox*>( iListBox ); |
|
516 listbox->SizeChanged(); |
|
517 AssertTrueL( ETrue, KFormGraphicWideTest1 ); |
|
518 size = listbox->MinimumSize(); |
|
519 AssertTrueL( ETrue, KFormGraphicWideTest2 ); |
|
520 listbox->HandlePointerEventL( event ); |
|
521 AssertTrueL( ETrue, KFormGraphicWideTest3 ); |
|
522 } |
|
523 break; |
|
524 |
|
525 default: |
|
526 break; |
|
527 } |
|
528 } |
|
529 |
|
530 // --------------------------------------------------------------------------- |
|
531 // CBCTestListPopupCase::GraphicIconL |
|
532 // --------------------------------------------------------------------------- |
|
533 // |
|
534 void CBCTestListPopupCase::GraphicIconL( CArrayPtr<CGulIcon>* aIcons ) |
|
535 { |
|
536 if ( aIcons ) |
|
537 { |
|
538 // Appends icon according to iOutlineId. |
|
539 switch ( iOutlineId ) |
|
540 { |
|
541 case EBCTestCmdOutline37: |
|
542 case EBCTestCmdOutline38: |
|
543 case EBCTestCmdOutline39: |
|
544 for ( TInt i = 0; i< 10; i++ ) |
|
545 { |
|
546 CreateIconAndAddToArrayL( |
|
547 aIcons, KBCTestListMbmFileName, |
|
548 EMbmBctestlistGolgo2, |
|
549 EMbmBctestlistGolgo2_mask ); |
|
550 } |
|
551 |
|
552 break; |
|
553 |
|
554 default: |
|
555 break; |
|
556 } |
|
557 } |
|
558 } |
|
559 |
|
560 // ======== MEMBER FUNCTIONS ======== |
|
561 |
|
562 // --------------------------------------------------------------------------- |
|
563 // CBCTestSinglePopupMenuStyleListBox::TestCreateItemDrawerL |
|
564 // --------------------------------------------------------------------------- |
|
565 // |
|
566 void CBCTestSinglePopupMenuStyleListBox:: |
|
567 TestHandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
568 { |
|
569 HandlePointerEventL( aPointerEvent ); |
|
570 } |
|
571 |
|
572 // ======== MEMBER FUNCTIONS ======== |
|
573 |
|
574 // --------------------------------------------------------------------------- |
|
575 // CBCTestSingleGraphicPopupMenuStyleListBox::TestCreateItemDrawerL |
|
576 // --------------------------------------------------------------------------- |
|
577 // |
|
578 void CBCTestSingleGraphicPopupMenuStyleListBox:: |
|
579 TestHandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
580 { |
|
581 HandlePointerEventL( aPointerEvent ); |
|
582 } |
|
583 |
|
584 // ======== MEMBER FUNCTIONS ======== |
|
585 |
|
586 // --------------------------------------------------------------------------- |
|
587 // CBCTestSingle2GraphicPopupMenuStyleListBox::TestHandlePointerEventL |
|
588 // --------------------------------------------------------------------------- |
|
589 // |
|
590 void CBCTestSingle2GraphicPopupMenuStyleListBox:: |
|
591 TestHandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
592 { |
|
593 HandlePointerEventL( aPointerEvent ); |
|
594 } |
|
595 |
|
596 // ======== MEMBER FUNCTIONS ======== |
|
597 |
|
598 // --------------------------------------------------------------------------- |
|
599 // CBCTestDoubleGraphicPopupMenuStyleListBox::TestHandlePointerEventL |
|
600 // --------------------------------------------------------------------------- |
|
601 // |
|
602 void CBCTestDoubleGraphicPopupMenuStyleListBox:: |
|
603 TestHandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
604 { |
|
605 HandlePointerEventL( aPointerEvent ); |
|
606 } |
|
607 |