|
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 aknquerydialog.h |
|
15 * |
|
16 */ |
|
17 |
|
18 //INCLUDE |
|
19 #include <aknquerydialog.h> |
|
20 #include <testsdkqueries.rsg> |
|
21 #include <in_sock.h> |
|
22 #include <aknquerycontrol.h> |
|
23 #include <avkon.mbg> |
|
24 |
|
25 #include "testsdkqueries.h" |
|
26 #include "testsdkaknquerydialogprotected.h" |
|
27 #include "testsdkqueriescontainer.h" |
|
28 #include "testsdkaknquerycontrolprotected.h" |
|
29 |
|
30 const TInt KZero = 0; |
|
31 const TInt KOne = 1; |
|
32 const TInt KFive = 5; |
|
33 const TInt KTen = 10; |
|
34 const TInt KBufSize = 32; |
|
35 const TReal KRealvalue = 2.12345; |
|
36 const TReal KMaxRealvalue = 1000.3233; |
|
37 const TUint32 KAddrValue = 0x11111111; |
|
38 const TInt KHundred = 100; |
|
39 const TUint32 KMaxAddrValue = 0xffffffff; |
|
40 |
|
41 _LIT( KTestString, "It is a test!" ); |
|
42 _LIT( KTestStringReplace, "It is a test too!" ); |
|
43 _LIT( KTestTime, "20000111:200600.000000" ); |
|
44 _LIT( KTestMinTime, "10000111:100100.000000" ); |
|
45 _LIT( KTestMbmFile,"\\resource\\apps\\avkon2.mbm" ); |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CTestSDKQueries::TestQdlgNewLOneL |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 TInt CTestSDKQueries::TestQdlgNewLOneL( CStifItemParser& /*aItem*/ ) |
|
52 { |
|
53 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
54 CleanupStack::PushL( dlg ); |
|
55 |
|
56 STIF_ASSERT_NOT_NULL( dlg ); |
|
57 |
|
58 CleanupStack::PopAndDestroy( dlg ); |
|
59 return KErrNone; |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CTestSDKQueries::TestQdlgNewLTwoL |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 TInt CTestSDKQueries::TestQdlgNewLTwoL( CStifItemParser& /*aItem*/ ) |
|
67 { |
|
68 TBuf< KBufSize > message( KTestString ); |
|
69 |
|
70 CAknQueryDialog* dlg = CAknQueryDialog::NewL( message ); |
|
71 CleanupStack::PushL( dlg ); |
|
72 |
|
73 STIF_ASSERT_NOT_NULL( dlg ); |
|
74 |
|
75 CleanupStack::PopAndDestroy( dlg ); |
|
76 return KErrNone; |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CTestSDKQueries::TestQdlgNewLThreeL |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 TInt CTestSDKQueries::TestQdlgNewLThreeL( CStifItemParser& /*aItem*/ ) |
|
84 { |
|
85 TInt number = KTen; |
|
86 |
|
87 CAknQueryDialog* dlg = CAknQueryDialog::NewL( number ); |
|
88 CleanupStack::PushL( dlg ); |
|
89 |
|
90 STIF_ASSERT_NOT_NULL( dlg ); |
|
91 |
|
92 CleanupStack::PopAndDestroy( dlg ); |
|
93 return KErrNone; |
|
94 } |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CTestSDKQueries::TestQdlgNewLFourL |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 TInt CTestSDKQueries::TestQdlgNewLFourL( CStifItemParser& /*aItem*/ ) |
|
101 { |
|
102 TTime time( KTestTime ); |
|
103 |
|
104 CAknQueryDialog* dlg = CAknQueryDialog::NewL( time ); |
|
105 CleanupStack::PushL( dlg ); |
|
106 |
|
107 STIF_ASSERT_NOT_NULL( dlg ); |
|
108 |
|
109 CleanupStack::PopAndDestroy( dlg ); |
|
110 return KErrNone; |
|
111 } |
|
112 |
|
113 // ----------------------------------------------------------------------------- |
|
114 // CTestSDKQueries::TestQdlgNewLFiveL |
|
115 // ----------------------------------------------------------------------------- |
|
116 // |
|
117 TInt CTestSDKQueries::TestQdlgNewLFiveL( CStifItemParser& /*aItem*/ ) |
|
118 { |
|
119 TTimeIntervalSeconds time = KTen; |
|
120 |
|
121 CAknQueryDialog* dlg = CAknQueryDialog::NewL( time ); |
|
122 CleanupStack::PushL( dlg ); |
|
123 |
|
124 STIF_ASSERT_NOT_NULL( dlg ); |
|
125 |
|
126 CleanupStack::PopAndDestroy( dlg ); |
|
127 return KErrNone; |
|
128 } |
|
129 |
|
130 // ----------------------------------------------------------------------------- |
|
131 // CTestSDKQueries::TestQdlgNewLSixL |
|
132 // ----------------------------------------------------------------------------- |
|
133 // |
|
134 TInt CTestSDKQueries::TestQdlgNewLSixL( CStifItemParser& /*aItem*/ ) |
|
135 { |
|
136 TReal number( KRealvalue ); |
|
137 |
|
138 CAknQueryDialog* dlg = CAknQueryDialog::NewL( number ); |
|
139 CleanupStack::PushL( dlg ); |
|
140 |
|
141 STIF_ASSERT_NOT_NULL( dlg ); |
|
142 |
|
143 CleanupStack::PopAndDestroy( dlg ); |
|
144 return KErrNone; |
|
145 } |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // CTestSDKQueries::TestQdlgNewLSevenL |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 TInt CTestSDKQueries::TestQdlgNewLSevenL( CStifItemParser& /*aItem*/ ) |
|
152 { |
|
153 TInetAddr mAddr( KAddrValue ); |
|
154 |
|
155 CAknQueryDialog* dlg = CAknQueryDialog::NewL( mAddr ); |
|
156 CleanupStack::PushL( dlg ); |
|
157 |
|
158 STIF_ASSERT_NOT_NULL( dlg ); |
|
159 |
|
160 CleanupStack::PopAndDestroy( dlg ); |
|
161 return KErrNone; |
|
162 } |
|
163 |
|
164 // ----------------------------------------------------------------------------- |
|
165 // CTestSDKQueries::TestQdlgNewLEightL |
|
166 // ----------------------------------------------------------------------------- |
|
167 // |
|
168 TInt CTestSDKQueries::TestQdlgNewLEightL( CStifItemParser& /*aItem*/ ) |
|
169 { |
|
170 TTime time( KTestTime ); |
|
171 TCoordinate coord( 01.00, 01.0 ); |
|
172 TLocality loc( coord, 0.1 ); |
|
173 TPosition position( loc, time ); |
|
174 |
|
175 CAknQueryDialog* dlg = CAknQueryDialog::NewL( position ); |
|
176 CleanupStack::PushL( dlg ); |
|
177 |
|
178 STIF_ASSERT_NULL( dlg ); |
|
179 |
|
180 CleanupStack::PopAndDestroy( dlg ); |
|
181 return KErrNone; |
|
182 } |
|
183 |
|
184 // ----------------------------------------------------------------------------- |
|
185 // CTestSDKQueries::TestQdlgDestructorL |
|
186 // ----------------------------------------------------------------------------- |
|
187 // |
|
188 TInt CTestSDKQueries::TestQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
189 { |
|
190 TInetAddr mAddr( KAddrValue ); |
|
191 CAknQueryDialog* dlg = CAknQueryDialog::NewL( mAddr ); |
|
192 CleanupStack::PushL( dlg ); |
|
193 CleanupStack::PopAndDestroy( dlg ); |
|
194 return KErrNone; |
|
195 } |
|
196 |
|
197 // ----------------------------------------------------------------------------- |
|
198 // CTestSDKQueries::TestQdlgConstructorOneL |
|
199 // ----------------------------------------------------------------------------- |
|
200 // |
|
201 TInt CTestSDKQueries::TestQdlgConstructorOneL( CStifItemParser& /*aItem*/ ) |
|
202 { |
|
203 CAknQueryDialog* dlg = new( ELeave ) CAknQueryDialog( CAknQueryDialog ::ENoTone ); |
|
204 CleanupStack::PushL( dlg ); |
|
205 STIF_ASSERT_NOT_NULL( dlg ); |
|
206 CleanupStack::PopAndDestroy( dlg ); |
|
207 return KErrNone; |
|
208 } |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // CTestSDKQueries::TestQdlgQueryHeadingL |
|
212 // ----------------------------------------------------------------------------- |
|
213 // |
|
214 TInt CTestSDKQueries::TestQdlgQueryHeadingL( CStifItemParser& /*aItem*/ ) |
|
215 { |
|
216 TInt number = KTen; |
|
217 |
|
218 CAknQueryDialog* dlg = CAknQueryDialog::NewL( number ); |
|
219 CleanupStack::PushL( dlg ); |
|
220 |
|
221 CAknPopupHeadingPane* heading = dlg->QueryHeading(); |
|
222 STIF_ASSERT_NULL( heading ); |
|
223 |
|
224 dlg->PrepareLC( R_MESSAGE_DIALOG ); |
|
225 |
|
226 heading = dlg->QueryHeading(); |
|
227 dlg->Heading(); |
|
228 |
|
229 STIF_ASSERT_NOT_NULL( heading ); |
|
230 |
|
231 CleanupStack::PopAndDestroy( dlg ); |
|
232 CleanupStack::Pop( KOne ); |
|
233 return KErrNone; |
|
234 } |
|
235 |
|
236 // ----------------------------------------------------------------------------- |
|
237 // CTestSDKQueries::TestQdlgHeadingL |
|
238 // ----------------------------------------------------------------------------- |
|
239 // |
|
240 TInt CTestSDKQueries::TestQdlgHeadingL( CStifItemParser& aItem ) |
|
241 { |
|
242 TInt err = TestQdlgQueryHeadingL( aItem ); |
|
243 return err; |
|
244 } |
|
245 |
|
246 // ----------------------------------------------------------------------------- |
|
247 // CTestSDKQueries::TestQdlgSetPromptL |
|
248 // ----------------------------------------------------------------------------- |
|
249 // |
|
250 TInt CTestSDKQueries::TestQdlgSetPromptL( CStifItemParser& /*aItem*/ ) |
|
251 { |
|
252 CAknQueryDialog* dlg = new( ELeave ) CAknQueryDialog( CAknQueryDialog ::ENoTone ); |
|
253 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
254 |
|
255 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
256 |
|
257 TBuf< KBufSize > text( KTestString ); |
|
258 |
|
259 TPtrC returnPromptOne = testDlg->Prompt(); |
|
260 STIF_ASSERT_NOT_NULL( &returnPromptOne ); |
|
261 |
|
262 dlg->SetPromptL( text ); |
|
263 |
|
264 TPtrC returnPromptTwo = testDlg->Prompt(); |
|
265 STIF_ASSERT_NOT_NULL( &returnPromptTwo ); |
|
266 STIF_ASSERT_EQUALS( returnPromptTwo, ( TPtrC )( text )); |
|
267 |
|
268 CleanupStack::PopAndDestroy( dlg ); |
|
269 return KErrNone; |
|
270 } |
|
271 |
|
272 // ----------------------------------------------------------------------------- |
|
273 // CTestSDKQueries::TestQdlgMakeLeftSoftkeyVisibleL |
|
274 // ----------------------------------------------------------------------------- |
|
275 // |
|
276 TInt CTestSDKQueries::TestQdlgMakeLeftSoftkeyVisibleL( CStifItemParser& /*aItem*/ ) |
|
277 { |
|
278 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
279 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
280 |
|
281 dlg->MakeLeftSoftkeyVisible( ETrue ); |
|
282 dlg->MakeLeftSoftkeyVisible( EFalse ); |
|
283 |
|
284 CleanupStack::PopAndDestroy( dlg ); |
|
285 return KErrNone; |
|
286 } |
|
287 |
|
288 // ----------------------------------------------------------------------------- |
|
289 // CTestSDKQueries::TestQdlgSetEmergencyCallSupportL |
|
290 // ----------------------------------------------------------------------------- |
|
291 // |
|
292 TInt CTestSDKQueries::TestQdlgSetEmergencyCallSupportL( CStifItemParser& /*aItem*/ ) |
|
293 { |
|
294 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
295 |
|
296 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
297 |
|
298 dlg->SetEmergencyCallSupport( ETrue ); |
|
299 dlg->SetEmergencyCallSupport( EFalse ); |
|
300 |
|
301 CleanupStack::PopAndDestroy( dlg ); |
|
302 return KErrNone; |
|
303 } |
|
304 |
|
305 // ----------------------------------------------------------------------------- |
|
306 // CTestSDKQueries::TestQdlgRemoveEditorIndicatorL |
|
307 // ----------------------------------------------------------------------------- |
|
308 // |
|
309 TInt CTestSDKQueries::TestQdlgRemoveEditorIndicatorL( CStifItemParser& /*aItem*/ ) |
|
310 { |
|
311 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
312 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
313 |
|
314 dlg->RemoveEditorIndicator(); |
|
315 |
|
316 CleanupStack::PopAndDestroy( dlg ); |
|
317 return KErrNone; |
|
318 } |
|
319 |
|
320 // ----------------------------------------------------------------------------- |
|
321 // CTestSDKQueries::TestQdlgSetPredictiveTextInputPermittedL |
|
322 // ----------------------------------------------------------------------------- |
|
323 // |
|
324 TInt CTestSDKQueries::TestQdlgSetPredictiveTextInputPermittedL( CStifItemParser& /*aItem*/ ) |
|
325 { |
|
326 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
327 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
328 TBool temp = ETrue; |
|
329 dlg->SetPredictiveTextInputPermitted( temp ); |
|
330 |
|
331 CleanupStack::PopAndDestroy( dlg ); |
|
332 return KErrNone; |
|
333 } |
|
334 |
|
335 // ----------------------------------------------------------------------------- |
|
336 // CTestSDKQueries::TestQdlgRunLDL |
|
337 // ----------------------------------------------------------------------------- |
|
338 // |
|
339 TInt CTestSDKQueries::TestQdlgRunLDL( CStifItemParser& /*aItem*/ ) |
|
340 { |
|
341 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
342 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
343 |
|
344 dlg->RunLD(); |
|
345 |
|
346 return KErrNone; |
|
347 } |
|
348 |
|
349 // ----------------------------------------------------------------------------- |
|
350 // CTestSDKQueries::TestQdlgExecuteLDOneL |
|
351 // ----------------------------------------------------------------------------- |
|
352 // |
|
353 TInt CTestSDKQueries::TestQdlgExecuteLDOneL( CStifItemParser& /*aItem*/ ) |
|
354 { |
|
355 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
356 CleanupStack::PushL( dlg ); |
|
357 |
|
358 dlg->ExecuteLD( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
359 |
|
360 CleanupStack::Pop( dlg ); |
|
361 return KErrNone; |
|
362 } |
|
363 |
|
364 // ----------------------------------------------------------------------------- |
|
365 // CTestSDKQueries::TestQdlgExecuteLDTwoL |
|
366 // ----------------------------------------------------------------------------- |
|
367 // |
|
368 TInt CTestSDKQueries::TestQdlgExecuteLDTwoL( CStifItemParser& /*aItem*/ ) |
|
369 { |
|
370 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
371 CleanupStack::PushL( dlg ); |
|
372 |
|
373 TBuf< KBufSize > message( KTestString ); |
|
374 |
|
375 dlg->ExecuteLD( R_AKNEXQUERY_CONFIRMATION_QUERY, message ); |
|
376 |
|
377 CleanupStack::Pop( dlg ); |
|
378 return KErrNone; |
|
379 } |
|
380 |
|
381 // ----------------------------------------------------------------------------- |
|
382 // CTestSDKQueries::TestQdlgOfferKeyEventL |
|
383 // ----------------------------------------------------------------------------- |
|
384 // |
|
385 TInt CTestSDKQueries::TestQdlgOfferKeyEventL( CStifItemParser& /*aItem*/ ) |
|
386 { |
|
387 TInt number = KTen; |
|
388 |
|
389 CAknQueryDialog* dlg = CAknQueryDialog::NewL( number ); |
|
390 |
|
391 dlg->PrepareLC( R_MESSAGE_DIALOG ); |
|
392 |
|
393 TKeyEvent event; |
|
394 event.iCode = EKeyOK; |
|
395 |
|
396 TKeyResponse reponse = dlg->OfferKeyEventL( event, EEventKey ); |
|
397 STIF_ASSERT_EQUALS( EKeyWasConsumed, reponse ); |
|
398 |
|
399 event.iCode = EKeyEnter; |
|
400 |
|
401 dlg->OfferKeyEventL( event, EEventKey ); |
|
402 STIF_ASSERT_EQUALS( EKeyWasConsumed, reponse ); |
|
403 |
|
404 event.iScanCode = EStdKeyHash; |
|
405 |
|
406 dlg->OfferKeyEventL( event, EEventKey ); |
|
407 STIF_ASSERT_EQUALS( EKeyWasConsumed, reponse ); |
|
408 |
|
409 CleanupStack::PopAndDestroy( dlg ); |
|
410 return KErrNone; |
|
411 } |
|
412 |
|
413 // ----------------------------------------------------------------------------- |
|
414 // CTestSDKQueries::TestQdlgHandlePointerEventL |
|
415 // ----------------------------------------------------------------------------- |
|
416 // |
|
417 TInt CTestSDKQueries::TestQdlgHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
418 { |
|
419 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
420 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
421 |
|
422 TPointerEvent event; |
|
423 event.iType = TPointerEvent::EButton1Down; |
|
424 event.iModifiers = KZero; |
|
425 TPoint eventPos( 10, 30 ); |
|
426 event.iPosition = eventPos; |
|
427 event.iParentPosition = eventPos; |
|
428 TInt err = KErrNone; |
|
429 TRAP( err, dlg->HandlePointerEventL( event ) ); |
|
430 |
|
431 CleanupStack::PopAndDestroy( dlg ); |
|
432 return KErrNone; |
|
433 } |
|
434 |
|
435 // ----------------------------------------------------------------------------- |
|
436 // CTestSDKQueries::TestQdlgMaxTextLengthOneL |
|
437 // ----------------------------------------------------------------------------- |
|
438 // |
|
439 TInt CTestSDKQueries::TestQdlgMaxTextLengthOneL( CStifItemParser& /*aItem*/ ) |
|
440 { |
|
441 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
442 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
443 |
|
444 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
445 CAknQueryControl* control = testDlg->QueryControl(); |
|
446 |
|
447 control->SetTextEntryLength( KFive ); |
|
448 |
|
449 TBuf< KBufSize > buffer( KTestString ); |
|
450 |
|
451 TInt length = dlg->MaxTextLength( control, buffer, KTen ); |
|
452 STIF_ASSERT_EQUALS( KTen, length ); |
|
453 |
|
454 length = dlg->MaxTextLength( control, buffer, KHundred ); |
|
455 STIF_ASSERT_EQUALS( KFive, length ); |
|
456 |
|
457 control->SetTextEntryLength( KZero ); |
|
458 |
|
459 length = dlg->MaxTextLength( control, buffer, KHundred ); |
|
460 STIF_ASSERT_EQUALS( KBufSize, length ); |
|
461 |
|
462 CleanupStack::PopAndDestroy( dlg ); |
|
463 return KErrNone; |
|
464 } |
|
465 |
|
466 // ----------------------------------------------------------------------------- |
|
467 // CTestSDKQueries::TestQdlgSetSizeAndPositionL |
|
468 // ----------------------------------------------------------------------------- |
|
469 // |
|
470 TInt CTestSDKQueries::TestQdlgSetSizeAndPositionL( CStifItemParser& /*aItem*/ ) |
|
471 { |
|
472 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
473 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
474 |
|
475 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
476 |
|
477 testDlg->SetSizeAndPosition( iContainer->Rect().Size() ); |
|
478 |
|
479 CleanupStack::PopAndDestroy( dlg ); |
|
480 return KErrNone; |
|
481 } |
|
482 |
|
483 // ----------------------------------------------------------------------------- |
|
484 // CTestSDKQueries::TestQdlgPreLayoutDynInitL |
|
485 // ----------------------------------------------------------------------------- |
|
486 // |
|
487 TInt CTestSDKQueries::TestQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
488 { |
|
489 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
490 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
491 |
|
492 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
493 |
|
494 testDlg->PreLayoutDynInitL(); |
|
495 |
|
496 CleanupStack::PopAndDestroy( dlg ); |
|
497 return KErrNone; |
|
498 } |
|
499 |
|
500 // ----------------------------------------------------------------------------- |
|
501 // CTestSDKQueries::TestQdlgPostLayoutDynInitL |
|
502 // ----------------------------------------------------------------------------- |
|
503 // |
|
504 TInt CTestSDKQueries::TestQdlgPostLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
505 { |
|
506 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
507 dlg->PrepareLC( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
508 |
|
509 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
510 |
|
511 testDlg->PostLayoutDynInitL(); |
|
512 |
|
513 CleanupStack::PopAndDestroy( dlg ); |
|
514 return KErrNone; |
|
515 } |
|
516 |
|
517 // ----------------------------------------------------------------------------- |
|
518 // CTestSDKQueries::TestQdlgOkToExitL |
|
519 // ----------------------------------------------------------------------------- |
|
520 // |
|
521 TInt CTestSDKQueries::TestQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
522 { |
|
523 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
524 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
525 |
|
526 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
527 |
|
528 TBool flag = testDlg->OkToExitL( EAknSoftkeyEmergencyCall ); |
|
529 STIF_ASSERT_TRUE( flag ); |
|
530 |
|
531 flag = testDlg->OkToExitL( EEikBidOk ); |
|
532 STIF_ASSERT_TRUE( flag ); |
|
533 |
|
534 CleanupStack::PopAndDestroy( dlg ); |
|
535 return KErrNone; |
|
536 } |
|
537 |
|
538 // ----------------------------------------------------------------------------- |
|
539 // CTestSDKQueries::TestQdlgHandleQueryEditorSizeEventL |
|
540 // ----------------------------------------------------------------------------- |
|
541 // |
|
542 TInt CTestSDKQueries::TestQdlgHandleQueryEditorSizeEventL( CStifItemParser& /*aItem*/ ) |
|
543 { |
|
544 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
545 CleanupStack::PushL( dlg ); |
|
546 |
|
547 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
548 |
|
549 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
550 CAknQueryControl* control = testDlg->QueryControl(); |
|
551 |
|
552 TBool flag = dlg->HandleQueryEditorSizeEventL( control, |
|
553 MAknQueryControlObserver::EQueryControltSizeChanging ); |
|
554 STIF_ASSERT_FALSE( flag ); |
|
555 |
|
556 CleanupStack::PopAndDestroy( dlg ); |
|
557 CleanupStack::Pop( KOne ); |
|
558 return KErrNone; |
|
559 } |
|
560 |
|
561 // ----------------------------------------------------------------------------- |
|
562 // CTestSDKQueries::TestQdlgHandleQueryEditorStateEventL |
|
563 // ----------------------------------------------------------------------------- |
|
564 // |
|
565 TInt CTestSDKQueries::TestQdlgHandleQueryEditorStateEventL( CStifItemParser& /*aItem*/ ) |
|
566 { |
|
567 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
568 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
569 |
|
570 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
571 CAknQueryControl* control = testDlg->QueryControl(); |
|
572 |
|
573 dlg->SetContainerWindowL( *iContainer ); |
|
574 |
|
575 TBool flag = dlg->HandleQueryEditorStateEventL( control, |
|
576 MAknQueryControlObserver::EEmergencyCallAttempted, |
|
577 MAknQueryControlObserver::EEditorValueValid ); |
|
578 STIF_ASSERT_FALSE( flag ); |
|
579 |
|
580 CleanupStack::Pop( dlg ); |
|
581 |
|
582 CAknQueryDialog* dlgTwo = CAknQueryDialog::NewL(); |
|
583 dlgTwo->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
584 |
|
585 CTestCAknQueryDialog* testDlgTwo = static_cast<CTestCAknQueryDialog*>( dlgTwo ); |
|
586 control = testDlgTwo->QueryControl(); |
|
587 |
|
588 dlgTwo->SetContainerWindowL( *iContainer ); |
|
589 |
|
590 flag = dlgTwo->HandleQueryEditorStateEventL( control, |
|
591 MAknQueryControlObserver::EQueryControlEditorStateChanging, |
|
592 MAknQueryControlObserver::EEditorValueValid ); |
|
593 STIF_ASSERT_FALSE( flag ); |
|
594 |
|
595 CleanupStack::PopAndDestroy( dlgTwo ); |
|
596 |
|
597 |
|
598 return KErrNone; |
|
599 } |
|
600 |
|
601 // ----------------------------------------------------------------------------- |
|
602 // CTestSDKQueries::TestQdlgNeedToDismissQueryL |
|
603 // ----------------------------------------------------------------------------- |
|
604 // |
|
605 TInt CTestSDKQueries::TestQdlgNeedToDismissQueryL( CStifItemParser& /*aItem*/ ) |
|
606 { |
|
607 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
608 dlg->PrepareLC( R_DEMO_DATA_PIN_QUERY ); |
|
609 |
|
610 TKeyEvent event; |
|
611 event.iScanCode = EStdKeySquareBracketLeft; |
|
612 |
|
613 TBool flag = dlg->NeedToDismissQueryL( event ); |
|
614 STIF_ASSERT_FALSE( flag ); |
|
615 |
|
616 event.iScanCode = EStdKeyHash; |
|
617 |
|
618 flag = dlg->NeedToDismissQueryL( event ); |
|
619 STIF_ASSERT_TRUE( flag ); |
|
620 |
|
621 CleanupStack::Pop( dlg ); |
|
622 return KErrNone; |
|
623 } |
|
624 |
|
625 // ----------------------------------------------------------------------------- |
|
626 // CTestSDKQueries::TestQdlgDismissQueryL |
|
627 // ----------------------------------------------------------------------------- |
|
628 // |
|
629 TInt CTestSDKQueries::TestQdlgDismissQueryL( CStifItemParser& aItem ) |
|
630 { |
|
631 TInt err = TestQdlgNeedToDismissQueryL( aItem ); |
|
632 return err; |
|
633 } |
|
634 |
|
635 // ----------------------------------------------------------------------------- |
|
636 // CTestSDKQueries::TestQdlgUpdateLeftSoftKeyL |
|
637 // ----------------------------------------------------------------------------- |
|
638 // |
|
639 TInt CTestSDKQueries::TestQdlgUpdateLeftSoftKeyL( CStifItemParser& /*aItem*/ ) |
|
640 { |
|
641 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
642 |
|
643 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
644 |
|
645 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
646 |
|
647 testDlg->UpdateLeftSoftKeyL(); |
|
648 |
|
649 CleanupStack::PopAndDestroy( dlg ); |
|
650 return KErrNone; |
|
651 } |
|
652 |
|
653 // ----------------------------------------------------------------------------- |
|
654 // CTestSDKQueries::TestQdlgDoSetPromptL |
|
655 // ----------------------------------------------------------------------------- |
|
656 // |
|
657 TInt CTestSDKQueries::TestQdlgDoSetPromptL( CStifItemParser& aItem ) |
|
658 { |
|
659 TInt err = TestQdlgSetPromptL( aItem ); |
|
660 return err; |
|
661 } |
|
662 |
|
663 // ----------------------------------------------------------------------------- |
|
664 // CTestSDKQueries::TestQdlgQueryControlL |
|
665 // ----------------------------------------------------------------------------- |
|
666 // |
|
667 TInt CTestSDKQueries::TestQdlgQueryControlL( CStifItemParser& /*aItem*/ ) |
|
668 { |
|
669 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
670 CleanupStack::PushL( dlg ); |
|
671 |
|
672 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
673 |
|
674 CAknQueryControl* control = testDlg->QueryControl(); |
|
675 STIF_ASSERT_NULL( control ); |
|
676 |
|
677 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
678 |
|
679 control = testDlg->QueryControl(); |
|
680 STIF_ASSERT_NOT_NULL( control ); |
|
681 |
|
682 CleanupStack::PopAndDestroy( dlg ); |
|
683 CleanupStack::Pop( KOne ); |
|
684 return KErrNone; |
|
685 } |
|
686 |
|
687 // ----------------------------------------------------------------------------- |
|
688 // CTestSDKQueries::TestQdlgPromptL |
|
689 // ----------------------------------------------------------------------------- |
|
690 // |
|
691 TInt CTestSDKQueries::TestQdlgPromptL( CStifItemParser& aItem ) |
|
692 { |
|
693 TInt err = TestQdlgSetPromptL( aItem ); |
|
694 return err; |
|
695 } |
|
696 |
|
697 // ----------------------------------------------------------------------------- |
|
698 // CTestSDKQueries::TestQdlgConstructorTwoL |
|
699 // ----------------------------------------------------------------------------- |
|
700 // |
|
701 TInt CTestSDKQueries::TestQdlgConstructorTwoL( CStifItemParser& /*aItem*/ ) |
|
702 { |
|
703 CAknQueryDialog* dlg = new( ELeave ) CAknQueryDialog(); |
|
704 CleanupStack::PushL( dlg ); |
|
705 STIF_ASSERT_NOT_NULL( dlg ); |
|
706 CleanupStack::PopAndDestroy( dlg ); |
|
707 return KErrNone; |
|
708 } |
|
709 |
|
710 // ----------------------------------------------------------------------------- |
|
711 // CTestSDKQueries::TestQdlgConstructorThreeL |
|
712 // ----------------------------------------------------------------------------- |
|
713 // |
|
714 TInt CTestSDKQueries::TestQdlgConstructorThreeL( CStifItemParser& /*aItem*/ ) |
|
715 { |
|
716 TBuf< KBufSize > message( KTestString ); |
|
717 |
|
718 CAknQueryDialog* dlg = new( ELeave ) CAknQueryDialog( message ); |
|
719 CleanupStack::PushL( dlg ); |
|
720 STIF_ASSERT_NOT_NULL( dlg ); |
|
721 CleanupStack::PopAndDestroy( dlg ); |
|
722 return KErrNone; |
|
723 } |
|
724 |
|
725 // ----------------------------------------------------------------------------- |
|
726 // CTestSDKQueries::TestQdlgSetHeaderTextL |
|
727 // ----------------------------------------------------------------------------- |
|
728 // |
|
729 TInt CTestSDKQueries::TestQdlgSetHeaderTextL( CStifItemParser& /*aItem*/ ) |
|
730 { |
|
731 TInt number = KTen; |
|
732 |
|
733 CAknQueryDialog* dlg = CAknQueryDialog::NewL( number ); |
|
734 CleanupStack::PushL( dlg ); |
|
735 |
|
736 dlg->PrepareLC( R_MESSAGE_DIALOG ); |
|
737 |
|
738 TBuf< KBufSize > heading( KTestString ); |
|
739 |
|
740 dlg->SetHeaderTextL( heading ); |
|
741 |
|
742 CleanupStack::PopAndDestroy( dlg ); |
|
743 CleanupStack::Pop( KOne ); |
|
744 return KErrNone; |
|
745 } |
|
746 |
|
747 // ----------------------------------------------------------------------------- |
|
748 // CTestSDKQueries::TestQdlgSetHeaderImageL |
|
749 // ----------------------------------------------------------------------------- |
|
750 // |
|
751 TInt CTestSDKQueries::TestQdlgSetHeaderImageL( CStifItemParser& /*aItem*/ ) |
|
752 { |
|
753 TInt number = KTen; |
|
754 |
|
755 CAknQueryDialog* dlg = CAknQueryDialog::NewL( number ); |
|
756 CleanupStack::PushL( dlg ); |
|
757 |
|
758 dlg->PrepareLC( R_MESSAGE_DIALOG ); |
|
759 |
|
760 CEikImage* mImage = new( ELeave ) CEikImage(); |
|
761 CleanupStack::PushL( mImage ); |
|
762 |
|
763 TFileName file( KTestMbmFile ); |
|
764 User::LeaveIfError( CompleteWithAppPath( file ) ); |
|
765 |
|
766 mImage->CreatePictureFromFileL( file, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
767 |
|
768 dlg->SetHeaderImageL( mImage ); |
|
769 |
|
770 CleanupStack::Pop( mImage ); |
|
771 CleanupStack::PopAndDestroy( dlg ); |
|
772 CleanupStack::Pop( KOne ); |
|
773 return KErrNone; |
|
774 } |
|
775 |
|
776 // ----------------------------------------------------------------------------- |
|
777 // CTestSDKQueries::TestQdlgRunDlgLDL |
|
778 // ----------------------------------------------------------------------------- |
|
779 // |
|
780 TInt CTestSDKQueries::TestQdlgRunDlgLDL( CStifItemParser& /*aItem*/ ) |
|
781 { |
|
782 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
783 CleanupStack::PushL( dlg ); |
|
784 |
|
785 dlg->RunDlgLD( R_AKNEXQUERY_CONFIRMATION_QUERY ); |
|
786 |
|
787 CleanupStack::Pop( dlg ); |
|
788 return KErrNone; |
|
789 } |
|
790 |
|
791 // ----------------------------------------------------------------------------- |
|
792 // CTestSDKQueries::TestQdlgMaxTextLengthTwoL |
|
793 // ----------------------------------------------------------------------------- |
|
794 // |
|
795 TInt CTestSDKQueries::TestQdlgMaxTextLengthTwoL( CStifItemParser& /*aItem*/ ) |
|
796 { |
|
797 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
798 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
799 |
|
800 CTestCAknQueryDialog* testDlg = static_cast<CTestCAknQueryDialog*>( dlg ); |
|
801 CAknQueryControl* control = testDlg->QueryControl(); |
|
802 |
|
803 control->SetTextEntryLength( KFive ); |
|
804 |
|
805 TBuf< KBufSize > buffer( KTestString ); |
|
806 |
|
807 TInt length = dlg->MaxTextLength( control, &buffer, KTen ); |
|
808 STIF_ASSERT_EQUALS( KTen, length ); |
|
809 |
|
810 length = dlg->MaxTextLength( control, &buffer, KHundred ); |
|
811 STIF_ASSERT_EQUALS( KFive, length ); |
|
812 |
|
813 control->SetTextEntryLength( KZero ); |
|
814 |
|
815 length = dlg->MaxTextLength( control, &buffer, KHundred ); |
|
816 STIF_ASSERT_EQUALS( KBufSize, length ); |
|
817 |
|
818 CleanupStack::PopAndDestroy( dlg ); |
|
819 return KErrNone; |
|
820 } |
|
821 |
|
822 // ----------------------------------------------------------------------------- |
|
823 // CTestSDKQueries::TestQdlgInputCapabilitiesL |
|
824 // ----------------------------------------------------------------------------- |
|
825 // |
|
826 TInt CTestSDKQueries::TestQdlgInputCapabilitiesL( CStifItemParser& /*aItem*/ ) |
|
827 { |
|
828 TInt number = KTen; |
|
829 |
|
830 CAknQueryDialog* dlg = CAknQueryDialog::NewL( number ); |
|
831 dlg->PrepareLC( R_MESSAGE_DIALOG ); |
|
832 |
|
833 TCoeInputCapabilities capabilities = dlg->InputCapabilities(); |
|
834 STIF_ASSERT_NOT_NULL( &capabilities ); |
|
835 |
|
836 CleanupStack::PopAndDestroy( dlg ); |
|
837 return KErrNone; |
|
838 } |
|
839 |
|
840 // ----------------------------------------------------------------------------- |
|
841 // CTestSDKQueries::TestQdlgSetEmergencyCallSupportForCBAL |
|
842 // ----------------------------------------------------------------------------- |
|
843 // |
|
844 TInt CTestSDKQueries::TestQdlgSetEmergencyCallSupportForCBAL( CStifItemParser& /*aItem*/ ) |
|
845 { |
|
846 TInt number = KTen; |
|
847 |
|
848 CAknQueryDialog* dlg = CAknQueryDialog::NewL( number ); |
|
849 dlg->PrepareLC( R_MESSAGE_DIALOG ); |
|
850 |
|
851 dlg->SetEmergencyCallSupportForCBA( ETrue ); |
|
852 dlg->SetEmergencyCallSupportForCBA( EFalse ); |
|
853 |
|
854 CleanupStack::PopAndDestroy( dlg ); |
|
855 return KErrNone; |
|
856 } |
|
857 |
|
858 // ----------------------------------------------------------------------------- |
|
859 // CTestSDKQueries::TestTextQdlgNewL |
|
860 // ----------------------------------------------------------------------------- |
|
861 // |
|
862 TInt CTestSDKQueries::TestTextQdlgNewL( CStifItemParser& /*aItem*/ ) |
|
863 { |
|
864 TBuf< KBufSize > dateText( KTestTime ); |
|
865 |
|
866 CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( dateText ); |
|
867 CleanupStack::PushL( dlg ); |
|
868 STIF_ASSERT_NOT_NULL( dlg ); |
|
869 CleanupStack::PopAndDestroy( dlg ); |
|
870 return KErrNone; |
|
871 } |
|
872 |
|
873 // ----------------------------------------------------------------------------- |
|
874 // CTestSDKQueries::TestTextQdlgConstructorL |
|
875 // ----------------------------------------------------------------------------- |
|
876 // |
|
877 TInt CTestSDKQueries::TestTextQdlgConstructorL( CStifItemParser& /*aItem*/ ) |
|
878 { |
|
879 TBuf< KBufSize > dateText( KTestTime ); |
|
880 |
|
881 CAknTextQueryDialog* dlg = new( ELeave ) CAknTextQueryDialog( dateText ); |
|
882 CleanupStack::PushL( dlg ); |
|
883 STIF_ASSERT_NOT_NULL( dlg ); |
|
884 CleanupStack::PopAndDestroy( dlg ); |
|
885 return KErrNone; |
|
886 } |
|
887 |
|
888 // ----------------------------------------------------------------------------- |
|
889 // CTestSDKQueries::TestTextQdlgDestructorL |
|
890 // ----------------------------------------------------------------------------- |
|
891 // |
|
892 TInt CTestSDKQueries::TestTextQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
893 { |
|
894 TBuf< KBufSize > dateText( KTestTime ); |
|
895 TBuf< KBufSize > datePromt( KTestTime ); |
|
896 |
|
897 CAknTextQueryDialog* dlg = new( ELeave ) CAknTextQueryDialog( dateText, datePromt ); |
|
898 CleanupStack::PushL( dlg ); |
|
899 CleanupStack::PopAndDestroy( dlg ); |
|
900 return KErrNone; |
|
901 } |
|
902 |
|
903 // ----------------------------------------------------------------------------- |
|
904 // CTestSDKQueries::TestTextQdlgSetMaxLengthL |
|
905 // ----------------------------------------------------------------------------- |
|
906 // |
|
907 TInt CTestSDKQueries::TestTextQdlgSetMaxLengthL( CStifItemParser& /*aItem*/ ) |
|
908 { |
|
909 TBuf< KBufSize > dateText( KTestTime ); |
|
910 |
|
911 CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( dateText ); |
|
912 CleanupStack::PushL( dlg ); |
|
913 dlg->SetMaxLength( KTen ); |
|
914 CleanupStack::PopAndDestroy( dlg ); |
|
915 return KErrNone; |
|
916 } |
|
917 |
|
918 // ----------------------------------------------------------------------------- |
|
919 // CTestSDKQueries::TestTextQdlgCheckIfEntryTextOkL |
|
920 // ----------------------------------------------------------------------------- |
|
921 // |
|
922 TInt CTestSDKQueries::TestTextQdlgCheckIfEntryTextOkL( CStifItemParser& /*aItem*/ ) |
|
923 { |
|
924 TBuf< KBufSize > dateText( KTestTime ); |
|
925 |
|
926 CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( dateText ); |
|
927 CleanupStack::PushL( dlg ); |
|
928 |
|
929 TBool flag = dlg->CheckIfEntryTextOk(); |
|
930 STIF_ASSERT_FALSE( flag ); |
|
931 |
|
932 CleanupStack::Pop( dlg ); |
|
933 dlg->PrepareLC( R_DEMO_DATA_QUERY ); |
|
934 |
|
935 flag = dlg->CheckIfEntryTextOk(); |
|
936 STIF_ASSERT_FALSE( flag ); |
|
937 |
|
938 CleanupStack::PopAndDestroy( dlg ); |
|
939 return KErrNone; |
|
940 } |
|
941 |
|
942 // ----------------------------------------------------------------------------- |
|
943 // CTestSDKQueries::TestTextQdlgSetDefaultInputModeL |
|
944 // ----------------------------------------------------------------------------- |
|
945 // |
|
946 TInt CTestSDKQueries::TestTextQdlgSetDefaultInputModeL( CStifItemParser& /*aItem*/ ) |
|
947 { |
|
948 TBuf< KBufSize > dateText( KTestTime ); |
|
949 |
|
950 CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( dateText ); |
|
951 |
|
952 dlg->PrepareLC( R_DEMO_DATA_QUERY ); |
|
953 |
|
954 dlg->SetDefaultInputMode( KTen ); |
|
955 |
|
956 CleanupStack::PopAndDestroy( dlg ); |
|
957 return KErrNone; |
|
958 } |
|
959 |
|
960 // ----------------------------------------------------------------------------- |
|
961 // CTestSDKQueries::TestTextQdlgPreLayoutDynInitL |
|
962 // ----------------------------------------------------------------------------- |
|
963 // |
|
964 TInt CTestSDKQueries::TestTextQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
965 { |
|
966 TBuf< KBufSize > dateText( KTestTime ); |
|
967 |
|
968 CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( dateText ); |
|
969 CTestCAknTextQueryDialog* testDlg = static_cast<CTestCAknTextQueryDialog*>( dlg ); |
|
970 |
|
971 testDlg->PrepareLC( R_DEMO_DATA_QUERY ); |
|
972 |
|
973 CTestCAknQueryControl* control = static_cast<CTestCAknQueryControl*>( testDlg->QueryControl() ); |
|
974 control->iEdwin->SetMaxLength( KHundred ); |
|
975 |
|
976 testDlg->PreLayoutDynInitL(); |
|
977 |
|
978 CleanupStack::PopAndDestroy( dlg ); |
|
979 return KErrNone; |
|
980 } |
|
981 |
|
982 // ----------------------------------------------------------------------------- |
|
983 // CTestSDKQueries::TestTextQdlgOkToExitL |
|
984 // ----------------------------------------------------------------------------- |
|
985 // |
|
986 TInt CTestSDKQueries::TestTextQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
987 { |
|
988 TBuf< KBufSize > dateText( KTestTime ); |
|
989 |
|
990 CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( dateText ); |
|
991 CTestCAknTextQueryDialog* testDlg = static_cast<CTestCAknTextQueryDialog*>( dlg ); |
|
992 |
|
993 testDlg->PrepareLC( R_DEMO_DATA_QUERY ); |
|
994 |
|
995 TBool flag = testDlg->OkToExitL( EAknSoftkeyEmergencyCall ); |
|
996 STIF_ASSERT_TRUE( flag ); |
|
997 |
|
998 flag = testDlg->OkToExitL( EEikBidOk ); |
|
999 STIF_ASSERT_TRUE( flag ); |
|
1000 |
|
1001 flag = testDlg->OkToExitL( KHundred ); |
|
1002 STIF_ASSERT_FALSE( flag ); |
|
1003 |
|
1004 CleanupStack::PopAndDestroy( dlg ); |
|
1005 return KErrNone; |
|
1006 } |
|
1007 |
|
1008 // ----------------------------------------------------------------------------- |
|
1009 // CTestSDKQueries::TestTextQdlgHandleQueryEditorSizeEventL |
|
1010 // ----------------------------------------------------------------------------- |
|
1011 // |
|
1012 TInt CTestSDKQueries::TestTextQdlgHandleQueryEditorSizeEventL( CStifItemParser& /*aItem*/ ) |
|
1013 { |
|
1014 TBuf< KBufSize > dateText( KTestTime ); |
|
1015 |
|
1016 CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( dateText ); |
|
1017 CTestCAknTextQueryDialog* testDlg = static_cast<CTestCAknTextQueryDialog*>( dlg ); |
|
1018 |
|
1019 testDlg->PrepareLC( R_DEMO_DATA_QUERY ); |
|
1020 |
|
1021 CAknQueryControl* control = testDlg->QueryControl(); |
|
1022 |
|
1023 TBool flag = dlg->HandleQueryEditorSizeEventL( control, |
|
1024 MAknQueryControlObserver::EQueryControltSizeChanging ); |
|
1025 STIF_ASSERT_FALSE( flag ); |
|
1026 |
|
1027 CleanupStack::PopAndDestroy( dlg ); |
|
1028 return KErrNone; |
|
1029 } |
|
1030 |
|
1031 // ----------------------------------------------------------------------------- |
|
1032 // CTestSDKQueries::TestTextQdlgHandlePointerEventL |
|
1033 // ----------------------------------------------------------------------------- |
|
1034 // |
|
1035 TInt CTestSDKQueries::TestTextQdlgHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
1036 { |
|
1037 TBuf< KBufSize > dateText( KTestTime ); |
|
1038 |
|
1039 CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( dateText ); |
|
1040 |
|
1041 dlg->PrepareLC( R_DEMO_DATA_QUERY ); |
|
1042 |
|
1043 TPointerEvent event; |
|
1044 event.iType = TPointerEvent::EButton1Down; |
|
1045 event.iModifiers = KZero; |
|
1046 TPoint eventPos( 10, 30 ); |
|
1047 event.iPosition = eventPos; |
|
1048 event.iParentPosition = eventPos; |
|
1049 TInt err = KErrNone; |
|
1050 TRAP( err, dlg->HandlePointerEventL( event ) ); |
|
1051 |
|
1052 CleanupStack::PopAndDestroy( dlg ); |
|
1053 return KErrNone; |
|
1054 } |
|
1055 |
|
1056 // ----------------------------------------------------------------------------- |
|
1057 // CTestSDKQueries::TestTextQdlgConstructorLL |
|
1058 // ----------------------------------------------------------------------------- |
|
1059 // |
|
1060 TInt CTestSDKQueries::TestTextQdlgConstructorLL( CStifItemParser& /*aItem*/ ) |
|
1061 { |
|
1062 TBuf< KBufSize > dataText( KTestTime ); |
|
1063 TBuf< KBufSize > promptText( KTestString ); |
|
1064 |
|
1065 CAknTextQueryDialog* dlg = new( ELeave ) CAknTextQueryDialog( dataText, promptText ); |
|
1066 CleanupStack::PushL( dlg ); |
|
1067 STIF_ASSERT_NOT_NULL( dlg ); |
|
1068 CleanupStack::PopAndDestroy( dlg ); |
|
1069 return KErrNone; |
|
1070 } |
|
1071 |
|
1072 // ----------------------------------------------------------------------------- |
|
1073 // CTestSDKQueries::TestNumberQdlgNewL |
|
1074 // ----------------------------------------------------------------------------- |
|
1075 // |
|
1076 TInt CTestSDKQueries::TestNumberQdlgNewL( CStifItemParser& /*aItem*/ ) |
|
1077 { |
|
1078 TInt number = KTen; |
|
1079 |
|
1080 CAknNumberQueryDialog* dlg = CAknNumberQueryDialog::NewL( number ); |
|
1081 CleanupStack::PushL( dlg ); |
|
1082 |
|
1083 STIF_ASSERT_NOT_NULL( dlg ); |
|
1084 |
|
1085 CleanupStack::PopAndDestroy( dlg ); |
|
1086 return KErrNone; |
|
1087 } |
|
1088 |
|
1089 // ----------------------------------------------------------------------------- |
|
1090 // CTestSDKQueries::TestNumberQdlgConstructorL |
|
1091 // ----------------------------------------------------------------------------- |
|
1092 // |
|
1093 TInt CTestSDKQueries::TestNumberQdlgConstructorL( CStifItemParser& /*aItem*/ ) |
|
1094 { |
|
1095 TInt number = KTen; |
|
1096 |
|
1097 CAknNumberQueryDialog* dlg = new( ELeave ) CAknNumberQueryDialog( number ); |
|
1098 CleanupStack::PushL( dlg ); |
|
1099 |
|
1100 STIF_ASSERT_NOT_NULL( dlg ); |
|
1101 |
|
1102 CleanupStack::PopAndDestroy( dlg ); |
|
1103 return KErrNone; |
|
1104 } |
|
1105 |
|
1106 // ----------------------------------------------------------------------------- |
|
1107 // CTestSDKQueries::TestNumberQdlgDestructorL |
|
1108 // ----------------------------------------------------------------------------- |
|
1109 // |
|
1110 TInt CTestSDKQueries::TestNumberQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
1111 { |
|
1112 TInt number = KTen; |
|
1113 |
|
1114 CAknNumberQueryDialog* dlg = CAknNumberQueryDialog::NewL( number ); |
|
1115 CleanupStack::PushL( dlg ); |
|
1116 CleanupStack::PopAndDestroy( dlg ); |
|
1117 return KErrNone; |
|
1118 } |
|
1119 |
|
1120 // ----------------------------------------------------------------------------- |
|
1121 // CTestSDKQueries::TestNumberQdlgSetMinimumAndMaximumL |
|
1122 // ----------------------------------------------------------------------------- |
|
1123 // |
|
1124 TInt CTestSDKQueries::TestNumberQdlgSetMinimumAndMaximumL( CStifItemParser& /*aItem*/ ) |
|
1125 { |
|
1126 TInt number = KTen; |
|
1127 |
|
1128 CAknNumberQueryDialog* dlg = CAknNumberQueryDialog::NewL( number ); |
|
1129 |
|
1130 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
1131 |
|
1132 dlg->SetMinimumAndMaximum( KZero, KHundred ); |
|
1133 |
|
1134 CleanupStack::PopAndDestroy( dlg ); |
|
1135 return KErrNone; |
|
1136 } |
|
1137 |
|
1138 // ----------------------------------------------------------------------------- |
|
1139 // CTestSDKQueries::TestNumberQdlgHandlePointerEventL |
|
1140 // ----------------------------------------------------------------------------- |
|
1141 // |
|
1142 TInt CTestSDKQueries::TestNumberQdlgHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
1143 { |
|
1144 TInt number = KTen; |
|
1145 |
|
1146 CAknNumberQueryDialog* dlg = CAknNumberQueryDialog::NewL( number ); |
|
1147 |
|
1148 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
1149 |
|
1150 TPointerEvent event; |
|
1151 event.iType = TPointerEvent::EButton1Down; |
|
1152 event.iModifiers = KZero; |
|
1153 TPoint eventPos( 10, 30 ); |
|
1154 event.iPosition = eventPos; |
|
1155 event.iParentPosition = eventPos; |
|
1156 TInt err = KErrNone; |
|
1157 TRAP( err, dlg->HandlePointerEventL( event ) ); |
|
1158 |
|
1159 CleanupStack::PopAndDestroy( dlg ); |
|
1160 return KErrNone; |
|
1161 } |
|
1162 |
|
1163 // ----------------------------------------------------------------------------- |
|
1164 // CTestSDKQueries::TestNumberQdlgPreLayoutDynInitL |
|
1165 // ----------------------------------------------------------------------------- |
|
1166 // |
|
1167 TInt CTestSDKQueries::TestNumberQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
1168 { |
|
1169 TInt number = KTen; |
|
1170 |
|
1171 CAknNumberQueryDialog* dlg = CAknNumberQueryDialog::NewL( number ); |
|
1172 |
|
1173 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
1174 |
|
1175 CTestCAknNumberQueryDialog* testDlg = static_cast<CTestCAknNumberQueryDialog*>( dlg ); |
|
1176 |
|
1177 testDlg->PreLayoutDynInitL(); |
|
1178 |
|
1179 CleanupStack::PopAndDestroy( dlg ); |
|
1180 return KErrNone; |
|
1181 } |
|
1182 |
|
1183 // ----------------------------------------------------------------------------- |
|
1184 // CTestSDKQueries::TestNumberQdlgOkToExitL |
|
1185 // ----------------------------------------------------------------------------- |
|
1186 // |
|
1187 TInt CTestSDKQueries::TestNumberQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
1188 { |
|
1189 TInt number = KTen; |
|
1190 |
|
1191 CAknNumberQueryDialog* dlg = CAknNumberQueryDialog::NewL( number ); |
|
1192 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
1193 |
|
1194 CTestCAknNumberQueryDialog* testDlg = static_cast<CTestCAknNumberQueryDialog*>( dlg ); |
|
1195 |
|
1196 TBool flag = testDlg->OkToExitL( EAknSoftkeyEmergencyCall ); |
|
1197 STIF_ASSERT_TRUE( flag ); |
|
1198 |
|
1199 flag = testDlg->OkToExitL( EEikBidOk ); |
|
1200 STIF_ASSERT_TRUE( flag ); |
|
1201 |
|
1202 flag = testDlg->OkToExitL( KHundred ); |
|
1203 STIF_ASSERT_FALSE( flag ); |
|
1204 |
|
1205 CleanupStack::PopAndDestroy( dlg ); |
|
1206 return KErrNone; |
|
1207 } |
|
1208 |
|
1209 // ----------------------------------------------------------------------------- |
|
1210 // CTestSDKQueries::TestNumberQdlgNumberL |
|
1211 // ----------------------------------------------------------------------------- |
|
1212 // |
|
1213 TInt CTestSDKQueries::TestNumberQdlgNumberOneL( CStifItemParser& /*aItem*/ ) |
|
1214 { |
|
1215 TInt number = KTen; |
|
1216 |
|
1217 CAknNumberQueryDialog* dlg = CAknNumberQueryDialog::NewL( number ); |
|
1218 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
1219 |
|
1220 CTestCAknNumberQueryDialog* testDlg = static_cast<CTestCAknNumberQueryDialog*>( dlg ); |
|
1221 |
|
1222 TInt returnNumber = testDlg->Number(); |
|
1223 STIF_ASSERT_EQUALS( KTen, returnNumber ); |
|
1224 |
|
1225 CleanupStack::PopAndDestroy( dlg ); |
|
1226 return KErrNone; |
|
1227 } |
|
1228 |
|
1229 // ----------------------------------------------------------------------------- |
|
1230 // CTestSDKQueries::TestNumberQdlgNumberL |
|
1231 // ----------------------------------------------------------------------------- |
|
1232 // |
|
1233 TInt CTestSDKQueries::TestNumberQdlgNumberTwoL( CStifItemParser& /*aItem*/ ) |
|
1234 { |
|
1235 TInt number = KTen; |
|
1236 |
|
1237 CAknNumberQueryDialog* dlg = CAknNumberQueryDialog::NewL( number ); |
|
1238 dlg->PrepareLC( R_AKNEXQUERY_NUMBER_LAYOUT ); |
|
1239 |
|
1240 CTestCAknNumberQueryDialog* testDlg = static_cast<CTestCAknNumberQueryDialog*>( dlg ); |
|
1241 |
|
1242 const TInt returnNumber = testDlg->Number(); |
|
1243 STIF_ASSERT_EQUALS( KTen, returnNumber ); |
|
1244 |
|
1245 CleanupStack::PopAndDestroy( dlg ); |
|
1246 return KErrNone; |
|
1247 } |
|
1248 |
|
1249 // ----------------------------------------------------------------------------- |
|
1250 // CTestSDKQueries::TestTimeQdlgNewL |
|
1251 // ----------------------------------------------------------------------------- |
|
1252 // |
|
1253 TInt CTestSDKQueries::TestTimeQdlgNewL( CStifItemParser& /*aItem*/ ) |
|
1254 { |
|
1255 TTime time( KTestTime ); |
|
1256 |
|
1257 CAknTimeQueryDialog* dlg = CAknTimeQueryDialog::NewL( time ); |
|
1258 CleanupStack::PushL( dlg ); |
|
1259 |
|
1260 STIF_ASSERT_NOT_NULL( dlg ); |
|
1261 |
|
1262 CleanupStack::PopAndDestroy( dlg ); |
|
1263 return KErrNone; |
|
1264 } |
|
1265 |
|
1266 // ----------------------------------------------------------------------------- |
|
1267 // CTestSDKQueries::TestTimeQdlgConstructorL |
|
1268 // ----------------------------------------------------------------------------- |
|
1269 // |
|
1270 TInt CTestSDKQueries::TestTimeQdlgConstructorL( CStifItemParser& /*aItem*/ ) |
|
1271 { |
|
1272 TTime time( KTestTime ); |
|
1273 |
|
1274 CAknTimeQueryDialog* dlg = new( ELeave ) CAknTimeQueryDialog( time ); |
|
1275 CleanupStack::PushL( dlg ); |
|
1276 |
|
1277 STIF_ASSERT_NOT_NULL( dlg ); |
|
1278 |
|
1279 CleanupStack::PopAndDestroy( dlg ); |
|
1280 return KErrNone; |
|
1281 } |
|
1282 |
|
1283 // ----------------------------------------------------------------------------- |
|
1284 // CTestSDKQueries::TestTimeQdlgDestructorL |
|
1285 // ----------------------------------------------------------------------------- |
|
1286 // |
|
1287 TInt CTestSDKQueries::TestTimeQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
1288 { |
|
1289 TTime time( KTestTime ); |
|
1290 TBuf< KBufSize > text( KTestString ); |
|
1291 |
|
1292 CAknTimeQueryDialog* dlg = new( ELeave ) CAknTimeQueryDialog( time, text ); |
|
1293 delete dlg; |
|
1294 return KErrNone; |
|
1295 } |
|
1296 |
|
1297 // ----------------------------------------------------------------------------- |
|
1298 // CTestSDKQueries::TestTimeQdlgSetMinimumAndMaximumL |
|
1299 // ----------------------------------------------------------------------------- |
|
1300 // |
|
1301 TInt CTestSDKQueries::TestTimeQdlgSetMinimumAndMaximumL( CStifItemParser& /*aItem*/ ) |
|
1302 { |
|
1303 TTime time( KTestTime ); |
|
1304 |
|
1305 CAknTimeQueryDialog* dlg = CAknTimeQueryDialog::NewL( time ); |
|
1306 dlg->PrepareLC( R_AKNEXQUERY_TIME_QUERY ); |
|
1307 |
|
1308 TTime minTime( KZero ); |
|
1309 |
|
1310 dlg->SetMinimumAndMaximum( minTime, time ); |
|
1311 |
|
1312 CleanupStack::PopAndDestroy( dlg ); |
|
1313 return KErrNone; |
|
1314 } |
|
1315 |
|
1316 // ----------------------------------------------------------------------------- |
|
1317 // CTestSDKQueries::TestTimeQdlgHandlePointerEventL |
|
1318 // ----------------------------------------------------------------------------- |
|
1319 // |
|
1320 TInt CTestSDKQueries::TestTimeQdlgHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
1321 { |
|
1322 TTime time( KTestTime ); |
|
1323 |
|
1324 CAknTimeQueryDialog* dlg = CAknTimeQueryDialog::NewL( time ); |
|
1325 dlg->PrepareLC( R_AKNEXQUERY_TIME_QUERY ); |
|
1326 |
|
1327 TPointerEvent event; |
|
1328 event.iType = TPointerEvent::EButton1Down; |
|
1329 event.iModifiers = KZero; |
|
1330 TPoint eventPos( 10, 30 ); |
|
1331 event.iPosition = eventPos; |
|
1332 event.iParentPosition = eventPos; |
|
1333 TInt err = KErrNone; |
|
1334 TRAP( err, dlg->HandlePointerEventL( event ) ); |
|
1335 |
|
1336 CleanupStack::PopAndDestroy( dlg ); |
|
1337 return KErrNone; |
|
1338 } |
|
1339 |
|
1340 // ----------------------------------------------------------------------------- |
|
1341 // CTestSDKQueries::TestTimeQdlgPreLayoutDynInitL |
|
1342 // ----------------------------------------------------------------------------- |
|
1343 // |
|
1344 TInt CTestSDKQueries::TestTimeQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
1345 { |
|
1346 TTime time( KTestTime ); |
|
1347 |
|
1348 CAknTimeQueryDialog* dlg = CAknTimeQueryDialog::NewL( time ); |
|
1349 dlg->PrepareLC( R_AKNEXQUERY_TIME_QUERY ); |
|
1350 |
|
1351 CTestCAknTimeQueryDialog* testDlg = static_cast<CTestCAknTimeQueryDialog*>( dlg ); |
|
1352 |
|
1353 testDlg->PreLayoutDynInitL(); |
|
1354 |
|
1355 CleanupStack::PopAndDestroy( dlg ); |
|
1356 return KErrNone; |
|
1357 } |
|
1358 |
|
1359 // ----------------------------------------------------------------------------- |
|
1360 // CTestSDKQueries::TestTimeQdlgOkToExitL |
|
1361 // ----------------------------------------------------------------------------- |
|
1362 // |
|
1363 TInt CTestSDKQueries::TestTimeQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
1364 { |
|
1365 TTime time( KTestTime ); |
|
1366 |
|
1367 CAknTimeQueryDialog* dlg = CAknTimeQueryDialog::NewL( time ); |
|
1368 dlg->PrepareLC( R_AKNEXQUERY_TIME_QUERY ); |
|
1369 |
|
1370 CTestCAknTimeQueryDialog* testDlg = static_cast<CTestCAknTimeQueryDialog*>( dlg ); |
|
1371 |
|
1372 TBool flag = testDlg->OkToExitL( EEikBidOk ); |
|
1373 STIF_ASSERT_TRUE( flag ); |
|
1374 |
|
1375 flag = testDlg->OkToExitL( KHundred ); |
|
1376 STIF_ASSERT_FALSE( flag ); |
|
1377 |
|
1378 CleanupStack::PopAndDestroy( dlg ); |
|
1379 return KErrNone; |
|
1380 } |
|
1381 |
|
1382 // ----------------------------------------------------------------------------- |
|
1383 // CTestSDKQueries::TestTimeQdlgTimeOneL |
|
1384 // ----------------------------------------------------------------------------- |
|
1385 // |
|
1386 TInt CTestSDKQueries::TestTimeQdlgTimeOneL( CStifItemParser& /*aItem*/ ) |
|
1387 { |
|
1388 TTime time( KTestTime ); |
|
1389 |
|
1390 CAknTimeQueryDialog* dlg = CAknTimeQueryDialog::NewL( time ); |
|
1391 dlg->PrepareLC( R_AKNEXQUERY_TIME_QUERY ); |
|
1392 |
|
1393 CTestCAknTimeQueryDialog* testDlg = static_cast<CTestCAknTimeQueryDialog*>( dlg ); |
|
1394 |
|
1395 TTime returnTime = testDlg->Time(); |
|
1396 STIF_ASSERT_EQUALS( time, returnTime ); |
|
1397 |
|
1398 CleanupStack::PopAndDestroy( dlg ); |
|
1399 return KErrNone; |
|
1400 } |
|
1401 |
|
1402 // ----------------------------------------------------------------------------- |
|
1403 // CTestSDKQueries::TestTimeQdlgTimeTwoL |
|
1404 // ----------------------------------------------------------------------------- |
|
1405 // |
|
1406 TInt CTestSDKQueries::TestTimeQdlgTimeTwoL( CStifItemParser& /*aItem*/ ) |
|
1407 { |
|
1408 TTime time( KTestTime ); |
|
1409 |
|
1410 CAknTimeQueryDialog* dlg = CAknTimeQueryDialog::NewL( time ); |
|
1411 dlg->PrepareLC( R_AKNEXQUERY_TIME_QUERY ); |
|
1412 |
|
1413 CTestCAknTimeQueryDialog* testDlg = static_cast<CTestCAknTimeQueryDialog*>( dlg ); |
|
1414 |
|
1415 const TTime returnTime = testDlg->Time(); |
|
1416 STIF_ASSERT_EQUALS( time, returnTime ); |
|
1417 |
|
1418 CleanupStack::PopAndDestroy( dlg ); |
|
1419 return KErrNone; |
|
1420 } |
|
1421 |
|
1422 // ----------------------------------------------------------------------------- |
|
1423 // CTestSDKQueries::TestTimeQdlgConstructorLL |
|
1424 // ----------------------------------------------------------------------------- |
|
1425 // |
|
1426 TInt CTestSDKQueries::TestTimeQdlgConstructorLL( CStifItemParser& /*aItem*/ ) |
|
1427 { |
|
1428 TTime time( KTestTime ); |
|
1429 TBuf< KBufSize > prompt( KTestString ); |
|
1430 |
|
1431 CAknTimeQueryDialog* dlg = new( ELeave ) CAknTimeQueryDialog( time, prompt ); |
|
1432 CleanupStack::PushL( dlg ); |
|
1433 |
|
1434 STIF_ASSERT_NOT_NULL( dlg ); |
|
1435 |
|
1436 CleanupStack::PopAndDestroy( dlg ); |
|
1437 return KErrNone; |
|
1438 } |
|
1439 |
|
1440 // ----------------------------------------------------------------------------- |
|
1441 // CTestSDKQueries::TestDurationNewL |
|
1442 // ----------------------------------------------------------------------------- |
|
1443 // |
|
1444 TInt CTestSDKQueries::TestDurationNewL( CStifItemParser& /*aItem*/ ) |
|
1445 { |
|
1446 TTimeIntervalSeconds duration; |
|
1447 |
|
1448 CAknDurationQueryDialog* durationDlg = CAknDurationQueryDialog::NewL( duration ); |
|
1449 CleanupStack::PushL( durationDlg ); |
|
1450 |
|
1451 STIF_ASSERT_NOT_NULL( durationDlg ); |
|
1452 |
|
1453 CleanupStack::PopAndDestroy( durationDlg ); |
|
1454 return KErrNone; |
|
1455 } |
|
1456 |
|
1457 // ----------------------------------------------------------------------------- |
|
1458 // CTestSDKQueries::TestDurationConstructorL |
|
1459 // ----------------------------------------------------------------------------- |
|
1460 // |
|
1461 TInt CTestSDKQueries::TestDurationConstructorL( CStifItemParser& /*aItem*/ ) |
|
1462 { |
|
1463 TTimeIntervalSeconds duration; |
|
1464 |
|
1465 CAknDurationQueryDialog* durationDlg = new( ELeave ) CAknDurationQueryDialog( duration ); |
|
1466 CleanupStack::PushL( durationDlg ); |
|
1467 |
|
1468 STIF_ASSERT_NOT_NULL( durationDlg ); |
|
1469 |
|
1470 CleanupStack::PopAndDestroy( durationDlg ); |
|
1471 return KErrNone; |
|
1472 } |
|
1473 |
|
1474 // ----------------------------------------------------------------------------- |
|
1475 // CTestSDKQueries::TestDurationDestructorL |
|
1476 // ----------------------------------------------------------------------------- |
|
1477 // |
|
1478 TInt CTestSDKQueries::TestDurationDestructorL( CStifItemParser& /*aItem*/ ) |
|
1479 { |
|
1480 TTimeIntervalSeconds duration; |
|
1481 |
|
1482 CAknDurationQueryDialog* durationDlg = CAknDurationQueryDialog::NewL( duration ); |
|
1483 delete durationDlg; |
|
1484 return KErrNone; |
|
1485 } |
|
1486 |
|
1487 // ----------------------------------------------------------------------------- |
|
1488 // CTestSDKQueries::TestDurationSetMinimumAndMaximumL |
|
1489 // ----------------------------------------------------------------------------- |
|
1490 // |
|
1491 TInt CTestSDKQueries::TestDurationSetMinimumAndMaximumL( CStifItemParser& /*aItem*/ ) |
|
1492 { |
|
1493 TTimeIntervalSeconds duration; |
|
1494 |
|
1495 CAknDurationQueryDialog* durationDlg = new( ELeave ) CAknDurationQueryDialog( duration ); |
|
1496 durationDlg->PrepareLC( R_AKNEXQUERY_DURATION_LAYOUT ); |
|
1497 |
|
1498 TTimeIntervalSeconds minDuration( KZero ); |
|
1499 TTimeIntervalSeconds maxDuration( KHundred ); |
|
1500 |
|
1501 durationDlg->SetMinimumAndMaximum( minDuration, maxDuration ); |
|
1502 |
|
1503 CleanupStack::PopAndDestroy( durationDlg ); |
|
1504 return KErrNone; |
|
1505 } |
|
1506 |
|
1507 // ----------------------------------------------------------------------------- |
|
1508 // CTestSDKQueries::TestDurationHandlePointerEventL |
|
1509 // ----------------------------------------------------------------------------- |
|
1510 // |
|
1511 TInt CTestSDKQueries::TestDurationHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
1512 { |
|
1513 TTimeIntervalSeconds duration; |
|
1514 |
|
1515 CAknDurationQueryDialog* dlg = new( ELeave ) CAknDurationQueryDialog( duration ); |
|
1516 dlg->PrepareLC( R_AKNEXQUERY_DURATION_LAYOUT ); |
|
1517 |
|
1518 TPointerEvent event; |
|
1519 event.iType = TPointerEvent::EButton1Down; |
|
1520 event.iModifiers = KZero; |
|
1521 TPoint eventPos( 10, 30 ); |
|
1522 event.iPosition = eventPos; |
|
1523 event.iParentPosition = eventPos; |
|
1524 TInt err = KErrNone; |
|
1525 TRAP( err, dlg->HandlePointerEventL( event ) ); |
|
1526 |
|
1527 CleanupStack::PopAndDestroy( dlg ); |
|
1528 return KErrNone; |
|
1529 } |
|
1530 |
|
1531 // ----------------------------------------------------------------------------- |
|
1532 // CTestSDKQueries::TestDurationPreLayoutDynInitL |
|
1533 // ----------------------------------------------------------------------------- |
|
1534 // |
|
1535 TInt CTestSDKQueries::TestDurationPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
1536 { |
|
1537 TTimeIntervalSeconds duration( KOne ); |
|
1538 |
|
1539 CAknDurationQueryDialog* dlg = new( ELeave ) CAknDurationQueryDialog( duration ); |
|
1540 dlg->PrepareLC( R_AKNEXQUERY_DURATION_LAYOUT ); |
|
1541 |
|
1542 CTestCAknDurationQueryDialog* testDlg = static_cast<CTestCAknDurationQueryDialog*>( dlg ); |
|
1543 |
|
1544 testDlg->PreLayoutDynInitL(); |
|
1545 |
|
1546 CleanupStack::PopAndDestroy( dlg ); |
|
1547 return KErrNone; |
|
1548 } |
|
1549 |
|
1550 // ----------------------------------------------------------------------------- |
|
1551 // CTestSDKQueries::TestDurationOkToExitL |
|
1552 // ----------------------------------------------------------------------------- |
|
1553 // |
|
1554 TInt CTestSDKQueries::TestDurationOkToExitL( CStifItemParser& /*aItem*/ ) |
|
1555 { |
|
1556 TTimeIntervalSeconds duration; |
|
1557 |
|
1558 CAknDurationQueryDialog* dlg = new( ELeave ) CAknDurationQueryDialog( duration ); |
|
1559 dlg->PrepareLC( R_AKNEXQUERY_DURATION_LAYOUT ); |
|
1560 |
|
1561 CTestCAknDurationQueryDialog* testDlg = static_cast<CTestCAknDurationQueryDialog*>( dlg ); |
|
1562 |
|
1563 TBool flag = testDlg->OkToExitL( EEikBidOk ); |
|
1564 STIF_ASSERT_TRUE( flag ); |
|
1565 |
|
1566 flag = testDlg->OkToExitL( KHundred ); |
|
1567 STIF_ASSERT_FALSE( flag ); |
|
1568 |
|
1569 CleanupStack::PopAndDestroy( dlg ); |
|
1570 return KErrNone; |
|
1571 } |
|
1572 |
|
1573 // ----------------------------------------------------------------------------- |
|
1574 // CTestSDKQueries::TestDurationDurationOneL |
|
1575 // ----------------------------------------------------------------------------- |
|
1576 // |
|
1577 TInt CTestSDKQueries::TestDurationDurationOneL( CStifItemParser& /*aItem*/ ) |
|
1578 { |
|
1579 TTimeIntervalSeconds duration( KOne ); |
|
1580 |
|
1581 CAknDurationQueryDialog* dlg = new( ELeave ) CAknDurationQueryDialog( duration ); |
|
1582 dlg->PrepareLC( R_AKNEXQUERY_DURATION_LAYOUT ); |
|
1583 |
|
1584 CTestCAknDurationQueryDialog* testDlg = static_cast<CTestCAknDurationQueryDialog*>( dlg ); |
|
1585 |
|
1586 TTimeIntervalSeconds& returnDuration = testDlg->Duration(); |
|
1587 STIF_ASSERT_EQUALS( duration, returnDuration ); |
|
1588 |
|
1589 CleanupStack::PopAndDestroy( dlg ); |
|
1590 return KErrNone; |
|
1591 } |
|
1592 |
|
1593 // ----------------------------------------------------------------------------- |
|
1594 // CTestSDKQueries::TestDurationDurationTwoL |
|
1595 // ----------------------------------------------------------------------------- |
|
1596 // |
|
1597 TInt CTestSDKQueries::TestDurationDurationTwoL( CStifItemParser& /*aItem*/ ) |
|
1598 { |
|
1599 TTimeIntervalSeconds duration( KOne ); |
|
1600 |
|
1601 CAknDurationQueryDialog* dlg = new( ELeave ) CAknDurationQueryDialog( duration ); |
|
1602 dlg->PrepareLC( R_AKNEXQUERY_DURATION_LAYOUT ); |
|
1603 |
|
1604 CTestCAknDurationQueryDialog* testDlg = static_cast<CTestCAknDurationQueryDialog*>( dlg ); |
|
1605 |
|
1606 const TTimeIntervalSeconds& returnDuration = testDlg->Duration(); |
|
1607 STIF_ASSERT_EQUALS( duration, returnDuration ); |
|
1608 |
|
1609 CleanupStack::PopAndDestroy( dlg ); |
|
1610 return KErrNone; |
|
1611 } |
|
1612 |
|
1613 // ----------------------------------------------------------------------------- |
|
1614 // CTestSDKQueries::TestFloatingQdlgNewL |
|
1615 // ----------------------------------------------------------------------------- |
|
1616 // |
|
1617 TInt CTestSDKQueries::TestFloatingQdlgNewL( CStifItemParser& /*aItem*/ ) |
|
1618 { |
|
1619 TReal value = KRealvalue; |
|
1620 |
|
1621 CAknFloatingPointQueryDialog* dlg = CAknFloatingPointQueryDialog::NewL( value ); |
|
1622 CleanupStack::PushL( dlg ); |
|
1623 |
|
1624 STIF_ASSERT_NOT_NULL( dlg ); |
|
1625 |
|
1626 CleanupStack::PopAndDestroy( dlg ); |
|
1627 return KErrNone; |
|
1628 } |
|
1629 |
|
1630 // ----------------------------------------------------------------------------- |
|
1631 // CTestSDKQueries::TestFloatingQdlgConstructorL |
|
1632 // ----------------------------------------------------------------------------- |
|
1633 // |
|
1634 TInt CTestSDKQueries::TestFloatingQdlgConstructorL( CStifItemParser& /*aItem*/ ) |
|
1635 { |
|
1636 TReal value = KRealvalue; |
|
1637 |
|
1638 CAknFloatingPointQueryDialog* dlg = new( ELeave ) CAknFloatingPointQueryDialog( value ); |
|
1639 CleanupStack::PushL( dlg ); |
|
1640 |
|
1641 STIF_ASSERT_NOT_NULL( dlg ); |
|
1642 |
|
1643 CleanupStack::PopAndDestroy( dlg ); |
|
1644 return KErrNone; |
|
1645 } |
|
1646 |
|
1647 // ----------------------------------------------------------------------------- |
|
1648 // CTestSDKQueries::TestFloatingQdlgDestructorL |
|
1649 // ----------------------------------------------------------------------------- |
|
1650 // |
|
1651 TInt CTestSDKQueries::TestFloatingQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
1652 { |
|
1653 TReal value = KRealvalue; |
|
1654 |
|
1655 CAknFloatingPointQueryDialog* dlg = new( ELeave ) CAknFloatingPointQueryDialog( value ); |
|
1656 delete dlg; |
|
1657 |
|
1658 return KErrNone; |
|
1659 } |
|
1660 |
|
1661 // ----------------------------------------------------------------------------- |
|
1662 // CTestSDKQueries::TestFloatingQdlgSetMinimumAndMaximumL |
|
1663 // ----------------------------------------------------------------------------- |
|
1664 // |
|
1665 TInt CTestSDKQueries::TestFloatingQdlgSetMinimumAndMaximumL( CStifItemParser& /*aItem*/ ) |
|
1666 { |
|
1667 TReal value = KRealvalue; |
|
1668 |
|
1669 CAknFloatingPointQueryDialog* dlg = CAknFloatingPointQueryDialog::NewL( value ); |
|
1670 dlg->PrepareLC( R_DEMO_FLOATING_QUERY ); |
|
1671 |
|
1672 TReal maxValue = KMaxRealvalue; |
|
1673 |
|
1674 dlg->SetMinimumAndMaximum( value, maxValue ); |
|
1675 |
|
1676 CleanupStack::PopAndDestroy( dlg ); |
|
1677 return KErrNone; |
|
1678 } |
|
1679 |
|
1680 // ----------------------------------------------------------------------------- |
|
1681 // CTestSDKQueries::TestFloatingQdlgHandlePointerEventL |
|
1682 // ----------------------------------------------------------------------------- |
|
1683 // |
|
1684 TInt CTestSDKQueries::TestFloatingQdlgHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
1685 { |
|
1686 TReal value = KRealvalue; |
|
1687 |
|
1688 CAknFloatingPointQueryDialog* dlg = CAknFloatingPointQueryDialog::NewL( value ); |
|
1689 dlg->PrepareLC( R_DEMO_FLOATING_QUERY ); |
|
1690 |
|
1691 TPointerEvent event; |
|
1692 event.iType = TPointerEvent::EButton1Down; |
|
1693 event.iModifiers = KZero; |
|
1694 TPoint eventPos( 10, 30 ); |
|
1695 event.iPosition = eventPos; |
|
1696 event.iParentPosition = eventPos; |
|
1697 TInt err = KErrNone; |
|
1698 TRAP( err, dlg->HandlePointerEventL( event ) ); |
|
1699 |
|
1700 CleanupStack::PopAndDestroy( dlg ); |
|
1701 return KErrNone; |
|
1702 } |
|
1703 |
|
1704 // ----------------------------------------------------------------------------- |
|
1705 // CTestSDKQueries::TestFloatingQdlgPreLayoutDynInitL |
|
1706 // ----------------------------------------------------------------------------- |
|
1707 // |
|
1708 TInt CTestSDKQueries::TestFloatingQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
1709 { |
|
1710 TReal value = KRealvalue; |
|
1711 |
|
1712 CAknFloatingPointQueryDialog* dlg = CAknFloatingPointQueryDialog::NewL( value ); |
|
1713 dlg->PrepareLC( R_DEMO_FLOATING_QUERY ); |
|
1714 |
|
1715 CTestCAknFloatingPointQueryDialog* testDlg = static_cast<CTestCAknFloatingPointQueryDialog*>( dlg ); |
|
1716 |
|
1717 testDlg->PreLayoutDynInitL(); |
|
1718 |
|
1719 CleanupStack::PopAndDestroy( dlg ); |
|
1720 return KErrNone; |
|
1721 } |
|
1722 |
|
1723 // ----------------------------------------------------------------------------- |
|
1724 // CTestSDKQueries::TestFloatingQdlgOkToExitL |
|
1725 // ----------------------------------------------------------------------------- |
|
1726 // |
|
1727 TInt CTestSDKQueries::TestFloatingQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
1728 { |
|
1729 TReal value = KRealvalue; |
|
1730 |
|
1731 CAknFloatingPointQueryDialog* dlg = CAknFloatingPointQueryDialog::NewL( value ); |
|
1732 dlg->PrepareLC( R_DEMO_FLOATING_QUERY ); |
|
1733 |
|
1734 CTestCAknFloatingPointQueryDialog* testDlg = static_cast<CTestCAknFloatingPointQueryDialog*>( dlg ); |
|
1735 |
|
1736 TBool flag = testDlg->OkToExitL( EEikBidOk ); |
|
1737 STIF_ASSERT_TRUE( flag ); |
|
1738 |
|
1739 flag = testDlg->OkToExitL( KHundred ); |
|
1740 STIF_ASSERT_FALSE( flag ); |
|
1741 |
|
1742 CleanupStack::PopAndDestroy( dlg ); |
|
1743 return KErrNone; |
|
1744 } |
|
1745 |
|
1746 // ----------------------------------------------------------------------------- |
|
1747 // CTestSDKQueries::TestFloatingQdlgNumberOneL |
|
1748 // ----------------------------------------------------------------------------- |
|
1749 // |
|
1750 TInt CTestSDKQueries::TestFloatingQdlgNumberOneL( CStifItemParser& /*aItem*/ ) |
|
1751 { |
|
1752 TReal value = KRealvalue; |
|
1753 |
|
1754 CAknFloatingPointQueryDialog* dlg = CAknFloatingPointQueryDialog::NewL( value ); |
|
1755 dlg->PrepareLC( R_DEMO_FLOATING_QUERY ); |
|
1756 |
|
1757 CTestCAknFloatingPointQueryDialog* testDlg = static_cast<CTestCAknFloatingPointQueryDialog*>( dlg ); |
|
1758 |
|
1759 TReal returnValue = testDlg->Number(); |
|
1760 STIF_ASSERT_EQUALS( value, returnValue ); |
|
1761 |
|
1762 CleanupStack::PopAndDestroy( dlg ); |
|
1763 return KErrNone; |
|
1764 } |
|
1765 |
|
1766 // ----------------------------------------------------------------------------- |
|
1767 // CTestSDKQueries::TestFloatingQdlgNumberTwoL |
|
1768 // ----------------------------------------------------------------------------- |
|
1769 // |
|
1770 TInt CTestSDKQueries::TestFloatingQdlgNumberTwoL( CStifItemParser& /*aItem*/ ) |
|
1771 { |
|
1772 TReal value = KRealvalue; |
|
1773 |
|
1774 CAknFloatingPointQueryDialog* dlg = CAknFloatingPointQueryDialog::NewL( value ); |
|
1775 dlg->PrepareLC( R_DEMO_FLOATING_QUERY ); |
|
1776 |
|
1777 CTestCAknFloatingPointQueryDialog* testDlg = static_cast<CTestCAknFloatingPointQueryDialog*>( dlg ); |
|
1778 |
|
1779 const TReal returnValue = testDlg->Number(); |
|
1780 STIF_ASSERT_EQUALS( value, returnValue ); |
|
1781 |
|
1782 CleanupStack::PopAndDestroy( dlg ); |
|
1783 return KErrNone; |
|
1784 } |
|
1785 |
|
1786 // ----------------------------------------------------------------------------- |
|
1787 // CTestSDKQueries::TestMultiLineDataQdlgNewLOneL |
|
1788 // ----------------------------------------------------------------------------- |
|
1789 // |
|
1790 TInt CTestSDKQueries::TestMultiLineDataQdlgNewLOneL( CStifItemParser& /*aItem*/ ) |
|
1791 { |
|
1792 TTime time1( KTestTime ); |
|
1793 TTime time2( KTestMinTime ); |
|
1794 |
|
1795 CAknMultiLineDataQueryDialog* dlg = |
|
1796 CAknMultiLineDataQueryDialog::NewL( time1, time2 ); |
|
1797 CleanupStack::PushL( dlg ); |
|
1798 |
|
1799 STIF_ASSERT_NOT_NULL( dlg ); |
|
1800 |
|
1801 CleanupStack::PopAndDestroy( dlg ); |
|
1802 return KErrNone; |
|
1803 } |
|
1804 |
|
1805 // ----------------------------------------------------------------------------- |
|
1806 // CTestSDKQueries::TestMultiLineDataQdlgNewLTwoL |
|
1807 // ----------------------------------------------------------------------------- |
|
1808 // |
|
1809 TInt CTestSDKQueries::TestMultiLineDataQdlgNewLTwoL( CStifItemParser& /*aItem*/ ) |
|
1810 { |
|
1811 TBuf< KBufSize > text1( KTestString ); |
|
1812 TBuf< KBufSize > text2( KTestStringReplace ); |
|
1813 |
|
1814 CAknMultiLineDataQueryDialog* dlg = |
|
1815 CAknMultiLineDataQueryDialog::NewL( text1, text2 ); |
|
1816 CleanupStack::PushL( dlg ); |
|
1817 |
|
1818 STIF_ASSERT_NOT_NULL( dlg ); |
|
1819 |
|
1820 CleanupStack::PopAndDestroy( dlg ); |
|
1821 return KErrNone; |
|
1822 } |
|
1823 |
|
1824 // ----------------------------------------------------------------------------- |
|
1825 // CTestSDKQueries::TestMultiLineDataQdlgNewLThreeL |
|
1826 // ----------------------------------------------------------------------------- |
|
1827 // |
|
1828 TInt CTestSDKQueries::TestMultiLineDataQdlgNewLThreeL( CStifItemParser& /*aItem*/ ) |
|
1829 { |
|
1830 TBuf< KBufSize > text( KTestString ); |
|
1831 TTime time( KTestTime ); |
|
1832 |
|
1833 CAknMultiLineDataQueryDialog* dlg = |
|
1834 CAknMultiLineDataQueryDialog::NewL( text, time ); |
|
1835 CleanupStack::PushL( dlg ); |
|
1836 |
|
1837 STIF_ASSERT_NOT_NULL( dlg ); |
|
1838 |
|
1839 CleanupStack::PopAndDestroy( dlg ); |
|
1840 return KErrNone; |
|
1841 } |
|
1842 |
|
1843 // ----------------------------------------------------------------------------- |
|
1844 // CTestSDKQueries::TestMultiLineDataQdlgNewLFourL |
|
1845 // ----------------------------------------------------------------------------- |
|
1846 // |
|
1847 TInt CTestSDKQueries::TestMultiLineDataQdlgNewLFourL( CStifItemParser& /*aItem*/ ) |
|
1848 { |
|
1849 TBuf< KBufSize > text( KTestString ); |
|
1850 TInt number = KTen; |
|
1851 |
|
1852 CAknMultiLineDataQueryDialog* dlg = |
|
1853 CAknMultiLineDataQueryDialog::NewL( text, number ); |
|
1854 CleanupStack::PushL( dlg ); |
|
1855 |
|
1856 STIF_ASSERT_NOT_NULL( dlg ); |
|
1857 |
|
1858 CleanupStack::PopAndDestroy( dlg ); |
|
1859 return KErrNone; |
|
1860 } |
|
1861 |
|
1862 // ----------------------------------------------------------------------------- |
|
1863 // CTestSDKQueries::TestMultiLineDataQdlgNewLFiveL |
|
1864 // ----------------------------------------------------------------------------- |
|
1865 // |
|
1866 TInt CTestSDKQueries::TestMultiLineDataQdlgNewLFiveL( CStifItemParser& /*aItem*/ ) |
|
1867 { |
|
1868 TBuf< KBufSize > text( KTestString ); |
|
1869 TTimeIntervalSeconds duration( KOne ); |
|
1870 |
|
1871 CAknMultiLineDataQueryDialog* dlg = |
|
1872 CAknMultiLineDataQueryDialog::NewL( text, duration ); |
|
1873 CleanupStack::PushL( dlg ); |
|
1874 |
|
1875 STIF_ASSERT_NOT_NULL( dlg ); |
|
1876 |
|
1877 CleanupStack::PopAndDestroy( dlg ); |
|
1878 return KErrNone; |
|
1879 } |
|
1880 |
|
1881 // ----------------------------------------------------------------------------- |
|
1882 // CTestSDKQueries::TestMultiLineDataQdlgNewLSixL |
|
1883 // ----------------------------------------------------------------------------- |
|
1884 // |
|
1885 TInt CTestSDKQueries::TestMultiLineDataQdlgNewLSixL( CStifItemParser& /*aItem*/ ) |
|
1886 { |
|
1887 TTime time( KTestTime ); |
|
1888 TTimeIntervalSeconds duration( KOne ); |
|
1889 |
|
1890 CAknMultiLineDataQueryDialog* dlg = |
|
1891 CAknMultiLineDataQueryDialog::NewL( time, duration ); |
|
1892 CleanupStack::PushL( dlg ); |
|
1893 |
|
1894 STIF_ASSERT_NOT_NULL( dlg ); |
|
1895 |
|
1896 CleanupStack::PopAndDestroy( dlg ); |
|
1897 return KErrNone; |
|
1898 } |
|
1899 |
|
1900 // ----------------------------------------------------------------------------- |
|
1901 // CTestSDKQueries::TestMultiLineDataQdlgNewLSevenL |
|
1902 // ----------------------------------------------------------------------------- |
|
1903 // |
|
1904 TInt CTestSDKQueries::TestMultiLineDataQdlgNewLSevenL( CStifItemParser& /*aItem*/ ) |
|
1905 { |
|
1906 TInt number1 = KZero; |
|
1907 TInt number2 = KTen; |
|
1908 |
|
1909 CAknMultiLineDataQueryDialog* dlg = |
|
1910 CAknMultiLineDataQueryDialog::NewL( number1, number2 ); |
|
1911 CleanupStack::PushL( dlg ); |
|
1912 |
|
1913 STIF_ASSERT_NOT_NULL( dlg ); |
|
1914 |
|
1915 CleanupStack::PopAndDestroy( dlg ); |
|
1916 return KErrNone; |
|
1917 } |
|
1918 |
|
1919 // ----------------------------------------------------------------------------- |
|
1920 // CTestSDKQueries::TestMultiLineDataQdlgNewLEightL |
|
1921 // ----------------------------------------------------------------------------- |
|
1922 // |
|
1923 TInt CTestSDKQueries::TestMultiLineDataQdlgNewLEightL( CStifItemParser& /*aItem*/ ) |
|
1924 { |
|
1925 TTime time( KTestTime ); |
|
1926 TCoordinate coord( 01.00, 01.0 ); |
|
1927 TLocality loc( coord, 0.1 ); |
|
1928 TPosition position( loc, time ); |
|
1929 |
|
1930 CAknMultiLineDataQueryDialog* dlg = |
|
1931 CAknMultiLineDataQueryDialog::NewL( position ); |
|
1932 CleanupStack::PushL( dlg ); |
|
1933 |
|
1934 STIF_ASSERT_NOT_NULL( dlg ); |
|
1935 |
|
1936 CleanupStack::PopAndDestroy( dlg ); |
|
1937 return KErrNone; |
|
1938 } |
|
1939 |
|
1940 // ----------------------------------------------------------------------------- |
|
1941 // CTestSDKQueries::TestMultiLineDataQdlgDestructorL |
|
1942 // ----------------------------------------------------------------------------- |
|
1943 // |
|
1944 TInt CTestSDKQueries::TestMultiLineDataQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
1945 { |
|
1946 TTime time( KTestTime ); |
|
1947 TCoordinate coord( 01.00, 01.0 ); |
|
1948 TLocality loc( coord, 0.1 ); |
|
1949 TPosition position( loc, time ); |
|
1950 |
|
1951 CAknMultiLineDataQueryDialog* dlg = |
|
1952 CAknMultiLineDataQueryDialog::NewL( position ); |
|
1953 delete dlg; |
|
1954 |
|
1955 return KErrNone; |
|
1956 } |
|
1957 |
|
1958 // ----------------------------------------------------------------------------- |
|
1959 // CTestSDKQueries::TestMultiLineDataQdlgConstructorOneL |
|
1960 // ----------------------------------------------------------------------------- |
|
1961 // |
|
1962 TInt CTestSDKQueries::TestMultiLineDataQdlgConstructorOneL( CStifItemParser& /*aItem*/ ) |
|
1963 { |
|
1964 CTestCAknMultiLineDataQueryDialog* dlg = |
|
1965 new( ELeave ) CTestCAknMultiLineDataQueryDialog( CAknQueryDialog::ENoTone ); |
|
1966 CleanupStack::PushL( dlg ); |
|
1967 |
|
1968 STIF_ASSERT_NOT_NULL( dlg ); |
|
1969 |
|
1970 CleanupStack::PopAndDestroy( dlg ); |
|
1971 return KErrNone; |
|
1972 } |
|
1973 |
|
1974 // ----------------------------------------------------------------------------- |
|
1975 // CTestSDKQueries::TestMultiLineDataQdlgSetPromptL |
|
1976 // ----------------------------------------------------------------------------- |
|
1977 // |
|
1978 TInt CTestSDKQueries::TestMultiLineDataQdlgSetPromptL( CStifItemParser& /*aItem*/ ) |
|
1979 { |
|
1980 TBuf< KBufSize > message( KTestString ); |
|
1981 TTime topDateTime; |
|
1982 topDateTime.Set( message ); |
|
1983 topDateTime.HomeTime(); |
|
1984 TTimeIntervalSeconds bottomDuration = KHundred; |
|
1985 |
|
1986 CAknMultiLineDataQueryDialog* dlg = |
|
1987 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
1988 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
1989 |
|
1990 TBuf< KBufSize > secondPrompt( KTestStringReplace ); |
|
1991 |
|
1992 dlg->SetPromptL( message, secondPrompt ); |
|
1993 |
|
1994 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
1995 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
1996 |
|
1997 TPtrC returnPrompt = testDlg->SecondPrompt(); |
|
1998 STIF_ASSERT_EQUALS( ( TPtrC )secondPrompt, returnPrompt ); |
|
1999 |
|
2000 CleanupStack::PopAndDestroy( dlg ); |
|
2001 return KErrNone; |
|
2002 } |
|
2003 |
|
2004 // ----------------------------------------------------------------------------- |
|
2005 // CTestSDKQueries::TestMultiLineDataQdlgSetMaxLengthOfFirstEditorL |
|
2006 // ----------------------------------------------------------------------------- |
|
2007 // |
|
2008 TInt CTestSDKQueries::TestMultiLineDataQdlgSetMaxLengthOfFirstEditorL( CStifItemParser& /*aItem*/ ) |
|
2009 { |
|
2010 TBuf< KBufSize > message( KTestString ); |
|
2011 TTime topDateTime; |
|
2012 topDateTime.Set( message ); |
|
2013 topDateTime.HomeTime(); |
|
2014 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2015 |
|
2016 CAknMultiLineDataQueryDialog* dlg = |
|
2017 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2018 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2019 |
|
2020 dlg->SetMaxLengthOfFirstEditor( KHundred ); |
|
2021 |
|
2022 CleanupStack::PopAndDestroy( dlg ); |
|
2023 return KErrNone; |
|
2024 } |
|
2025 |
|
2026 // ----------------------------------------------------------------------------- |
|
2027 // CTestSDKQueries::TestMultiLineDataQdlgSetMaxLengthOfSecondEditorL |
|
2028 // ----------------------------------------------------------------------------- |
|
2029 // |
|
2030 TInt CTestSDKQueries::TestMultiLineDataQdlgSetMaxLengthOfSecondEditorL( CStifItemParser& /*aItem*/ ) |
|
2031 { |
|
2032 TBuf< KBufSize > message( KTestString ); |
|
2033 TTime topDateTime; |
|
2034 topDateTime.Set( message ); |
|
2035 topDateTime.HomeTime(); |
|
2036 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2037 |
|
2038 CAknMultiLineDataQueryDialog* dlg = |
|
2039 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2040 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2041 |
|
2042 dlg->SetMaxLengthOfSecondEditor( KHundred ); |
|
2043 |
|
2044 CleanupStack::PopAndDestroy( dlg ); |
|
2045 return KErrNone; |
|
2046 } |
|
2047 |
|
2048 // ----------------------------------------------------------------------------- |
|
2049 // CTestSDKQueries::TestMultiLineDataQdlgHandlePointerEventL |
|
2050 // ----------------------------------------------------------------------------- |
|
2051 // |
|
2052 TInt CTestSDKQueries::TestMultiLineDataQdlgHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
2053 { |
|
2054 TBuf< KBufSize > message( KTestString ); |
|
2055 TTime topDateTime; |
|
2056 topDateTime.Set( message ); |
|
2057 topDateTime.HomeTime(); |
|
2058 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2059 |
|
2060 CAknMultiLineDataQueryDialog* dlg = |
|
2061 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2062 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2063 |
|
2064 TPointerEvent event; |
|
2065 event.iType = TPointerEvent::EButton1Down; |
|
2066 event.iModifiers = KZero; |
|
2067 TPoint eventPos( 10, 30 ); |
|
2068 event.iPosition = eventPos; |
|
2069 event.iParentPosition = eventPos; |
|
2070 TInt err = KErrNone; |
|
2071 TRAP( err, dlg->HandlePointerEventL( event ) ); |
|
2072 |
|
2073 CleanupStack::PopAndDestroy( dlg ); |
|
2074 return KErrNone; |
|
2075 } |
|
2076 |
|
2077 // ----------------------------------------------------------------------------- |
|
2078 // CTestSDKQueries::TestMultiLineDataQdlgOkToExitL |
|
2079 // ----------------------------------------------------------------------------- |
|
2080 // |
|
2081 TInt CTestSDKQueries::TestMultiLineDataQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
2082 { |
|
2083 TBuf< KBufSize > message( KTestString ); |
|
2084 TTime topDateTime; |
|
2085 topDateTime.Set( message ); |
|
2086 topDateTime.HomeTime(); |
|
2087 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2088 |
|
2089 CAknMultiLineDataQueryDialog* dlg = |
|
2090 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2091 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2092 |
|
2093 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2094 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2095 |
|
2096 TBool flag = testDlg->OkToExitL( EEikBidOk ); |
|
2097 STIF_ASSERT_TRUE( flag ); |
|
2098 |
|
2099 flag = testDlg->OkToExitL( KHundred ); |
|
2100 STIF_ASSERT_FALSE( flag ); |
|
2101 |
|
2102 CleanupStack::PopAndDestroy( dlg ); |
|
2103 return KErrNone; |
|
2104 } |
|
2105 |
|
2106 // ----------------------------------------------------------------------------- |
|
2107 // CTestSDKQueries::TestMultiLineDataQdlgPreLayoutDynInitL |
|
2108 // ----------------------------------------------------------------------------- |
|
2109 // |
|
2110 TInt CTestSDKQueries::TestMultiLineDataQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
2111 { |
|
2112 TBuf< KBufSize > message( KTestString ); |
|
2113 TTime topDateTime; |
|
2114 topDateTime.Set( message ); |
|
2115 topDateTime.HomeTime(); |
|
2116 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2117 |
|
2118 CAknMultiLineDataQueryDialog* dlg = |
|
2119 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2120 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2121 |
|
2122 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2123 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2124 |
|
2125 testDlg->PreLayoutDynInitL(); |
|
2126 |
|
2127 CleanupStack::PopAndDestroy( dlg ); |
|
2128 return KErrNone; |
|
2129 } |
|
2130 |
|
2131 // ----------------------------------------------------------------------------- |
|
2132 // CTestSDKQueries::TestMultiLineDataQdlgHandleResourceChangeL |
|
2133 // ----------------------------------------------------------------------------- |
|
2134 // |
|
2135 TInt CTestSDKQueries::TestMultiLineDataQdlgHandleResourceChangeL( CStifItemParser& /*aItem*/ ) |
|
2136 { |
|
2137 TBuf< KBufSize > message( KTestString ); |
|
2138 TTime topDateTime; |
|
2139 topDateTime.Set( message ); |
|
2140 topDateTime.HomeTime(); |
|
2141 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2142 |
|
2143 CAknMultiLineDataQueryDialog* dlg = |
|
2144 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2145 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2146 |
|
2147 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2148 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2149 |
|
2150 testDlg->HandleResourceChange( KEikDynamicLayoutVariantSwitch ); |
|
2151 |
|
2152 CleanupStack::PopAndDestroy( dlg ); |
|
2153 return KErrNone; |
|
2154 } |
|
2155 |
|
2156 // ----------------------------------------------------------------------------- |
|
2157 // CTestSDKQueries::TestMultiLineDataQdlgUpdateLeftSoftKeyL |
|
2158 // ----------------------------------------------------------------------------- |
|
2159 // |
|
2160 TInt CTestSDKQueries::TestMultiLineDataQdlgUpdateLeftSoftKeyL( CStifItemParser& /*aItem*/ ) |
|
2161 { |
|
2162 TBuf< KBufSize > message( KTestString ); |
|
2163 TTime topDateTime; |
|
2164 topDateTime.Set( message ); |
|
2165 topDateTime.HomeTime(); |
|
2166 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2167 |
|
2168 CAknMultiLineDataQueryDialog* dlg = |
|
2169 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2170 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2171 |
|
2172 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2173 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2174 |
|
2175 testDlg->UpdateLeftSoftKeyL(); |
|
2176 |
|
2177 CleanupStack::PopAndDestroy( dlg ); |
|
2178 return KErrNone; |
|
2179 } |
|
2180 |
|
2181 // ----------------------------------------------------------------------------- |
|
2182 // CTestSDKQueries::TestMultiLineDataQdlgDoSetPromptL |
|
2183 // ----------------------------------------------------------------------------- |
|
2184 // |
|
2185 TInt CTestSDKQueries::TestMultiLineDataQdlgDoSetPromptL( CStifItemParser& /*aItem*/ ) |
|
2186 { |
|
2187 TBuf< KBufSize > message( KTestString ); |
|
2188 TTime topDateTime; |
|
2189 topDateTime.Set( message ); |
|
2190 topDateTime.HomeTime(); |
|
2191 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2192 |
|
2193 CAknMultiLineDataQueryDialog* dlg = |
|
2194 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2195 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2196 |
|
2197 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2198 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2199 |
|
2200 testDlg->DoSetPromptL(); |
|
2201 |
|
2202 CleanupStack::PopAndDestroy( dlg ); |
|
2203 return KErrNone; |
|
2204 } |
|
2205 |
|
2206 // ----------------------------------------------------------------------------- |
|
2207 // CTestSDKQueries::TestMultiLineDataQdlgNeedToDismissQueryL |
|
2208 // ----------------------------------------------------------------------------- |
|
2209 // |
|
2210 TInt CTestSDKQueries::TestMultiLineDataQdlgNeedToDismissQueryL( CStifItemParser& /*aItem*/ ) |
|
2211 { |
|
2212 TBuf< KBufSize > message( KTestString ); |
|
2213 TTime topDateTime; |
|
2214 topDateTime.Set( message ); |
|
2215 topDateTime.HomeTime(); |
|
2216 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2217 |
|
2218 CAknMultiLineDataQueryDialog* dlg = |
|
2219 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2220 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2221 |
|
2222 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2223 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2224 |
|
2225 TKeyEvent event; |
|
2226 event.iScanCode = EStdKeyHash; |
|
2227 event.iCode = EKeyTab; |
|
2228 |
|
2229 TBool flag = testDlg->NeedToDismissQueryL( event ); |
|
2230 STIF_ASSERT_FALSE( flag ); |
|
2231 |
|
2232 event.iScanCode = EStdKeySquareBracketLeft; |
|
2233 |
|
2234 flag = testDlg->NeedToDismissQueryL( event ); |
|
2235 STIF_ASSERT_FALSE( flag ); |
|
2236 |
|
2237 CleanupStack::PopAndDestroy( dlg ); |
|
2238 return KErrNone; |
|
2239 } |
|
2240 |
|
2241 // ----------------------------------------------------------------------------- |
|
2242 // CTestSDKQueries::TestMultiLineDataQdlgFirstControlL |
|
2243 // ----------------------------------------------------------------------------- |
|
2244 // |
|
2245 TInt CTestSDKQueries::TestMultiLineDataQdlgFirstControlL( CStifItemParser& /*aItem*/ ) |
|
2246 { |
|
2247 TBuf< KBufSize > message( KTestString ); |
|
2248 TTime topDateTime; |
|
2249 topDateTime.Set( message ); |
|
2250 topDateTime.HomeTime(); |
|
2251 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2252 |
|
2253 CAknMultiLineDataQueryDialog* dlg = |
|
2254 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2255 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2256 |
|
2257 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2258 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2259 |
|
2260 CAknMultilineQueryControl* firstControl = testDlg->FirstControl(); |
|
2261 STIF_ASSERT_NOT_NULL( firstControl ); |
|
2262 |
|
2263 CleanupStack::PopAndDestroy( dlg ); |
|
2264 return KErrNone; |
|
2265 } |
|
2266 |
|
2267 // ----------------------------------------------------------------------------- |
|
2268 // CTestSDKQueries::TestMultiLineDataQdlgSecondControlL |
|
2269 // ----------------------------------------------------------------------------- |
|
2270 // |
|
2271 TInt CTestSDKQueries::TestMultiLineDataQdlgSecondControlL( CStifItemParser& /*aItem*/ ) |
|
2272 { |
|
2273 TBuf< KBufSize > message( KTestString ); |
|
2274 TTime topDateTime; |
|
2275 topDateTime.Set( message ); |
|
2276 topDateTime.HomeTime(); |
|
2277 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2278 |
|
2279 CAknMultiLineDataQueryDialog* dlg = |
|
2280 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2281 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2282 |
|
2283 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2284 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2285 |
|
2286 CAknMultilineQueryControl* secondControl = testDlg->SecondControl(); |
|
2287 STIF_ASSERT_NOT_NULL( secondControl ); |
|
2288 |
|
2289 CleanupStack::PopAndDestroy( dlg ); |
|
2290 return KErrNone; |
|
2291 } |
|
2292 |
|
2293 // ----------------------------------------------------------------------------- |
|
2294 // CTestSDKQueries::TestMultiLineDataQdlgQueryControlL |
|
2295 // ----------------------------------------------------------------------------- |
|
2296 // |
|
2297 TInt CTestSDKQueries::TestMultiLineDataQdlgQueryControlL( CStifItemParser& /*aItem*/ ) |
|
2298 { |
|
2299 TBuf< KBufSize > message( KTestString ); |
|
2300 TTime topDateTime; |
|
2301 topDateTime.Set( message ); |
|
2302 topDateTime.HomeTime(); |
|
2303 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2304 |
|
2305 CAknMultiLineDataQueryDialog* dlg = |
|
2306 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2307 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2308 |
|
2309 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2310 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2311 |
|
2312 CAknQueryControl* control = testDlg->QueryControl(); |
|
2313 STIF_ASSERT_NOT_NULL( control ); |
|
2314 |
|
2315 CleanupStack::PopAndDestroy( dlg ); |
|
2316 return KErrNone; |
|
2317 } |
|
2318 |
|
2319 // ----------------------------------------------------------------------------- |
|
2320 // CTestSDKQueries::TestMultiLineDataQdlgQueryHeadingL |
|
2321 // ----------------------------------------------------------------------------- |
|
2322 // |
|
2323 TInt CTestSDKQueries::TestMultiLineDataQdlgQueryHeadingL( CStifItemParser& /*aItem*/ ) |
|
2324 { |
|
2325 TBuf< KBufSize > message( KTestString ); |
|
2326 TTime topDateTime; |
|
2327 topDateTime.Set( message ); |
|
2328 topDateTime.HomeTime(); |
|
2329 TTimeIntervalSeconds bottomDuration = KHundred; |
|
2330 |
|
2331 CAknMultiLineDataQueryDialog* dlg = |
|
2332 CAknMultiLineDataQueryDialog::NewL(topDateTime,bottomDuration); |
|
2333 dlg->PrepareLC( R_AKNEXQUERY_MULTI_LINE_DATE_AND_DURATION_LAYOUT ); |
|
2334 |
|
2335 CTestCAknMultiLineDataQueryDialog* testDlg = |
|
2336 static_cast<CTestCAknMultiLineDataQueryDialog*>( dlg ); |
|
2337 |
|
2338 CAknPopupHeadingPane* heading = testDlg->QueryHeading(); |
|
2339 STIF_ASSERT_NULL( heading ); |
|
2340 |
|
2341 CleanupStack::PopAndDestroy( dlg ); |
|
2342 return KErrNone; |
|
2343 } |
|
2344 |
|
2345 // ----------------------------------------------------------------------------- |
|
2346 // CTestSDKQueries::TestMultiLineDataSecondPromptL |
|
2347 // ----------------------------------------------------------------------------- |
|
2348 // |
|
2349 TInt CTestSDKQueries::TestMultiLineDataSecondPromptL( CStifItemParser& aItem ) |
|
2350 { |
|
2351 TInt err = TestMultiLineDataQdlgSetPromptL( aItem ); |
|
2352 return err; |
|
2353 } |
|
2354 |
|
2355 // ----------------------------------------------------------------------------- |
|
2356 // CTestSDKQueries::TestMultiLineDataQdlgConstructorTwoL |
|
2357 // ----------------------------------------------------------------------------- |
|
2358 // |
|
2359 TInt CTestSDKQueries::TestMultiLineDataQdlgConstructorTwoL( CStifItemParser& /*aItem*/ ) |
|
2360 { |
|
2361 TTime time1( KTestTime ); |
|
2362 TTime time2( KTestMinTime ); |
|
2363 |
|
2364 CAknMultiLineDataQueryDialog* dlg = new( ELeave ) CAknMultiLineDataQueryDialog( &time1, &time2 ); |
|
2365 CleanupStack::PushL( dlg ); |
|
2366 |
|
2367 STIF_ASSERT_NOT_NULL( dlg ); |
|
2368 |
|
2369 CleanupStack::PopAndDestroy( dlg ); |
|
2370 return KErrNone; |
|
2371 } |
|
2372 |
|
2373 // ----------------------------------------------------------------------------- |
|
2374 // CTestSDKQueries::TestMultiLineDataQdlgConstructorThreeL |
|
2375 // ----------------------------------------------------------------------------- |
|
2376 // |
|
2377 TInt CTestSDKQueries::TestMultiLineDataQdlgConstructorThreeL( CStifItemParser& /*aItem*/ ) |
|
2378 { |
|
2379 TBuf< KBufSize > text1( KTestString ); |
|
2380 TBuf< KBufSize > text2( KTestStringReplace ); |
|
2381 |
|
2382 CAknMultiLineDataQueryDialog* dlg = new( ELeave ) CAknMultiLineDataQueryDialog( &text1, &text2 ); |
|
2383 CleanupStack::PushL( dlg ); |
|
2384 |
|
2385 STIF_ASSERT_NOT_NULL( dlg ); |
|
2386 |
|
2387 CleanupStack::PopAndDestroy( dlg ); |
|
2388 return KErrNone; |
|
2389 } |
|
2390 |
|
2391 // ----------------------------------------------------------------------------- |
|
2392 // CTestSDKQueries::TestMultiLineDataQdlgConstructorFourL |
|
2393 // ----------------------------------------------------------------------------- |
|
2394 // |
|
2395 TInt CTestSDKQueries::TestMultiLineDataQdlgConstructorFourL( CStifItemParser& /*aItem*/ ) |
|
2396 { |
|
2397 TTime time( KTestTime ); |
|
2398 TBuf< KBufSize > text( KTestString ); |
|
2399 |
|
2400 CAknMultiLineDataQueryDialog* dlg = new( ELeave ) CAknMultiLineDataQueryDialog( &text, &time ); |
|
2401 CleanupStack::PushL( dlg ); |
|
2402 |
|
2403 STIF_ASSERT_NOT_NULL( dlg ); |
|
2404 |
|
2405 CleanupStack::PopAndDestroy( dlg ); |
|
2406 return KErrNone; |
|
2407 } |
|
2408 |
|
2409 // ----------------------------------------------------------------------------- |
|
2410 // CTestSDKQueries::TestMultiLineDataQdlgConstructorFiveL |
|
2411 // ----------------------------------------------------------------------------- |
|
2412 // |
|
2413 TInt CTestSDKQueries::TestMultiLineDataQdlgConstructorFiveL( CStifItemParser& /*aItem*/ ) |
|
2414 { |
|
2415 TBuf< KBufSize > text( KTestString ); |
|
2416 TInt number = KTen; |
|
2417 |
|
2418 CAknMultiLineDataQueryDialog* dlg = new( ELeave ) CAknMultiLineDataQueryDialog( &text, &number ); |
|
2419 CleanupStack::PushL( dlg ); |
|
2420 |
|
2421 STIF_ASSERT_NOT_NULL( dlg ); |
|
2422 |
|
2423 CleanupStack::PopAndDestroy( dlg ); |
|
2424 return KErrNone; |
|
2425 } |
|
2426 |
|
2427 // ----------------------------------------------------------------------------- |
|
2428 // CTestSDKQueries::TestMultiLineDataQdlgConstructorSixL |
|
2429 // ----------------------------------------------------------------------------- |
|
2430 // |
|
2431 TInt CTestSDKQueries::TestMultiLineDataQdlgConstructorSixL( CStifItemParser& /*aItem*/ ) |
|
2432 { |
|
2433 TBuf< KBufSize > text( KTestString ); |
|
2434 TTimeIntervalSeconds duration( KOne ); |
|
2435 |
|
2436 CAknMultiLineDataQueryDialog* dlg = new( ELeave ) CAknMultiLineDataQueryDialog( &text, &duration ); |
|
2437 CleanupStack::PushL( dlg ); |
|
2438 |
|
2439 STIF_ASSERT_NOT_NULL( dlg ); |
|
2440 |
|
2441 CleanupStack::PopAndDestroy( dlg ); |
|
2442 return KErrNone; |
|
2443 } |
|
2444 |
|
2445 // ----------------------------------------------------------------------------- |
|
2446 // CTestSDKQueries::TestMultiLineDataQdlgConstructorSevenL |
|
2447 // ----------------------------------------------------------------------------- |
|
2448 // |
|
2449 TInt CTestSDKQueries::TestMultiLineDataQdlgConstructorSevenL( CStifItemParser& /*aItem*/ ) |
|
2450 { |
|
2451 TTime time( KTestTime ); |
|
2452 TTimeIntervalSeconds duration( KOne ); |
|
2453 |
|
2454 CAknMultiLineDataQueryDialog* dlg = new( ELeave ) CAknMultiLineDataQueryDialog( &time, &duration ); |
|
2455 CleanupStack::PushL( dlg ); |
|
2456 |
|
2457 STIF_ASSERT_NOT_NULL( dlg ); |
|
2458 |
|
2459 CleanupStack::PopAndDestroy( dlg ); |
|
2460 return KErrNone; |
|
2461 } |
|
2462 |
|
2463 // ----------------------------------------------------------------------------- |
|
2464 // CTestSDKQueries::TestMultiLineDataQdlgConstructorEightL |
|
2465 // ----------------------------------------------------------------------------- |
|
2466 // |
|
2467 TInt CTestSDKQueries::TestMultiLineDataQdlgConstructorEightL( CStifItemParser& /*aItem*/ ) |
|
2468 { |
|
2469 TInt number1 = KZero; |
|
2470 TInt number2 = KTen; |
|
2471 |
|
2472 CAknMultiLineDataQueryDialog* dlg = new( ELeave ) CAknMultiLineDataQueryDialog( &number1, &number2 ); |
|
2473 CleanupStack::PushL( dlg ); |
|
2474 |
|
2475 STIF_ASSERT_NOT_NULL( dlg ); |
|
2476 |
|
2477 CleanupStack::PopAndDestroy( dlg ); |
|
2478 return KErrNone; |
|
2479 } |
|
2480 |
|
2481 // ----------------------------------------------------------------------------- |
|
2482 // CTestSDKQueries::TestIpAddressQdlgNewL |
|
2483 // ----------------------------------------------------------------------------- |
|
2484 // |
|
2485 TInt CTestSDKQueries::TestIpAddressQdlgNewL( CStifItemParser& /*aItem*/ ) |
|
2486 { |
|
2487 TInetAddr mAddress; |
|
2488 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2489 |
|
2490 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2491 CAknIpAddressQueryDialog::ENoTone ); |
|
2492 CleanupStack::PushL( dlg ); |
|
2493 |
|
2494 STIF_ASSERT_NOT_NULL( dlg ); |
|
2495 |
|
2496 CleanupStack::PopAndDestroy( dlg ); |
|
2497 return KErrNone; |
|
2498 } |
|
2499 |
|
2500 // ----------------------------------------------------------------------------- |
|
2501 // CTestSDKQueries::TestIpAddressQdlgDestructorL |
|
2502 // ----------------------------------------------------------------------------- |
|
2503 // |
|
2504 TInt CTestSDKQueries::TestIpAddressQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
2505 { |
|
2506 TInetAddr mAddress; |
|
2507 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2508 |
|
2509 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2510 CAknIpAddressQueryDialog::ENoTone ); |
|
2511 delete dlg; |
|
2512 |
|
2513 return KErrNone; |
|
2514 } |
|
2515 |
|
2516 // ----------------------------------------------------------------------------- |
|
2517 // CTestSDKQueries::TestIpAddressQdlgSetMinimumAndMaximumL |
|
2518 // ----------------------------------------------------------------------------- |
|
2519 // |
|
2520 TInt CTestSDKQueries::TestIpAddressQdlgSetMinimumAndMaximumL( CStifItemParser& /*aItem*/ ) |
|
2521 { |
|
2522 TInetAddr mAddress; |
|
2523 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2524 |
|
2525 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2526 CAknIpAddressQueryDialog::ENoTone ); |
|
2527 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2528 |
|
2529 TInetAddr minAddr( KZero, KZero ); |
|
2530 TInetAddr maxAddr( KMaxAddrValue ); |
|
2531 |
|
2532 dlg->SetMinimumAndMaximum( minAddr, maxAddr ); |
|
2533 |
|
2534 CleanupStack::PopAndDestroy( dlg ); |
|
2535 return KErrNone; |
|
2536 } |
|
2537 |
|
2538 // ----------------------------------------------------------------------------- |
|
2539 // CTestSDKQueries::TestIpAddressQdlgNeedToDismissQueryL |
|
2540 // ----------------------------------------------------------------------------- |
|
2541 // |
|
2542 TInt CTestSDKQueries::TestIpAddressQdlgNeedToDismissQueryL( CStifItemParser& /*aItem*/ ) |
|
2543 { |
|
2544 TInetAddr mAddress; |
|
2545 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2546 |
|
2547 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2548 CAknIpAddressQueryDialog::ENoTone ); |
|
2549 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2550 |
|
2551 TKeyEvent event; |
|
2552 event.iScanCode = EStdKeySquareBracketLeft; |
|
2553 |
|
2554 TBool flag = dlg->NeedToDismissQueryL( event ); |
|
2555 |
|
2556 STIF_ASSERT_FALSE( flag ); |
|
2557 |
|
2558 CleanupStack::PopAndDestroy( dlg ); |
|
2559 return KErrNone; |
|
2560 } |
|
2561 |
|
2562 // ----------------------------------------------------------------------------- |
|
2563 // CTestSDKQueries::TestIpAddressQdlgQueryControlL |
|
2564 // ----------------------------------------------------------------------------- |
|
2565 // |
|
2566 TInt CTestSDKQueries::TestIpAddressQdlgQueryControlL( CStifItemParser& /*aItem*/ ) |
|
2567 { |
|
2568 TInetAddr mAddress; |
|
2569 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2570 |
|
2571 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2572 CAknIpAddressQueryDialog::ENoTone ); |
|
2573 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2574 |
|
2575 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2576 |
|
2577 CAknQueryControl* control = testDlg->QueryControl(); |
|
2578 STIF_ASSERT_NOT_NULL( control ); |
|
2579 |
|
2580 CleanupStack::PopAndDestroy( dlg ); |
|
2581 return KErrNone; |
|
2582 } |
|
2583 |
|
2584 // ----------------------------------------------------------------------------- |
|
2585 // CTestSDKQueries::TestIpAddressQdlgSetSizeAndPositionL |
|
2586 // ----------------------------------------------------------------------------- |
|
2587 // |
|
2588 TInt CTestSDKQueries::TestIpAddressQdlgSetSizeAndPositionL( CStifItemParser& /*aItem*/ ) |
|
2589 { |
|
2590 TInetAddr mAddress; |
|
2591 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2592 |
|
2593 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2594 CAknIpAddressQueryDialog::ENoTone ); |
|
2595 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2596 |
|
2597 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2598 |
|
2599 testDlg->SetSizeAndPosition( iContainer->Rect().Size() ); |
|
2600 |
|
2601 CleanupStack::PopAndDestroy( dlg ); |
|
2602 return KErrNone; |
|
2603 } |
|
2604 |
|
2605 // ----------------------------------------------------------------------------- |
|
2606 // CTestSDKQueries::TestIpAddressQdlgPreLayoutDynInitL |
|
2607 // ----------------------------------------------------------------------------- |
|
2608 // |
|
2609 TInt CTestSDKQueries::TestIpAddressQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
2610 { |
|
2611 TInetAddr mAddress; |
|
2612 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2613 |
|
2614 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2615 CAknIpAddressQueryDialog::ENoTone ); |
|
2616 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2617 |
|
2618 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2619 |
|
2620 testDlg->PreLayoutDynInitL(); |
|
2621 |
|
2622 CleanupStack::PopAndDestroy( dlg ); |
|
2623 return KErrNone; |
|
2624 } |
|
2625 |
|
2626 // ----------------------------------------------------------------------------- |
|
2627 // CTestSDKQueries::TestIpAddressQdlgPostLayoutDynInitL |
|
2628 // ----------------------------------------------------------------------------- |
|
2629 // |
|
2630 TInt CTestSDKQueries::TestIpAddressQdlgPostLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
2631 { |
|
2632 TInetAddr mAddress; |
|
2633 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2634 |
|
2635 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2636 CAknIpAddressQueryDialog::ENoTone ); |
|
2637 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2638 |
|
2639 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2640 |
|
2641 testDlg->PostLayoutDynInitL(); |
|
2642 |
|
2643 CleanupStack::PopAndDestroy( dlg ); |
|
2644 return KErrNone; |
|
2645 } |
|
2646 |
|
2647 // ----------------------------------------------------------------------------- |
|
2648 // CTestSDKQueries::TestIpAddressQdlgDoSetPromptL |
|
2649 // ----------------------------------------------------------------------------- |
|
2650 // |
|
2651 TInt CTestSDKQueries::TestIpAddressQdlgDoSetPromptL( CStifItemParser& /*aItem*/ ) |
|
2652 { |
|
2653 TInetAddr mAddress; |
|
2654 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2655 |
|
2656 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2657 CAknIpAddressQueryDialog::ENoTone ); |
|
2658 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2659 |
|
2660 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2661 |
|
2662 testDlg->DoSetPromptL(); |
|
2663 |
|
2664 CleanupStack::PopAndDestroy( dlg ); |
|
2665 return KErrNone; |
|
2666 } |
|
2667 |
|
2668 // ----------------------------------------------------------------------------- |
|
2669 // CTestSDKQueries::TestIpAddressQdlgOkToExitL |
|
2670 // ----------------------------------------------------------------------------- |
|
2671 // |
|
2672 TInt CTestSDKQueries::TestIpAddressQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
2673 { |
|
2674 TInetAddr mAddress; |
|
2675 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2676 |
|
2677 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2678 CAknIpAddressQueryDialog::ENoTone ); |
|
2679 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2680 |
|
2681 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2682 |
|
2683 TBool flag = testDlg->OkToExitL( EEikBidOk ); |
|
2684 STIF_ASSERT_TRUE( flag ); |
|
2685 |
|
2686 flag = testDlg->OkToExitL( KHundred ); |
|
2687 STIF_ASSERT_FALSE( flag ); |
|
2688 |
|
2689 CleanupStack::PopAndDestroy( dlg ); |
|
2690 return KErrNone; |
|
2691 } |
|
2692 |
|
2693 // ----------------------------------------------------------------------------- |
|
2694 // CTestSDKQueries::TestIpAddressQdlgUpdateLeftSoftKeyL |
|
2695 // ----------------------------------------------------------------------------- |
|
2696 // |
|
2697 TInt CTestSDKQueries::TestIpAddressQdlgUpdateLeftSoftKeyL( CStifItemParser& /*aItem*/ ) |
|
2698 { |
|
2699 TInetAddr mAddress; |
|
2700 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2701 |
|
2702 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2703 CAknIpAddressQueryDialog::ENoTone ); |
|
2704 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2705 |
|
2706 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2707 |
|
2708 testDlg->UpdateLeftSoftKeyL(); |
|
2709 |
|
2710 CleanupStack::PopAndDestroy( dlg ); |
|
2711 return KErrNone; |
|
2712 } |
|
2713 |
|
2714 // ----------------------------------------------------------------------------- |
|
2715 // CTestSDKQueries::TestIpAddressQdlgInetAddrOneL |
|
2716 // ----------------------------------------------------------------------------- |
|
2717 // |
|
2718 TInt CTestSDKQueries::TestIpAddressQdlgInetAddrOneL( CStifItemParser& /*aItem*/ ) |
|
2719 { |
|
2720 TInetAddr mAddress; |
|
2721 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2722 |
|
2723 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2724 CAknIpAddressQueryDialog::ENoTone ); |
|
2725 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2726 |
|
2727 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2728 |
|
2729 TInetAddr returnAddr = testDlg->InetAddr(); |
|
2730 STIF_ASSERT_EQUALS( mAddress, returnAddr ); |
|
2731 |
|
2732 CleanupStack::PopAndDestroy( dlg ); |
|
2733 return KErrNone; |
|
2734 } |
|
2735 |
|
2736 // ----------------------------------------------------------------------------- |
|
2737 // CTestSDKQueries::TestIpAddressQdlgInetAddrTwoL |
|
2738 // ----------------------------------------------------------------------------- |
|
2739 // |
|
2740 TInt CTestSDKQueries::TestIpAddressQdlgInetAddrTwoL( CStifItemParser& /*aItem*/ ) |
|
2741 { |
|
2742 TInetAddr mAddress; |
|
2743 mAddress.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
2744 |
|
2745 CAknIpAddressQueryDialog* dlg = CAknIpAddressQueryDialog::NewL( mAddress, |
|
2746 CAknIpAddressQueryDialog::ENoTone ); |
|
2747 dlg->PrepareLC( R_TESTQUERY_IP_ADDRESS ); |
|
2748 |
|
2749 CTestCAknIpAddressQueryDialog* testDlg = static_cast<CTestCAknIpAddressQueryDialog*>( dlg ); |
|
2750 |
|
2751 const TInetAddr returnAddr = testDlg->InetAddr(); |
|
2752 STIF_ASSERT_EQUALS( mAddress, returnAddr ); |
|
2753 |
|
2754 CleanupStack::PopAndDestroy( dlg ); |
|
2755 return KErrNone; |
|
2756 } |
|
2757 |
|
2758 // ----------------------------------------------------------------------------- |
|
2759 // CTestSDKQueries::TestFixedPointQdlgNewL |
|
2760 // ----------------------------------------------------------------------------- |
|
2761 // |
|
2762 TInt CTestSDKQueries::TestFixedPointQdlgNewL( CStifItemParser& /*aItem*/ ) |
|
2763 { |
|
2764 TInt number = KTen; |
|
2765 |
|
2766 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2767 CAknFixedPointQueryDialog::ENoTone ); |
|
2768 CleanupStack::PushL( dlg ); |
|
2769 |
|
2770 STIF_ASSERT_NOT_NULL( dlg ); |
|
2771 |
|
2772 CleanupStack::PopAndDestroy( dlg ); |
|
2773 return KErrNone; |
|
2774 } |
|
2775 |
|
2776 // ----------------------------------------------------------------------------- |
|
2777 // CTestSDKQueries::TestFixedPointQdlgDestructorL |
|
2778 // ----------------------------------------------------------------------------- |
|
2779 // |
|
2780 TInt CTestSDKQueries::TestFixedPointQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
2781 { |
|
2782 TInt number = KTen; |
|
2783 |
|
2784 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2785 CAknFixedPointQueryDialog::ENoTone ); |
|
2786 delete dlg; |
|
2787 |
|
2788 return KErrNone; |
|
2789 } |
|
2790 |
|
2791 // ----------------------------------------------------------------------------- |
|
2792 // CTestSDKQueries::TestFixedPointQdlgSetMinimumAndMaximumL |
|
2793 // ----------------------------------------------------------------------------- |
|
2794 // |
|
2795 TInt CTestSDKQueries::TestFixedPointQdlgSetMinimumAndMaximumL( CStifItemParser& /*aItem*/ ) |
|
2796 { |
|
2797 TInt number = KTen; |
|
2798 |
|
2799 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2800 CAknFixedPointQueryDialog::ENoTone ); |
|
2801 |
|
2802 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2803 |
|
2804 dlg->SetMinimumAndMaximum( KZero, KHundred ); |
|
2805 |
|
2806 CleanupStack::PopAndDestroy( dlg ); |
|
2807 return KErrNone; |
|
2808 } |
|
2809 |
|
2810 // ----------------------------------------------------------------------------- |
|
2811 // CTestSDKQueries::TestFixedPointQdlgNeedToDismissQueryL |
|
2812 // ----------------------------------------------------------------------------- |
|
2813 // |
|
2814 TInt CTestSDKQueries::TestFixedPointQdlgNeedToDismissQueryL( CStifItemParser& /*aItem*/ ) |
|
2815 { |
|
2816 TInt number = KTen; |
|
2817 |
|
2818 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2819 CAknFixedPointQueryDialog::ENoTone ); |
|
2820 |
|
2821 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2822 |
|
2823 TKeyEvent event; |
|
2824 event.iScanCode = EStdKeyHash; |
|
2825 event.iCode = EKeyTab; |
|
2826 |
|
2827 TBool flag = dlg->NeedToDismissQueryL( event ); |
|
2828 STIF_ASSERT_FALSE( flag ); |
|
2829 |
|
2830 CleanupStack::PopAndDestroy( dlg ); |
|
2831 return KErrNone; |
|
2832 } |
|
2833 |
|
2834 // ----------------------------------------------------------------------------- |
|
2835 // CTestSDKQueries::TestFixedPointQdlgQueryControlL |
|
2836 // ----------------------------------------------------------------------------- |
|
2837 // |
|
2838 TInt CTestSDKQueries::TestFixedPointQdlgQueryControlL( CStifItemParser& /*aItem*/ ) |
|
2839 { |
|
2840 TInt number = KTen; |
|
2841 |
|
2842 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2843 CAknFixedPointQueryDialog::ENoTone ); |
|
2844 |
|
2845 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2846 |
|
2847 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
2848 |
|
2849 CAknQueryControl* control = testDlg->QueryControl(); |
|
2850 |
|
2851 STIF_ASSERT_NOT_NULL( control ); |
|
2852 |
|
2853 CleanupStack::PopAndDestroy( dlg ); |
|
2854 return KErrNone; |
|
2855 } |
|
2856 |
|
2857 // ----------------------------------------------------------------------------- |
|
2858 // CTestSDKQueries::TestFixedPointQdlgSetSizeAndPositionL |
|
2859 // ----------------------------------------------------------------------------- |
|
2860 // |
|
2861 TInt CTestSDKQueries::TestFixedPointQdlgSetSizeAndPositionL( CStifItemParser& /*aItem*/ ) |
|
2862 { |
|
2863 TInt number = KTen; |
|
2864 |
|
2865 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2866 CAknFixedPointQueryDialog::ENoTone ); |
|
2867 |
|
2868 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2869 |
|
2870 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
2871 |
|
2872 testDlg->SetSizeAndPosition( iContainer->Rect().Size() ); |
|
2873 |
|
2874 CleanupStack::PopAndDestroy( dlg ); |
|
2875 return KErrNone; |
|
2876 } |
|
2877 |
|
2878 // ----------------------------------------------------------------------------- |
|
2879 // CTestSDKQueries::TestFixedPointQdlgPreLayoutDynInitL |
|
2880 // ----------------------------------------------------------------------------- |
|
2881 // |
|
2882 TInt CTestSDKQueries::TestFixedPointQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
2883 { |
|
2884 TInt number = KTen; |
|
2885 |
|
2886 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2887 CAknFixedPointQueryDialog::ENoTone ); |
|
2888 |
|
2889 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2890 |
|
2891 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
2892 |
|
2893 testDlg->PreLayoutDynInitL(); |
|
2894 |
|
2895 CleanupStack::PopAndDestroy( dlg ); |
|
2896 return KErrNone; |
|
2897 } |
|
2898 |
|
2899 // ----------------------------------------------------------------------------- |
|
2900 // CTestSDKQueries::TestFixedPointQdlgPostLayoutDynInitL |
|
2901 // ----------------------------------------------------------------------------- |
|
2902 // |
|
2903 TInt CTestSDKQueries::TestFixedPointQdlgPostLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
2904 { |
|
2905 TInt number = KTen; |
|
2906 |
|
2907 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2908 CAknFixedPointQueryDialog::ENoTone ); |
|
2909 |
|
2910 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2911 |
|
2912 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
2913 |
|
2914 testDlg->PostLayoutDynInitL(); |
|
2915 |
|
2916 CleanupStack::PopAndDestroy( dlg ); |
|
2917 return KErrNone; |
|
2918 } |
|
2919 |
|
2920 // ----------------------------------------------------------------------------- |
|
2921 // CTestSDKQueries::TestFixedPointQdlgDoSetPromptL |
|
2922 // ----------------------------------------------------------------------------- |
|
2923 // |
|
2924 TInt CTestSDKQueries::TestFixedPointQdlgDoSetPromptL( CStifItemParser& /*aItem*/ ) |
|
2925 { |
|
2926 TInt number = KTen; |
|
2927 |
|
2928 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2929 CAknFixedPointQueryDialog::ENoTone ); |
|
2930 |
|
2931 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2932 |
|
2933 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
2934 |
|
2935 testDlg->DoSetPromptL(); |
|
2936 |
|
2937 CleanupStack::PopAndDestroy( dlg ); |
|
2938 return KErrNone; |
|
2939 } |
|
2940 |
|
2941 // ----------------------------------------------------------------------------- |
|
2942 // CTestSDKQueries::TestFixedPointQdlgOkToExitL |
|
2943 // ----------------------------------------------------------------------------- |
|
2944 // |
|
2945 TInt CTestSDKQueries::TestFixedPointQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
2946 { |
|
2947 TInt number = KTen; |
|
2948 |
|
2949 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2950 CAknFixedPointQueryDialog::ENoTone ); |
|
2951 |
|
2952 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2953 |
|
2954 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
2955 |
|
2956 TBool flag = testDlg->OkToExitL( EEikBidOk ); |
|
2957 STIF_ASSERT_TRUE( flag ); |
|
2958 |
|
2959 flag = testDlg->OkToExitL( KHundred ); |
|
2960 STIF_ASSERT_FALSE( flag ); |
|
2961 |
|
2962 CleanupStack::PopAndDestroy( dlg ); |
|
2963 return KErrNone; |
|
2964 } |
|
2965 |
|
2966 // ----------------------------------------------------------------------------- |
|
2967 // CTestSDKQueries::TestFixedPointQdlgUpdateLeftSoftKeyL |
|
2968 // ----------------------------------------------------------------------------- |
|
2969 // |
|
2970 TInt CTestSDKQueries::TestFixedPointQdlgUpdateLeftSoftKeyL( CStifItemParser& /*aItem*/ ) |
|
2971 { |
|
2972 TInt number = KTen; |
|
2973 |
|
2974 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2975 CAknFixedPointQueryDialog::ENoTone ); |
|
2976 |
|
2977 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2978 |
|
2979 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
2980 |
|
2981 testDlg->UpdateLeftSoftKeyL(); |
|
2982 |
|
2983 CleanupStack::PopAndDestroy( dlg ); |
|
2984 return KErrNone; |
|
2985 } |
|
2986 |
|
2987 // ----------------------------------------------------------------------------- |
|
2988 // CTestSDKQueries::TestFixedPointQdlgNumberOneL |
|
2989 // ----------------------------------------------------------------------------- |
|
2990 // |
|
2991 TInt CTestSDKQueries::TestFixedPointQdlgNumberOneL( CStifItemParser& /*aItem*/ ) |
|
2992 { |
|
2993 TInt number = KTen; |
|
2994 |
|
2995 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
2996 CAknFixedPointQueryDialog::ENoTone ); |
|
2997 |
|
2998 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
2999 |
|
3000 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
3001 |
|
3002 TInt returnNumber = testDlg->Number(); |
|
3003 STIF_ASSERT_EQUALS( KTen, returnNumber ); |
|
3004 |
|
3005 CleanupStack::PopAndDestroy( dlg ); |
|
3006 return KErrNone; |
|
3007 } |
|
3008 |
|
3009 // ----------------------------------------------------------------------------- |
|
3010 // CTestSDKQueries::TestFixedPointQdlgNumberTwoL |
|
3011 // ----------------------------------------------------------------------------- |
|
3012 // |
|
3013 TInt CTestSDKQueries::TestFixedPointQdlgNumberTwoL( CStifItemParser& /*aItem*/ ) |
|
3014 { |
|
3015 TInt number = KTen; |
|
3016 |
|
3017 CAknFixedPointQueryDialog* dlg = CAknFixedPointQueryDialog::NewL( number, |
|
3018 CAknFixedPointQueryDialog::ENoTone ); |
|
3019 |
|
3020 dlg->PrepareLC( R_TESTQUERY_FIXED_POINT ); |
|
3021 |
|
3022 CTestCAknFixedPointQueryDialog* testDlg = static_cast<CTestCAknFixedPointQueryDialog*>( dlg ); |
|
3023 |
|
3024 const TInt returnNumber = testDlg->Number(); |
|
3025 STIF_ASSERT_EQUALS( KTen, returnNumber ); |
|
3026 |
|
3027 CleanupStack::PopAndDestroy( dlg ); |
|
3028 return KErrNone; |
|
3029 } |
|
3030 |
|
3031 // ----------------------------------------------------------------------------- |
|
3032 // CTestSDKQueries::TestMultiLineIpQdlgNewL |
|
3033 // ----------------------------------------------------------------------------- |
|
3034 // |
|
3035 TInt CTestSDKQueries::TestMultiLineIpQdlgNewL( CStifItemParser& /*aItem*/ ) |
|
3036 { |
|
3037 TInetAddr mAddress1; |
|
3038 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3039 |
|
3040 TInetAddr mAddress2; |
|
3041 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3042 |
|
3043 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3044 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3045 CleanupStack::PushL( dlg ); |
|
3046 |
|
3047 STIF_ASSERT_NOT_NULL( dlg ); |
|
3048 |
|
3049 CleanupStack::PopAndDestroy( dlg ); |
|
3050 return KErrNone; |
|
3051 } |
|
3052 |
|
3053 // ----------------------------------------------------------------------------- |
|
3054 // CTestSDKQueries::TestMultiLineIpQdlgDestructorL |
|
3055 // ----------------------------------------------------------------------------- |
|
3056 // |
|
3057 TInt CTestSDKQueries::TestMultiLineIpQdlgDestructorL( CStifItemParser& /*aItem*/ ) |
|
3058 { |
|
3059 TInetAddr mAddress1; |
|
3060 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3061 |
|
3062 TInetAddr mAddress2; |
|
3063 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3064 |
|
3065 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3066 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3067 delete dlg; |
|
3068 |
|
3069 return KErrNone; |
|
3070 } |
|
3071 |
|
3072 // ----------------------------------------------------------------------------- |
|
3073 // CTestSDKQueries::TestMultiLineIpQdlgSetPromptL |
|
3074 // ----------------------------------------------------------------------------- |
|
3075 // |
|
3076 TInt CTestSDKQueries::TestMultiLineIpQdlgSetPromptL( CStifItemParser& /*aItem*/ ) |
|
3077 { |
|
3078 TInetAddr mAddress1; |
|
3079 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3080 |
|
3081 TInetAddr mAddress2; |
|
3082 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3083 |
|
3084 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3085 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3086 |
|
3087 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3088 |
|
3089 TBuf< KBufSize > firstPrompt( KTestString ); |
|
3090 TBuf< KBufSize > secondPrompt( KTestStringReplace ); |
|
3091 |
|
3092 dlg->SetPromptL( firstPrompt, secondPrompt ); |
|
3093 |
|
3094 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3095 |
|
3096 TPtrC returnPrompt = testDlg->SecondPrompt(); |
|
3097 STIF_ASSERT_EQUALS( ( TPtrC )secondPrompt, returnPrompt ); |
|
3098 |
|
3099 CleanupStack::PopAndDestroy( dlg ); |
|
3100 return KErrNone; |
|
3101 } |
|
3102 |
|
3103 // ----------------------------------------------------------------------------- |
|
3104 // CTestSDKQueries::TestMultiLineIpQdlgSetMaxLengthOfFirstEditorL |
|
3105 // ----------------------------------------------------------------------------- |
|
3106 // |
|
3107 TInt CTestSDKQueries::TestMultiLineIpQdlgSetMaxLengthOfFirstEditorL( CStifItemParser& /*aItem*/ ) |
|
3108 { |
|
3109 TInetAddr mAddress1; |
|
3110 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3111 |
|
3112 TInetAddr mAddress2; |
|
3113 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3114 |
|
3115 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3116 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3117 |
|
3118 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3119 |
|
3120 dlg->SetMaxLengthOfFirstEditor( KHundred ); |
|
3121 |
|
3122 CleanupStack::PopAndDestroy( dlg ); |
|
3123 return KErrNone; |
|
3124 } |
|
3125 |
|
3126 // ----------------------------------------------------------------------------- |
|
3127 // CTestSDKQueries::TestMultiLineIpQdlgSetMaxLengthOfSecondEditorL |
|
3128 // ----------------------------------------------------------------------------- |
|
3129 // |
|
3130 TInt CTestSDKQueries::TestMultiLineIpQdlgSetMaxLengthOfSecondEditorL( CStifItemParser& /*aItem*/ ) |
|
3131 { |
|
3132 TInetAddr mAddress1; |
|
3133 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3134 |
|
3135 TInetAddr mAddress2; |
|
3136 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3137 |
|
3138 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3139 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3140 |
|
3141 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3142 |
|
3143 dlg->SetMaxLengthOfSecondEditor( KHundred ); |
|
3144 |
|
3145 CleanupStack::PopAndDestroy( dlg ); |
|
3146 return KErrNone; |
|
3147 } |
|
3148 |
|
3149 // ----------------------------------------------------------------------------- |
|
3150 // CTestSDKQueries::TestMultiLineIpQdlgOkToExitL |
|
3151 // ----------------------------------------------------------------------------- |
|
3152 // |
|
3153 TInt CTestSDKQueries::TestMultiLineIpQdlgOkToExitL( CStifItemParser& /*aItem*/ ) |
|
3154 { |
|
3155 TInetAddr mAddress1; |
|
3156 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3157 |
|
3158 TInetAddr mAddress2; |
|
3159 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3160 |
|
3161 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3162 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3163 |
|
3164 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3165 |
|
3166 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3167 |
|
3168 TBool flag = testDlg->OkToExitL( EEikBidOk ); |
|
3169 STIF_ASSERT_TRUE( flag ); |
|
3170 |
|
3171 flag = testDlg->OkToExitL( KHundred ); |
|
3172 STIF_ASSERT_FALSE( flag ); |
|
3173 |
|
3174 CleanupStack::PopAndDestroy( dlg ); |
|
3175 return KErrNone; |
|
3176 } |
|
3177 |
|
3178 // ----------------------------------------------------------------------------- |
|
3179 // CTestSDKQueries::TestMultiLineIpQdlgPreLayoutDynInitL |
|
3180 // ----------------------------------------------------------------------------- |
|
3181 // |
|
3182 TInt CTestSDKQueries::TestMultiLineIpQdlgPreLayoutDynInitL( CStifItemParser& /*aItem*/ ) |
|
3183 { |
|
3184 TInetAddr mAddress1; |
|
3185 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3186 |
|
3187 TInetAddr mAddress2; |
|
3188 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3189 |
|
3190 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3191 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3192 |
|
3193 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3194 |
|
3195 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3196 |
|
3197 testDlg->PreLayoutDynInitL(); |
|
3198 |
|
3199 CleanupStack::PopAndDestroy( dlg ); |
|
3200 return KErrNone; |
|
3201 } |
|
3202 |
|
3203 // ----------------------------------------------------------------------------- |
|
3204 // CTestSDKQueries::TestMultiLineIpQdlgHandleResourceChangeL |
|
3205 // ----------------------------------------------------------------------------- |
|
3206 // |
|
3207 TInt CTestSDKQueries::TestMultiLineIpQdlgHandleResourceChangeL( CStifItemParser& /*aItem*/ ) |
|
3208 { |
|
3209 TInetAddr mAddress1; |
|
3210 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3211 |
|
3212 TInetAddr mAddress2; |
|
3213 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3214 |
|
3215 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3216 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3217 |
|
3218 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3219 |
|
3220 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3221 |
|
3222 testDlg->HandleResourceChange( KEikDynamicLayoutVariantSwitch ); |
|
3223 |
|
3224 CleanupStack::PopAndDestroy( dlg ); |
|
3225 return KErrNone; |
|
3226 } |
|
3227 |
|
3228 // ----------------------------------------------------------------------------- |
|
3229 // CTestSDKQueries::TestMultiLineIpQdlgUpdateLeftSoftKeyL |
|
3230 // ----------------------------------------------------------------------------- |
|
3231 // |
|
3232 TInt CTestSDKQueries::TestMultiLineIpQdlgUpdateLeftSoftKeyL( CStifItemParser& /*aItem*/ ) |
|
3233 { |
|
3234 TInetAddr mAddress1; |
|
3235 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3236 |
|
3237 TInetAddr mAddress2; |
|
3238 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3239 |
|
3240 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3241 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3242 |
|
3243 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3244 |
|
3245 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3246 |
|
3247 testDlg->UpdateLeftSoftKeyL(); |
|
3248 |
|
3249 CleanupStack::PopAndDestroy( dlg ); |
|
3250 return KErrNone; |
|
3251 } |
|
3252 |
|
3253 // ----------------------------------------------------------------------------- |
|
3254 // CTestSDKQueries::TestMultiLineIpQdlgDoSetPromptL |
|
3255 // ----------------------------------------------------------------------------- |
|
3256 // |
|
3257 TInt CTestSDKQueries::TestMultiLineIpQdlgDoSetPromptL( CStifItemParser& /*aItem*/ ) |
|
3258 { |
|
3259 TInetAddr mAddress1; |
|
3260 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3261 |
|
3262 TInetAddr mAddress2; |
|
3263 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3264 |
|
3265 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3266 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3267 |
|
3268 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3269 |
|
3270 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3271 |
|
3272 testDlg->DoSetPromptL(); |
|
3273 |
|
3274 CleanupStack::PopAndDestroy( dlg ); |
|
3275 return KErrNone; |
|
3276 } |
|
3277 |
|
3278 // ----------------------------------------------------------------------------- |
|
3279 // CTestSDKQueries::TestMultiLineIpQdlgNeedToDismissQueryL |
|
3280 // ----------------------------------------------------------------------------- |
|
3281 // |
|
3282 TInt CTestSDKQueries::TestMultiLineIpQdlgNeedToDismissQueryL( CStifItemParser& /*aItem*/ ) |
|
3283 { |
|
3284 TInetAddr mAddress1; |
|
3285 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3286 |
|
3287 TInetAddr mAddress2; |
|
3288 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3289 |
|
3290 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3291 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3292 |
|
3293 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3294 |
|
3295 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3296 |
|
3297 TKeyEvent event; |
|
3298 event.iScanCode = EStdKeyHash; |
|
3299 event.iCode = EKeyTab; |
|
3300 |
|
3301 TBool flag = testDlg->NeedToDismissQueryL( event ); |
|
3302 STIF_ASSERT_FALSE( flag ); |
|
3303 |
|
3304 CleanupStack::PopAndDestroy( dlg ); |
|
3305 return KErrNone; |
|
3306 } |
|
3307 |
|
3308 // ----------------------------------------------------------------------------- |
|
3309 // CTestSDKQueries::TestMultiLineIpQdlgFirstControlL |
|
3310 // ----------------------------------------------------------------------------- |
|
3311 // |
|
3312 TInt CTestSDKQueries::TestMultiLineIpQdlgFirstControlL( CStifItemParser& /*aItem*/ ) |
|
3313 { |
|
3314 TInetAddr mAddress1; |
|
3315 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3316 |
|
3317 TInetAddr mAddress2; |
|
3318 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3319 |
|
3320 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3321 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3322 |
|
3323 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3324 |
|
3325 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3326 |
|
3327 CAknExtMultilineQueryControl* firstControl = testDlg->FirstControl(); |
|
3328 STIF_ASSERT_NOT_NULL( firstControl ); |
|
3329 |
|
3330 CleanupStack::PopAndDestroy( dlg ); |
|
3331 return KErrNone; |
|
3332 } |
|
3333 |
|
3334 // ----------------------------------------------------------------------------- |
|
3335 // CTestSDKQueries::TestMultiLineIpQdlgSecondControlL |
|
3336 // ----------------------------------------------------------------------------- |
|
3337 // |
|
3338 TInt CTestSDKQueries::TestMultiLineIpQdlgSecondControlL( CStifItemParser& /*aItem*/ ) |
|
3339 { |
|
3340 TInetAddr mAddress1; |
|
3341 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3342 |
|
3343 TInetAddr mAddress2; |
|
3344 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3345 |
|
3346 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3347 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3348 |
|
3349 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3350 |
|
3351 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3352 |
|
3353 CAknExtMultilineQueryControl* secondControl = testDlg->SecondControl(); |
|
3354 STIF_ASSERT_NOT_NULL( secondControl ); |
|
3355 |
|
3356 CleanupStack::PopAndDestroy( dlg ); |
|
3357 return KErrNone; |
|
3358 } |
|
3359 |
|
3360 // ----------------------------------------------------------------------------- |
|
3361 // CTestSDKQueries::TestMultiLineIpQdlgQueryControlL |
|
3362 // ----------------------------------------------------------------------------- |
|
3363 // |
|
3364 TInt CTestSDKQueries::TestMultiLineIpQdlgQueryControlL( CStifItemParser& /*aItem*/ ) |
|
3365 { |
|
3366 TInetAddr mAddress1; |
|
3367 mAddress1.SetAddress( INET_ADDR( KTen, KTen, KTen, KTen )); |
|
3368 |
|
3369 TInetAddr mAddress2; |
|
3370 mAddress2.SetAddress( INET_ADDR( KTen, KZero, KTen, KOne )); |
|
3371 |
|
3372 CAknMultiLineIpQueryDialog* dlg = CAknMultiLineIpQueryDialog::NewL( mAddress1, |
|
3373 mAddress1, CAknMultiLineIpQueryDialog::ENoTone ); |
|
3374 |
|
3375 dlg->PrepareLC( R_TESTQUERY_MULTI_LINE_IP_ADDRESS ); |
|
3376 |
|
3377 CTestCAknMultiLineIpQueryDialog* testDlg = static_cast<CTestCAknMultiLineIpQueryDialog*>( dlg ); |
|
3378 |
|
3379 CAknQueryControl* control = testDlg->QueryControl(); |
|
3380 STIF_ASSERT_NOT_NULL( control ); |
|
3381 |
|
3382 CleanupStack::PopAndDestroy( dlg ); |
|
3383 return KErrNone; |
|
3384 } |
|
3385 |
|
3386 // ----------------------------------------------------------------------------- |
|
3387 // CTestSDKQueries::TestMultiLineIpQdlgSecondPromptL |
|
3388 // ----------------------------------------------------------------------------- |
|
3389 // |
|
3390 TInt CTestSDKQueries::TestMultiLineIpQdlgSecondPromptL( CStifItemParser& aItem ) |
|
3391 { |
|
3392 TInt err = TestMultiLineIpQdlgSetPromptL( aItem ); |
|
3393 return err; |
|
3394 } |
|
3395 |
|
3396 //End file |
|
3397 |
|
3398 |
|
3399 |