|
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: Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <stifparser.h> |
|
22 #include <stiftestinterface.h> |
|
23 #include <aknsfld.h> |
|
24 #include <coemain.h> |
|
25 #include <eikedwin.h> |
|
26 |
|
27 #include "testsdksearchfield.h" |
|
28 #include "testsdksearchfieldcontainer.h" |
|
29 #include "testsdksfastobserver.h" |
|
30 #include "testsdksfview.h" |
|
31 |
|
32 const TInt KSearchFieldMaxLength = 256; |
|
33 const TInt KExpected = 0; |
|
34 const TInt KOne = 1; |
|
35 const TInt KThree = 3; |
|
36 |
|
37 _LIT( KText, "TestSearchField" ); |
|
38 _LIT( KGridText, "TestGrid" ); |
|
39 _LIT( KInfoText, "This is my searchfield."); |
|
40 const TInt KBufSize = 32; |
|
41 |
|
42 // ============================ MEMBER FUNCTIONS =============================== |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // Ctestsdksearchfield::Delete |
|
46 // Delete here all resources allocated and opened from test methods. |
|
47 // Called from destructor. |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 void CTestSDKSearchField::Delete() |
|
51 { |
|
52 |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // Ctestsdksearchfield::RunMethodL |
|
57 // Run specified method. Contains also table of test mothods and their names. |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 TInt CTestSDKSearchField::RunMethodL( CStifItemParser& aItem ) |
|
61 { |
|
62 |
|
63 static TStifFunctionInfo const KFunctions[] = |
|
64 { |
|
65 // First string is the function name used in TestScripter script file. |
|
66 // Second is the actual implementation member function. |
|
67 ENTRY( "TestSFNewL", CTestSDKSearchField::TestSFNewL ), |
|
68 ENTRY( "TestSFDelete", CTestSDKSearchField::TestSFDelete ), |
|
69 ENTRY( "TestSFTextLength", CTestSDKSearchField::TestSFTextLength ), |
|
70 ENTRY( "TestSFGetSearchText", CTestSDKSearchField::TestSFGetSearchText ), |
|
71 ENTRY( "TestSFSetSearchTextL", CTestSDKSearchField::TestSFSetSearchTextL ), |
|
72 ENTRY( "TestSFSelectSearchTextL", CTestSDKSearchField::TestSFSelectSearchTextL ), |
|
73 ENTRY( "TestSFResetL", CTestSDKSearchField::TestSFResetL ), |
|
74 ENTRY( "TestSFSetInfoTextL", CTestSDKSearchField::TestSFSetInfoTextL ), |
|
75 ENTRY( "TestSFClipboardL", CTestSDKSearchField::TestSFClipboardL ), |
|
76 ENTRY( "TestSFSearchFieldStyle", CTestSDKSearchField::TestSFSearchFieldStyle ), |
|
77 ENTRY( "TestSFSetSkinEnabledL", CTestSDKSearchField::TestSFSetSkinEnabledL ), |
|
78 ENTRY( "TestSFOfferKeyEventL", CTestSDKSearchField::TestSFOfferKeyEventL ), |
|
79 ENTRY( "TestSFMinimumSize", CTestSDKSearchField::TestSFMinimumSize ), |
|
80 ENTRY( "TestSFMakeVisible", CTestSDKSearchField::TestSFMakeVisible ), |
|
81 ENTRY( "TestSFSetLinePos", CTestSDKSearchField::TestSFSetLinePos ), |
|
82 ENTRY( "TestSFEditor", CTestSDKSearchField::TestSFEditor ), |
|
83 ENTRY( "TestSFSetAdaptiveGridChars", CTestSDKSearchField::TestSFSetAdaptiveGridChars ), |
|
84 ENTRY( "TestSFShowAdaptiveSearchGrid", CTestSDKSearchField::TestSFShowAdaptiveSearchGrid ), |
|
85 ENTRY( "TestSFSetListColumnFilterFlags", CTestSDKSearchField::TestSFSetListColumnFilterFlagsL ), |
|
86 ENTRY( "TestSFListColumnFilterFlags", CTestSDKSearchField::TestSFListColumnFilterFlags ), |
|
87 ENTRY( "TestSFAddAdaptiveSearchTextObserverL", CTestSDKSearchField::TestSFAddAdaptiveSearchTextObserverL ), |
|
88 ENTRY( "TestSFRemoveAdaptiveSearchTextObserver", CTestSDKSearchField::TestSFRemoveAdaptiveSearchTextObserver ), |
|
89 ENTRY( "TestSFAdaptiveSearchEnabled", CTestSDKSearchField::TestSFAdaptiveSearchEnabled ), |
|
90 ENTRY( "TestSFLanguageChanged", CTestSDKSearchField::TestSFLanguageChanged ), |
|
91 |
|
92 // [test cases entries] |
|
93 |
|
94 }; |
|
95 |
|
96 const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); |
|
97 |
|
98 return RunInternalL( KFunctions, count, aItem ); |
|
99 |
|
100 } |
|
101 |
|
102 // ============================ MEMBER FUNCTIONS =============================== |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // Ctestsdksearchfield::TestSFNewL |
|
106 // NewL test method function. |
|
107 // ----------------------------------------------------------------------------- |
|
108 // |
|
109 TInt CTestSDKSearchField::TestSFNewL( CStifItemParser& /*aItem*/ ) |
|
110 { |
|
111 |
|
112 // Print to UI |
|
113 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
114 _LIT( KTestSFNewL, "In Example" ); |
|
115 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFNewL ); |
|
116 // Print to log file |
|
117 iLog->Log( KTestSFNewL ); |
|
118 |
|
119 iObserver = new( ELeave ) CTestSDKSFASTObserver(); |
|
120 |
|
121 iTestSDKSFView = CTestSDKSFView::NewL(); |
|
122 CCoeAppUi* appUi = CCoeEnv::Static()->AppUi(); |
|
123 iTestSDKSearchFieldContainer = new ( ELeave ) CTestSDKSearchFieldContainer(); |
|
124 |
|
125 iTestSDKSearchFieldContainer->SetMopParent( iTestSDKSFView ); |
|
126 iTestSDKSearchFieldContainer->ConstructL( iTestSDKSFView->ClientRect() ); |
|
127 CCoeEnv::Static()->AppUi()->AddToStackL( iTestSDKSearchFieldContainer ); |
|
128 iTestSDKSearchFieldContainer->MakeVisible( ETrue ); |
|
129 |
|
130 iSearchField = CAknSearchField::NewL( *iTestSDKSearchFieldContainer, CAknSearchField::ESearch, NULL, KSearchFieldMaxLength ); |
|
131 STIF_ASSERT_NOT_NULL( iSearchField ); |
|
132 |
|
133 return KErrNone; |
|
134 } |
|
135 |
|
136 // ----------------------------------------------------------------------------- |
|
137 // Ctestsdksearchfield::TestSFDelete |
|
138 // destructor test method function. |
|
139 // ----------------------------------------------------------------------------- |
|
140 // |
|
141 TInt CTestSDKSearchField::TestSFDelete( CStifItemParser& /*aItem*/ ) |
|
142 { |
|
143 |
|
144 // Print to UI |
|
145 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
146 _LIT( KTestSFDelete, "In Example" ); |
|
147 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFDelete ); |
|
148 // Print to log file |
|
149 iLog->Log( KTestSFDelete ); |
|
150 |
|
151 CCoeEnv::Static()->AppUi()->RemoveFromStack( iTestSDKSearchFieldContainer ); |
|
152 delete iSearchField; |
|
153 iSearchField = NULL; |
|
154 |
|
155 return KErrNone; |
|
156 } |
|
157 |
|
158 // ----------------------------------------------------------------------------- |
|
159 // Ctestsdksearchfield::TestSFTextLength |
|
160 // TextLength test method function. |
|
161 // ----------------------------------------------------------------------------- |
|
162 // |
|
163 TInt CTestSDKSearchField::TestSFTextLength( CStifItemParser& /*aItem*/ ) |
|
164 { |
|
165 |
|
166 // Print to UI |
|
167 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
168 _LIT( KTestSFTextLength, "In Example" ); |
|
169 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFTextLength ); |
|
170 // Print to log file |
|
171 iLog->Log( KTestSFTextLength ); |
|
172 |
|
173 TInt length; |
|
174 length = iSearchField->TextLength(); |
|
175 STIF_ASSERT_EQUALS( KExpected, length ); |
|
176 |
|
177 return KErrNone; |
|
178 } |
|
179 |
|
180 // ----------------------------------------------------------------------------- |
|
181 // Ctestsdksearchfield::TestSFGetSearchText |
|
182 // GetSearchText test method function. |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 TInt CTestSDKSearchField::TestSFGetSearchText( CStifItemParser& /*aItem*/ ) |
|
186 { |
|
187 |
|
188 // Print to UI |
|
189 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
190 _LIT( KTestSFGetSearchText, "In Example" ); |
|
191 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFGetSearchText ); |
|
192 // Print to log file |
|
193 iLog->Log( KTestSFGetSearchText ); |
|
194 |
|
195 TBuf<KBufSize> expectedTxt( KText ); |
|
196 TBuf<KBufSize> rSearchTxt; |
|
197 iSearchField->GetSearchText( rSearchTxt ); |
|
198 TBool flag = expectedTxt == rSearchTxt; |
|
199 STIF_ASSERT_TRUE( flag ); |
|
200 |
|
201 return KErrNone; |
|
202 } |
|
203 |
|
204 |
|
205 // ----------------------------------------------------------------------------- |
|
206 // Ctestsdksearchfield::TestSFSetSearchTextL |
|
207 // SetSearchTextL test method function. |
|
208 // ----------------------------------------------------------------------------- |
|
209 // |
|
210 TInt CTestSDKSearchField::TestSFSetSearchTextL( CStifItemParser& /*aItem*/ ) |
|
211 { |
|
212 // Print to UI |
|
213 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
214 _LIT( KTestSFSetSearchTextL, "In Example" ); |
|
215 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFSetSearchTextL ); |
|
216 // Print to log file |
|
217 iLog->Log( KTestSFSetSearchTextL ); |
|
218 |
|
219 iSearchField->SetSearchTextL( KText ); |
|
220 |
|
221 return KErrNone; |
|
222 } |
|
223 |
|
224 // ----------------------------------------------------------------------------- |
|
225 // Ctestsdksearchfield::TestSFSelectSearchTextL |
|
226 // SelectSearchTextL test method function. |
|
227 // ----------------------------------------------------------------------------- |
|
228 // |
|
229 TInt CTestSDKSearchField::TestSFSelectSearchTextL( CStifItemParser& /*aItem*/ ) |
|
230 { |
|
231 // Print to UI |
|
232 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
233 _LIT( KTestSFSelectSearchTextL, "In Example" ); |
|
234 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFSelectSearchTextL ); |
|
235 // Print to log file |
|
236 iLog->Log( KTestSFSelectSearchTextL ); |
|
237 |
|
238 iSearchField->SelectSearchTextL(); |
|
239 |
|
240 return KErrNone; |
|
241 } |
|
242 |
|
243 // ----------------------------------------------------------------------------- |
|
244 // Ctestsdksearchfield::TestSFResetL |
|
245 // ResetL test method function. |
|
246 // ----------------------------------------------------------------------------- |
|
247 // |
|
248 TInt CTestSDKSearchField::TestSFResetL( CStifItemParser& /*aItem*/ ) |
|
249 { |
|
250 // Print to UI |
|
251 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
252 _LIT( KTestSFResetL, "In Example" ); |
|
253 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFResetL ); |
|
254 // Print to log file |
|
255 iLog->Log( KTestSFResetL ); |
|
256 |
|
257 iSearchField->ResetL(); |
|
258 return KErrNone; |
|
259 } |
|
260 |
|
261 // ----------------------------------------------------------------------------- |
|
262 // Ctestsdksearchfield::TestSFSetInfoTextL |
|
263 // SetInfoTextL test method function. |
|
264 // ----------------------------------------------------------------------------- |
|
265 // |
|
266 TInt CTestSDKSearchField::TestSFSetInfoTextL( CStifItemParser& /*aItem*/ ) |
|
267 { |
|
268 // Print to UI |
|
269 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
270 _LIT( KTestSFSetInfoTextL, "In Example" ); |
|
271 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFSetInfoTextL ); |
|
272 // Print to log file |
|
273 iLog->Log( KTestSFSetInfoTextL ); |
|
274 |
|
275 iSearchField->SetInfoTextL( KInfoText ); |
|
276 |
|
277 return KErrNone; |
|
278 } |
|
279 |
|
280 // ----------------------------------------------------------------------------- |
|
281 // Ctestsdksearchfield::TestSFClipboardL |
|
282 // ClipboardL test method function. |
|
283 // ----------------------------------------------------------------------------- |
|
284 // |
|
285 TInt CTestSDKSearchField::TestSFClipboardL( CStifItemParser& /*aItem*/ ) |
|
286 { |
|
287 // Print to UI |
|
288 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
289 _LIT( KTestSFClipboardL, "In Example" ); |
|
290 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFClipboardL ); |
|
291 // Print to log file |
|
292 iLog->Log( KTestSFClipboardL ); |
|
293 |
|
294 iSearchField->ClipboardL( CEikEdwin::ECopy ); |
|
295 |
|
296 return KErrNone; |
|
297 } |
|
298 |
|
299 // ----------------------------------------------------------------------------- |
|
300 // Ctestsdksearchfield::TestSFSearchFieldStyle |
|
301 // SearchFieldStyle test method function. |
|
302 // ----------------------------------------------------------------------------- |
|
303 // |
|
304 TInt CTestSDKSearchField::TestSFSearchFieldStyle( CStifItemParser& /*aItem*/ ) |
|
305 { |
|
306 |
|
307 // Print to UI |
|
308 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
309 _LIT( KTestSFSearchFieldStyle, "In Example" ); |
|
310 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFSearchFieldStyle ); |
|
311 // Print to log file |
|
312 iLog->Log( KTestSFSearchFieldStyle ); |
|
313 |
|
314 CAknSearchField::TSearchFieldStyle axpected = CAknSearchField::ESearch; |
|
315 CAknSearchField::TSearchFieldStyle style = iSearchField->SearchFieldStyle(); |
|
316 STIF_ASSERT_EQUALS( axpected, style ); |
|
317 |
|
318 return KErrNone; |
|
319 } |
|
320 |
|
321 // ----------------------------------------------------------------------------- |
|
322 // Ctestsdksearchfield::TestSFSetSkinEnabledL |
|
323 // SetSkinEnabledL test method function. |
|
324 // ----------------------------------------------------------------------------- |
|
325 // |
|
326 TInt CTestSDKSearchField::TestSFSetSkinEnabledL( CStifItemParser& aItem ) |
|
327 { |
|
328 |
|
329 // Print to UI |
|
330 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
331 _LIT( KTestSFSetSkinEnabledL, "In Example" ); |
|
332 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFSetSkinEnabledL ); |
|
333 // Print to log file |
|
334 iLog->Log( KTestSFSetSkinEnabledL ); |
|
335 |
|
336 TInt choose; |
|
337 aItem.GetNextInt( choose ); |
|
338 if ( choose == 1 ) |
|
339 { |
|
340 iSearchField->SetSkinEnabledL( ETrue ); |
|
341 } |
|
342 else |
|
343 { |
|
344 iSearchField->SetSkinEnabledL( EFalse ); |
|
345 } |
|
346 |
|
347 return KErrNone; |
|
348 } |
|
349 |
|
350 // ----------------------------------------------------------------------------- |
|
351 // Ctestsdksearchfield::TestSFOfferKeyEventL |
|
352 // OfferKeyEventL test method function. |
|
353 // ----------------------------------------------------------------------------- |
|
354 // |
|
355 TInt CTestSDKSearchField::TestSFOfferKeyEventL( CStifItemParser& /*aItem*/ ) |
|
356 { |
|
357 |
|
358 // Print to UI |
|
359 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
360 _LIT( KTestSFOfferKeyEventL, "In Example" ); |
|
361 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFOfferKeyEventL ); |
|
362 // Print to log file |
|
363 iLog->Log( KTestSFOfferKeyEventL ); |
|
364 |
|
365 TKeyEvent keyevent; |
|
366 keyevent.iCode = EKeyOK; |
|
367 iSearchField->OfferKeyEventL( keyevent, EEventKey ); |
|
368 |
|
369 keyevent.iCode = EKeyRightArrow; |
|
370 iSearchField->OfferKeyEventL( keyevent, EEventKey ); |
|
371 |
|
372 keyevent.iCode = EKeyLeftArrow; |
|
373 iSearchField->OfferKeyEventL( keyevent, EEventKey ); |
|
374 |
|
375 keyevent.iCode = EKeyUpArrow; |
|
376 iSearchField->OfferKeyEventL( keyevent, EEventKey ); |
|
377 |
|
378 keyevent.iCode = EKeyDownArrow; |
|
379 iSearchField->OfferKeyEventL( keyevent, EEventKey ); |
|
380 |
|
381 return KErrNone; |
|
382 } |
|
383 |
|
384 // ----------------------------------------------------------------------------- |
|
385 // Ctestsdksearchfield::TestSFMinimumSize |
|
386 // MinimumSize test method function. |
|
387 // ----------------------------------------------------------------------------- |
|
388 // |
|
389 TInt CTestSDKSearchField::TestSFMinimumSize( CStifItemParser& /*aItem*/ ) |
|
390 { |
|
391 |
|
392 // Print to UI |
|
393 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
394 _LIT( KTestSFMinimumSize, "In Example" ); |
|
395 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMinimumSize ); |
|
396 // Print to log file |
|
397 iLog->Log( KTestSFMinimumSize ); |
|
398 |
|
399 TSize size = iSearchField->MinimumSize(); |
|
400 |
|
401 return KErrNone; |
|
402 } |
|
403 |
|
404 // ----------------------------------------------------------------------------- |
|
405 // Ctestsdksearchfield::TestSFMakeVisible |
|
406 // MakeVisible test method function. |
|
407 // ----------------------------------------------------------------------------- |
|
408 // |
|
409 TInt CTestSDKSearchField::TestSFMakeVisible( CStifItemParser& /*aItem*/ ) |
|
410 { |
|
411 |
|
412 // Print to UI |
|
413 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
414 _LIT( KTestSFMakeVisible, "In Example" ); |
|
415 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
416 // Print to log file |
|
417 iLog->Log( KTestSFMakeVisible ); |
|
418 |
|
419 iSearchField->MakeVisible( ETrue ); |
|
420 iSearchField->MakeVisible( EFalse ); |
|
421 |
|
422 return KErrNone; |
|
423 } |
|
424 |
|
425 // ----------------------------------------------------------------------------- |
|
426 // Ctestsdksearchfield::TestSFSetLinePos |
|
427 // SetLinePos test method function. |
|
428 // ----------------------------------------------------------------------------- |
|
429 // |
|
430 TInt CTestSDKSearchField::TestSFSetLinePos( CStifItemParser& /*aItem*/ ) |
|
431 { |
|
432 |
|
433 // Print to UI |
|
434 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
435 _LIT( KTestSFMakeVisible, "In Example" ); |
|
436 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
437 // Print to log file |
|
438 iLog->Log( KTestSFMakeVisible ); |
|
439 |
|
440 // two path for 1 and 3 |
|
441 iSearchField->SetLinePos( KOne ); |
|
442 iSearchField->SetLinePos( KThree ); |
|
443 |
|
444 return KErrNone; |
|
445 } |
|
446 |
|
447 // ----------------------------------------------------------------------------- |
|
448 // Ctestsdksearchfield::TestSFEditor |
|
449 // Editor test method function. |
|
450 // ----------------------------------------------------------------------------- |
|
451 // |
|
452 TInt CTestSDKSearchField::TestSFEditor( CStifItemParser& /*aItem*/ ) |
|
453 { |
|
454 |
|
455 // Print to UI |
|
456 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
457 _LIT( KTestSFMakeVisible, "In Example" ); |
|
458 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
459 // Print to log file |
|
460 iLog->Log( KTestSFMakeVisible ); |
|
461 |
|
462 CEikEdwin& edwin = iSearchField->Editor(); |
|
463 |
|
464 return KErrNone; |
|
465 } |
|
466 |
|
467 // ----------------------------------------------------------------------------- |
|
468 // Ctestsdksearchfield::TestSFSetAdaptiveGridChars |
|
469 // SetAdaptiveGridChars test method function. |
|
470 // ----------------------------------------------------------------------------- |
|
471 // |
|
472 TInt CTestSDKSearchField::TestSFSetAdaptiveGridChars( CStifItemParser& /*aItem*/ ) |
|
473 { |
|
474 |
|
475 // Print to UI |
|
476 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
477 _LIT( KTestSFMakeVisible, "In Example" ); |
|
478 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
479 // Print to log file |
|
480 iLog->Log( KTestSFMakeVisible ); |
|
481 |
|
482 iSearchField->SetAdaptiveGridChars( KGridText ); |
|
483 |
|
484 return KErrNone; |
|
485 } |
|
486 |
|
487 // ----------------------------------------------------------------------------- |
|
488 // Ctestsdksearchfield::TestSFShowAdaptiveSearchGrid |
|
489 // ShowAdaptiveSearchGrid test method function. |
|
490 // ----------------------------------------------------------------------------- |
|
491 // |
|
492 TInt CTestSDKSearchField::TestSFShowAdaptiveSearchGrid( CStifItemParser& /*aItem*/ ) |
|
493 { |
|
494 |
|
495 // Print to UI |
|
496 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
497 _LIT( KTestSFMakeVisible, "In Example" ); |
|
498 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
499 // Print to log file |
|
500 iLog->Log( KTestSFMakeVisible ); |
|
501 |
|
502 iSearchField->ShowAdaptiveSearchGrid(); |
|
503 |
|
504 return KErrNone; |
|
505 } |
|
506 |
|
507 // ----------------------------------------------------------------------------- |
|
508 // Ctestsdksearchfield::TestSFSetListColumnFilterFlags |
|
509 // SetListColumnFilterFlags test method function. |
|
510 // ----------------------------------------------------------------------------- |
|
511 // |
|
512 TInt CTestSDKSearchField::TestSFSetListColumnFilterFlagsL( CStifItemParser& /*aItem*/ ) |
|
513 { |
|
514 |
|
515 // Print to UI |
|
516 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
517 _LIT( KTestSFMakeVisible, "In Example" ); |
|
518 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
519 // Print to log file |
|
520 iLog->Log( KTestSFMakeVisible ); |
|
521 |
|
522 TBitFlags32* bitFlag = new( ELeave ) TBitFlags32(); |
|
523 CleanupStack::PushL( bitFlag ); |
|
524 iSearchField->SetListColumnFilterFlags( *bitFlag ); |
|
525 CleanupStack::Pop( bitFlag ); |
|
526 |
|
527 return KErrNone; |
|
528 } |
|
529 |
|
530 // ----------------------------------------------------------------------------- |
|
531 // Ctestsdksearchfield::TestSFListColumnFilterFlags |
|
532 // ListColumnFilterFlags test method function. |
|
533 // ----------------------------------------------------------------------------- |
|
534 // |
|
535 TInt CTestSDKSearchField::TestSFListColumnFilterFlags( CStifItemParser& /*aItem*/ ) |
|
536 { |
|
537 |
|
538 // Print to UI |
|
539 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
540 _LIT( KTestSFMakeVisible, "In Example" ); |
|
541 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
542 // Print to log file |
|
543 iLog->Log( KTestSFMakeVisible ); |
|
544 |
|
545 iSearchField->ListColumnFilterFlags(); |
|
546 |
|
547 return KErrNone; |
|
548 } |
|
549 |
|
550 // ----------------------------------------------------------------------------- |
|
551 // Ctestsdksearchfield::TestSFAddAdaptiveSearchTextObserverL |
|
552 // AddAdaptiveSearchTextObserverL test method function. |
|
553 // ----------------------------------------------------------------------------- |
|
554 // |
|
555 TInt CTestSDKSearchField::TestSFAddAdaptiveSearchTextObserverL( CStifItemParser& /*aItem*/ ) |
|
556 { |
|
557 |
|
558 // Print to UI |
|
559 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
560 _LIT( KTestSFMakeVisible, "In Example" ); |
|
561 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
562 // Print to log file |
|
563 iLog->Log( KTestSFMakeVisible ); |
|
564 |
|
565 iSearchField->AddAdaptiveSearchTextObserverL( iObserver ); |
|
566 |
|
567 return KErrNone; |
|
568 } |
|
569 |
|
570 // ----------------------------------------------------------------------------- |
|
571 // Ctestsdksearchfield::TestSFRemoveAdaptiveSearchTextObserver |
|
572 // RemoveAdaptiveSearchTextObserver test method function. |
|
573 // ----------------------------------------------------------------------------- |
|
574 // |
|
575 TInt CTestSDKSearchField::TestSFRemoveAdaptiveSearchTextObserver( CStifItemParser& /*aItem*/ ) |
|
576 { |
|
577 |
|
578 // Print to UI |
|
579 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
580 _LIT( KTestSFMakeVisible, "In Example" ); |
|
581 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
582 // Print to log file |
|
583 iLog->Log( KTestSFMakeVisible ); |
|
584 |
|
585 TBool flag = iSearchField->RemoveAdaptiveSearchTextObserver( iObserver ); |
|
586 |
|
587 return KErrNone; |
|
588 } |
|
589 |
|
590 // ----------------------------------------------------------------------------- |
|
591 // Ctestsdksearchfield::TestSFAdaptiveSearchEnabled |
|
592 // AdaptiveSearchEnabled test method function. |
|
593 // ----------------------------------------------------------------------------- |
|
594 // |
|
595 TInt CTestSDKSearchField::TestSFAdaptiveSearchEnabled( CStifItemParser& /*aItem*/ ) |
|
596 { |
|
597 |
|
598 // Print to UI |
|
599 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
600 _LIT( KTestSFMakeVisible, "In Example" ); |
|
601 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
602 // Print to log file |
|
603 iLog->Log( KTestSFMakeVisible ); |
|
604 |
|
605 TBool flag = iSearchField->AdaptiveSearchEnabled(); |
|
606 |
|
607 return KErrNone; |
|
608 } |
|
609 |
|
610 // ----------------------------------------------------------------------------- |
|
611 // Ctestsdksearchfield::TestSFLanguageChanged |
|
612 // LanguageChanged test method function. |
|
613 // ----------------------------------------------------------------------------- |
|
614 // |
|
615 TInt CTestSDKSearchField::TestSFLanguageChanged( CStifItemParser& /*aItem*/ ) |
|
616 { |
|
617 |
|
618 // Print to UI |
|
619 _LIT( Ktestsdksearchfield, "testsdksearchfield" ); |
|
620 _LIT( KTestSFMakeVisible, "In Example" ); |
|
621 TestModuleIf().Printf( 0, Ktestsdksearchfield, KTestSFMakeVisible ); |
|
622 // Print to log file |
|
623 iLog->Log( KTestSFMakeVisible ); |
|
624 |
|
625 TBool flag = iSearchField->LanguageChanged(); |
|
626 |
|
627 return KErrNone; |
|
628 } |
|
629 |
|
630 // [End of File] |