classicui_pub/dialogs_api/tsrc/src/testsdkdialogsblocks.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     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 EIKDIALG.H
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // [INCLUDE FILES]
       
    20 #include <e32svr.h>
       
    21 #include <stifparser.h>
       
    22 #include <stiftestinterface.h>
       
    23 #include <eikdialg.h>
       
    24 #include <testsdkdialogs.rsg>
       
    25 #include <coeaui.h>
       
    26 #include <avkon.rsg>
       
    27 #include <eikcapc.h> 
       
    28 #include <eikedwin.h> 
       
    29 #include <eikbtgpc.h> 
       
    30 #include <coecntrl.h>
       
    31 #include <akncontrol.h> 
       
    32 #include <coedef.h>
       
    33 #include <akndef.h>
       
    34 #include <eikon.hrh>
       
    35 #include <uikon.hrh>
       
    36 #include <s32std.h>
       
    37 #include <eikmfne.h> 
       
    38 #include <eikfpne.h>
       
    39 #include <eikseced.h> 
       
    40 #include <eikgted.h> 
       
    41 #include <txtglobl.h> 
       
    42 #include <barsread.h>
       
    43 #include <eikrted.h> 
       
    44 #include <flddef.h>
       
    45 #include <s32mem.h>
       
    46 #include <eikmover.h>
       
    47 #include <eikdpage.h> 
       
    48 #include <coecobs.h>
       
    49 #include <aknborders.h> 
       
    50 #include <eiktxlbm.h> 
       
    51 #include <txtrich.h>
       
    52 
       
    53 #include "testsdkdialogs.hrh"
       
    54 #include "testsdkdialogs.h"
       
    55 #include "testsdkdialogscontrol.h"
       
    56 
       
    57 // ============================ MEMBER FUNCTIONS ===============================
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CTestSDKDialogs::Delete
       
    61 // Delete here all resources allocated and opened from test methods. 
       
    62 // Called from destructor. 
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 void CTestSDKDialogs::Delete() 
       
    66     {
       
    67 
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // Ctestsdkdialogs::RunMethodL
       
    72 // Run specified method. Contains also table of test mothods and their names.
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 TInt CTestSDKDialogs::RunMethodL( CStifItemParser& aItem ) 
       
    76     {
       
    77     static TStifFunctionInfo const KFunctions[] =
       
    78         {  
       
    79         ENTRY( "TestDCEikDialogL", CTestSDKDialogs::TestDCEikDialogL ),
       
    80         ENTRY( "TestDDeconstructorL", CTestSDKDialogs::TestDDeconstructorL ),
       
    81         ENTRY( "TestDExecuteLD", CTestSDKDialogs::TestDExecuteLD ),
       
    82         ENTRY( "TestDPrepareLC", CTestSDKDialogs::TestDPrepareLC ),
       
    83         ENTRY( "TestDReadResourceLC", CTestSDKDialogs::TestDReadResourceLC ),
       
    84         ENTRY( "TestDRunLD", CTestSDKDialogs::TestDRunLD ),
       
    85         ENTRY( "TestDSetTitleTDesCL", CTestSDKDialogs::TestDSetTitleTDesCL ),
       
    86         ENTRY( "TestDSetTitleResourceL", CTestSDKDialogs::TestDSetTitleResourceL ),
       
    87         ENTRY( "TestDSetPageDimmedNowL", CTestSDKDialogs::TestDSetPageDimmedNowL ),
       
    88         ENTRY( "TestDSetLineNonFocusingL", CTestSDKDialogs::TestDSetLineNonFocusingL ),
       
    89         ENTRY( "TestDSetLineDimmedNowL", CTestSDKDialogs::TestDSetLineDimmedNowL ),
       
    90         ENTRY( "TestDMakeLineVisibleL", CTestSDKDialogs::TestDMakeLineVisibleL ),
       
    91         ENTRY( "TestDMakeWholeLineVisibleL", CTestSDKDialogs::TestDMakeWholeLineVisibleL ),
       
    92         ENTRY( "TestDDeleteLineL", CTestSDKDialogs::TestDDeleteLineL ),
       
    93         ENTRY( "TestDInsertLineL", CTestSDKDialogs::TestDInsertLineL ),
       
    94         ENTRY( "TestDMakePanelButtonVisibleL", CTestSDKDialogs::TestDMakePanelButtonVisibleL ),
       
    95         ENTRY( "TestDTryChangeFocusToL", CTestSDKDialogs::TestDTryChangeFocusToL ),
       
    96         ENTRY( "TestDSwitchLineLatencyL", CTestSDKDialogs::TestDSwitchLineLatencyL ),
       
    97         ENTRY( "TestDSetPageDensePackingL", CTestSDKDialogs::TestDSetPageDensePackingL ),
       
    98         ENTRY( "TestDConstructAutoDialogLC", CTestSDKDialogs::TestDConstructAutoDialogLC ),
       
    99         ENTRY( "TestDDeclareItemAutoL", CTestSDKDialogs::TestDDeclareItemAutoL ),
       
   100         ENTRY( "TestDLayoutL", CTestSDKDialogs::TestDLayoutL ),
       
   101         ENTRY( "TestDPreferredSizeL", CTestSDKDialogs::TestDPreferredSizeL ),
       
   102         ENTRY( "TestDCreateLineByTypeL", CTestSDKDialogs::TestDCreateLineByTypeL ),
       
   103         ENTRY( "TestDCreateLineByTypePageIdL", CTestSDKDialogs::TestDCreateLineByTypePageIdL ),
       
   104         ENTRY( "TestDSetControlCaptionTextL", CTestSDKDialogs::TestDSetControlCaptionTextL ),
       
   105         ENTRY( "TestDSetControlCaptionResourceIdL", CTestSDKDialogs::TestDSetControlCaptionResourceIdL ),
       
   106         ENTRY( "TestDControlCaptionL", CTestSDKDialogs::TestDControlCaptionL ),
       
   107         ENTRY( "TestDControlL", CTestSDKDialogs::TestDControlL ),
       
   108         ENTRY( "TestDControlOrNullL", CTestSDKDialogs::TestDControlOrNullL ),
       
   109         ENTRY( "TestDButtonGroupContainerL", CTestSDKDialogs::TestDButtonGroupContainerL ),
       
   110         ENTRY( "TestDTitleL", CTestSDKDialogs::TestDTitleL ),
       
   111         ENTRY( "TestDActivePageIdL", CTestSDKDialogs::TestDActivePageIdL ),
       
   112         ENTRY( "TestDActivateFirstPageL", CTestSDKDialogs::TestDActivateFirstPageL ),
       
   113         ENTRY( "TestDSetEditableL", CTestSDKDialogs::TestDSetEditableL ),
       
   114         ENTRY( "TestDIsEditableL", CTestSDKDialogs::TestDIsEditableL ),
       
   115         ENTRY( "TestDOfferKeyEventL", CTestSDKDialogs::TestDOfferKeyEventL ),
       
   116         ENTRY( "TestDFocusChangedL", CTestSDKDialogs::TestDFocusChangedL ),
       
   117         ENTRY( "TestDGetColorUseListL", CTestSDKDialogs::TestDGetColorUseListL ),
       
   118         ENTRY( "TestDHandleResourceChangeL", CTestSDKDialogs::TestDHandleResourceChangeL ),
       
   119         ENTRY( "TestDInputCapabilitiesL", CTestSDKDialogs::TestDInputCapabilitiesL ),
       
   120         ENTRY( "TestDMakeVisibleL", CTestSDKDialogs::TestDMakeVisibleL ),
       
   121         ENTRY( "TestDHandlePointerEventL", CTestSDKDialogs::TestDHandlePointerEventL ),
       
   122         ENTRY( "TestDPrepareForFocusTransitionL", CTestSDKDialogs::TestDPrepareForFocusTransitionL ),
       
   123         ENTRY( "TestDPageChangedL", CTestSDKDialogs::TestDPageChangedL ),
       
   124         ENTRY( "TestDLineChangedL", CTestSDKDialogs::TestDLineChangedL ),
       
   125         ENTRY( "TestDCreateCustomControlL", CTestSDKDialogs::TestDCreateCustomControlL ),
       
   126         ENTRY( "TestDConvertCustomControlTypeToBaseControlTypeL", CTestSDKDialogs::TestDConvertCustomControlTypeToBaseControlTypeL ),
       
   127         ENTRY( "TestDGetCustomAutoValueL", CTestSDKDialogs::TestDGetCustomAutoValueL ),
       
   128         ENTRY( "TestDPrepareContextL", CTestSDKDialogs::TestDPrepareContextL ),
       
   129         ENTRY( "TestDWriteInternalStateL", CTestSDKDialogs::TestDWriteInternalStateL ),
       
   130         ENTRY( "TestDCountComponentControlsL", CTestSDKDialogs::TestDCountComponentControlsL ),
       
   131         ENTRY( "TestDComponentControlL", CTestSDKDialogs::TestDComponentControlL ),
       
   132         ENTRY( "TestDGetNumberOfLinesOnPageL", CTestSDKDialogs::TestDGetNumberOfLinesOnPageL ),
       
   133         ENTRY( "TestDGetNumberOfPagesL", CTestSDKDialogs::TestDGetNumberOfPagesL ),
       
   134         ENTRY( "TestDGetLineByLineAndPageIndexL", CTestSDKDialogs::TestDGetLineByLineAndPageIndexL ),
       
   135         ENTRY( "TestDHandleControlEventL", CTestSDKDialogs::TestDHandleControlEventL ),
       
   136         ENTRY( "TestDTryExitL", CTestSDKDialogs::TestDTryExitL ),
       
   137         ENTRY( "TestDAdjustAllIdsOnPageL", CTestSDKDialogs::TestDAdjustAllIdsOnPageL ),
       
   138         ENTRY( "TestDConstructSleepingDialogL", CTestSDKDialogs::TestDConstructSleepingDialogL ),
       
   139         ENTRY( "TestDConstructSleepingAlertDialogL", CTestSDKDialogs::TestDConstructSleepingAlertDialogL ),
       
   140         ENTRY( "TestDRouseSleepingDialogL", CTestSDKDialogs::TestDRouseSleepingDialogL ),
       
   141         ENTRY( "TestDExitSleepingDialogL", CTestSDKDialogs::TestDExitSleepingDialogL ),
       
   142         ENTRY( "TestDIdOfFocusControlL", CTestSDKDialogs::TestDIdOfFocusControlL ),
       
   143         ENTRY( "TestDFindLineIndexL", CTestSDKDialogs::TestDFindLineIndexL ),
       
   144         ENTRY( "TestDLineL", CTestSDKDialogs::TestDLineL ),
       
   145         ENTRY( "TestDCurrentLineL", CTestSDKDialogs::TestDCurrentLineL ),
       
   146         ENTRY( "TestDRotateFocusByL", CTestSDKDialogs::TestDRotateFocusByL ),
       
   147         ENTRY( "TestDActivePageIndexL", CTestSDKDialogs::TestDActivePageIndexL ),
       
   148         ENTRY( "TestDResetLineMinimumSizesL", CTestSDKDialogs::TestDResetLineMinimumSizesL ),
       
   149         ENTRY( "TestDSwapButtonGroupContainerL", CTestSDKDialogs::TestDSwapButtonGroupContainerL ),
       
   150         ENTRY( "TestDButtonCommandObserverL", CTestSDKDialogs::TestDButtonCommandObserverL ),
       
   151         ENTRY( "TestDOkToExitL", CTestSDKDialogs::TestDOkToExitL ),
       
   152         ENTRY( "TestDPreLayoutDynInitL", CTestSDKDialogs::TestDPreLayoutDynInitL ),
       
   153         ENTRY( "TestDPostLayoutDynInitL", CTestSDKDialogs::TestDPostLayoutDynInitL ),
       
   154         ENTRY( "TestDSetInitialCurrentLineL", CTestSDKDialogs::TestDSetInitialCurrentLineL ),
       
   155         ENTRY( "TestDHandleControlStateChangeL", CTestSDKDialogs::TestDHandleControlStateChangeL ),
       
   156         ENTRY( "TestDHandleInteractionRefusedL", CTestSDKDialogs::TestDHandleInteractionRefusedL ),
       
   157         ENTRY( "TestDSetSizeAndPositionL", CTestSDKDialogs::TestDSetSizeAndPositionL ),
       
   158         ENTRY( "TestDBorderStyleL", CTestSDKDialogs::TestDBorderStyleL ),
       
   159         ENTRY( "TestDMappedCommandIdL", CTestSDKDialogs::TestDMappedCommandIdL ),
       
   160         ENTRY( "TestDFormFlagsFromActivePageL", CTestSDKDialogs::TestDFormFlagsFromActivePageL ),
       
   161         ENTRY( "TestDGetFirstLineOnFirstPageOrNullL", CTestSDKDialogs::TestDGetFirstLineOnFirstPageOrNullL ),
       
   162         ENTRY( "TestDControlsOnPageL", CTestSDKDialogs::TestDControlsOnPageL ),
       
   163         ENTRY( "TestDMopSupplyObjectL", CTestSDKDialogs::TestDMopSupplyObjectL ),
       
   164         ENTRY( "TestDExtensionL", CTestSDKDialogs::TestDExtensionL ),
       
   165         ENTRY( "TestDDialogFlagsL", CTestSDKDialogs::TestDDialogFlagsL ),
       
   166         ENTRY( "TestDDeclareAutoTextEditorL", CTestSDKDialogs::TestDDeclareAutoTextEditorL ),
       
   167         ENTRY( "TestDDeclareAutoNumberEditorL", CTestSDKDialogs::TestDDeclareAutoNumberEditorL ),
       
   168         ENTRY( "TestDDeclareAutoRangeEditorL", CTestSDKDialogs::TestDDeclareAutoRangeEditorL ),
       
   169         ENTRY( "TestDDeclareAutoTimeEditorL", CTestSDKDialogs::TestDDeclareAutoTimeEditorL ),
       
   170         ENTRY( "TestDDeclareAutoDateEditorL", CTestSDKDialogs::TestDDeclareAutoDateEditorL ),
       
   171         ENTRY( "TestDDeclareAutoTimeAndDateEditorL", CTestSDKDialogs::TestDDeclareAutoTimeAndDateEditorL ),
       
   172         ENTRY( "TestDDeclareAutoDurationEditorL", CTestSDKDialogs::TestDDeclareAutoDurationEditorL ),
       
   173         ENTRY( "TestDDeclareAutoTimeOffsetEditorL", CTestSDKDialogs::TestDDeclareAutoTimeOffsetEditorL ),
       
   174         ENTRY( "TestDDeclareAutoFixedPointEditorL", CTestSDKDialogs::TestDDeclareAutoFixedPointEditorL ),
       
   175         ENTRY( "TestDDeclareAutoSecretEditorL", CTestSDKDialogs::TestDDeclareAutoSecretEditorL ),
       
   176         ENTRY( "TestDAddAutoTextEditorL", CTestSDKDialogs::TestDAddAutoTextEditorL ),
       
   177         ENTRY( "TestDAddAutoGlobalTextEditorL", CTestSDKDialogs::TestDAddAutoGlobalTextEditorL ),
       
   178         ENTRY( "TestDAddAutoRichTextEditorL", CTestSDKDialogs::TestDAddAutoRichTextEditorL ),
       
   179         ENTRY( "TestDAddAutoNumberEditorL", CTestSDKDialogs::TestDAddAutoNumberEditorL ),
       
   180         ENTRY( "TestDAddAutoRangeEditorL", CTestSDKDialogs::TestDAddAutoRangeEditorL ),
       
   181         ENTRY( "TestDAddAutoTimeEditorL", CTestSDKDialogs::TestDAddAutoTimeEditorL ),
       
   182         ENTRY( "TestDAddAutoDateEditorL", CTestSDKDialogs::TestDAddAutoDateEditorL ),
       
   183         ENTRY( "TestDAddAutoTimeAndDateEditorL", CTestSDKDialogs::TestDAddAutoTimeAndDateEditorL ),
       
   184         ENTRY( "TestDAddAutoDurationEditorL", CTestSDKDialogs::TestDAddAutoDurationEditorL ),
       
   185         ENTRY( "TestDAddAutoTimeOffsetEditorL", CTestSDKDialogs::TestDAddAutoTimeOffsetEditorL ),
       
   186         ENTRY( "TestDAddAutoFloatEditorL", CTestSDKDialogs::TestDAddAutoFloatEditorL ),
       
   187         ENTRY( "TestDAddAutoFixedPointEditorL", CTestSDKDialogs::TestDAddAutoFixedPointEditorL ),
       
   188         ENTRY( "TestDAddAutoSecretEditorL", CTestSDKDialogs::TestDAddAutoSecretEditorL ),
       
   189         ENTRY( "TestDSetLabelByDesL", CTestSDKDialogs::TestDSetLabelByDesL ),
       
   190         ENTRY( "TestDSetLabelByResourceIdL", CTestSDKDialogs::TestDSetLabelByResourceIdL ),
       
   191         ENTRY( "TestDSetLabelReserveLengthL", CTestSDKDialogs::TestDSetLabelReserveLengthL ),
       
   192         ENTRY( "TestDSetEdwinTextL", CTestSDKDialogs::TestDSetEdwinTextL ),
       
   193         ENTRY( "TestDSetTextEditorTextL", CTestSDKDialogs::TestDSetTextEditorTextL ),
       
   194         ENTRY( "TestDResetSecretEditorL", CTestSDKDialogs::TestDResetSecretEditorL ),
       
   195         ENTRY( "TestDSetFloatingPointEditorValueL", CTestSDKDialogs::TestDSetFloatingPointEditorValueL ),
       
   196         ENTRY( "TestDSetFixedPointEditorValueL", CTestSDKDialogs::TestDSetFixedPointEditorValueL ),
       
   197         ENTRY( "TestDSetFixedPointEditorDecimalL", CTestSDKDialogs::TestDSetFixedPointEditorDecimalL ),
       
   198         ENTRY( "TestDSetNumberEditorMinAndMaxL", CTestSDKDialogs::TestDSetNumberEditorMinAndMaxL ),
       
   199         ENTRY( "TestDSetNumberEditorValueL", CTestSDKDialogs::TestDSetNumberEditorValueL ),
       
   200         ENTRY( "TestDSetFloatEditorMinAndMaxL", CTestSDKDialogs::TestDSetFloatEditorMinAndMaxL ),
       
   201         ENTRY( "TestDSetFloatEditorValueL", CTestSDKDialogs::TestDSetFloatEditorValueL ),
       
   202         ENTRY( "TestDSetRangeEditorMinAndMaxL", CTestSDKDialogs::TestDSetRangeEditorMinAndMaxL ),
       
   203         ENTRY( "TestDSetRangeEditorValueL", CTestSDKDialogs::TestDSetRangeEditorValueL ),
       
   204         ENTRY( "TestDSetTTimeEditorMinAndMaxL", CTestSDKDialogs::TestDSetTTimeEditorMinAndMaxL ),
       
   205         ENTRY( "TestDSetTTimeEditorValueL", CTestSDKDialogs::TestDSetTTimeEditorValueL ),
       
   206         ENTRY( "TestDSetDurationEditorMinAndMaxL", CTestSDKDialogs::TestDSetDurationEditorMinAndMaxL ),
       
   207         ENTRY( "TestDSetDurationEditorValueL", CTestSDKDialogs::TestDSetDurationEditorValueL ),
       
   208         ENTRY( "TestDSetTimeOffsetEditorMinAndMaxL", CTestSDKDialogs::TestDSetTimeOffsetEditorMinAndMaxL ),
       
   209         ENTRY( "TestDSetTimeOffsetEditorValueL", CTestSDKDialogs::TestDSetTimeOffsetEditorValueL ),
       
   210         ENTRY( "TestDSetListBoxCurrentItemL", CTestSDKDialogs::TestDSetListBoxCurrentItemL ),
       
   211         ENTRY( "TestDSetFileNameL", CTestSDKDialogs::TestDSetFileNameL ),
       
   212         ENTRY( "TestDGetLabelTextL", CTestSDKDialogs::TestDGetLabelTextL ),
       
   213         ENTRY( "TestDGetEdwinTextL", CTestSDKDialogs::TestDGetEdwinTextL ),
       
   214         ENTRY( "TestDGetTextEditorTextL", CTestSDKDialogs::TestDGetTextEditorTextL ),
       
   215         ENTRY( "TestDGetSecretEditorTextL", CTestSDKDialogs::TestDGetSecretEditorTextL ),
       
   216         ENTRY( "TestDFloatingPointEditorValueL", CTestSDKDialogs::TestDFloatingPointEditorValueL ),
       
   217         ENTRY( "TestDFixedPointEditorValueL", CTestSDKDialogs::TestDFixedPointEditorValueL ),
       
   218         ENTRY( "TestDFixedPointEditorDecimalL", CTestSDKDialogs::TestDFixedPointEditorDecimalL ),
       
   219         ENTRY( "TestDFloatEditorValueL", CTestSDKDialogs::TestDFloatEditorValueL ),
       
   220         ENTRY( "TestDNumberEditorValueL", CTestSDKDialogs::TestDNumberEditorValueL ),
       
   221         ENTRY( "TestDRangeEditorValueL", CTestSDKDialogs::TestDRangeEditorValueL ),
       
   222         ENTRY( "TestDTTimeEditorValueL", CTestSDKDialogs::TestDTTimeEditorValueL ),
       
   223         ENTRY( "TestDDurationEditorValueL", CTestSDKDialogs::TestDDurationEditorValueL ),
       
   224         ENTRY( "TestDTimeOffsetEditorValueL", CTestSDKDialogs::TestDTimeOffsetEditorValueL ),
       
   225         ENTRY( "TestDGetAutoValuesFromPageL", CTestSDKDialogs::TestDGetAutoValuesFromPageL ),
       
   226         ENTRY( "TestDListBoxCurrentItemL", CTestSDKDialogs::TestDListBoxCurrentItemL ),
       
   227         ENTRY( "TestDGetFileNameL", CTestSDKDialogs::TestDGetFileNameL ),
       
   228         ENTRY( "TestDUpdatePageL", CTestSDKDialogs::TestDUpdatePageL ),
       
   229         ENTRY( "TestDHandleDialogPageEventL", CTestSDKDialogs::TestDHandleDialogPageEventL ),
       
   230         ENTRY( "TestDPublishDialogL", CTestSDKDialogs::TestDPublishDialogL ),
       
   231         ENTRY( "TestDSetMediatorObserverL", CTestSDKDialogs::TestDSetMediatorObserverL ),
       
   232         ENTRY( "TestDSlideDialogL", CTestSDKDialogs::TestDSlideDialogL ),
       
   233         ENTRY( "TestDSetMultilineQueryL", CTestSDKDialogs::TestDSetMultilineQueryL ),
       
   234         };
       
   235 
       
   236     const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
       
   237 
       
   238     return RunInternalL( KFunctions, count, aItem );
       
   239 
       
   240     }
       
   241 
       
   242 // ============================ MEMBER FUNCTIONS ===============================
       
   243 // =========================== CLASS CEIKDIALOG ================================
       
   244 // -----------------------------------------------------------------------------
       
   245 // CTestSDKDialogs::TestDCEikDialogL 
       
   246 // -----------------------------------------------------------------------------
       
   247 TInt CTestSDKDialogs::TestDCEikDialogL( CStifItemParser& /*aItem*/ )
       
   248     {
       
   249     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   250     CleanupStack::PushL( dialog );
       
   251     
       
   252     STIF_ASSERT_NOT_NULL( dialog );
       
   253     
       
   254     CleanupStack::PopAndDestroy( dialog );
       
   255     
       
   256     return KErrNone;
       
   257     
       
   258     }
       
   259 
       
   260 // -----------------------------------------------------------------------------
       
   261 // CTestSDKDialogs::TestDDeconstructorL 
       
   262 // -----------------------------------------------------------------------------
       
   263 TInt CTestSDKDialogs::TestDDeconstructorL( CStifItemParser& /*aItem*/ )
       
   264     {
       
   265     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   266     CleanupStack::PushL( dialog );
       
   267     
       
   268     STIF_ASSERT_NOT_NULL( dialog );
       
   269     
       
   270     CleanupStack::Pop( dialog );
       
   271     delete dialog;
       
   272     
       
   273     return KErrNone;
       
   274     
       
   275     }
       
   276     
       
   277 // -----------------------------------------------------------------------------
       
   278 // CTestSDKDialogs::TestDExecuteLD 
       
   279 // -----------------------------------------------------------------------------
       
   280 TInt CTestSDKDialogs::TestDExecuteLD( CStifItemParser& /*aItem*/ )
       
   281     {
       
   282     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   283     CleanupStack::PushL( dialog );
       
   284     STIF_ASSERT_NOT_NULL( dialog );
       
   285     CleanupStack::Pop( dialog );
       
   286     
       
   287     TInt flag = dialog->ExecuteLD( R_TESTSDK_DIALOG );
       
   288     STIF_ASSERT_EQUALS( 0, flag );
       
   289     
       
   290     return KErrNone;
       
   291     
       
   292     }
       
   293 
       
   294 // -----------------------------------------------------------------------------
       
   295 // CTestSDKDialogs::TestDPrepareLC 
       
   296 // -----------------------------------------------------------------------------
       
   297 TInt CTestSDKDialogs::TestDPrepareLC( CStifItemParser& /*aItem*/ )
       
   298     {
       
   299     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   300     CleanupStack::PushL( dialog );
       
   301     STIF_ASSERT_NOT_NULL( dialog );
       
   302     CleanupStack::Pop( dialog );
       
   303     
       
   304     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   305     TInt flag = dialog->RunLD();
       
   306     STIF_ASSERT_EQUALS( 0, flag );
       
   307     
       
   308     return KErrNone;
       
   309     
       
   310     }
       
   311 
       
   312 // -----------------------------------------------------------------------------
       
   313 // CTestSDKDialogs::TestDReadResourceLC 
       
   314 // -----------------------------------------------------------------------------
       
   315 TInt CTestSDKDialogs::TestDReadResourceLC( CStifItemParser& /*aItem*/ )
       
   316     {
       
   317     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   318     CleanupStack::PushL( dialog );
       
   319     STIF_ASSERT_NOT_NULL( dialog );
       
   320     CleanupStack::Pop( dialog );
       
   321     
       
   322     dialog->ReadResourceLC( R_TESTSDK_DIALOG );
       
   323     TInt flag = dialog->RunLD();
       
   324     STIF_ASSERT_EQUALS( 0, flag );
       
   325     
       
   326     return KErrNone;
       
   327     
       
   328     }
       
   329 
       
   330 // -----------------------------------------------------------------------------
       
   331 // CTestSDKDialogs::TestDRunLD 
       
   332 // -----------------------------------------------------------------------------
       
   333 TInt CTestSDKDialogs::TestDRunLD( CStifItemParser& /*aItem*/ )
       
   334     {
       
   335     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   336     CleanupStack::PushL( dialog );
       
   337     STIF_ASSERT_NOT_NULL( dialog );
       
   338     CleanupStack::Pop( dialog );
       
   339     
       
   340     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   341     TInt flag = dialog->RunLD();
       
   342     STIF_ASSERT_EQUALS( 0, flag );
       
   343     
       
   344     return KErrNone;
       
   345     
       
   346     }
       
   347 
       
   348 // -----------------------------------------------------------------------------
       
   349 // CTestSDKDialogs::TestDSetTitleTDesCL 
       
   350 // -----------------------------------------------------------------------------
       
   351 TInt CTestSDKDialogs::TestDSetTitleTDesCL( CStifItemParser& /*aItem*/ )
       
   352     {
       
   353     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   354     CleanupStack::PushL( dialog );
       
   355     STIF_ASSERT_NOT_NULL( dialog );
       
   356     CleanupStack::Pop( dialog );
       
   357     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   358     
       
   359     _LIT( KTitle, "TestSDKDialogs" );
       
   360     const TInt lengthC = 20;
       
   361     TBuf<lengthC> title( KTitle );
       
   362     STIF_ASSERT_NOT_LEAVES( dialog->SetTitleL( title ) );
       
   363     
       
   364     TInt flag = dialog->RunLD();
       
   365     STIF_ASSERT_EQUALS( 0, flag );
       
   366     
       
   367     return KErrNone;
       
   368     
       
   369     }
       
   370 
       
   371 // -----------------------------------------------------------------------------
       
   372 // CTestSDKDialogs::TestDSetTitleResourceL 
       
   373 // -----------------------------------------------------------------------------
       
   374 TInt CTestSDKDialogs::TestDSetTitleResourceL( CStifItemParser& /*aItem*/ )
       
   375     {
       
   376     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   377     CleanupStack::PushL( dialog );
       
   378     STIF_ASSERT_NOT_NULL( dialog );
       
   379     CleanupStack::Pop( dialog );
       
   380     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   381     
       
   382     STIF_ASSERT_NOT_LEAVES( dialog->SetTitleL( R_TESTSDK_TITLE ) );
       
   383     
       
   384     TInt flag = dialog->RunLD();
       
   385     STIF_ASSERT_EQUALS( 0, flag );
       
   386     
       
   387     return KErrNone;
       
   388     
       
   389     }
       
   390 
       
   391 // -----------------------------------------------------------------------------
       
   392 // CTestSDKDialogs::TestDSetPageDimmedNowL 
       
   393 // -----------------------------------------------------------------------------
       
   394 TInt CTestSDKDialogs::TestDSetPageDimmedNowL( CStifItemParser& /*aItem*/ )
       
   395     {
       
   396     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   397     CleanupStack::PushL( dialog );
       
   398     STIF_ASSERT_NOT_NULL( dialog );
       
   399     CleanupStack::Pop( dialog );
       
   400     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   401     
       
   402     dialog->SetPageDimmedNow( 0, EFalse );
       
   403     dialog->SetPageDimmedNow( 0, ETrue );
       
   404     
       
   405     TInt flag = dialog->RunLD();
       
   406     STIF_ASSERT_EQUALS( 0, flag );
       
   407     
       
   408     return KErrNone;
       
   409     
       
   410     }
       
   411 
       
   412 // -----------------------------------------------------------------------------
       
   413 // CTestSDKDialogs::TestDSetLineNonFocusingL 
       
   414 // -----------------------------------------------------------------------------
       
   415 TInt CTestSDKDialogs::TestDSetLineNonFocusingL( CStifItemParser& /*aItem*/ )
       
   416     {
       
   417     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   418     CleanupStack::PushL( dialog );
       
   419     STIF_ASSERT_NOT_NULL( dialog );
       
   420     CleanupStack::Pop( dialog );
       
   421     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   422     
       
   423     dialog->SetLineNonFocusing( EDialogLine );
       
   424     
       
   425     TInt flag = dialog->RunLD();
       
   426     STIF_ASSERT_EQUALS( 0, flag );
       
   427     
       
   428     return KErrNone;
       
   429     
       
   430     }
       
   431 
       
   432 // -----------------------------------------------------------------------------
       
   433 // CTestSDKDialogs::TestDSetLineDimmedNowL 
       
   434 // -----------------------------------------------------------------------------
       
   435 TInt CTestSDKDialogs::TestDSetLineDimmedNowL( CStifItemParser& /*aItem*/ )
       
   436     {
       
   437     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   438     CleanupStack::PushL( dialog );
       
   439     STIF_ASSERT_NOT_NULL( dialog );
       
   440     CleanupStack::Pop( dialog );
       
   441     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   442     
       
   443     dialog->SetLineDimmedNow( EDialogLine, EFalse );
       
   444     dialog->SetLineDimmedNow( EDialogLine, ETrue );
       
   445     
       
   446     TInt flag = dialog->RunLD();
       
   447     STIF_ASSERT_EQUALS( 0, flag );
       
   448     
       
   449     return KErrNone;
       
   450     
       
   451     }
       
   452 
       
   453 // -----------------------------------------------------------------------------
       
   454 // CTestSDKDialogs::TestDMakeLineVisibleL 
       
   455 // -----------------------------------------------------------------------------
       
   456 TInt CTestSDKDialogs::TestDMakeLineVisibleL( CStifItemParser& /*aItem*/ )
       
   457     {
       
   458     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   459     CleanupStack::PushL( dialog );
       
   460     STIF_ASSERT_NOT_NULL( dialog );
       
   461     CleanupStack::Pop( dialog );
       
   462     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   463     
       
   464     dialog->MakeLineVisible( EDialogLine, EFalse );
       
   465     dialog->MakeLineVisible( EDialogLine, ETrue );
       
   466     
       
   467     TInt flag = dialog->RunLD();
       
   468     STIF_ASSERT_EQUALS( 0, flag );
       
   469     
       
   470     return KErrNone;
       
   471     
       
   472     }
       
   473 
       
   474 // -----------------------------------------------------------------------------
       
   475 // CTestSDKDialogs::TestDMakeWholeLineVisibleL 
       
   476 // -----------------------------------------------------------------------------
       
   477 TInt CTestSDKDialogs::TestDMakeWholeLineVisibleL( CStifItemParser& /*aItem*/ )
       
   478     {
       
   479     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   480     CleanupStack::PushL( dialog );
       
   481     STIF_ASSERT_NOT_NULL( dialog );
       
   482     CleanupStack::Pop( dialog );
       
   483     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   484     
       
   485     dialog->MakeWholeLineVisible( EDialogLine, EFalse );
       
   486     dialog->MakeWholeLineVisible( EDialogLine, ETrue );
       
   487     
       
   488     TInt flag = dialog->RunLD();
       
   489     STIF_ASSERT_EQUALS( 0, flag );
       
   490     
       
   491     return KErrNone;
       
   492     
       
   493     }
       
   494 
       
   495 // -----------------------------------------------------------------------------
       
   496 // CTestSDKDialogs::TestDDeleteLineL 
       
   497 // -----------------------------------------------------------------------------
       
   498 TInt CTestSDKDialogs::TestDDeleteLineL( CStifItemParser& /*aItem*/ )
       
   499     {
       
   500     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   501     CleanupStack::PushL( dialog );
       
   502     STIF_ASSERT_NOT_NULL( dialog );
       
   503     CleanupStack::Pop( dialog );
       
   504     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   505     
       
   506     dialog->DeleteLine( EDialogLine, ETrue );
       
   507     
       
   508     TInt flag = dialog->RunLD();
       
   509     STIF_ASSERT_EQUALS( 0, flag );
       
   510     dialog = NULL;
       
   511     
       
   512     dialog = new (ELeave) CEikDialog;
       
   513     CleanupStack::PushL( dialog );
       
   514     STIF_ASSERT_NOT_NULL( dialog );
       
   515     CleanupStack::Pop( dialog );
       
   516     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   517     
       
   518     dialog->DeleteLine( EDialogLine, EFalse );
       
   519     
       
   520     flag = dialog->RunLD();
       
   521     STIF_ASSERT_EQUALS( 0, flag );
       
   522     
       
   523     return KErrNone;
       
   524     }
       
   525 
       
   526 // -----------------------------------------------------------------------------
       
   527 // CTestSDKDialogs::TestDInsertLineL 
       
   528 // -----------------------------------------------------------------------------
       
   529 TInt CTestSDKDialogs::TestDInsertLineL( CStifItemParser& /*aItem*/ )
       
   530     {
       
   531     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   532     CleanupStack::PushL( dialog );
       
   533     STIF_ASSERT_NOT_NULL( dialog );
       
   534     CleanupStack::Pop( dialog );
       
   535     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   536     
       
   537     dialog->InsertLineL( 0, R_TESTSDK_LINE, 0 );
       
   538     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->ControlOrNull( EEdwinLine ) );
       
   539     STIF_ASSERT_NOT_NULL( edwin );
       
   540     
       
   541     TInt flag = dialog->RunLD();
       
   542     STIF_ASSERT_EQUALS( 0, flag );
       
   543     
       
   544     return KErrNone;
       
   545     }
       
   546 
       
   547 // -----------------------------------------------------------------------------
       
   548 // CTestSDKDialogs::TestDMakePanelButtonVisibleL 
       
   549 // -----------------------------------------------------------------------------
       
   550 TInt CTestSDKDialogs::TestDMakePanelButtonVisibleL( CStifItemParser& /*aItem*/ )
       
   551     {
       
   552     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   553     CleanupStack::PushL( dialog );
       
   554     STIF_ASSERT_NOT_NULL( dialog );
       
   555     CleanupStack::Pop( dialog );
       
   556     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   557     
       
   558     dialog->MakePanelButtonVisible( R_AVKON_SOFTKEYS_OK_CANCEL, EFalse );
       
   559     dialog->MakePanelButtonVisible( R_AVKON_SOFTKEYS_OK_CANCEL, ETrue );
       
   560     
       
   561     TInt flag = dialog->RunLD();
       
   562     STIF_ASSERT_EQUALS( 0, flag );
       
   563     
       
   564     return KErrNone;
       
   565     }
       
   566 
       
   567 // -----------------------------------------------------------------------------
       
   568 // CTestSDKDialogs::TestDTryChangeFocusToL 
       
   569 // -----------------------------------------------------------------------------
       
   570 TInt CTestSDKDialogs::TestDTryChangeFocusToL( CStifItemParser& /*aItem*/ )
       
   571     {
       
   572     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
   573     CleanupStack::PushL( dialog );
       
   574     STIF_ASSERT_NOT_NULL( dialog );
       
   575     CleanupStack::Pop( dialog );
       
   576     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   577     
       
   578     dialog->InsertLineL( 1, R_TESTSDK_LINE );
       
   579     dialog->InsertLineL( 1, R_TESTSDK_LINE2 );
       
   580     
       
   581     dialog->CTestSDKDialogsSetInitialCurrentLine();
       
   582     CEikCaptionedControl* curLine = dialog->CTestSDKDialogsCurrentLine();
       
   583     if (curLine)
       
   584         {
       
   585         dialog->TryChangeFocusToL(curLine->iId);
       
   586         }
       
   587     
       
   588     TInt flag = dialog->RunLD();
       
   589     STIF_ASSERT_EQUALS( 0, flag );
       
   590     
       
   591     return KErrNone;
       
   592     }
       
   593 
       
   594 // -----------------------------------------------------------------------------
       
   595 // CTestSDKDialogs::TestDSwitchLineLatencyL 
       
   596 // -----------------------------------------------------------------------------
       
   597 TInt CTestSDKDialogs::TestDSwitchLineLatencyL( CStifItemParser& /*aItem*/ )
       
   598     {
       
   599     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   600     CleanupStack::PushL( dialog );
       
   601     STIF_ASSERT_NOT_NULL( dialog );
       
   602     CleanupStack::Pop( dialog );
       
   603     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   604     
       
   605     dialog->InsertLineL( 1, R_TESTSDK_LINE );
       
   606     dialog->InsertLineL( 2, R_TESTSDK_LINE2 );
       
   607     dialog->SwitchLineLatency( EEdwinLine, EEdwinLine2 );
       
   608     
       
   609     TInt flag = dialog->RunLD();
       
   610     STIF_ASSERT_EQUALS( 0, flag );
       
   611     
       
   612     return KErrNone;
       
   613     }
       
   614 
       
   615 // -----------------------------------------------------------------------------
       
   616 // CTestSDKDialogs::TestDSetPageDensePackingL 
       
   617 // -----------------------------------------------------------------------------
       
   618 TInt CTestSDKDialogs::TestDSetPageDensePackingL( CStifItemParser& /*aItem*/ )
       
   619     {
       
   620     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   621     CleanupStack::PushL( dialog );
       
   622     STIF_ASSERT_NOT_NULL( dialog );
       
   623     CleanupStack::Pop( dialog );
       
   624     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   625     
       
   626     dialog->InsertLineL( 1, R_TESTSDK_LINE );
       
   627     dialog->SetPageDensePacking( 0, ETrue );
       
   628     
       
   629     TInt flag = dialog->RunLD();
       
   630     STIF_ASSERT_EQUALS( 0, flag );
       
   631     
       
   632     return KErrNone;
       
   633     
       
   634     }
       
   635 
       
   636 // -----------------------------------------------------------------------------
       
   637 // CTestSDKDialogs::TestDConstructAutoDialogLC 
       
   638 // -----------------------------------------------------------------------------
       
   639 TInt CTestSDKDialogs::TestDConstructAutoDialogLC( CStifItemParser& /*aItem*/ )
       
   640     {
       
   641     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   642     CleanupStack::PushL( dialog );
       
   643     STIF_ASSERT_NOT_NULL( dialog );
       
   644     CleanupStack::Pop( dialog );
       
   645     
       
   646     dialog->ConstructAutoDialogLC( EEikDialogFlagFillScreen, R_AVKON_SOFTKEYS_OK_CANCEL );
       
   647     dialog->InsertLineL( 0, R_TESTSDK_LINE );
       
   648     
       
   649     TInt flag = dialog->RunLD();
       
   650     STIF_ASSERT_EQUALS( 0, flag );
       
   651     
       
   652     return KErrNone;
       
   653     
       
   654     }
       
   655 
       
   656 // -----------------------------------------------------------------------------
       
   657 // CTestSDKDialogs::TestDDeclareItemAutoL 
       
   658 // -----------------------------------------------------------------------------
       
   659 TInt CTestSDKDialogs::TestDDeclareItemAutoL( CStifItemParser& /*aItem*/ )
       
   660     {
       
   661     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   662     CleanupStack::PushL( dialog );
       
   663     STIF_ASSERT_NOT_NULL( dialog );
       
   664     CleanupStack::Pop( dialog );
       
   665     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   666     
       
   667     TInt value = 0;
       
   668     dialog->DeclareItemAuto( EDialogLine, EEikCtEdwin, &value );
       
   669     
       
   670     TInt flag = dialog->RunLD();
       
   671     STIF_ASSERT_EQUALS( 0, flag );
       
   672     
       
   673     return KErrNone;
       
   674     
       
   675     }
       
   676 
       
   677 // -----------------------------------------------------------------------------
       
   678 // CTestSDKDialogs::TestDLayoutL 
       
   679 // -----------------------------------------------------------------------------
       
   680 TInt CTestSDKDialogs::TestDLayoutL( CStifItemParser& /*aItem*/ )
       
   681     {
       
   682     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   683     CleanupStack::PushL( dialog );
       
   684     STIF_ASSERT_NOT_NULL( dialog );
       
   685     CleanupStack::Pop( dialog );
       
   686     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   687     
       
   688     dialog->Layout();
       
   689     
       
   690     TInt flag = dialog->RunLD();
       
   691     STIF_ASSERT_EQUALS( 0, flag );
       
   692     
       
   693     return KErrNone;
       
   694     
       
   695     }
       
   696 
       
   697 // -----------------------------------------------------------------------------
       
   698 // CTestSDKDialogs::TestDPreferredSizeL 
       
   699 // -----------------------------------------------------------------------------
       
   700 TInt CTestSDKDialogs::TestDPreferredSizeL( CStifItemParser& /*aItem*/ )
       
   701     {
       
   702     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   703     CleanupStack::PushL( dialog );
       
   704     STIF_ASSERT_NOT_NULL( dialog );
       
   705     CleanupStack::Pop( dialog );
       
   706     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   707     
       
   708     dialog->Layout();
       
   709     const TInt lengthC = 10;
       
   710     TSize size( lengthC, lengthC );
       
   711     TSize preferredSize = dialog->PreferredSize( size );
       
   712     TPoint point( preferredSize.AsPoint() );
       
   713     
       
   714     STIF_ASSERT_EQUALS( lengthC, point.iX );
       
   715     STIF_ASSERT_EQUALS( lengthC, point.iY );
       
   716     
       
   717     TInt flag = dialog->RunLD();
       
   718     STIF_ASSERT_EQUALS( 0, flag );
       
   719     
       
   720     return KErrNone;
       
   721     
       
   722     }
       
   723 
       
   724 // -----------------------------------------------------------------------------
       
   725 // CTestSDKDialogs::TestDCreateLineByTypeL 
       
   726 // -----------------------------------------------------------------------------
       
   727 TInt CTestSDKDialogs::TestDCreateLineByTypeL( CStifItemParser& /*aItem*/ )
       
   728     {
       
   729     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   730     CleanupStack::PushL( dialog );
       
   731     STIF_ASSERT_NOT_NULL( dialog );
       
   732     CleanupStack::Pop( dialog );
       
   733     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   734     
       
   735     const TInt lengthC = 20;
       
   736     _LIT( KCaption, "LineByType" );
       
   737     TBufC<lengthC> caption( KCaption );
       
   738     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->CreateLineByTypeL( 
       
   739         caption, ELineByType, EEikCtEdwin, NULL ) );
       
   740     CleanupStack::PushL( edwin );
       
   741     STIF_ASSERT_NOT_NULL( edwin );
       
   742     
       
   743     const TInt textLimitC = 100;
       
   744     const TInt widthC = 10;
       
   745     edwin->ConstructL( 0, lengthC, textLimitC, widthC );
       
   746     edwin->CreateTextViewL();
       
   747     edwin->SetTextL( &caption );
       
   748     CleanupStack::Pop( edwin );
       
   749     
       
   750     TInt flag = dialog->RunLD();
       
   751     STIF_ASSERT_EQUALS( 0, flag );
       
   752     
       
   753     return KErrNone;
       
   754     
       
   755     }
       
   756 
       
   757 // -----------------------------------------------------------------------------
       
   758 // CTestSDKDialogs::TestDCreateLineByTypePageIdL 
       
   759 // -----------------------------------------------------------------------------
       
   760 TInt CTestSDKDialogs::TestDCreateLineByTypePageIdL( CStifItemParser& /*aItem*/ )
       
   761     {
       
   762     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   763     CleanupStack::PushL( dialog );
       
   764     STIF_ASSERT_NOT_NULL( dialog );
       
   765     CleanupStack::Pop( dialog );
       
   766     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   767     
       
   768     _LIT( KCaption, "LineByType" );
       
   769     const TInt lengthC = 20;
       
   770     TBufC<lengthC> caption( KCaption );
       
   771     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->CreateLineByTypeL( 
       
   772         caption, 0, ELineByType, EEikCtEdwin, NULL ) );
       
   773     CleanupStack::PushL( edwin );
       
   774     STIF_ASSERT_NOT_NULL( edwin );
       
   775     const TInt textLimitC = 100;
       
   776     const TInt widthC = 10;
       
   777     edwin->ConstructL( 0, lengthC, textLimitC, widthC );
       
   778     edwin->CreateTextViewL();
       
   779     edwin->SetTextL( &caption );
       
   780     CleanupStack::Pop( edwin );
       
   781     
       
   782     TInt flag = dialog->RunLD();
       
   783     STIF_ASSERT_EQUALS( 0, flag );
       
   784     
       
   785     return KErrNone;
       
   786     
       
   787     }
       
   788 
       
   789 // -----------------------------------------------------------------------------
       
   790 // CTestSDKDialogs::TestDSetControlCaptionTextL 
       
   791 // -----------------------------------------------------------------------------
       
   792 TInt CTestSDKDialogs::TestDSetControlCaptionTextL( CStifItemParser& /*aItem*/ )
       
   793     {
       
   794     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   795     CleanupStack::PushL( dialog );
       
   796     STIF_ASSERT_NOT_NULL( dialog );
       
   797     CleanupStack::Pop( dialog );
       
   798     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   799     
       
   800     _LIT( KCaption, "CaptionText" );
       
   801     const TInt lengthC = 20;
       
   802     TBufC<lengthC> captionValue( KCaption );
       
   803     dialog->SetControlCaptionL( EDialogLine, captionValue );
       
   804     
       
   805     CEikLabel* caption = dialog->ControlCaption( EDialogLine );
       
   806     HBufC* captionbuf = caption->Text()->AllocLC();
       
   807     STIF_ASSERT_EQUALS( 0, captionbuf->Compare( KCaption ) );
       
   808     CleanupStack::PopAndDestroy( captionbuf );
       
   809 
       
   810     TInt flag = dialog->RunLD();
       
   811     STIF_ASSERT_EQUALS( 0, flag );
       
   812     
       
   813     return KErrNone;
       
   814     
       
   815     }
       
   816 
       
   817 // -----------------------------------------------------------------------------
       
   818 // CTestSDKDialogs::TestDSetControlCaptionResourceIdL 
       
   819 // -----------------------------------------------------------------------------
       
   820 TInt CTestSDKDialogs::TestDSetControlCaptionResourceIdL( CStifItemParser& /*aItem*/ )
       
   821     {
       
   822     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   823     CleanupStack::PushL( dialog );
       
   824     STIF_ASSERT_NOT_NULL( dialog );
       
   825     CleanupStack::Pop( dialog );
       
   826     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   827     
       
   828     dialog->SetControlCaptionL( EDialogLine, R_TESTSDK_CAPTION );
       
   829     CEikLabel* caption = dialog->ControlCaption( EDialogLine );
       
   830     HBufC* captionbuf = caption->Text()->AllocLC();
       
   831     _LIT( KCaption, "CaptionResource" );
       
   832     STIF_ASSERT_EQUALS( 0, captionbuf->Compare( KCaption ) );
       
   833     CleanupStack::PopAndDestroy( captionbuf );
       
   834     
       
   835     TInt flag = dialog->RunLD();
       
   836     STIF_ASSERT_EQUALS( 0, flag );
       
   837     
       
   838     return KErrNone;
       
   839     
       
   840     }
       
   841 
       
   842 // -----------------------------------------------------------------------------
       
   843 // CTestSDKDialogs::TestDControlCaptionL 
       
   844 // -----------------------------------------------------------------------------
       
   845 TInt CTestSDKDialogs::TestDControlCaptionL( CStifItemParser& /*aItem*/ )
       
   846     {
       
   847     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   848     CleanupStack::PushL( dialog );
       
   849     STIF_ASSERT_NOT_NULL( dialog );
       
   850     CleanupStack::Pop( dialog );
       
   851     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   852     
       
   853     _LIT( KCaption, "ControlCaption" );
       
   854     const TInt lengthC = 20;
       
   855     TBufC<lengthC> captionValue( KCaption );
       
   856     dialog->SetControlCaptionL( EDialogLine, captionValue );
       
   857     
       
   858     CEikLabel* caption = dialog->ControlCaption( EDialogLine );
       
   859     HBufC* captionbuf = caption->Text()->AllocLC();
       
   860     STIF_ASSERT_EQUALS( 0, captionbuf->Compare( KCaption ) );
       
   861     CleanupStack::PopAndDestroy( captionbuf );
       
   862     
       
   863     TInt flag = dialog->RunLD();
       
   864     STIF_ASSERT_EQUALS( 0, flag );
       
   865     
       
   866     return KErrNone;
       
   867     
       
   868     }
       
   869 
       
   870 // -----------------------------------------------------------------------------
       
   871 // CTestSDKDialogs::TestDControlL 
       
   872 // -----------------------------------------------------------------------------
       
   873 TInt CTestSDKDialogs::TestDControlL( CStifItemParser& /*aItem*/ )
       
   874     {
       
   875     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   876     CleanupStack::PushL( dialog );
       
   877     STIF_ASSERT_NOT_NULL( dialog );
       
   878     CleanupStack::Pop( dialog );
       
   879     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   880     
       
   881     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->Control( EDialogLine ) );
       
   882     STIF_ASSERT_NOT_NULL( edwin );
       
   883     
       
   884     TInt flag = dialog->RunLD();
       
   885     STIF_ASSERT_EQUALS( 0, flag );
       
   886     
       
   887     return KErrNone;
       
   888     
       
   889     }
       
   890 
       
   891 // -----------------------------------------------------------------------------
       
   892 // CTestSDKDialogs::TestDControlOrNullL 
       
   893 // -----------------------------------------------------------------------------
       
   894 TInt CTestSDKDialogs::TestDControlOrNullL( CStifItemParser& /*aItem*/ )
       
   895     {
       
   896     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   897     CleanupStack::PushL( dialog );
       
   898     STIF_ASSERT_NOT_NULL( dialog );
       
   899     CleanupStack::Pop( dialog );
       
   900     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   901     
       
   902     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->ControlOrNull( EDialogLine ) );
       
   903     STIF_ASSERT_NOT_NULL( edwin );
       
   904     
       
   905     TInt flag = dialog->RunLD();
       
   906     STIF_ASSERT_EQUALS( 0, flag );
       
   907     
       
   908     return KErrNone;
       
   909     
       
   910     }
       
   911 
       
   912 // -----------------------------------------------------------------------------
       
   913 // CTestSDKDialogs::TestDButtonGroupContainerL 
       
   914 // -----------------------------------------------------------------------------
       
   915 TInt CTestSDKDialogs::TestDButtonGroupContainerL( CStifItemParser& /*aItem*/ )
       
   916     {
       
   917     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   918     CleanupStack::PushL( dialog );
       
   919     STIF_ASSERT_NOT_NULL( dialog );
       
   920     CleanupStack::Pop( dialog );
       
   921     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   922     
       
   923     CEikButtonGroupContainer* container = &( dialog->ButtonGroupContainer() );
       
   924     STIF_ASSERT_NOT_NULL( container );
       
   925     
       
   926     TInt flag = dialog->RunLD();
       
   927     STIF_ASSERT_EQUALS( 0, flag );
       
   928     
       
   929     return KErrNone;
       
   930     
       
   931     }
       
   932 
       
   933 // -----------------------------------------------------------------------------
       
   934 // CTestSDKDialogs::TestDTitleL 
       
   935 // -----------------------------------------------------------------------------
       
   936 TInt CTestSDKDialogs::TestDTitleL( CStifItemParser& /*aItem*/ )
       
   937     {
       
   938     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   939     CleanupStack::PushL( dialog );
       
   940     STIF_ASSERT_NOT_NULL( dialog );
       
   941     CleanupStack::Pop( dialog );
       
   942     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   943     
       
   944     CEikMover* title = &( dialog->Title() );
       
   945     STIF_ASSERT_NOT_NULL( title );
       
   946     
       
   947     TInt flag = dialog->RunLD();
       
   948     STIF_ASSERT_EQUALS( 0, flag );
       
   949     
       
   950     return KErrNone;
       
   951     
       
   952     }
       
   953 
       
   954 // -----------------------------------------------------------------------------
       
   955 // CTestSDKDialogs::TestDActivePageIdL 
       
   956 // -----------------------------------------------------------------------------
       
   957 TInt CTestSDKDialogs::TestDActivePageIdL( CStifItemParser& /*aItem*/ )
       
   958     {
       
   959     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   960     CleanupStack::PushL( dialog );
       
   961     STIF_ASSERT_NOT_NULL( dialog );
       
   962     CleanupStack::Pop( dialog );
       
   963     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   964     
       
   965     TInt pageid = dialog->ActivePageId();
       
   966     STIF_ASSERT_EQUALS( 0, pageid);
       
   967     
       
   968     TInt flag = dialog->RunLD();
       
   969     STIF_ASSERT_EQUALS( 0, flag );
       
   970     
       
   971     return KErrNone;
       
   972     
       
   973     }
       
   974 
       
   975 // -----------------------------------------------------------------------------
       
   976 // CTestSDKDialogs::TestDActivateFirstPageL 
       
   977 // -----------------------------------------------------------------------------
       
   978 TInt CTestSDKDialogs::TestDActivateFirstPageL( CStifItemParser& /*aItem*/ )
       
   979     {
       
   980     CEikDialog* dialog = new (ELeave) CEikDialog;
       
   981     CleanupStack::PushL( dialog );
       
   982     STIF_ASSERT_NOT_NULL( dialog );
       
   983     CleanupStack::Pop( dialog );
       
   984     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
   985     
       
   986     dialog->ActivateFirstPageL();
       
   987     
       
   988     TInt flag = dialog->RunLD();
       
   989     STIF_ASSERT_EQUALS( 0, flag );
       
   990     
       
   991     return KErrNone;
       
   992     
       
   993     }
       
   994 
       
   995 // -----------------------------------------------------------------------------
       
   996 // CTestSDKDialogs::TestDSetEditableL 
       
   997 // -----------------------------------------------------------------------------
       
   998 TInt CTestSDKDialogs::TestDSetEditableL( CStifItemParser& /*aItem*/ )
       
   999     {
       
  1000     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1001     CleanupStack::PushL( dialog );
       
  1002     STIF_ASSERT_NOT_NULL( dialog );
       
  1003     CleanupStack::Pop( dialog );
       
  1004     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1005     
       
  1006     dialog->SetEditableL( EFalse );
       
  1007     dialog->SetEditableL( ETrue );
       
  1008     
       
  1009     TInt flag = dialog->RunLD();
       
  1010     STIF_ASSERT_EQUALS( 0, flag );
       
  1011     
       
  1012     return KErrNone;
       
  1013     
       
  1014     }
       
  1015 
       
  1016 // -----------------------------------------------------------------------------
       
  1017 // CTestSDKDialogs::TestDIsEditableL 
       
  1018 // -----------------------------------------------------------------------------
       
  1019 TInt CTestSDKDialogs::TestDIsEditableL( CStifItemParser& /*aItem*/ )
       
  1020     {
       
  1021     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1022     CleanupStack::PushL( dialog );
       
  1023     STIF_ASSERT_NOT_NULL( dialog );
       
  1024     CleanupStack::Pop( dialog );
       
  1025     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1026     
       
  1027     dialog->SetEditableL( ETrue );
       
  1028     TBool edit = dialog->IsEditable();
       
  1029     STIF_ASSERT_TRUE( edit );
       
  1030     
       
  1031     dialog->SetEditableL( EFalse );
       
  1032     edit = dialog->IsEditable();
       
  1033     STIF_ASSERT_FALSE( edit );
       
  1034     
       
  1035     TInt flag = dialog->RunLD();
       
  1036     STIF_ASSERT_EQUALS( 0, flag );
       
  1037     
       
  1038     return KErrNone;
       
  1039     
       
  1040     }
       
  1041 
       
  1042 // -----------------------------------------------------------------------------
       
  1043 // CTestSDKDialogs::TestDOfferKeyEventL 
       
  1044 // -----------------------------------------------------------------------------
       
  1045 TInt CTestSDKDialogs::TestDOfferKeyEventL( CStifItemParser& /*aItem*/ )
       
  1046     {
       
  1047     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1048     CleanupStack::PushL( dialog );
       
  1049     STIF_ASSERT_NOT_NULL( dialog );
       
  1050     CleanupStack::Pop( dialog );
       
  1051     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1052     
       
  1053     TKeyEvent event;
       
  1054     event.iCode = '0';
       
  1055     TKeyResponse response = dialog->OfferKeyEventL( event, EEventKey );
       
  1056     STIF_ASSERT_EQUALS( EKeyWasConsumed, response );
       
  1057     
       
  1058     TInt flag = dialog->RunLD();
       
  1059     STIF_ASSERT_EQUALS( 0, flag );
       
  1060     
       
  1061     return KErrNone;
       
  1062     
       
  1063     }
       
  1064 
       
  1065 // -----------------------------------------------------------------------------
       
  1066 // CTestSDKDialogs::TestDFocusChangedL 
       
  1067 // -----------------------------------------------------------------------------
       
  1068 TInt CTestSDKDialogs::TestDFocusChangedL( CStifItemParser& /*aItem*/ )
       
  1069     {
       
  1070     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1071     CleanupStack::PushL( dialog );
       
  1072     STIF_ASSERT_NOT_NULL( dialog );
       
  1073     CleanupStack::Pop( dialog );
       
  1074     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1075     
       
  1076     dialog->InsertLineL( 1, R_TESTSDK_LINE );
       
  1077     dialog->InsertLineL( 1, R_TESTSDK_LINE2 );
       
  1078     
       
  1079     dialog->CTestSDKDialogsSetInitialCurrentLine();
       
  1080     CEikCaptionedControl* curLine = dialog->CTestSDKDialogsCurrentLine();
       
  1081     if (curLine)
       
  1082         {
       
  1083         dialog->TryChangeFocusToL(curLine->iId);
       
  1084         }
       
  1085     
       
  1086     dialog->FocusChanged( ENoDrawNow );
       
  1087     dialog->FocusChanged( EDrawNow );
       
  1088     
       
  1089     TInt flag = dialog->RunLD();
       
  1090     STIF_ASSERT_EQUALS( 0, flag );
       
  1091     
       
  1092     return KErrNone;
       
  1093     
       
  1094     }
       
  1095 
       
  1096 // -----------------------------------------------------------------------------
       
  1097 // CTestSDKDialogs::TestDGetColorUseListL 
       
  1098 // -----------------------------------------------------------------------------
       
  1099 TInt CTestSDKDialogs::TestDGetColorUseListL( CStifItemParser& /*aItem*/ )
       
  1100     {
       
  1101     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1102     CleanupStack::PushL( dialog );
       
  1103     STIF_ASSERT_NOT_NULL( dialog );
       
  1104     CleanupStack::Pop( dialog );
       
  1105     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1106     
       
  1107     CArrayFix<TCoeColorUse>* colorList = new (ELeave) CArrayFixFlat<TCoeColorUse>(1);
       
  1108     CleanupStack::PushL(colorList);
       
  1109     dialog->GetColorUseListL( *colorList ); 
       
  1110     STIF_ASSERT_NOT_NULL( colorList );
       
  1111     CleanupStack::PopAndDestroy( colorList );
       
  1112     
       
  1113     TInt flag = dialog->RunLD();
       
  1114     STIF_ASSERT_EQUALS( 0, flag );
       
  1115     
       
  1116     return KErrNone;
       
  1117     
       
  1118     }
       
  1119 
       
  1120 // -----------------------------------------------------------------------------
       
  1121 // CTestSDKDialogs::TestDHandleResourceChangeL 
       
  1122 // -----------------------------------------------------------------------------
       
  1123 TInt CTestSDKDialogs::TestDHandleResourceChangeL( CStifItemParser& /*aItem*/ )
       
  1124     {
       
  1125     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1126     CleanupStack::PushL( dialog );
       
  1127     STIF_ASSERT_NOT_NULL( dialog );
       
  1128     CleanupStack::Pop( dialog );
       
  1129     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1130     
       
  1131     dialog->HandleResourceChange( KEikDynamicLayoutVariantSwitch );
       
  1132     dialog->HandleResourceChange( KEikColorResourceChange );
       
  1133     
       
  1134     TInt flag = dialog->RunLD();
       
  1135     STIF_ASSERT_EQUALS( 0, flag );
       
  1136     
       
  1137     return KErrNone;
       
  1138     
       
  1139     }
       
  1140 
       
  1141 // -----------------------------------------------------------------------------
       
  1142 // CTestSDKDialogs::TestDInputCapabilitiesL 
       
  1143 // -----------------------------------------------------------------------------
       
  1144 TInt CTestSDKDialogs::TestDInputCapabilitiesL( CStifItemParser& /*aItem*/ )
       
  1145     {
       
  1146     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1147     CleanupStack::PushL( dialog );
       
  1148     STIF_ASSERT_NOT_NULL( dialog );
       
  1149     CleanupStack::Pop( dialog );
       
  1150     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1151     
       
  1152     TCoeInputCapabilities capability = dialog->InputCapabilities();
       
  1153     TUint uvalue = capability.Capabilities();
       
  1154     STIF_ASSERT_TRUE( uvalue == TCoeInputCapabilities::ENavigation );
       
  1155     
       
  1156     TInt flag = dialog->RunLD();
       
  1157     STIF_ASSERT_EQUALS( 0, flag );
       
  1158     
       
  1159     return KErrNone;
       
  1160     
       
  1161     }
       
  1162 
       
  1163 // -----------------------------------------------------------------------------
       
  1164 // CTestSDKDialogs::TestDMakeVisibleL 
       
  1165 // -----------------------------------------------------------------------------
       
  1166 TInt CTestSDKDialogs::TestDMakeVisibleL( CStifItemParser& /*aItem*/ )
       
  1167     {
       
  1168     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1169     CleanupStack::PushL( dialog );
       
  1170     STIF_ASSERT_NOT_NULL( dialog );
       
  1171     CleanupStack::Pop( dialog );
       
  1172     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1173     
       
  1174     dialog->MakeVisible( EFalse );
       
  1175     dialog->MakeVisible( ETrue );
       
  1176     
       
  1177     TInt flag = dialog->RunLD();
       
  1178     STIF_ASSERT_EQUALS( 0, flag );
       
  1179     
       
  1180     return KErrNone;
       
  1181     
       
  1182     }
       
  1183 
       
  1184 // -----------------------------------------------------------------------------
       
  1185 // CTestSDKDialogs::TestDHandlePointerEventL 
       
  1186 // -----------------------------------------------------------------------------
       
  1187 TInt CTestSDKDialogs::TestDHandlePointerEventL( CStifItemParser& /*aItem*/ )
       
  1188     {
       
  1189     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1190     CleanupStack::PushL( dialog );
       
  1191     STIF_ASSERT_NOT_NULL( dialog );
       
  1192     CleanupStack::Pop( dialog );
       
  1193     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1194     
       
  1195     TPointerEvent event;
       
  1196     event.iType = TPointerEvent::EButton1Down;
       
  1197     STIF_ASSERT_NOT_LEAVES( dialog->HandlePointerEventL( event ) );
       
  1198     
       
  1199     TInt flag = dialog->RunLD();
       
  1200     STIF_ASSERT_EQUALS( 0, flag );
       
  1201     
       
  1202     return KErrNone;
       
  1203     
       
  1204     }
       
  1205 
       
  1206 // -----------------------------------------------------------------------------
       
  1207 // CTestSDKDialogs::TestDPrepareForFocusTransitionL 
       
  1208 // -----------------------------------------------------------------------------
       
  1209 TInt CTestSDKDialogs::TestDPrepareForFocusTransitionL( CStifItemParser& /*aItem*/ )
       
  1210     {
       
  1211     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1212     CleanupStack::PushL( dialog );
       
  1213     STIF_ASSERT_NOT_NULL( dialog );
       
  1214     CleanupStack::Pop( dialog );
       
  1215     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1216     
       
  1217     dialog->PrepareForFocusTransitionL();
       
  1218     TInt lineId = dialog->IdOfFocusControl();
       
  1219     
       
  1220     STIF_ASSERT_TRUE( lineId = EDialogLine );
       
  1221     
       
  1222     TInt flag = dialog->RunLD();
       
  1223     STIF_ASSERT_EQUALS( 0, flag );
       
  1224     
       
  1225     return KErrNone;
       
  1226     
       
  1227     }
       
  1228 
       
  1229 // -----------------------------------------------------------------------------
       
  1230 // CTestSDKDialogs::TestDPageChangedL 
       
  1231 // -----------------------------------------------------------------------------
       
  1232 TInt CTestSDKDialogs::TestDPageChangedL( CStifItemParser& /*aItem*/ )
       
  1233     {
       
  1234     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1235     CleanupStack::PushL( dialog );
       
  1236     STIF_ASSERT_NOT_NULL( dialog );
       
  1237     CleanupStack::Pop( dialog );
       
  1238     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1239     
       
  1240     dialog->PageChangedL( 1 );
       
  1241     dialog->ActivateFirstPageL();
       
  1242     TInt pageId = dialog->ActivePageId();
       
  1243     STIF_ASSERT_TRUE( pageId == 0 );
       
  1244     
       
  1245     TInt flag = dialog->RunLD();
       
  1246     STIF_ASSERT_EQUALS( 0, flag );
       
  1247 
       
  1248     return KErrNone;
       
  1249     
       
  1250     }
       
  1251 
       
  1252 // -----------------------------------------------------------------------------
       
  1253 // CTestSDKDialogs::TestDLineChangedL 
       
  1254 // -----------------------------------------------------------------------------
       
  1255 TInt CTestSDKDialogs::TestDLineChangedL( CStifItemParser& /*aItem*/ )
       
  1256     {
       
  1257     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1258     CleanupStack::PushL( dialog );
       
  1259     STIF_ASSERT_NOT_NULL( dialog );
       
  1260     CleanupStack::Pop( dialog );
       
  1261     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1262     
       
  1263     dialog->InsertLineL( 0, R_TESTSDK_LINE, 0 );
       
  1264     dialog->LineChangedL( EEdwinLine );
       
  1265     
       
  1266     TInt flag = dialog->RunLD();
       
  1267     STIF_ASSERT_EQUALS( 0, flag );
       
  1268     
       
  1269     return KErrNone;
       
  1270     
       
  1271     }
       
  1272 
       
  1273 // -----------------------------------------------------------------------------
       
  1274 // CTestSDKDialogs::TestDCreateCustomControlL 
       
  1275 // -----------------------------------------------------------------------------
       
  1276 TInt CTestSDKDialogs::TestDCreateCustomControlL( CStifItemParser& /*aItem*/ )
       
  1277     {
       
  1278     // This function will call panic directly, so no need to test it temporary
       
  1279     return KErrNone;
       
  1280     
       
  1281     }
       
  1282 
       
  1283 // -----------------------------------------------------------------------------
       
  1284 // CTestSDKDialogs::TestDConvertCustomControlTypeToBaseControlTypeL 
       
  1285 // -----------------------------------------------------------------------------
       
  1286 TInt CTestSDKDialogs::TestDConvertCustomControlTypeToBaseControlTypeL( CStifItemParser& /*aItem*/ )
       
  1287     {
       
  1288     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1289     CleanupStack::PushL( dialog );
       
  1290     STIF_ASSERT_NOT_NULL( dialog );
       
  1291     CleanupStack::Pop( dialog );
       
  1292     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1293     
       
  1294     TInt controlType = EEikCtEdwin;
       
  1295     MEikDialogPageObserver::TFormControlTypes type = 
       
  1296         dialog->ConvertCustomControlTypeToBaseControlType( controlType );
       
  1297     STIF_ASSERT_EQUALS( type, MEikDialogPageObserver::EUnknownType );
       
  1298     
       
  1299     TInt flag = dialog->RunLD();
       
  1300     STIF_ASSERT_EQUALS( 0, flag );
       
  1301     
       
  1302     return KErrNone;
       
  1303     
       
  1304     }
       
  1305 
       
  1306 // -----------------------------------------------------------------------------
       
  1307 // CTestSDKDialogs::TestDGetCustomAutoValueL 
       
  1308 // -----------------------------------------------------------------------------
       
  1309 TInt CTestSDKDialogs::TestDGetCustomAutoValueL( CStifItemParser& /*aItem*/ )
       
  1310     {
       
  1311     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  1312     CleanupStack::PushL( dialog );
       
  1313     STIF_ASSERT_NOT_NULL( dialog );
       
  1314     CleanupStack::Pop( dialog );
       
  1315     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1316     
       
  1317     // GetCustomAutoValue will call assert efalse directly, no need to test it temporary
       
  1318     
       
  1319     TInt flag = dialog->RunLD();
       
  1320     STIF_ASSERT_EQUALS( 0, flag );
       
  1321     
       
  1322     return KErrNone;
       
  1323     
       
  1324     }
       
  1325 
       
  1326 // -----------------------------------------------------------------------------
       
  1327 // CTestSDKDialogs::TestDPrepareContextL 
       
  1328 // -----------------------------------------------------------------------------
       
  1329 TInt CTestSDKDialogs::TestDPrepareContextL( CStifItemParser& /*aItem*/ )
       
  1330     {
       
  1331     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1332     CleanupStack::PushL( dialog );
       
  1333     STIF_ASSERT_NOT_NULL( dialog );
       
  1334     CleanupStack::Pop( dialog );
       
  1335     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1336     
       
  1337     CWindowGc& gc = CCoeEnv::Static()->SystemGc();
       
  1338     
       
  1339     dialog->ActivateGc();
       
  1340     dialog->PrepareContext();
       
  1341     dialog->DeactivateGc();
       
  1342     
       
  1343     TInt flag = dialog->RunLD();
       
  1344     STIF_ASSERT_EQUALS( 0, flag );
       
  1345     
       
  1346     return KErrNone;
       
  1347     
       
  1348     }
       
  1349 
       
  1350 // -----------------------------------------------------------------------------
       
  1351 // CTestSDKDialogs::TestDWriteInternalStateL 
       
  1352 // -----------------------------------------------------------------------------
       
  1353 TInt CTestSDKDialogs::TestDWriteInternalStateL( CStifItemParser& /*aItem*/ )
       
  1354     {
       
  1355     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1356     CleanupStack::PushL( dialog );
       
  1357     STIF_ASSERT_NOT_NULL( dialog );
       
  1358     CleanupStack::Pop( dialog );
       
  1359     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1360     
       
  1361     const TInt LengthC = 200;
       
  1362     CBufFlat* buf = CBufFlat::NewL( LengthC );
       
  1363     CleanupStack::PushL( buf );
       
  1364     RBufWriteStream writeStream;
       
  1365     CleanupClosePushL( writeStream );
       
  1366     writeStream.Open( *buf );
       
  1367         
       
  1368     STIF_ASSERT_NOT_LEAVES( dialog->WriteInternalStateL( writeStream ) );
       
  1369     STIF_ASSERT_NOT_NULL( buf );
       
  1370     STIF_ASSERT_NOT_NULL( &writeStream );
       
  1371     
       
  1372     CleanupStack::PopAndDestroy( &writeStream );
       
  1373     CleanupStack::PopAndDestroy( buf );
       
  1374     
       
  1375     TInt flag = dialog->RunLD();
       
  1376     STIF_ASSERT_EQUALS( 0, flag );
       
  1377     
       
  1378     return KErrNone;
       
  1379     
       
  1380     }
       
  1381 
       
  1382 // -----------------------------------------------------------------------------
       
  1383 // CTestSDKDialogs::TestDCountComponentControlsL 
       
  1384 // -----------------------------------------------------------------------------
       
  1385 TInt CTestSDKDialogs::TestDCountComponentControlsL( CStifItemParser& /*aItem*/ )
       
  1386     {
       
  1387     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1388     CleanupStack::PushL( dialog );
       
  1389     STIF_ASSERT_NOT_NULL( dialog );
       
  1390     CleanupStack::Pop( dialog );
       
  1391     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1392     
       
  1393     TInt count = dialog->CountComponentControls();
       
  1394     STIF_ASSERT_EQUALS( 2, count );
       
  1395     
       
  1396     TInt flag = dialog->RunLD();
       
  1397     STIF_ASSERT_EQUALS( 0, flag );
       
  1398     
       
  1399     return KErrNone;
       
  1400     
       
  1401     }
       
  1402 
       
  1403 // -----------------------------------------------------------------------------
       
  1404 // CTestSDKDialogs::TestDComponentControlL 
       
  1405 // -----------------------------------------------------------------------------
       
  1406 TInt CTestSDKDialogs::TestDComponentControlL( CStifItemParser& /*aItem*/ )
       
  1407     {
       
  1408     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1409     CleanupStack::PushL( dialog );
       
  1410     STIF_ASSERT_NOT_NULL( dialog );
       
  1411     CleanupStack::Pop( dialog );
       
  1412     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1413     
       
  1414     CEikMover* mover = static_cast<CEikMover*> ( dialog->ComponentControl( 1 ) );
       
  1415     STIF_ASSERT_NOT_NULL( mover );
       
  1416 
       
  1417     CCoeControl* selector = static_cast<CCoeControl*> ( dialog->ComponentControl( 2 ) );
       
  1418     STIF_ASSERT_NOT_NULL( selector );
       
  1419     
       
  1420     const TInt numberC =3;
       
  1421     CCoeControl* otherselector = static_cast<CCoeControl*> ( dialog->ComponentControl( numberC ) );
       
  1422     STIF_ASSERT_NOT_NULL( otherselector );
       
  1423     
       
  1424     TInt flag = dialog->RunLD();
       
  1425     STIF_ASSERT_EQUALS( 0, flag );
       
  1426     
       
  1427     return KErrNone;
       
  1428     
       
  1429     }
       
  1430 
       
  1431 // -----------------------------------------------------------------------------
       
  1432 // CTestSDKDialogs::TestDGetNumberOfLinesOnPageL 
       
  1433 // -----------------------------------------------------------------------------
       
  1434 TInt CTestSDKDialogs::TestDGetNumberOfLinesOnPageL( CStifItemParser& /*aItem*/ )
       
  1435     {
       
  1436     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1437     CleanupStack::PushL( dialog );
       
  1438     STIF_ASSERT_NOT_NULL( dialog );
       
  1439     CleanupStack::Pop( dialog );
       
  1440     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1441     
       
  1442     dialog->InsertLineL( 1, R_TESTSDK_LINE );
       
  1443     dialog->InsertLineL( 1, R_TESTSDK_LINE2 );
       
  1444     
       
  1445     TInt number = dialog->GetNumberOfLinesOnPage( 0 );
       
  1446     const TInt numberC =3;
       
  1447     STIF_ASSERT_EQUALS( numberC, number );
       
  1448     
       
  1449     TInt flag = dialog->RunLD();
       
  1450     STIF_ASSERT_EQUALS( 0, flag );
       
  1451     
       
  1452     return KErrNone;
       
  1453     
       
  1454     }
       
  1455 
       
  1456 // -----------------------------------------------------------------------------
       
  1457 // CTestSDKDialogs::TestDGetNumberOfPagesL 
       
  1458 // -----------------------------------------------------------------------------
       
  1459 TInt CTestSDKDialogs::TestDGetNumberOfPagesL( CStifItemParser& /*aItem*/ )
       
  1460     {
       
  1461     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1462     CleanupStack::PushL( dialog );
       
  1463     STIF_ASSERT_NOT_NULL( dialog );
       
  1464     CleanupStack::Pop( dialog );
       
  1465     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1466     
       
  1467     TInt number = dialog->GetNumberOfPages();
       
  1468     STIF_ASSERT_EQUALS( 2, number );
       
  1469     
       
  1470     TInt flag = dialog->RunLD();
       
  1471     STIF_ASSERT_EQUALS( 0, flag );
       
  1472     
       
  1473     return KErrNone;
       
  1474     
       
  1475     }
       
  1476 
       
  1477 // -----------------------------------------------------------------------------
       
  1478 // CTestSDKDialogs::TestDGetLineByLineAndPageIndexL 
       
  1479 // -----------------------------------------------------------------------------
       
  1480 TInt CTestSDKDialogs::TestDGetLineByLineAndPageIndexL( CStifItemParser& /*aItem*/ )
       
  1481     {
       
  1482     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1483     CleanupStack::PushL( dialog );
       
  1484     STIF_ASSERT_NOT_NULL( dialog );
       
  1485     CleanupStack::Pop( dialog );
       
  1486     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1487     
       
  1488     CEikCaptionedControl* control = dialog->GetLineByLineAndPageIndex( ETESTSDKPageLine2Editor , 1 );
       
  1489     STIF_ASSERT_NOT_NULL( dialog );
       
  1490     
       
  1491     TInt flag = dialog->RunLD();
       
  1492     STIF_ASSERT_EQUALS( 0, flag );
       
  1493     
       
  1494     return KErrNone;
       
  1495     
       
  1496     }
       
  1497 
       
  1498 // -----------------------------------------------------------------------------
       
  1499 // CTestSDKDialogs::TestDHandleControlEventL 
       
  1500 // -----------------------------------------------------------------------------
       
  1501 TInt CTestSDKDialogs::TestDHandleControlEventL( CStifItemParser& /*aItem*/ )
       
  1502     {
       
  1503     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1504     CleanupStack::PushL( dialog );
       
  1505     STIF_ASSERT_NOT_NULL( dialog );
       
  1506     CleanupStack::Pop( dialog );
       
  1507     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1508     
       
  1509     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->ControlOrNull( ETESTSDKPageLine1Editor ) );
       
  1510     CEikTimeAndDateEditor* dateTimeEditor = NULL;
       
  1511     dialog->HandleControlEventL( edwin, MCoeControlObserver::EEventStateChanged );
       
  1512     dialog->HandleControlEventL( edwin, MCoeControlObserver::EEventInteractionRefused );
       
  1513     dialog->HandleControlEventL( edwin, MCoeControlObserver::EEventPrepareFocusTransition );
       
  1514     dialog->HandleControlEventL( dateTimeEditor, MCoeControlObserver::EEventStateChanged );
       
  1515     
       
  1516     TInt flag = dialog->RunLD();
       
  1517     STIF_ASSERT_EQUALS( 0, flag );
       
  1518     
       
  1519     return KErrNone;
       
  1520     
       
  1521     }
       
  1522 
       
  1523 // -----------------------------------------------------------------------------
       
  1524 // CTestSDKDialogs::TestDTryExitL 
       
  1525 // -----------------------------------------------------------------------------
       
  1526 TInt CTestSDKDialogs::TestDTryExitL( CStifItemParser& /*aItem*/ )
       
  1527     {
       
  1528   
       
  1529     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1530     CleanupStack::PushL( dialog );
       
  1531     STIF_ASSERT_NOT_NULL( dialog );
       
  1532     CleanupStack::Pop( dialog );
       
  1533     
       
  1534     dialog->ConstructAutoDialogLC( EEikDialogFlagNoUserExit, R_AVKON_SOFTKEYS_OK_CANCEL );
       
  1535     dialog->TryExitL( EEikBidCancel );
       
  1536     
       
  1537     TInt flag = dialog->RunLD();
       
  1538     STIF_ASSERT_EQUALS( 0, flag );
       
  1539     
       
  1540     dialog = new (ELeave) CTestSDKDialogsControl;
       
  1541     CleanupStack::PushL( dialog );
       
  1542     STIF_ASSERT_NOT_NULL( dialog );
       
  1543     CleanupStack::Pop( dialog );
       
  1544     
       
  1545     dialog->ConstructAutoDialogLC( EEikDialogFlagNotifyEsc, R_AVKON_SOFTKEYS_OK_CANCEL );
       
  1546     CleanupStack::Pop( dialog );
       
  1547     dialog->TryExitL( EEikBidCancel );
       
  1548     
       
  1549     return KErrNone;
       
  1550 
       
  1551     }
       
  1552 
       
  1553 // -----------------------------------------------------------------------------
       
  1554 // CTestSDKDialogs::TestDAdjustAllIdsOnPageL 
       
  1555 // -----------------------------------------------------------------------------
       
  1556 TInt CTestSDKDialogs::TestDAdjustAllIdsOnPageL( CStifItemParser& /*aItem*/ )
       
  1557     {
       
  1558     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1559     CleanupStack::PushL( dialog );
       
  1560     STIF_ASSERT_NOT_NULL( dialog );
       
  1561     CleanupStack::Pop( dialog );
       
  1562     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1563     
       
  1564     dialog->AdjustAllIdsOnPage( 1, 2 );
       
  1565     TInt id = ETESTSDKPageLine2Editor + 2;
       
  1566     CEikCaptionedControl* control = dialog->GetLineByLineAndPageIndex( id , 1 );
       
  1567     STIF_ASSERT_NOT_NULL( dialog );
       
  1568     
       
  1569     TInt flag = dialog->RunLD();
       
  1570     STIF_ASSERT_EQUALS( 0, flag );
       
  1571     
       
  1572     return KErrNone;
       
  1573     
       
  1574     }
       
  1575 
       
  1576 // -----------------------------------------------------------------------------
       
  1577 // CTestSDKDialogs::TestDConstructSleepingDialogL 
       
  1578 // -----------------------------------------------------------------------------
       
  1579 TInt CTestSDKDialogs::TestDConstructSleepingDialogL( CStifItemParser& /*aItem*/ )
       
  1580     {
       
  1581     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1582     CleanupStack::PushL( dialog );
       
  1583     STIF_ASSERT_NOT_NULL( dialog );
       
  1584     
       
  1585     dialog->ConstructSleepingDialogL( R_TESTSDK_PAGE );
       
  1586     
       
  1587     TInt flag = dialog->RunLD();
       
  1588     STIF_ASSERT_EQUALS( 0, flag );
       
  1589     
       
  1590     return KErrNone;
       
  1591     
       
  1592     }
       
  1593 
       
  1594 // -----------------------------------------------------------------------------
       
  1595 // CTestSDKDialogs::TestDConstructSleepingAlertDialogL 
       
  1596 // -----------------------------------------------------------------------------
       
  1597 TInt CTestSDKDialogs::TestDConstructSleepingAlertDialogL( CStifItemParser& /*aItem*/ )
       
  1598     {
       
  1599     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1600     CleanupStack::PushL( dialog );
       
  1601     STIF_ASSERT_NOT_NULL( dialog );
       
  1602     
       
  1603     dialog->ConstructSleepingAlertDialogL( R_TESTSDK_PAGE );
       
  1604     
       
  1605     TInt flag = dialog->RunLD();
       
  1606     STIF_ASSERT_EQUALS( 0, flag );
       
  1607     
       
  1608     return KErrNone;
       
  1609     
       
  1610     }
       
  1611 
       
  1612 // -----------------------------------------------------------------------------
       
  1613 // CTestSDKDialogs::TestDRouseSleepingDialogL 
       
  1614 // -----------------------------------------------------------------------------
       
  1615 TInt CTestSDKDialogs::TestDRouseSleepingDialogL( CStifItemParser& /*aItem*/ )
       
  1616     {
       
  1617     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1618     CleanupStack::PushL( dialog );
       
  1619     STIF_ASSERT_NOT_NULL( dialog );
       
  1620     CleanupStack::Pop( dialog );
       
  1621     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1622     
       
  1623     dialog->RouseSleepingDialog();
       
  1624     TInt flag = dialog->RunLD();
       
  1625     STIF_ASSERT_EQUALS( 0, flag );
       
  1626     
       
  1627     dialog = new (ELeave) CTestSDKDialogsControl;
       
  1628     CleanupStack::PushL( dialog );
       
  1629     STIF_ASSERT_NOT_NULL( dialog );
       
  1630 
       
  1631     dialog->ConstructSleepingDialogL( R_TESTSDK_PAGE );
       
  1632     dialog->RouseSleepingDialog();
       
  1633     dialog->RunLD();
       
  1634     
       
  1635     return KErrNone;
       
  1636     
       
  1637     }
       
  1638 
       
  1639 // -----------------------------------------------------------------------------
       
  1640 // CTestSDKDialogs::TestDExitSleepingDialogL 
       
  1641 // -----------------------------------------------------------------------------
       
  1642 TInt CTestSDKDialogs::TestDExitSleepingDialogL( CStifItemParser& /*aItem*/ )
       
  1643     {
       
  1644     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1645     CleanupStack::PushL( dialog );
       
  1646     STIF_ASSERT_NOT_NULL( dialog );
       
  1647     CleanupStack::Pop( dialog );
       
  1648     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1649     
       
  1650     dialog->ExitSleepingDialog();
       
  1651     TInt flag = dialog->RunLD();
       
  1652     STIF_ASSERT_EQUALS( 0, flag );
       
  1653     
       
  1654     dialog = new (ELeave) CTestSDKDialogsControl;
       
  1655     CleanupStack::PushL( dialog );
       
  1656     STIF_ASSERT_NOT_NULL( dialog );
       
  1657 
       
  1658     dialog->ConstructSleepingDialogL( R_TESTSDK_PAGE );
       
  1659     dialog->ExitSleepingDialog();
       
  1660     dialog->RunLD();
       
  1661     
       
  1662     return KErrNone;
       
  1663     
       
  1664     }
       
  1665 
       
  1666 // -----------------------------------------------------------------------------
       
  1667 // CTestSDKDialogs::TestDIdOfFocusControlL 
       
  1668 // -----------------------------------------------------------------------------
       
  1669 TInt CTestSDKDialogs::TestDIdOfFocusControlL( CStifItemParser& /*aItem*/ )
       
  1670     {
       
  1671     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1672     CleanupStack::PushL( dialog );
       
  1673     STIF_ASSERT_NOT_NULL( dialog );
       
  1674     CleanupStack::Pop( dialog );
       
  1675     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1676     
       
  1677     dialog->InsertLineL( 1, R_TESTSDK_LINE );
       
  1678     dialog->InsertLineL( 1, R_TESTSDK_LINE2 );
       
  1679     
       
  1680     dialog->CTestSDKDialogsSetInitialCurrentLine();
       
  1681     CEikCaptionedControl* curLine = dialog->CTestSDKDialogsCurrentLine();
       
  1682     if (curLine)
       
  1683         {
       
  1684         dialog->TryChangeFocusToL(curLine->iId);
       
  1685         }
       
  1686     
       
  1687     TInt idFocus = dialog->IdOfFocusControl();
       
  1688     STIF_ASSERT_TRUE( EDialogLine == idFocus );
       
  1689     
       
  1690     TInt flag = dialog->RunLD();
       
  1691     STIF_ASSERT_EQUALS( 0, flag );
       
  1692     
       
  1693     return KErrNone;
       
  1694     
       
  1695     }
       
  1696 
       
  1697 // -----------------------------------------------------------------------------
       
  1698 // CTestSDKDialogs::TestDFindLineIndexL 
       
  1699 // -----------------------------------------------------------------------------
       
  1700 TInt CTestSDKDialogs::TestDFindLineIndexL( CStifItemParser& /*aItem*/ )
       
  1701     {
       
  1702     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1703     CleanupStack::PushL( dialog );
       
  1704     STIF_ASSERT_NOT_NULL( dialog );
       
  1705     CleanupStack::Pop( dialog );
       
  1706     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1707     
       
  1708     dialog->ActivateFirstPageL();
       
  1709     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->ControlOrNull( ETESTSDKPageLine1Editor ) );
       
  1710     TInt index = dialog->FindLineIndex( *edwin );
       
  1711     STIF_ASSERT_TRUE( index == 0 );
       
  1712     
       
  1713     edwin = static_cast<CEikEdwin*> ( dialog->ControlOrNull( ETESTSDKPageLine2Editor ) );
       
  1714     index = dialog->FindLineIndex( *edwin );
       
  1715     STIF_ASSERT_TRUE( index == KErrNotFound );
       
  1716     
       
  1717     CEikTimeAndDateEditor* dateTimeEditor = NULL;
       
  1718     index = dialog->FindLineIndex( *dateTimeEditor );
       
  1719     STIF_ASSERT_TRUE( index == KErrNotFound );
       
  1720     
       
  1721     TInt flag = dialog->RunLD();
       
  1722     STIF_ASSERT_EQUALS( 0, flag );
       
  1723     
       
  1724     return KErrNone;
       
  1725     
       
  1726     }
       
  1727 
       
  1728 // -----------------------------------------------------------------------------
       
  1729 // CTestSDKDialogs::TestDLineL 
       
  1730 // -----------------------------------------------------------------------------
       
  1731 TInt CTestSDKDialogs::TestDLineL( CStifItemParser& /*aItem*/ )
       
  1732     {
       
  1733     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1734     CleanupStack::PushL( dialog );
       
  1735     STIF_ASSERT_NOT_NULL( dialog );
       
  1736     CleanupStack::Pop( dialog );
       
  1737     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1738     
       
  1739     CEikCaptionedControl* control = dialog->Line( EDialogLine );
       
  1740     STIF_ASSERT_NOT_NULL( control );
       
  1741     
       
  1742     TInt flag = dialog->RunLD();
       
  1743     STIF_ASSERT_EQUALS( 0, flag );
       
  1744     
       
  1745     return KErrNone;
       
  1746     
       
  1747     }
       
  1748 
       
  1749 // -----------------------------------------------------------------------------
       
  1750 // CTestSDKDialogs::TestDCurrentLineL 
       
  1751 // -----------------------------------------------------------------------------
       
  1752 TInt CTestSDKDialogs::TestDCurrentLineL( CStifItemParser& /*aItem*/ )
       
  1753     {
       
  1754     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1755     CleanupStack::PushL( dialog );
       
  1756     STIF_ASSERT_NOT_NULL( dialog );
       
  1757     CleanupStack::Pop( dialog );
       
  1758     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1759     
       
  1760     dialog->ActivateFirstPageL();
       
  1761     dialog->InsertLineL( 1, R_TESTSDK_LINE );
       
  1762     dialog->InsertLineL( 1, R_TESTSDK_LINE2 );
       
  1763     
       
  1764     dialog->CTestSDKDialogsSetInitialCurrentLine();
       
  1765     CEikCaptionedControl* control = dialog->CurrentLine();
       
  1766     STIF_ASSERT_NOT_NULL( control );
       
  1767     
       
  1768     dialog->TryChangeFocusToL(control->iId);
       
  1769     TInt idFocus = dialog->IdOfFocusControl();
       
  1770     STIF_ASSERT_TRUE( EDialogLine == idFocus );
       
  1771     
       
  1772     TInt flag = dialog->RunLD();
       
  1773     STIF_ASSERT_EQUALS( 0, flag );
       
  1774     
       
  1775     return KErrNone;
       
  1776     
       
  1777     }
       
  1778 
       
  1779 // -----------------------------------------------------------------------------
       
  1780 // CTestSDKDialogs::TestDRotateFocusByL 
       
  1781 // -----------------------------------------------------------------------------
       
  1782 TInt CTestSDKDialogs::TestDRotateFocusByL( CStifItemParser& /*aItem*/ )
       
  1783     {
       
  1784     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1785     CleanupStack::PushL( dialog );
       
  1786     STIF_ASSERT_NOT_NULL( dialog );
       
  1787     CleanupStack::Pop( dialog );
       
  1788     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1789     
       
  1790     dialog->ActivateFirstPageL();
       
  1791     const TInt countC = 5;
       
  1792     TBool rotate = dialog->RotateFocusByL( countC );
       
  1793     STIF_ASSERT_TRUE( rotate );
       
  1794     
       
  1795     TInt flag = dialog->RunLD();
       
  1796     STIF_ASSERT_EQUALS( 0, flag );
       
  1797     
       
  1798     dialog = new (ELeave) CTestSDKDialogsControl;
       
  1799     CleanupStack::PushL( dialog );
       
  1800     STIF_ASSERT_NOT_NULL( dialog );
       
  1801     CleanupStack::Pop( dialog );
       
  1802     
       
  1803     dialog->ConstructAutoDialogLC( 0, R_AVKON_SOFTKEYS_OK_CANCEL );
       
  1804     rotate = dialog->RotateFocusByL( countC );
       
  1805     STIF_ASSERT_FALSE( rotate );
       
  1806     
       
  1807     flag = dialog->RunLD();
       
  1808     STIF_ASSERT_EQUALS( 0, flag );
       
  1809     
       
  1810     return KErrNone;
       
  1811     
       
  1812     }
       
  1813 
       
  1814 // -----------------------------------------------------------------------------
       
  1815 // CTestSDKDialogs::TestDActivePageIndexL 
       
  1816 // -----------------------------------------------------------------------------
       
  1817 TInt CTestSDKDialogs::TestDActivePageIndexL( CStifItemParser& /*aItem*/ )
       
  1818     {
       
  1819     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1820     CleanupStack::PushL( dialog );
       
  1821     STIF_ASSERT_NOT_NULL( dialog );
       
  1822     CleanupStack::Pop( dialog );
       
  1823     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1824     
       
  1825     dialog->ActivateFirstPageL();
       
  1826     TInt index = dialog->ActivePageIndex();
       
  1827     STIF_ASSERT_EQUALS( 0, index );
       
  1828     
       
  1829     TInt flag = dialog->RunLD();
       
  1830     STIF_ASSERT_EQUALS( 0, flag );
       
  1831     
       
  1832     return KErrNone;
       
  1833     
       
  1834     }
       
  1835 
       
  1836 // -----------------------------------------------------------------------------
       
  1837 // CTestSDKDialogs::TestDResetLineMinimumSizesL 
       
  1838 // -----------------------------------------------------------------------------
       
  1839 TInt CTestSDKDialogs::TestDResetLineMinimumSizesL( CStifItemParser& /*aItem*/ )
       
  1840     {
       
  1841     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1842     CleanupStack::PushL( dialog );
       
  1843     STIF_ASSERT_NOT_NULL( dialog );
       
  1844     CleanupStack::Pop( dialog );
       
  1845     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  1846     
       
  1847     dialog->ResetLineMinimumSizes();
       
  1848     
       
  1849     TInt flag = dialog->RunLD();
       
  1850     STIF_ASSERT_EQUALS( 0, flag );
       
  1851     
       
  1852     return KErrNone;
       
  1853     
       
  1854     }
       
  1855 
       
  1856 // -----------------------------------------------------------------------------
       
  1857 // CTestSDKDialogs::TestDSwapButtonGroupContainerL 
       
  1858 // -----------------------------------------------------------------------------
       
  1859 TInt CTestSDKDialogs::TestDSwapButtonGroupContainerL( CStifItemParser& /*aItem*/ )
       
  1860     {
       
  1861     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1862     CleanupStack::PushL( dialog );
       
  1863     STIF_ASSERT_NOT_NULL( dialog );
       
  1864     CleanupStack::Pop( dialog );
       
  1865     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1866     
       
  1867     CEikButtonGroupContainer* currentBtGrp = CEikButtonGroupContainer::Current();
       
  1868     STIF_ASSERT_NOT_NULL( currentBtGrp );
       
  1869     CEikButtonGroupContainer* btGrp = dialog->SwapButtonGroupContainer( currentBtGrp );
       
  1870     dialog->SwapButtonGroupContainer( btGrp );
       
  1871     
       
  1872     TInt flag = dialog->RunLD();
       
  1873     STIF_ASSERT_EQUALS( 0, flag );
       
  1874     
       
  1875     return KErrNone;
       
  1876     
       
  1877     }
       
  1878 
       
  1879 // -----------------------------------------------------------------------------
       
  1880 // CTestSDKDialogs::TestDButtonCommandObserverL 
       
  1881 // -----------------------------------------------------------------------------
       
  1882 TInt CTestSDKDialogs::TestDButtonCommandObserverL( CStifItemParser& /*aItem*/ )
       
  1883     {
       
  1884     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1885     CleanupStack::PushL( dialog );
       
  1886     STIF_ASSERT_NOT_NULL( dialog );
       
  1887     CleanupStack::Pop( dialog );
       
  1888     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1889     
       
  1890     MEikCommandObserver* server = dialog->ButtonCommandObserver();
       
  1891     STIF_ASSERT_NOT_NULL( server );
       
  1892     
       
  1893     TInt flag = dialog->RunLD();
       
  1894     STIF_ASSERT_EQUALS( 0, flag );
       
  1895     
       
  1896     return KErrNone;
       
  1897     
       
  1898     }
       
  1899 
       
  1900 // -----------------------------------------------------------------------------
       
  1901 // CTestSDKDialogs::TestDOkToExitL 
       
  1902 // -----------------------------------------------------------------------------
       
  1903 TInt CTestSDKDialogs::TestDOkToExitL( CStifItemParser& /*aItem*/ )
       
  1904     {
       
  1905     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1906     CleanupStack::PushL( dialog );
       
  1907     STIF_ASSERT_NOT_NULL( dialog );
       
  1908     CleanupStack::Pop( dialog );
       
  1909     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1910     
       
  1911     TBool exit = dialog->OkToExitL( R_AVKON_SOFTKEYS_OK_CANCEL );
       
  1912     STIF_ASSERT_TRUE( exit );
       
  1913     
       
  1914     TInt flag = dialog->RunLD();
       
  1915     STIF_ASSERT_EQUALS( 0, flag );
       
  1916     
       
  1917     return KErrNone;
       
  1918     
       
  1919     }
       
  1920 
       
  1921 // -----------------------------------------------------------------------------
       
  1922 // CTestSDKDialogs::TestDPreLayoutDynInitL 
       
  1923 // -----------------------------------------------------------------------------
       
  1924 TInt CTestSDKDialogs::TestDPreLayoutDynInitL( CStifItemParser& /*aItem*/ )
       
  1925     {
       
  1926     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1927     CleanupStack::PushL( dialog );
       
  1928     STIF_ASSERT_NOT_NULL( dialog );
       
  1929     CleanupStack::Pop( dialog );
       
  1930     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1931     
       
  1932     dialog->PreLayoutDynInitL();
       
  1933     
       
  1934     TInt flag = dialog->RunLD();
       
  1935     STIF_ASSERT_EQUALS( 0, flag );
       
  1936     
       
  1937     return KErrNone;
       
  1938     
       
  1939     }
       
  1940 
       
  1941 // -----------------------------------------------------------------------------
       
  1942 // CTestSDKDialogs::TestDPostLayoutDynInitL 
       
  1943 // -----------------------------------------------------------------------------
       
  1944 TInt CTestSDKDialogs::TestDPostLayoutDynInitL( CStifItemParser& /*aItem*/ )
       
  1945     {
       
  1946     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1947     CleanupStack::PushL( dialog );
       
  1948     STIF_ASSERT_NOT_NULL( dialog );
       
  1949     CleanupStack::Pop( dialog );
       
  1950     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1951     
       
  1952     dialog->PostLayoutDynInitL();
       
  1953     
       
  1954     TInt flag = dialog->RunLD();
       
  1955     STIF_ASSERT_EQUALS( 0, flag );
       
  1956     
       
  1957     return KErrNone;
       
  1958     
       
  1959     }
       
  1960 
       
  1961 // -----------------------------------------------------------------------------
       
  1962 // CTestSDKDialogs::TestDSetInitialCurrentLineL 
       
  1963 // -----------------------------------------------------------------------------
       
  1964 TInt CTestSDKDialogs::TestDSetInitialCurrentLineL( CStifItemParser& /*aItem*/ )
       
  1965     {
       
  1966     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1967     CleanupStack::PushL( dialog );
       
  1968     STIF_ASSERT_NOT_NULL( dialog );
       
  1969     CleanupStack::Pop( dialog );
       
  1970     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1971     
       
  1972     dialog->SetInitialCurrentLine();
       
  1973     TInt id = dialog->IdOfFocusControl();
       
  1974     STIF_ASSERT_TRUE( ETESTSDKPageLine1Editor == id );
       
  1975     
       
  1976     TInt flag = dialog->RunLD();
       
  1977     STIF_ASSERT_EQUALS( 0, flag );
       
  1978     
       
  1979     return KErrNone;
       
  1980     
       
  1981     }
       
  1982 
       
  1983 // -----------------------------------------------------------------------------
       
  1984 // CTestSDKDialogs::TestDHandleControlStateChangeL 
       
  1985 // -----------------------------------------------------------------------------
       
  1986 TInt CTestSDKDialogs::TestDHandleControlStateChangeL( CStifItemParser& /*aItem*/ )
       
  1987     {
       
  1988     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  1989     CleanupStack::PushL( dialog );
       
  1990     STIF_ASSERT_NOT_NULL( dialog );
       
  1991     CleanupStack::Pop( dialog );
       
  1992     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  1993     
       
  1994     dialog->HandleControlStateChangeL( ETESTSDKPageLine1Editor );
       
  1995     
       
  1996     TInt flag = dialog->RunLD();
       
  1997     STIF_ASSERT_EQUALS( 0, flag );
       
  1998     
       
  1999     return KErrNone;
       
  2000     
       
  2001     }
       
  2002 
       
  2003 // -----------------------------------------------------------------------------
       
  2004 // CTestSDKDialogs::TestDHandleInteractionRefusedL 
       
  2005 // -----------------------------------------------------------------------------
       
  2006 TInt CTestSDKDialogs::TestDHandleInteractionRefusedL( CStifItemParser& /*aItem*/ )
       
  2007     {
       
  2008     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2009     CleanupStack::PushL( dialog );
       
  2010     STIF_ASSERT_NOT_NULL( dialog );
       
  2011     CleanupStack::Pop( dialog );
       
  2012     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  2013     
       
  2014     dialog->SetLineDimmedNow( ETESTSDKPageLine1Editor, ETrue );
       
  2015     dialog->HandleInteractionRefused( ETESTSDKPageLine1Editor );
       
  2016     
       
  2017     TInt flag = dialog->RunLD();
       
  2018     STIF_ASSERT_EQUALS( 0, flag );
       
  2019     
       
  2020     return KErrNone;
       
  2021     
       
  2022     }
       
  2023 
       
  2024 // -----------------------------------------------------------------------------
       
  2025 // CTestSDKDialogs::TestDSetSizeAndPositionL 
       
  2026 // -----------------------------------------------------------------------------
       
  2027 TInt CTestSDKDialogs::TestDSetSizeAndPositionL( CStifItemParser& /*aItem*/ )
       
  2028     {
       
  2029     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2030     CleanupStack::PushL( dialog );
       
  2031     STIF_ASSERT_NOT_NULL( dialog );
       
  2032     CleanupStack::Pop( dialog );
       
  2033     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  2034     
       
  2035     const TInt lengthC = 10;
       
  2036     TSize size( lengthC, lengthC );
       
  2037     dialog->SetSizeAndPosition( size );
       
  2038     
       
  2039     TInt flag = dialog->RunLD();
       
  2040     STIF_ASSERT_EQUALS( 0, flag );
       
  2041     
       
  2042     return KErrNone;
       
  2043     
       
  2044     }
       
  2045 
       
  2046 // -----------------------------------------------------------------------------
       
  2047 // CTestSDKDialogs::TestDBorderStyleL 
       
  2048 // -----------------------------------------------------------------------------
       
  2049 TInt CTestSDKDialogs::TestDBorderStyleL( CStifItemParser& /*aItem*/ )
       
  2050     {
       
  2051     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2052     CleanupStack::PushL( dialog );
       
  2053     STIF_ASSERT_NOT_NULL( dialog );
       
  2054     CleanupStack::Pop( dialog );
       
  2055     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  2056     
       
  2057     TInt style = dialog->BorderStyle();
       
  2058     STIF_ASSERT_TRUE( TGulBorder::ENone == style );
       
  2059     
       
  2060     TInt flag = dialog->RunLD();
       
  2061     STIF_ASSERT_EQUALS( 0, flag );
       
  2062     
       
  2063     return KErrNone;
       
  2064     
       
  2065     }
       
  2066 
       
  2067 // -----------------------------------------------------------------------------
       
  2068 // CTestSDKDialogs::TestDMappedCommandIdL 
       
  2069 // -----------------------------------------------------------------------------
       
  2070 TInt CTestSDKDialogs::TestDMappedCommandIdL( CStifItemParser& /*aItem*/ )
       
  2071     {
       
  2072     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2073     CleanupStack::PushL( dialog );
       
  2074     STIF_ASSERT_NOT_NULL( dialog );
       
  2075     CleanupStack::Pop( dialog );
       
  2076     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  2077     
       
  2078     TInt id = dialog->MappedCommandId( EAknSoftkeyCancel );
       
  2079     STIF_ASSERT_TRUE( id == EEikBidCancel );
       
  2080     
       
  2081     TInt flag = dialog->RunLD();
       
  2082     STIF_ASSERT_EQUALS( 0, flag );
       
  2083     
       
  2084     return KErrNone;
       
  2085     
       
  2086     }
       
  2087 
       
  2088 // -----------------------------------------------------------------------------
       
  2089 // CTestSDKDialogs::TestDFormFlagsFromActivePageL 
       
  2090 // -----------------------------------------------------------------------------
       
  2091 TInt CTestSDKDialogs::TestDFormFlagsFromActivePageL( CStifItemParser& /*aItem*/ )
       
  2092     {
       
  2093     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2094     CleanupStack::PushL( dialog );
       
  2095     STIF_ASSERT_NOT_NULL( dialog );
       
  2096     CleanupStack::Pop( dialog );
       
  2097     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  2098     
       
  2099     dialog->ActivateFirstPageL();
       
  2100     TInt id = dialog->FormFlagsFromActivePage();
       
  2101     STIF_ASSERT_EQUALS( 0, id );
       
  2102     
       
  2103     TInt flag = dialog->RunLD();
       
  2104     STIF_ASSERT_EQUALS( 0, flag );
       
  2105     
       
  2106     return KErrNone;
       
  2107     
       
  2108     }
       
  2109 
       
  2110 // -----------------------------------------------------------------------------
       
  2111 // CTestSDKDialogs::TestDGetFirstLineOnFirstPageOrNullL 
       
  2112 // -----------------------------------------------------------------------------
       
  2113 TInt CTestSDKDialogs::TestDGetFirstLineOnFirstPageOrNullL( CStifItemParser& /*aItem*/ )
       
  2114     {
       
  2115     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2116     CleanupStack::PushL( dialog );
       
  2117     STIF_ASSERT_NOT_NULL( dialog );
       
  2118     CleanupStack::Pop( dialog );
       
  2119     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  2120     
       
  2121     CEikCaptionedControl* control = dialog->GetFirstLineOnFirstPageOrNull();
       
  2122     STIF_ASSERT_NOT_NULL( control );
       
  2123     STIF_ASSERT_TRUE( control->iId == ETESTSDKPageLine1Editor );
       
  2124     
       
  2125     TInt flag = dialog->RunLD();
       
  2126     STIF_ASSERT_EQUALS( 0, flag );
       
  2127     
       
  2128     return KErrNone;
       
  2129     
       
  2130     }
       
  2131 
       
  2132 // -----------------------------------------------------------------------------
       
  2133 // CTestSDKDialogs::TestDControlsOnPageL 
       
  2134 // -----------------------------------------------------------------------------
       
  2135 TInt CTestSDKDialogs::TestDControlsOnPageL( CStifItemParser& /*aItem*/ )
       
  2136     {
       
  2137     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2138     CleanupStack::PushL( dialog );
       
  2139     STIF_ASSERT_NOT_NULL( dialog );
       
  2140     CleanupStack::Pop( dialog );
       
  2141     dialog->PrepareLC( R_TESTSDK_PAGE );
       
  2142     
       
  2143     RArray<CEikCaptionedControl*> control(1) ;
       
  2144     CleanupClosePushL( control );
       
  2145     dialog->ControlsOnPage( control, 0 );
       
  2146     STIF_ASSERT_TRUE( control.Count() == 1 );
       
  2147     STIF_ASSERT_TRUE( control[0]->iId == ETESTSDKPageLine1Editor );
       
  2148     CleanupStack::Pop( &control );
       
  2149     
       
  2150     TInt flag = dialog->RunLD();
       
  2151     STIF_ASSERT_EQUALS( 0, flag );
       
  2152     
       
  2153     return KErrNone;
       
  2154     
       
  2155     }
       
  2156 
       
  2157 // -----------------------------------------------------------------------------
       
  2158 // CTestSDKDialogs::TestDMopSupplyObjectL 
       
  2159 // -----------------------------------------------------------------------------
       
  2160 TInt CTestSDKDialogs::TestDMopSupplyObjectL( CStifItemParser& /*aItem*/ )
       
  2161     {
       
  2162     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2163     CleanupStack::PushL( dialog );
       
  2164     STIF_ASSERT_NOT_NULL( dialog );
       
  2165     CleanupStack::Pop( dialog );
       
  2166     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  2167     
       
  2168     TTypeUid::Ptr ptr = TTypeUid::Null();
       
  2169     ptr = dialog->MopSupplyObject( CEikDialog::ETypeId );
       
  2170     CTestSDKDialogsControl* point = static_cast<CTestSDKDialogsControl*> ( ptr.Pointer() );
       
  2171     STIF_ASSERT_NOT_NULL( point );
       
  2172     
       
  2173     TInt flag = dialog->RunLD();
       
  2174     STIF_ASSERT_EQUALS( 0, flag );
       
  2175     
       
  2176     return KErrNone;
       
  2177     
       
  2178     }
       
  2179 
       
  2180 // -----------------------------------------------------------------------------
       
  2181 // CTestSDKDialogs::TestDExtensionL 
       
  2182 // -----------------------------------------------------------------------------
       
  2183 TInt CTestSDKDialogs::TestDExtensionL( CStifItemParser& /*aItem*/ )
       
  2184     {
       
  2185     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2186     CleanupStack::PushL( dialog );
       
  2187     STIF_ASSERT_NOT_NULL( dialog );
       
  2188     CleanupStack::Pop( dialog );
       
  2189     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  2190     
       
  2191     CEikDialogExtension* extension = dialog->Extension();
       
  2192     STIF_ASSERT_NOT_NULL( extension );
       
  2193     
       
  2194     TInt flag = dialog->RunLD();
       
  2195     STIF_ASSERT_EQUALS( 0, flag );
       
  2196     
       
  2197     return KErrNone;
       
  2198     
       
  2199     }
       
  2200 
       
  2201 // -----------------------------------------------------------------------------
       
  2202 // CTestSDKDialogs::TestDDialogFlagsL 
       
  2203 // -----------------------------------------------------------------------------
       
  2204 TInt CTestSDKDialogs::TestDDialogFlagsL( CStifItemParser& /*aItem*/ )
       
  2205     {
       
  2206     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2207     CleanupStack::PushL( dialog );
       
  2208     STIF_ASSERT_NOT_NULL( dialog );
       
  2209     CleanupStack::Pop( dialog );
       
  2210     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  2211     
       
  2212     TInt flags = dialog->DialogFlags();
       
  2213     STIF_ASSERT_EQUALS( 0, flags );
       
  2214     
       
  2215     TInt flag = dialog->RunLD();
       
  2216     STIF_ASSERT_EQUALS( 0, flag );
       
  2217     
       
  2218     return KErrNone;
       
  2219     
       
  2220     }
       
  2221 
       
  2222 // -----------------------------------------------------------------------------
       
  2223 // CTestSDKDialogs::TestDDeclareAutoTextEditorL 
       
  2224 // -----------------------------------------------------------------------------
       
  2225 TInt CTestSDKDialogs::TestDDeclareAutoTextEditorL( CStifItemParser& /*aItem*/ )
       
  2226     {
       
  2227     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2228     CleanupStack::PushL( dialog );
       
  2229     STIF_ASSERT_NOT_NULL( dialog );
       
  2230     CleanupStack::Pop( dialog );
       
  2231     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2232     
       
  2233     _LIT( KText, "TextEditor" );
       
  2234     const TInt lengthC = 20;
       
  2235     TBuf<lengthC> text( KText );
       
  2236     dialog->DeclareAutoTextEditorL( ETESTSDKTextEditor, &text );
       
  2237     
       
  2238     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->ControlOrNull( ETESTSDKTextEditor ) );
       
  2239     HBufC* textbuf = edwin->GetTextInHBufL();
       
  2240     STIF_ASSERT_EQUALS( 0, textbuf->Compare( KText ) );
       
  2241     
       
  2242     TInt flag = dialog->RunLD();
       
  2243     STIF_ASSERT_EQUALS( 0, flag );
       
  2244     
       
  2245     return KErrNone;
       
  2246     
       
  2247     }
       
  2248 
       
  2249 // -----------------------------------------------------------------------------
       
  2250 // CTestSDKDialogs::TestDDeclareAutoNumberEditorL 
       
  2251 // -----------------------------------------------------------------------------
       
  2252 TInt CTestSDKDialogs::TestDDeclareAutoNumberEditorL( CStifItemParser& /*aItem*/ )
       
  2253     {
       
  2254     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2255     CleanupStack::PushL( dialog );
       
  2256     STIF_ASSERT_NOT_NULL( dialog );
       
  2257     CleanupStack::Pop( dialog );
       
  2258     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2259     
       
  2260     const TInt numberC = 10;
       
  2261     TInt number = numberC;
       
  2262     dialog->DeclareAutoNumberEditor( ETESTSDKNumberEditor, &number );
       
  2263     
       
  2264     CEikNumberEditor* numberEditor = static_cast<CEikNumberEditor*> ( dialog->ControlOrNull( ETESTSDKNumberEditor ) );
       
  2265     TInt numberGet = numberEditor->Number();
       
  2266     STIF_ASSERT_EQUALS( number, numberGet );
       
  2267     
       
  2268     TInt flag = dialog->RunLD();
       
  2269     STIF_ASSERT_EQUALS( 0, flag );
       
  2270     
       
  2271     return KErrNone;
       
  2272     
       
  2273     }
       
  2274 
       
  2275 // -----------------------------------------------------------------------------
       
  2276 // CTestSDKDialogs::TestDDeclareAutoRangeEditorL 
       
  2277 // -----------------------------------------------------------------------------
       
  2278 TInt CTestSDKDialogs::TestDDeclareAutoRangeEditorL( CStifItemParser& /*aItem*/ )
       
  2279     {
       
  2280     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2281     CleanupStack::PushL( dialog );
       
  2282     STIF_ASSERT_NOT_NULL( dialog );
       
  2283     CleanupStack::Pop( dialog );
       
  2284     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2285     
       
  2286     SEikRange range;
       
  2287     range.iLowerLimit = 0;
       
  2288     const TInt upperLimitC = 100;
       
  2289     range.iUpperLimit = upperLimitC;
       
  2290     dialog->DeclareAutoRangeEditor( ETESTSDKRangeEditor, &range );
       
  2291     
       
  2292     CEikRangeEditor * rangeEditor = static_cast<CEikRangeEditor *> ( dialog->ControlOrNull( ETESTSDKRangeEditor ) );
       
  2293     SEikRange rangeGet = rangeEditor->Range();
       
  2294     TInt lower = rangeGet.iLowerLimit;
       
  2295     STIF_ASSERT_EQUALS( 0, lower );
       
  2296     TInt upper = rangeGet.iUpperLimit;
       
  2297     STIF_ASSERT_EQUALS( upperLimitC, upper );
       
  2298     
       
  2299     TInt flag = dialog->RunLD();
       
  2300     STIF_ASSERT_EQUALS( 0, flag );
       
  2301     
       
  2302     return KErrNone;
       
  2303     
       
  2304     }
       
  2305 
       
  2306 // -----------------------------------------------------------------------------
       
  2307 // CTestSDKDialogs::TestDDeclareAutoTimeEditorL 
       
  2308 // -----------------------------------------------------------------------------
       
  2309 TInt CTestSDKDialogs::TestDDeclareAutoTimeEditorL( CStifItemParser& /*aItem*/ )
       
  2310     {
       
  2311     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2312     CleanupStack::PushL( dialog );
       
  2313     STIF_ASSERT_NOT_NULL( dialog );
       
  2314     CleanupStack::Pop( dialog );
       
  2315     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2316     
       
  2317     TDateTime datetime( 0, TMonth( 0 ), 0, 20, 20, 20, 0 );
       
  2318     TTime time( datetime );
       
  2319     dialog->DeclareAutoTimeEditor( ETESTSDKTimeEditor, &time );
       
  2320     
       
  2321     CEikTimeEditor* timeEditor = static_cast<CEikTimeEditor*> ( dialog->ControlOrNull( ETESTSDKTimeEditor ) );
       
  2322     TTime timeGet = timeEditor->Time();
       
  2323     STIF_ASSERT_TRUE( time == timeGet );
       
  2324     
       
  2325     TInt flag = dialog->RunLD();
       
  2326     STIF_ASSERT_EQUALS( 0, flag );
       
  2327     
       
  2328     return KErrNone;
       
  2329     
       
  2330     }
       
  2331 
       
  2332 // -----------------------------------------------------------------------------
       
  2333 // CTestSDKDialogs::TestDDeclareAutoDateEditorL 
       
  2334 // -----------------------------------------------------------------------------
       
  2335 TInt CTestSDKDialogs::TestDDeclareAutoDateEditorL( CStifItemParser& /*aItem*/ )
       
  2336     {
       
  2337     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2338     CleanupStack::PushL( dialog );
       
  2339     STIF_ASSERT_NOT_NULL( dialog );
       
  2340     CleanupStack::Pop( dialog );
       
  2341     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2342     
       
  2343     TDateTime datetime( 2008, TMonth( 7 ), 8, 0, 0, 0, 0 );
       
  2344     TTime date( datetime );
       
  2345     dialog->DeclareAutoDateEditor( ETESTSDKDateEditor, &date );
       
  2346     
       
  2347     CEikDateEditor* dateEditor = static_cast<CEikDateEditor*> ( dialog->ControlOrNull( ETESTSDKDateEditor ) );
       
  2348     TTime dateGet = dateEditor->Date();
       
  2349     STIF_ASSERT_TRUE( date == dateGet );
       
  2350     
       
  2351     TInt flag = dialog->RunLD();
       
  2352     STIF_ASSERT_EQUALS( 0, flag );
       
  2353     
       
  2354     return KErrNone;
       
  2355     
       
  2356     }
       
  2357 
       
  2358 // -----------------------------------------------------------------------------
       
  2359 // CTestSDKDialogs::TestDDeclareAutoTimeAndDateEditorL 
       
  2360 // -----------------------------------------------------------------------------
       
  2361 TInt CTestSDKDialogs::TestDDeclareAutoTimeAndDateEditorL( CStifItemParser& /*aItem*/ )
       
  2362     {
       
  2363     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2364     CleanupStack::PushL( dialog );
       
  2365     STIF_ASSERT_NOT_NULL( dialog );
       
  2366     CleanupStack::Pop( dialog );
       
  2367     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2368     
       
  2369     TDateTime datetime( 2008, TMonth( 7 ), 8, 20, 0, 0, 0 );
       
  2370     TTime dateTime( datetime );
       
  2371     dialog->DeclareAutoTimeAndDateEditor( ETESTSDKTimeAndDateEditor, &dateTime );
       
  2372     
       
  2373     CEikTimeAndDateEditor* dateTimeEditor = static_cast<CEikTimeAndDateEditor*> ( dialog->ControlOrNull( ETESTSDKTimeAndDateEditor ) );
       
  2374     TTime dateTimeGet = dateTimeEditor->TimeAndDate();
       
  2375     STIF_ASSERT_TRUE( dateTime == dateTimeGet );
       
  2376     
       
  2377     TInt flag = dialog->RunLD();
       
  2378     STIF_ASSERT_EQUALS( 0, flag );
       
  2379     
       
  2380     return KErrNone;
       
  2381     
       
  2382     }
       
  2383 
       
  2384 // -----------------------------------------------------------------------------
       
  2385 // CTestSDKDialogs::TestDDeclareAutoDurationEditorL 
       
  2386 // -----------------------------------------------------------------------------
       
  2387 TInt CTestSDKDialogs::TestDDeclareAutoDurationEditorL( CStifItemParser& /*aItem*/ )
       
  2388     {
       
  2389     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2390     CleanupStack::PushL( dialog );
       
  2391     STIF_ASSERT_NOT_NULL( dialog );
       
  2392     CleanupStack::Pop( dialog );
       
  2393     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2394     
       
  2395     const TInt durationC(1000);
       
  2396     TTimeIntervalSeconds duration( durationC );
       
  2397     dialog->DeclareAutoDurationEditor( ETESTSDKDurationEditor, &duration );
       
  2398     
       
  2399     CEikDurationEditor* ddurationEditor = static_cast<CEikDurationEditor*> ( dialog->ControlOrNull( ETESTSDKDurationEditor ) );
       
  2400     TTimeIntervalSeconds durationGet = ddurationEditor->Duration();
       
  2401     STIF_ASSERT_TRUE( duration == durationGet );
       
  2402     
       
  2403     TInt flag = dialog->RunLD();
       
  2404     STIF_ASSERT_EQUALS( 0, flag );
       
  2405     
       
  2406     return KErrNone;
       
  2407     
       
  2408     }
       
  2409 
       
  2410 // -----------------------------------------------------------------------------
       
  2411 // CTestSDKDialogs::TestDDeclareAutoTimeOffsetEditorL 
       
  2412 // -----------------------------------------------------------------------------
       
  2413 TInt CTestSDKDialogs::TestDDeclareAutoTimeOffsetEditorL( CStifItemParser& /*aItem*/ )
       
  2414     {
       
  2415     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2416     CleanupStack::PushL( dialog );
       
  2417     STIF_ASSERT_NOT_NULL( dialog );
       
  2418     CleanupStack::Pop( dialog );
       
  2419     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2420     
       
  2421     const TInt timeOffsetC(1000);
       
  2422     TTimeIntervalSeconds timeOffset( timeOffsetC );
       
  2423     dialog->DeclareAutoTimeOffsetEditor( ETESTSDKTimeOffsetEditor, &timeOffset );
       
  2424     
       
  2425     CEikTimeOffsetEditor* timeOffsetEditor = static_cast<CEikTimeOffsetEditor*> ( dialog->ControlOrNull( ETESTSDKTimeOffsetEditor ) );
       
  2426     TTimeIntervalSeconds timeOffsetGet = timeOffsetEditor->TimeOffset();
       
  2427     STIF_ASSERT_TRUE( timeOffset == timeOffsetGet );
       
  2428     
       
  2429     TInt flag = dialog->RunLD();
       
  2430     STIF_ASSERT_EQUALS( 0, flag );
       
  2431     
       
  2432     return KErrNone;
       
  2433     
       
  2434     }
       
  2435 
       
  2436 // -----------------------------------------------------------------------------
       
  2437 // CTestSDKDialogs::TestDDeclareAutoFixedPointEditorL 
       
  2438 // -----------------------------------------------------------------------------
       
  2439 TInt CTestSDKDialogs::TestDDeclareAutoFixedPointEditorL( CStifItemParser& /*aItem*/ )
       
  2440     {
       
  2441     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2442     CleanupStack::PushL( dialog );
       
  2443     STIF_ASSERT_NOT_NULL( dialog );
       
  2444     CleanupStack::Pop( dialog );
       
  2445     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2446     
       
  2447     const TInt valueC(100);
       
  2448     TInt value = valueC;
       
  2449     dialog->DeclareAutoFixedPointEditor( ETESTSDKFixPointedEditor, &value );
       
  2450     
       
  2451     CEikFixedPointEditor* fixedPointEditor = static_cast<CEikFixedPointEditor*> ( dialog->ControlOrNull( ETESTSDKFixPointedEditor ) );
       
  2452     TInt valueGet = fixedPointEditor->Value();
       
  2453     STIF_ASSERT_TRUE( value == valueGet );
       
  2454     
       
  2455     TInt flag = dialog->RunLD();
       
  2456     STIF_ASSERT_EQUALS( 0, flag );
       
  2457     
       
  2458     return KErrNone;
       
  2459     
       
  2460     }
       
  2461 
       
  2462 // -----------------------------------------------------------------------------
       
  2463 // CTestSDKDialogs::TestDDeclareAutoSecretEditorL 
       
  2464 // -----------------------------------------------------------------------------
       
  2465 TInt CTestSDKDialogs::TestDDeclareAutoSecretEditorL( CStifItemParser& /*aItem*/ )
       
  2466     {
       
  2467     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2468     CleanupStack::PushL( dialog );
       
  2469     STIF_ASSERT_NOT_NULL( dialog );
       
  2470     CleanupStack::Pop( dialog );
       
  2471     dialog->PrepareLC( R_TESTSDK_DIALOGEDITOR );
       
  2472     
       
  2473     _LIT( KSecret, "Secret" );
       
  2474     const TInt lengthC = 10;
       
  2475     TBuf<lengthC> text( KSecret );
       
  2476     dialog->DeclareAutoSecretEditor( ETESTSDKSecretEditor, &text );
       
  2477     
       
  2478     CEikSecretEditor* secretEditor = static_cast<CEikSecretEditor*> ( dialog->ControlOrNull( ETESTSDKSecretEditor ) );
       
  2479     TBuf<lengthC> textGet;
       
  2480     secretEditor->GetText( textGet );
       
  2481     STIF_ASSERT_EQUALS( 0, text.Compare( KSecret ) );
       
  2482     
       
  2483     TInt flag = dialog->RunLD();
       
  2484     STIF_ASSERT_EQUALS( 0, flag );
       
  2485     
       
  2486     return KErrNone;
       
  2487     
       
  2488     }
       
  2489 
       
  2490 // -----------------------------------------------------------------------------
       
  2491 // CTestSDKDialogs::TestDAddAutoTextEditorL 
       
  2492 // -----------------------------------------------------------------------------
       
  2493 TInt CTestSDKDialogs::TestDAddAutoTextEditorL( CStifItemParser& /*aItem*/ )
       
  2494     {
       
  2495     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2496     CleanupStack::PushL( dialog );
       
  2497     STIF_ASSERT_NOT_NULL( dialog );
       
  2498     CleanupStack::Pop( dialog );
       
  2499     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2500     
       
  2501     _LIT( KText, "TextEditor" );
       
  2502     const TInt lengthC = 20;
       
  2503     TBuf<lengthC> text( KText );
       
  2504     _LIT( KPrompt, "AddTextEditor" );
       
  2505     TBuf<lengthC> prompt( KPrompt );
       
  2506     dialog->AddAutoTextEditorL( prompt, ETESTSDKAddTextEditor, 0, 10, 1, &text );
       
  2507     
       
  2508     CEikEdwin* edwin = static_cast<CEikEdwin*> ( dialog->ControlOrNull( ETESTSDKAddTextEditor ) );
       
  2509     STIF_ASSERT_NOT_NULL( edwin );
       
  2510     
       
  2511     HBufC* textbuf = edwin->GetTextInHBufL();
       
  2512     TBuf<lengthC> textGet;
       
  2513     edwin->GetText( textGet );
       
  2514     STIF_ASSERT_EQUALS( 0, textGet.Compare( KText ) );
       
  2515     
       
  2516     TInt flag = dialog->RunLD();
       
  2517     STIF_ASSERT_EQUALS( 0, flag );
       
  2518     
       
  2519     return KErrNone;
       
  2520     
       
  2521     }
       
  2522 
       
  2523 // -----------------------------------------------------------------------------
       
  2524 // CTestSDKDialogs::TestDAddAutoGlobalTextEditorL 
       
  2525 // -----------------------------------------------------------------------------
       
  2526 TInt CTestSDKDialogs::TestDAddAutoGlobalTextEditorL( CStifItemParser& /*aItem*/ )
       
  2527     {
       
  2528     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2529     CleanupStack::PushL( dialog );
       
  2530     STIF_ASSERT_NOT_NULL( dialog );
       
  2531     CleanupStack::Pop( dialog );
       
  2532     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2533     
       
  2534     CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL();
       
  2535     CleanupStack::PushL( paraFormatLayer );
       
  2536     CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL();
       
  2537     CleanupStack::PushL( charFormatLayer );
       
  2538     CGlobalText* globalText = CGlobalText::NewL( paraFormatLayer, charFormatLayer );
       
  2539     CleanupStack::PushL( globalText );
       
  2540     _LIT( KPrompt, "AddGlobalTextEditor" );
       
  2541     const TInt lengthC = 20;
       
  2542     const TInt textLimitC = 10;
       
  2543     TBufC<lengthC> prompt( KPrompt );
       
  2544     dialog->AddAutoGlobalTextEditorL( prompt, ETESTSDKAddGlobalTextEditor, 0, textLimitC, 1, lengthC, globalText );
       
  2545     
       
  2546     CEikGlobalTextEditor* globalTextEditor = static_cast<CEikGlobalTextEditor*> ( dialog->ControlOrNull( ETESTSDKAddGlobalTextEditor ) );
       
  2547     STIF_ASSERT_NOT_NULL( globalTextEditor );
       
  2548 
       
  2549     CleanupStack::Pop( globalText );
       
  2550     CleanupStack::Pop( charFormatLayer );
       
  2551     CleanupStack::Pop( paraFormatLayer );
       
  2552     
       
  2553     TInt flag = dialog->RunLD();
       
  2554     STIF_ASSERT_EQUALS( 0, flag );
       
  2555     
       
  2556     return KErrNone;
       
  2557     
       
  2558     }
       
  2559 
       
  2560 // -----------------------------------------------------------------------------
       
  2561 // CTestSDKDialogs::TestDAddAutoRichTextEditorL 
       
  2562 // -----------------------------------------------------------------------------
       
  2563 TInt CTestSDKDialogs::TestDAddAutoRichTextEditorL( CStifItemParser& /*aItem*/ )
       
  2564     {
       
  2565     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2566     CleanupStack::PushL( dialog );
       
  2567     STIF_ASSERT_NOT_NULL( dialog );
       
  2568     CleanupStack::Pop( dialog );
       
  2569     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2570     
       
  2571     CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL();
       
  2572     CleanupStack::PushL( paraFormatLayer );
       
  2573     CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL();
       
  2574     CleanupStack::PushL( charFormatLayer );
       
  2575     CRichText * richText = CRichText::NewL( paraFormatLayer, charFormatLayer );
       
  2576     CleanupStack::PushL( richText );
       
  2577 
       
  2578     _LIT( KPrompt, "AddRichTextEditor" );
       
  2579     const TInt lengthC = 20;
       
  2580     TBuf<lengthC> prompt( KPrompt );
       
  2581     dialog->AddAutoRichTextEditorL( prompt, ETESTSDKAddRichTextEditor, 0, 10, 1, 0, richText );
       
  2582     
       
  2583     CEikRichTextEditor* richTextEditor = static_cast<CEikRichTextEditor*> ( dialog->ControlOrNull( ETESTSDKAddRichTextEditor ) );
       
  2584     STIF_ASSERT_NOT_NULL( richTextEditor );
       
  2585     
       
  2586     CleanupStack::Pop( richText );
       
  2587     CleanupStack::Pop( charFormatLayer );
       
  2588     CleanupStack::Pop( paraFormatLayer );
       
  2589     
       
  2590     TInt flag = dialog->RunLD();
       
  2591     STIF_ASSERT_EQUALS( 0, flag );
       
  2592     
       
  2593     return KErrNone;
       
  2594     
       
  2595     }
       
  2596 
       
  2597 // -----------------------------------------------------------------------------
       
  2598 // CTestSDKDialogs::TestDAddAutoNumberEditorL 
       
  2599 // -----------------------------------------------------------------------------
       
  2600 TInt CTestSDKDialogs::TestDAddAutoNumberEditorL( CStifItemParser& /*aItem*/ )
       
  2601     {
       
  2602     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2603     CleanupStack::PushL( dialog );
       
  2604     STIF_ASSERT_NOT_NULL( dialog );
       
  2605     CleanupStack::Pop( dialog );
       
  2606     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2607     
       
  2608     _LIT( KText, "NumberEditor" );
       
  2609     const TInt lengthC = 20;
       
  2610     TBuf<lengthC> text( KText );
       
  2611     _LIT( KPrompt, "AddNumberEditor" );
       
  2612     TBuf<lengthC> prompt( KPrompt );
       
  2613     const TInt returnnumberC = 50;
       
  2614     TInt returnnumber = returnnumberC;
       
  2615     const TInt maxC = 100;
       
  2616     TInt max = maxC;
       
  2617     dialog->AddAutoNumberEditorL( prompt, ETESTSDKADDNumberEditor, 0, max, &returnnumber );
       
  2618     
       
  2619     CEikNumberEditor* numberEditor = static_cast<CEikNumberEditor*> ( dialog->ControlOrNull( ETESTSDKADDNumberEditor ) );
       
  2620     STIF_ASSERT_NOT_NULL( numberEditor );
       
  2621     
       
  2622     TInt numberGet = numberEditor->Number();
       
  2623     STIF_ASSERT_EQUALS( returnnumber, numberGet );
       
  2624     
       
  2625     TInt flag = dialog->RunLD();
       
  2626     STIF_ASSERT_EQUALS( 0, flag );
       
  2627     
       
  2628     return KErrNone;
       
  2629     
       
  2630     }
       
  2631 
       
  2632 // -----------------------------------------------------------------------------
       
  2633 // CTestSDKDialogs::TestDAddAutoRangeEditorL 
       
  2634 // -----------------------------------------------------------------------------
       
  2635 TInt CTestSDKDialogs::TestDAddAutoRangeEditorL( CStifItemParser& /*aItem*/ )
       
  2636     {
       
  2637     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2638     CleanupStack::PushL( dialog );
       
  2639     STIF_ASSERT_NOT_NULL( dialog );
       
  2640     CleanupStack::Pop( dialog );
       
  2641     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2642     
       
  2643     _LIT( KText, "RangerEditor" );
       
  2644     const TInt lengthC = 20;
       
  2645     TBuf<lengthC> text( KText );
       
  2646     HBufC* textbuf = text.AllocLC();
       
  2647     _LIT( KPrompt, "AddRangerEditor" );
       
  2648     TBuf<lengthC> prompt( KPrompt );
       
  2649     
       
  2650     SEikRange range;
       
  2651     range.iLowerLimit = 0;
       
  2652     const TInt upperLimit = 100;
       
  2653     range.iUpperLimit = upperLimit;
       
  2654     dialog->AddAutoRangeEditorL( prompt, ETESTSDKADDRangeEditor, 0, upperLimit, textbuf, &range );
       
  2655     
       
  2656     CEikRangeEditor * rangeEditor = static_cast<CEikRangeEditor *> ( dialog->ControlOrNull( ETESTSDKADDRangeEditor ) );
       
  2657     STIF_ASSERT_NOT_NULL( rangeEditor );
       
  2658     
       
  2659     SEikRange rangeGet = rangeEditor->Range();
       
  2660     TInt lower = rangeGet.iLowerLimit;
       
  2661     STIF_ASSERT_EQUALS( 0, lower );
       
  2662     TInt upper = rangeGet.iUpperLimit;
       
  2663     STIF_ASSERT_EQUALS( upperLimit, upper );
       
  2664     
       
  2665     CleanupStack::Pop( textbuf );
       
  2666     TInt flag = dialog->RunLD();
       
  2667     STIF_ASSERT_EQUALS( 0, flag );
       
  2668     
       
  2669     return KErrNone;
       
  2670     
       
  2671     }
       
  2672 
       
  2673 // -----------------------------------------------------------------------------
       
  2674 // CTestSDKDialogs::TestDAddAutoTimeEditorL 
       
  2675 // -----------------------------------------------------------------------------
       
  2676 TInt CTestSDKDialogs::TestDAddAutoTimeEditorL( CStifItemParser& /*aItem*/ )
       
  2677     {
       
  2678     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2679     CleanupStack::PushL( dialog );
       
  2680     STIF_ASSERT_NOT_NULL( dialog );
       
  2681     CleanupStack::Pop( dialog );
       
  2682     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2683     
       
  2684     TDateTime datetime( 0, TMonth( 0 ), 0, 20, 20, 20, 0 );
       
  2685     TTime time( datetime );
       
  2686     TDateTime mindatetime( 0, TMonth( 0 ), 0, 0, 0, 0, 0 );
       
  2687     TTime mintime( mindatetime );
       
  2688     TDateTime maxdatetime( 0, TMonth( 0 ), 0, 23, 59, 59, 0 );
       
  2689     TTime maxtime( mindatetime );
       
  2690     _LIT( KPrompt, "AddTimeEditor" );
       
  2691     const TInt lengthC = 20;
       
  2692     TBuf<lengthC> prompt( KPrompt );
       
  2693     dialog->AddAutoTimeEditorL( prompt, ETESTSDKADDTimeEditor, mintime, maxtime, EFalse, &time );
       
  2694     
       
  2695     CEikTimeEditor* timeEditor = static_cast<CEikTimeEditor*> ( dialog->ControlOrNull( ETESTSDKADDTimeEditor ) );
       
  2696     STIF_ASSERT_NOT_NULL( timeEditor );
       
  2697     
       
  2698     timeEditor->SetTime( time );
       
  2699     TTime timeGet = timeEditor->Time();
       
  2700     STIF_ASSERT_TRUE( time == timeGet );
       
  2701     
       
  2702     TInt flag = dialog->RunLD();
       
  2703     STIF_ASSERT_EQUALS( 0, flag );
       
  2704     
       
  2705     return KErrNone;
       
  2706     
       
  2707     }
       
  2708 
       
  2709 // -----------------------------------------------------------------------------
       
  2710 // CTestSDKDialogs::TestDAddAutoDateEditorL 
       
  2711 // -----------------------------------------------------------------------------
       
  2712 TInt CTestSDKDialogs::TestDAddAutoDateEditorL( CStifItemParser& /*aItem*/ )
       
  2713     {
       
  2714     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2715     CleanupStack::PushL( dialog );
       
  2716     STIF_ASSERT_NOT_NULL( dialog );
       
  2717     CleanupStack::Pop( dialog );
       
  2718     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2719     
       
  2720     TDateTime mindatetime( 1900, TMonth( 0 ), 1, 0, 0, 0, 0 );
       
  2721     TTime mintime( mindatetime );
       
  2722     TDateTime maxdatetime( 2100, TMonth( 11 ), 30, 0, 0, 0, 0 );
       
  2723     TTime maxtime( maxdatetime );
       
  2724     TDateTime datetime( 2008, TMonth( 7 ), 8, 0, 0, 0, 0 );
       
  2725     TTime date( datetime );
       
  2726     _LIT( KPrompt, "AddDateEditor" );
       
  2727     const TInt lengthC = 20;
       
  2728     TBuf<lengthC> prompt( KPrompt );
       
  2729     dialog->AddAutoDateEditorL( prompt, ETESTSDKADDDateEditor, mintime, maxtime, ETrue, &date );
       
  2730     
       
  2731     CEikDateEditor* dateEditor = static_cast<CEikDateEditor*> ( dialog->ControlOrNull( ETESTSDKADDDateEditor ) );
       
  2732     STIF_ASSERT_NOT_NULL( dateEditor );
       
  2733     
       
  2734     TTime dateGet = dateEditor->Date();
       
  2735     STIF_ASSERT_TRUE( date == dateGet );
       
  2736     
       
  2737     TInt flag = dialog->RunLD();
       
  2738     STIF_ASSERT_EQUALS( 0, flag );
       
  2739     
       
  2740     return KErrNone;
       
  2741     
       
  2742     }
       
  2743 
       
  2744 // -----------------------------------------------------------------------------
       
  2745 // CTestSDKDialogs::TestDAddAutoTimeAndDateEditorL 
       
  2746 // -----------------------------------------------------------------------------
       
  2747 TInt CTestSDKDialogs::TestDAddAutoTimeAndDateEditorL( CStifItemParser& /*aItem*/ )
       
  2748     {
       
  2749     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2750     CleanupStack::PushL( dialog );
       
  2751     STIF_ASSERT_NOT_NULL( dialog );
       
  2752     CleanupStack::Pop( dialog );
       
  2753     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2754     
       
  2755     TDateTime mindatetime( 1900, TMonth( 0 ), 1, 0, 0, 0, 0 );
       
  2756     TTime mintimeanddate( mindatetime );
       
  2757     TDateTime maxdatetime( 2100, TMonth( 11 ), 30, 23, 59, 59, 0 );
       
  2758     TTime maxtimeanddate( maxdatetime );
       
  2759     TDateTime datetime( 2008, TMonth( 7 ), 8, 20, 20, 20, 0 );
       
  2760     TTime timeanddate( datetime );
       
  2761     _LIT( KPrompt, "AddTimeAndDateEditor" );
       
  2762     const TInt lengthC = 20;
       
  2763     TBuf<lengthC> prompt( KPrompt );
       
  2764     dialog->AddAutoTimeAndDateEditorL( prompt, ETESTSDKAddTimeAndDateEditor, mintimeanddate, maxtimeanddate, EFalse, ETrue, NULL, &timeanddate );
       
  2765     
       
  2766     CEikTimeAndDateEditor* dateTimeEditor = static_cast<CEikTimeAndDateEditor*> ( dialog->ControlOrNull( ETESTSDKAddTimeAndDateEditor ) );
       
  2767     STIF_ASSERT_NOT_NULL( dateTimeEditor );
       
  2768     
       
  2769     TTime dateTimeGet = dateTimeEditor->TimeAndDate();
       
  2770     STIF_ASSERT_TRUE( timeanddate == dateTimeGet );
       
  2771     
       
  2772     TInt flag = dialog->RunLD();
       
  2773     STIF_ASSERT_EQUALS( 0, flag );
       
  2774     
       
  2775     return KErrNone;
       
  2776     
       
  2777     }
       
  2778 
       
  2779 // -----------------------------------------------------------------------------
       
  2780 // CTestSDKDialogs::TestDAddAutoDurationEditorL 
       
  2781 // -----------------------------------------------------------------------------
       
  2782 TInt CTestSDKDialogs::TestDAddAutoDurationEditorL( CStifItemParser& /*aItem*/ )
       
  2783     {
       
  2784     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2785     CleanupStack::PushL( dialog );
       
  2786     STIF_ASSERT_NOT_NULL( dialog );
       
  2787     CleanupStack::Pop( dialog );
       
  2788     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2789     
       
  2790     _LIT( KPrompt, "AddDurationEditor" );
       
  2791     const TInt lengthC = 20;
       
  2792     TBuf<lengthC> prompt( KPrompt );
       
  2793     const TInt minC = 0;
       
  2794     TTimeIntervalSeconds minduration( minC );
       
  2795     const TInt maxC = 1000000;
       
  2796     TTimeIntervalSeconds maxduration( maxC );
       
  2797     const TInt durationC = 1000;
       
  2798     TTimeIntervalSeconds duration( durationC );
       
  2799     dialog->AddAutoDurationEditorL( prompt, ETESTSDKAddDurationEditor, minduration, maxduration, EFalse, &duration );
       
  2800     
       
  2801     CEikDurationEditor* ddurationEditor = static_cast<CEikDurationEditor*> ( dialog->ControlOrNull( ETESTSDKAddDurationEditor ) );
       
  2802     STIF_ASSERT_NOT_NULL( ddurationEditor );
       
  2803     
       
  2804     TTimeIntervalSeconds durationGet = ddurationEditor->Duration();
       
  2805     STIF_ASSERT_TRUE( duration == durationGet );
       
  2806     
       
  2807     TInt flag = dialog->RunLD();
       
  2808     STIF_ASSERT_EQUALS( 0, flag );
       
  2809     
       
  2810     return KErrNone;
       
  2811     
       
  2812     }
       
  2813 
       
  2814 // -----------------------------------------------------------------------------
       
  2815 // CTestSDKDialogs::TestDAddAutoTimeOffsetEditorL 
       
  2816 // -----------------------------------------------------------------------------
       
  2817 TInt CTestSDKDialogs::TestDAddAutoTimeOffsetEditorL( CStifItemParser& /*aItem*/ )
       
  2818     {
       
  2819     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2820     CleanupStack::PushL( dialog );
       
  2821     STIF_ASSERT_NOT_NULL( dialog );
       
  2822     CleanupStack::Pop( dialog );
       
  2823     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2824     
       
  2825     _LIT( KPrompt, "AddTimeOffsetEditor" );
       
  2826     const TInt lengthC = 20;
       
  2827     TBuf<lengthC> prompt( KPrompt );
       
  2828     const TInt minC = 0;
       
  2829     TTimeIntervalSeconds minTimeOffset( minC );
       
  2830     const TInt maxC = 1000000;
       
  2831     TTimeIntervalSeconds maxTimeOffset( maxC );
       
  2832     const TInt timeOffsetC = 1000;
       
  2833     TTimeIntervalSeconds timeOffset( timeOffsetC );
       
  2834     dialog->AddAutoTimeOffsetEditorL( prompt, ETESTSDKAddTimeOffsetEditor, minTimeOffset, maxTimeOffset, EFalse, &timeOffset );
       
  2835     
       
  2836     CEikTimeOffsetEditor* timeOffsetEditor = static_cast<CEikTimeOffsetEditor*> ( dialog->ControlOrNull( ETESTSDKAddTimeOffsetEditor ) );
       
  2837     STIF_ASSERT_NOT_NULL( timeOffsetEditor );
       
  2838     
       
  2839     TTimeIntervalSeconds timeOffsetGet = timeOffsetEditor->TimeOffset();
       
  2840     STIF_ASSERT_TRUE( timeOffset == timeOffsetGet );
       
  2841     
       
  2842     TInt flag = dialog->RunLD();
       
  2843     STIF_ASSERT_EQUALS( 0, flag );
       
  2844     
       
  2845     return KErrNone;
       
  2846     
       
  2847     }
       
  2848 
       
  2849 // -----------------------------------------------------------------------------
       
  2850 // CTestSDKDialogs::TestDAddAutoFloatEditorL 
       
  2851 // -----------------------------------------------------------------------------
       
  2852 TInt CTestSDKDialogs::TestDAddAutoFloatEditorL( CStifItemParser& /*aItem*/ )
       
  2853     {
       
  2854     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2855     CleanupStack::PushL( dialog );
       
  2856     STIF_ASSERT_NOT_NULL( dialog );
       
  2857     CleanupStack::Pop( dialog );
       
  2858     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2859     
       
  2860     _LIT( KPrompt, "AddFloatEditor" );
       
  2861     const TInt lengthC = 20;
       
  2862     TBuf<lengthC> prompt( KPrompt );
       
  2863     const TReal minC(0);
       
  2864     TReal min = minC;
       
  2865     const TReal maxC(1000);
       
  2866     TReal max = maxC;
       
  2867     const TReal valueC(100);
       
  2868     TReal value = valueC;
       
  2869     dialog->AddAutoFloatEditorL( prompt, ETESTSDKAddFloatEditorEditor, min, max, &value );
       
  2870     
       
  2871     CEikFloatingPointEditor* floatEditor = static_cast<CEikFloatingPointEditor*> ( dialog->ControlOrNull( ETESTSDKAddFloatEditorEditor ) );
       
  2872     STIF_ASSERT_NOT_NULL( floatEditor );
       
  2873     
       
  2874     TReal floatEditorGet = floatEditor->Value();
       
  2875     STIF_ASSERT_TRUE( value == floatEditorGet );
       
  2876     
       
  2877     TInt flag = dialog->RunLD();
       
  2878     STIF_ASSERT_EQUALS( 0, flag );
       
  2879     
       
  2880     return KErrNone;
       
  2881     
       
  2882     }
       
  2883 
       
  2884 // -----------------------------------------------------------------------------
       
  2885 // CTestSDKDialogs::TestDAddAutoFixedPointEditorL 
       
  2886 // -----------------------------------------------------------------------------
       
  2887 TInt CTestSDKDialogs::TestDAddAutoFixedPointEditorL( CStifItemParser& /*aItem*/ )
       
  2888     {
       
  2889     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2890     CleanupStack::PushL( dialog );
       
  2891     STIF_ASSERT_NOT_NULL( dialog );
       
  2892     CleanupStack::Pop( dialog );
       
  2893     dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2894     
       
  2895     _LIT( KPrompt, "AddFixedPointEditor" );
       
  2896     const TInt lengthC = 20;
       
  2897     TBuf<lengthC> prompt( KPrompt );
       
  2898     const TInt minC(100);
       
  2899     TInt min = minC;
       
  2900     const TInt maxC(9999);
       
  2901     TInt max = maxC;
       
  2902     const TInt valueC(100);
       
  2903     TInt value = valueC;
       
  2904     dialog->AddAutoFixedPointEditorL( prompt, ETESTSDKAddFixPointedEditor, min, max, &value, 2 );
       
  2905     
       
  2906     CEikFixedPointEditor* fixedPointEditor = static_cast<CEikFixedPointEditor*> ( dialog->ControlOrNull( ETESTSDKAddFixPointedEditor ) );
       
  2907     STIF_ASSERT_NOT_NULL( fixedPointEditor );
       
  2908     
       
  2909     TInt valueGet = fixedPointEditor->Value();
       
  2910     STIF_ASSERT_TRUE( value == valueGet );
       
  2911     
       
  2912     TInt flag = dialog->RunLD();
       
  2913     STIF_ASSERT_EQUALS( 0, flag );
       
  2914     
       
  2915     return KErrNone;
       
  2916     
       
  2917     }
       
  2918 
       
  2919 // -----------------------------------------------------------------------------
       
  2920 // CTestSDKDialogs::TestDAddAutoSecretEditorL 
       
  2921 // -----------------------------------------------------------------------------
       
  2922 TInt CTestSDKDialogs::TestDAddAutoSecretEditorL( CStifItemParser& /*aItem*/ )
       
  2923     {
       
  2924     // Because AddAutoSecretEditorL is deprecated (Not supported) according to
       
  2925     // API comment, so comment below code.
       
  2926 //    CEikDialog* dialog = new (ELeave) CEikDialog;
       
  2927 //    CleanupStack::PushL( dialog );
       
  2928 //    STIF_ASSERT_NOT_NULL( dialog );
       
  2929 //    CleanupStack::Pop( dialog );
       
  2930 //    dialog->PrepareLC( R_TESTSDK_DIALOGADDEDITOR );
       
  2931 //    
       
  2932 //    const TInt lengthC = 10;
       
  2933 //    _LIT( KSecret, "Secret" );
       
  2934 //    TBuf<lengthC> text( KSecret );
       
  2935 //    _LIT( KPrompt, "Prompt" );
       
  2936 //    TBufC<lengthC> prompt( KPrompt );
       
  2937 //    dialog->AddAutoSecretEditorL( prompt, ETESTSDKAddSecretEditor, &text);
       
  2938 //    CEikSecretEditor* secretEditor = static_cast<CEikSecretEditor*> ( dialog->ControlOrNull( ETESTSDKAddSecretEditor ) );
       
  2939 //    STIF_ASSERT_NOT_NULL( secretEditor );
       
  2940 //    
       
  2941 //    TResourceReader reader;
       
  2942 //    CCoeEnv::Static()->CreateResourceReaderLC( reader, R_SECRET );
       
  2943 //    secretEditor->ConstructFromResourceL( reader );
       
  2944 //    CleanupStack::PopAndDestroy();
       
  2945 //    
       
  2946 //    secretEditor->SetText( KSecret );
       
  2947 //    TBuf<lengthC> textGet;
       
  2948 //    secretEditor->GetText( textGet );
       
  2949 //    STIF_ASSERT_EQUALS( 0, text.Compare( KSecret ) );
       
  2950 //    
       
  2951 //    TInt flag = dialog->RunLD();
       
  2952 //    STIF_ASSERT_EQUALS( 0, flag );
       
  2953     
       
  2954     return KErrNone;
       
  2955     
       
  2956     }
       
  2957 
       
  2958 // -----------------------------------------------------------------------------
       
  2959 // CTestSDKDialogs::TestDSetLabelByDesL 
       
  2960 // -----------------------------------------------------------------------------
       
  2961 TInt CTestSDKDialogs::TestDSetLabelByDesL( CStifItemParser& /*aItem*/ )
       
  2962     {
       
  2963     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2964     CleanupStack::PushL( dialog );
       
  2965     STIF_ASSERT_NOT_NULL( dialog );
       
  2966     CleanupStack::Pop( dialog );
       
  2967     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  2968     
       
  2969     _LIT( KLabel, "SetLabel" );
       
  2970     const TInt lengthC = 10;
       
  2971     TBuf<lengthC> label( KLabel );
       
  2972     dialog->SetLabelL( ETESTSDKSGLabel, label );
       
  2973     
       
  2974     TBuf<lengthC> labelGet;
       
  2975     dialog->GetLabelText( labelGet, ETESTSDKSGLabel );
       
  2976     
       
  2977     STIF_ASSERT_EQUALS( 0, label.Compare( labelGet ) );
       
  2978     
       
  2979     TInt flag = dialog->RunLD();
       
  2980     STIF_ASSERT_EQUALS( 0, flag );
       
  2981     
       
  2982     return KErrNone;
       
  2983     
       
  2984     }
       
  2985 
       
  2986 // -----------------------------------------------------------------------------
       
  2987 // CTestSDKDialogs::TestDSetLabelByResourceIdL 
       
  2988 // -----------------------------------------------------------------------------
       
  2989 TInt CTestSDKDialogs::TestDSetLabelByResourceIdL( CStifItemParser& /*aItem*/ )
       
  2990     {
       
  2991     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  2992     CleanupStack::PushL( dialog );
       
  2993     STIF_ASSERT_NOT_NULL( dialog );
       
  2994     CleanupStack::Pop( dialog );
       
  2995     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  2996     
       
  2997     _LIT( KLabel, "LabelResource" );
       
  2998     const TInt lengthC = 20;
       
  2999     TBuf<lengthC> label( KLabel );
       
  3000     dialog->SetLabelL( ETESTSDKSGLabel, R_TESTSDK_LABEL );
       
  3001     
       
  3002     TBuf<lengthC> labelGet;
       
  3003     dialog->GetLabelText( labelGet, ETESTSDKSGLabel );
       
  3004     
       
  3005     STIF_ASSERT_EQUALS( 0, label.Compare( labelGet ) );
       
  3006     
       
  3007     TInt flag = dialog->RunLD();
       
  3008     STIF_ASSERT_EQUALS( 0, flag );
       
  3009     
       
  3010     return KErrNone;
       
  3011     
       
  3012     }
       
  3013 
       
  3014 // -----------------------------------------------------------------------------
       
  3015 // CTestSDKDialogs::TestDSetLabelReserveLengthL 
       
  3016 // -----------------------------------------------------------------------------
       
  3017 TInt CTestSDKDialogs::TestDSetLabelReserveLengthL( CStifItemParser& /*aItem*/ )
       
  3018     {
       
  3019     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3020     CleanupStack::PushL( dialog );
       
  3021     STIF_ASSERT_NOT_NULL( dialog );
       
  3022     CleanupStack::Pop( dialog );
       
  3023     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3024     
       
  3025     const TInt lengthC = 20;
       
  3026     dialog->SetLabelReserveLengthL( ETESTSDKSGLabel, lengthC );
       
  3027     CEikLabel* label = static_cast<CEikLabel*> ( dialog->ControlOrNull( ETESTSDKSGLabel ) );
       
  3028     TInt length = label->BufferReserveLength();
       
  3029     STIF_ASSERT_EQUALS( lengthC, length );
       
  3030     
       
  3031     TInt flag = dialog->RunLD();
       
  3032     STIF_ASSERT_EQUALS( 0, flag );
       
  3033     
       
  3034     return KErrNone;
       
  3035     
       
  3036     }
       
  3037 
       
  3038 // -----------------------------------------------------------------------------
       
  3039 // CTestSDKDialogs::TestDSetEdwinTextL 
       
  3040 // -----------------------------------------------------------------------------
       
  3041 TInt CTestSDKDialogs::TestDSetEdwinTextL( CStifItemParser& /*aItem*/ )
       
  3042     {
       
  3043     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3044     CleanupStack::PushL( dialog );
       
  3045     STIF_ASSERT_NOT_NULL( dialog );
       
  3046     CleanupStack::Pop( dialog );
       
  3047     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3048     
       
  3049     _LIT( KText, "Edwin" );
       
  3050     const TInt lengthC = 10;
       
  3051     TBuf<lengthC> text( KText );
       
  3052     dialog->SetEdwinTextL( ETESTSDKSGEdwin, &text );
       
  3053     
       
  3054     TBuf<lengthC> textGet;
       
  3055     dialog->GetEdwinText( textGet, ETESTSDKSGEdwin );
       
  3056     STIF_ASSERT_EQUALS( 0, text.Compare( textGet ) );
       
  3057     
       
  3058     TInt flag = dialog->RunLD();
       
  3059     STIF_ASSERT_EQUALS( 0, flag );
       
  3060     
       
  3061     return KErrNone;
       
  3062     
       
  3063     }
       
  3064 
       
  3065 // -----------------------------------------------------------------------------
       
  3066 // CTestSDKDialogs::TestDSetTextEditorTextL 
       
  3067 // -----------------------------------------------------------------------------
       
  3068 TInt CTestSDKDialogs::TestDSetTextEditorTextL( CStifItemParser& /*aItem*/ )
       
  3069     {
       
  3070     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3071     CleanupStack::PushL( dialog );
       
  3072     STIF_ASSERT_NOT_NULL( dialog );
       
  3073     CleanupStack::Pop( dialog );
       
  3074     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3075     
       
  3076     CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL();
       
  3077     CleanupStack::PushL( paraFormatLayer );
       
  3078     CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL();
       
  3079     CleanupStack::PushL( charFormatLayer );
       
  3080     CGlobalText* globalText = CGlobalText::NewL( paraFormatLayer, charFormatLayer );
       
  3081     CleanupStack::PushL( globalText );
       
  3082     
       
  3083     dialog->SetTextEditorTextL( ETESTSDKSGTextEditor, globalText );
       
  3084     
       
  3085     CGlobalText* globalTextGet = NULL;
       
  3086     dialog->GetTextEditorText( globalTextGet, ETESTSDKSGTextEditor );
       
  3087     const CParaFormatLayer* paraFormatLayerGet = globalTextGet->GlobalParaFormatLayer();
       
  3088     TBool idntical = paraFormatLayerGet->IsIdentical( paraFormatLayer );
       
  3089     STIF_ASSERT_TRUE( idntical );
       
  3090     
       
  3091     CleanupStack::Pop( globalText );
       
  3092     CleanupStack::Pop( charFormatLayer );
       
  3093     CleanupStack::Pop( paraFormatLayer );
       
  3094     
       
  3095     TInt flag = dialog->RunLD();
       
  3096     STIF_ASSERT_EQUALS( 0, flag );
       
  3097     
       
  3098     return KErrNone;
       
  3099     
       
  3100     }
       
  3101 
       
  3102 // -----------------------------------------------------------------------------
       
  3103 // CTestSDKDialogs::TestDResetSecretEditorL 
       
  3104 // -----------------------------------------------------------------------------
       
  3105 TInt CTestSDKDialogs::TestDResetSecretEditorL( CStifItemParser& /*aItem*/ )
       
  3106     {
       
  3107     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3108     CleanupStack::PushL( dialog );
       
  3109     STIF_ASSERT_NOT_NULL( dialog );
       
  3110     CleanupStack::Pop( dialog );
       
  3111     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3112     
       
  3113     dialog->ResetSecretEditor( ETESTSDKSGSecretEditor );
       
  3114     const TInt lengthC = 10;
       
  3115     TBuf<lengthC> textGet;
       
  3116     dialog->GetSecretEditorText( textGet , ETESTSDKSGSecretEditor );
       
  3117     STIF_ASSERT_EQUALS( 0, textGet.Length() );
       
  3118     
       
  3119     TInt flag = dialog->RunLD();
       
  3120     STIF_ASSERT_EQUALS( 0, flag );
       
  3121     
       
  3122     return KErrNone;
       
  3123     
       
  3124     }
       
  3125 
       
  3126 // -----------------------------------------------------------------------------
       
  3127 // CTestSDKDialogs::TestDSetFloatingPointEditorValueL 
       
  3128 // -----------------------------------------------------------------------------
       
  3129 TInt CTestSDKDialogs::TestDSetFloatingPointEditorValueL( CStifItemParser& /*aItem*/ )
       
  3130     {
       
  3131     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3132     CleanupStack::PushL( dialog );
       
  3133     STIF_ASSERT_NOT_NULL( dialog );
       
  3134     CleanupStack::Pop( dialog );
       
  3135     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3136     
       
  3137     const TReal value = 3.14;
       
  3138     dialog->SetFloatingPointEditorValueL( ETESTSDKSGFloatPointEditor, &value );
       
  3139     STIF_ASSERT_TRUE( dialog->FloatingPointEditorValue( ETESTSDKSGFloatPointEditor ) == value );
       
  3140     
       
  3141     TInt flag = dialog->RunLD();
       
  3142     STIF_ASSERT_EQUALS( 0, flag );
       
  3143     
       
  3144     return KErrNone;
       
  3145     
       
  3146     }
       
  3147 
       
  3148 // -----------------------------------------------------------------------------
       
  3149 // CTestSDKDialogs::TestDSetFixedPointEditorValueL 
       
  3150 // -----------------------------------------------------------------------------
       
  3151 TInt CTestSDKDialogs::TestDSetFixedPointEditorValueL( CStifItemParser& /*aItem*/ )
       
  3152     {
       
  3153     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3154     CleanupStack::PushL( dialog );
       
  3155     STIF_ASSERT_NOT_NULL( dialog );
       
  3156     CleanupStack::Pop( dialog );
       
  3157     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3158     
       
  3159     const TInt value = 100;
       
  3160     dialog->SetFixedPointEditorValueL( ETESTSDKSGFixPointedEditor, value );
       
  3161     STIF_ASSERT_TRUE( dialog->FixedPointEditorValue( ETESTSDKSGFixPointedEditor ) == value );
       
  3162     
       
  3163     TInt flag = dialog->RunLD();
       
  3164     STIF_ASSERT_EQUALS( 0, flag );
       
  3165     
       
  3166     return KErrNone;
       
  3167     
       
  3168     }
       
  3169 
       
  3170 // -----------------------------------------------------------------------------
       
  3171 // CTestSDKDialogs::TestDSetFixedPointEditorDecimalL 
       
  3172 // -----------------------------------------------------------------------------
       
  3173 TInt CTestSDKDialogs::TestDSetFixedPointEditorDecimalL( CStifItemParser& /*aItem*/ )
       
  3174     {
       
  3175     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3176     CleanupStack::PushL( dialog );
       
  3177     STIF_ASSERT_NOT_NULL( dialog );
       
  3178     CleanupStack::Pop( dialog );
       
  3179     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3180     
       
  3181     const TInt decimal = 25;
       
  3182     dialog->SetFixedPointEditorDecimal( ETESTSDKSGFixPointedEditor, decimal );
       
  3183     STIF_ASSERT_TRUE( dialog->FixedPointEditorDecimal( ETESTSDKSGFixPointedEditor ) == decimal );
       
  3184     
       
  3185     TInt flag = dialog->RunLD();
       
  3186     STIF_ASSERT_EQUALS( 0, flag );
       
  3187     
       
  3188     return KErrNone;
       
  3189     
       
  3190     }
       
  3191 
       
  3192 // -----------------------------------------------------------------------------
       
  3193 // CTestSDKDialogs::TestDSetNumberEditorMinAndMaxL 
       
  3194 // -----------------------------------------------------------------------------
       
  3195 TInt CTestSDKDialogs::TestDSetNumberEditorMinAndMaxL( CStifItemParser& /*aItem*/ )
       
  3196     {
       
  3197     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3198     CleanupStack::PushL( dialog );
       
  3199     STIF_ASSERT_NOT_NULL( dialog );
       
  3200     CleanupStack::Pop( dialog );
       
  3201     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3202     
       
  3203     const TInt min = 10;
       
  3204     const TInt max = 20;
       
  3205     dialog->SetNumberEditorMinAndMax( ETESTSDKSGNumberEditor, min, max );
       
  3206     
       
  3207     CEikNumberEditor* numberEditor = static_cast<CEikNumberEditor*> ( dialog->ControlOrNull( ETESTSDKSGNumberEditor ) );
       
  3208     STIF_ASSERT_NOT_NULL( numberEditor );
       
  3209     TInt minGet;
       
  3210     TInt maxGet;
       
  3211     numberEditor->GetMinimumAndMaximum( minGet, maxGet );
       
  3212     STIF_ASSERT_EQUALS( min, minGet );
       
  3213     STIF_ASSERT_EQUALS( max, maxGet );
       
  3214     
       
  3215     TInt flag = dialog->RunLD();
       
  3216     STIF_ASSERT_EQUALS( 0, flag );
       
  3217     
       
  3218     return KErrNone;
       
  3219     
       
  3220     }
       
  3221 
       
  3222 // -----------------------------------------------------------------------------
       
  3223 // CTestSDKDialogs::TestDSetNumberEditorValueL 
       
  3224 // -----------------------------------------------------------------------------
       
  3225 TInt CTestSDKDialogs::TestDSetNumberEditorValueL( CStifItemParser& /*aItem*/ )
       
  3226     {
       
  3227     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3228     CleanupStack::PushL( dialog );
       
  3229     STIF_ASSERT_NOT_NULL( dialog );
       
  3230     CleanupStack::Pop( dialog );
       
  3231     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3232     
       
  3233     const TInt value = 50;
       
  3234     dialog->SetNumberEditorValue( ETESTSDKSGNumberEditor, value );
       
  3235     STIF_ASSERT_EQUALS( dialog->NumberEditorValue( ETESTSDKSGNumberEditor ), value );
       
  3236     
       
  3237     TInt flag = dialog->RunLD();
       
  3238     STIF_ASSERT_EQUALS( 0, flag );
       
  3239     
       
  3240     return KErrNone;
       
  3241     
       
  3242     }
       
  3243 
       
  3244 // -----------------------------------------------------------------------------
       
  3245 // CTestSDKDialogs::TestDSetFloatEditorMinAndMaxL 
       
  3246 // -----------------------------------------------------------------------------
       
  3247 TInt CTestSDKDialogs::TestDSetFloatEditorMinAndMaxL( CStifItemParser& /*aItem*/ )
       
  3248     {
       
  3249     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3250     CleanupStack::PushL( dialog );
       
  3251     STIF_ASSERT_NOT_NULL( dialog );
       
  3252     CleanupStack::Pop( dialog );
       
  3253     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3254     
       
  3255     const TReal min = 125;
       
  3256     const TReal max = 548;
       
  3257     dialog->SetFloatEditorMinAndMax( ETESTSDKSGFloatPointEditor, min, max );
       
  3258     
       
  3259     CEikFloatingPointEditor* floatEditor = static_cast<CEikFloatingPointEditor*> ( dialog->ControlOrNull( ETESTSDKSGFloatPointEditor ) );
       
  3260     STIF_ASSERT_NOT_NULL( floatEditor );
       
  3261     
       
  3262     TReal minGet;
       
  3263     TReal maxGet;
       
  3264     floatEditor->GetMinMax( minGet, maxGet );
       
  3265     STIF_ASSERT_TRUE( minGet == min );
       
  3266     STIF_ASSERT_TRUE( maxGet == max );
       
  3267     
       
  3268     TInt flag = dialog->RunLD();
       
  3269     STIF_ASSERT_EQUALS( 0, flag );
       
  3270     
       
  3271     return KErrNone;
       
  3272     
       
  3273     }
       
  3274 
       
  3275 // -----------------------------------------------------------------------------
       
  3276 // CTestSDKDialogs::TestDSetFloatEditorValueL 
       
  3277 // -----------------------------------------------------------------------------
       
  3278 TInt CTestSDKDialogs::TestDSetFloatEditorValueL( CStifItemParser& /*aItem*/ )
       
  3279     {
       
  3280     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3281     CleanupStack::PushL( dialog );
       
  3282     STIF_ASSERT_NOT_NULL( dialog );
       
  3283     CleanupStack::Pop( dialog );
       
  3284     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3285     
       
  3286     const TReal value = 3.14;
       
  3287     dialog->SetFloatEditorValueL( ETESTSDKSGFloatPointEditor, value );
       
  3288     STIF_ASSERT_TRUE( dialog->FloatEditorValue( ETESTSDKSGFloatPointEditor ) == value );
       
  3289     
       
  3290     TInt flag = dialog->RunLD();
       
  3291     STIF_ASSERT_EQUALS( 0, flag );
       
  3292     
       
  3293     return KErrNone;
       
  3294     
       
  3295     }
       
  3296 
       
  3297 // -----------------------------------------------------------------------------
       
  3298 // CTestSDKDialogs::TestDSetRangeEditorMinAndMaxL 
       
  3299 // -----------------------------------------------------------------------------
       
  3300 TInt CTestSDKDialogs::TestDSetRangeEditorMinAndMaxL( CStifItemParser& /*aItem*/ )
       
  3301     {
       
  3302     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3303     CleanupStack::PushL( dialog );
       
  3304     STIF_ASSERT_NOT_NULL( dialog );
       
  3305     CleanupStack::Pop( dialog );
       
  3306     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3307     
       
  3308     TInt min = 0;
       
  3309     const TInt max = 50;
       
  3310     dialog->SetRangeEditorMinAndMax( ETESTSDKSGRangeEditor, min, max );
       
  3311     
       
  3312     CEikRangeEditor * rangeEditor = static_cast<CEikRangeEditor *> ( dialog->ControlOrNull( ETESTSDKSGRangeEditor ) );
       
  3313     STIF_ASSERT_NOT_NULL( rangeEditor );
       
  3314     
       
  3315     TInt minGet;
       
  3316     TInt maxGet;
       
  3317     rangeEditor->GetMinimumAndMaximum( minGet, maxGet );
       
  3318     STIF_ASSERT_TRUE( min == minGet );
       
  3319     STIF_ASSERT_TRUE( max == maxGet );
       
  3320     
       
  3321     TInt flag = dialog->RunLD();
       
  3322     STIF_ASSERT_EQUALS( 0, flag );
       
  3323     
       
  3324     return KErrNone;
       
  3325     
       
  3326     }
       
  3327 
       
  3328 // -----------------------------------------------------------------------------
       
  3329 // CTestSDKDialogs::TestDSetRangeEditorValueL 
       
  3330 // -----------------------------------------------------------------------------
       
  3331 TInt CTestSDKDialogs::TestDSetRangeEditorValueL( CStifItemParser& /*aItem*/ )
       
  3332     {
       
  3333     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3334     CleanupStack::PushL( dialog );
       
  3335     STIF_ASSERT_NOT_NULL( dialog );
       
  3336     CleanupStack::Pop( dialog );
       
  3337     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3338     
       
  3339     const TInt lowerLimit = 10;
       
  3340     const TInt upperLimit = 50;
       
  3341     SEikRange range;
       
  3342     range.iLowerLimit = lowerLimit;
       
  3343     range.iUpperLimit = upperLimit;
       
  3344     dialog->SetRangeEditorValue( ETESTSDKSGRangeEditor, range );
       
  3345     
       
  3346     SEikRange rangeGet = dialog->RangeEditorValue( ETESTSDKSGRangeEditor );
       
  3347     TInt lower = rangeGet.iLowerLimit;
       
  3348     STIF_ASSERT_EQUALS( lowerLimit, lower );
       
  3349     TInt upper = rangeGet.iUpperLimit;
       
  3350     STIF_ASSERT_EQUALS( upperLimit, upper );
       
  3351     
       
  3352     TInt flag = dialog->RunLD();
       
  3353     STIF_ASSERT_EQUALS( 0, flag );
       
  3354     
       
  3355     return KErrNone;
       
  3356     
       
  3357     }
       
  3358 
       
  3359 // -----------------------------------------------------------------------------
       
  3360 // CTestSDKDialogs::TestDSetTTimeEditorMinAndMaxL 
       
  3361 // -----------------------------------------------------------------------------
       
  3362 TInt CTestSDKDialogs::TestDSetTTimeEditorMinAndMaxL( CStifItemParser& /*aItem*/ )
       
  3363     {
       
  3364     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3365     CleanupStack::PushL( dialog );
       
  3366     STIF_ASSERT_NOT_NULL( dialog );
       
  3367     CleanupStack::Pop( dialog );
       
  3368     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3369     
       
  3370     TDateTime mindatetime( 0, TMonth( 0 ), 0, 0, 0, 0, 0 );
       
  3371     TTime mintime( mindatetime );
       
  3372     TDateTime maxdatetime( 0, TMonth( 0 ), 0, 23, 59, 59, 0 );
       
  3373     TTime maxtime( mindatetime );
       
  3374     dialog->SetTTimeEditorMinAndMax( ETESTSDKSGTimeEditor, mintime, maxtime );
       
  3375     
       
  3376     CEikTimeEditor* timeEditor = static_cast<CEikTimeEditor*> ( dialog->ControlOrNull( ETESTSDKSGTimeEditor ) );
       
  3377     STIF_ASSERT_NOT_NULL( timeEditor );
       
  3378     TTime mintimeGet;
       
  3379     TTime maxtimeGet;
       
  3380     timeEditor->GetMinimumAndMaximum( mintimeGet, maxtimeGet );
       
  3381     STIF_ASSERT_TRUE( mintimeGet == mintime );
       
  3382     STIF_ASSERT_TRUE( maxtimeGet == maxtime );
       
  3383     
       
  3384     TInt flag = dialog->RunLD();
       
  3385     STIF_ASSERT_EQUALS( 0, flag );
       
  3386     
       
  3387     return KErrNone;
       
  3388     
       
  3389     }
       
  3390 
       
  3391 // -----------------------------------------------------------------------------
       
  3392 // CTestSDKDialogs::TestDSetTTimeEditorValueL 
       
  3393 // -----------------------------------------------------------------------------
       
  3394 TInt CTestSDKDialogs::TestDSetTTimeEditorValueL( CStifItemParser& /*aItem*/ )
       
  3395     {
       
  3396     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3397     CleanupStack::PushL( dialog );
       
  3398     STIF_ASSERT_NOT_NULL( dialog );
       
  3399     CleanupStack::Pop( dialog );
       
  3400     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3401     
       
  3402     TDateTime datetime( 0, TMonth( 0 ), 0, 2, 24, 10, 0 );
       
  3403     TTime time( datetime );
       
  3404     dialog->SetTTimeEditorValue( ETESTSDKSGTimeEditor, time );
       
  3405     STIF_ASSERT_TRUE( dialog->TTimeEditorValue( ETESTSDKSGTimeEditor ) == time );
       
  3406     
       
  3407     TInt flag = dialog->RunLD();
       
  3408     STIF_ASSERT_EQUALS( 0, flag );
       
  3409     
       
  3410     return KErrNone;
       
  3411     
       
  3412     }
       
  3413 
       
  3414 // -----------------------------------------------------------------------------
       
  3415 // CTestSDKDialogs::TestDSetDurationEditorMinAndMaxL 
       
  3416 // -----------------------------------------------------------------------------
       
  3417 TInt CTestSDKDialogs::TestDSetDurationEditorMinAndMaxL( CStifItemParser& /*aItem*/ )
       
  3418     {
       
  3419     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3420     CleanupStack::PushL( dialog );
       
  3421     STIF_ASSERT_NOT_NULL( dialog );
       
  3422     CleanupStack::Pop( dialog );
       
  3423     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3424     
       
  3425     const TInt mindurationC = 0;
       
  3426     const TInt maxdurationC = 2000000;
       
  3427     TTimeIntervalSeconds minduration( mindurationC );
       
  3428     TTimeIntervalSeconds maxduration( maxdurationC );
       
  3429     dialog->SetDurationEditorMinAndMax( ETESTSDKSGDurationEditor, minduration, maxduration );
       
  3430     CEikDurationEditor* ddurationEditor = static_cast<CEikDurationEditor*> ( dialog->ControlOrNull( ETESTSDKSGDurationEditor ) );
       
  3431     STIF_ASSERT_NOT_NULL( ddurationEditor );
       
  3432     
       
  3433     TTimeIntervalSeconds mindurationGet;
       
  3434     TTimeIntervalSeconds maxdurationGet;
       
  3435     ddurationEditor->GetMinimumAndMaximum( mindurationGet, maxdurationGet );
       
  3436     STIF_ASSERT_TRUE( mindurationGet == minduration );
       
  3437     STIF_ASSERT_TRUE( maxdurationGet == maxduration ); 
       
  3438     
       
  3439     TInt flag = dialog->RunLD();
       
  3440     STIF_ASSERT_EQUALS( 0, flag );
       
  3441     
       
  3442     return KErrNone;
       
  3443     
       
  3444     }
       
  3445 
       
  3446 // -----------------------------------------------------------------------------
       
  3447 // CTestSDKDialogs::TestDSetDurationEditorValueL 
       
  3448 // -----------------------------------------------------------------------------
       
  3449 TInt CTestSDKDialogs::TestDSetDurationEditorValueL( CStifItemParser& /*aItem*/ )
       
  3450     {
       
  3451     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3452     CleanupStack::PushL( dialog );
       
  3453     STIF_ASSERT_NOT_NULL( dialog );
       
  3454     CleanupStack::Pop( dialog );
       
  3455     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3456     
       
  3457     const TInt durationC = 1000;
       
  3458     TTimeIntervalSeconds duration( durationC );
       
  3459     dialog->SetDurationEditorValue( ETESTSDKSGDurationEditor, duration );
       
  3460     STIF_ASSERT_TRUE( dialog->DurationEditorValue( ETESTSDKSGDurationEditor ) == duration );
       
  3461     
       
  3462     TInt flag = dialog->RunLD();
       
  3463     STIF_ASSERT_EQUALS( 0, flag );
       
  3464     
       
  3465     return KErrNone;
       
  3466     
       
  3467     }
       
  3468 
       
  3469 // -----------------------------------------------------------------------------
       
  3470 // CTestSDKDialogs::TestDSetTimeOffsetEditorMinAndMaxL 
       
  3471 // -----------------------------------------------------------------------------
       
  3472 TInt CTestSDKDialogs::TestDSetTimeOffsetEditorMinAndMaxL( CStifItemParser& /*aItem*/ )
       
  3473     {
       
  3474     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3475     CleanupStack::PushL( dialog );
       
  3476     STIF_ASSERT_NOT_NULL( dialog );
       
  3477     CleanupStack::Pop( dialog );
       
  3478     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3479     
       
  3480     TTimeIntervalSeconds minTimeOffset(0);
       
  3481     const TInt timeOffsetC = 1000000;
       
  3482     TTimeIntervalSeconds maxTimeOffset( timeOffsetC );
       
  3483     dialog->SetTimeOffsetEditorMinAndMax( ETESTSDKSGTimeOffsetEditor, minTimeOffset, maxTimeOffset );
       
  3484 
       
  3485     CEikTimeOffsetEditor* timeOffsetEditor = static_cast<CEikTimeOffsetEditor*> ( dialog->ControlOrNull( ETESTSDKSGTimeOffsetEditor ) );
       
  3486     STIF_ASSERT_NOT_NULL( timeOffsetEditor );
       
  3487     
       
  3488     TTimeIntervalSeconds minTimeOffsetGet;
       
  3489     TTimeIntervalSeconds maxTimeOffsetGet;
       
  3490     timeOffsetEditor->GetMinimumAndMaximum( minTimeOffsetGet, maxTimeOffsetGet );
       
  3491     STIF_ASSERT_TRUE( minTimeOffsetGet == minTimeOffset );
       
  3492     STIF_ASSERT_TRUE( maxTimeOffsetGet == maxTimeOffset ); 
       
  3493     
       
  3494     TInt flag = dialog->RunLD();
       
  3495     STIF_ASSERT_EQUALS( 0, flag );
       
  3496     
       
  3497     return KErrNone;
       
  3498     
       
  3499     }
       
  3500 
       
  3501 // -----------------------------------------------------------------------------
       
  3502 // CTestSDKDialogs::TestDSetTimeOffsetEditorValueL 
       
  3503 // -----------------------------------------------------------------------------
       
  3504 TInt CTestSDKDialogs::TestDSetTimeOffsetEditorValueL( CStifItemParser& /*aItem*/ )
       
  3505     {
       
  3506     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3507     CleanupStack::PushL( dialog );
       
  3508     STIF_ASSERT_NOT_NULL( dialog );
       
  3509     CleanupStack::Pop( dialog );
       
  3510     dialog->PrepareLC( R_TESTSDK_DIALOGSGFUNCTION );
       
  3511     
       
  3512     const TInt timeOffsetC = 1000;
       
  3513     TTimeIntervalSeconds timeOffset( timeOffsetC );
       
  3514     dialog->SetTimeOffsetEditorValue( ETESTSDKSGTimeOffsetEditor, timeOffset );
       
  3515     STIF_ASSERT_TRUE( dialog->TimeOffsetEditorValue( ETESTSDKSGTimeOffsetEditor ) == timeOffset );
       
  3516     
       
  3517     TInt flag = dialog->RunLD();
       
  3518     STIF_ASSERT_EQUALS( 0, flag );
       
  3519     
       
  3520     return KErrNone;
       
  3521     
       
  3522     }
       
  3523 
       
  3524 // -----------------------------------------------------------------------------
       
  3525 // CTestSDKDialogs::TestDSetListBoxCurrentItemL 
       
  3526 // -----------------------------------------------------------------------------
       
  3527 TInt CTestSDKDialogs::TestDSetListBoxCurrentItemL( CStifItemParser& /*aItem*/ )
       
  3528     {
       
  3529     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3530     CleanupStack::PushL( dialog );
       
  3531     STIF_ASSERT_NOT_NULL( dialog );
       
  3532     CleanupStack::Pop( dialog );
       
  3533     dialog->PrepareLC( R_TESTSDK_LISTBOX );
       
  3534     
       
  3535     TInt item = 0;
       
  3536     dialog->SetListBoxCurrentItem( EDialogListBox, item );
       
  3537 
       
  3538     
       
  3539     TInt flag = dialog->RunLD();
       
  3540     STIF_ASSERT_EQUALS( 0, flag );
       
  3541     
       
  3542     return KErrNone;
       
  3543     
       
  3544     }
       
  3545 
       
  3546 // -----------------------------------------------------------------------------
       
  3547 // CTestSDKDialogs::TestDSetFileNameL 
       
  3548 // -----------------------------------------------------------------------------
       
  3549 TInt CTestSDKDialogs::TestDSetFileNameL( CStifItemParser& /*aItem*/ )
       
  3550     {
       
  3551     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3552     CleanupStack::PushL( dialog );
       
  3553     STIF_ASSERT_NOT_NULL( dialog );
       
  3554     CleanupStack::Pop( dialog );
       
  3555     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3556     
       
  3557     _LIT( KFileName, "filename" );
       
  3558     TFileName filename( KFileName );
       
  3559     dialog->SetFileNameL( EDialogLine, &filename );
       
  3560     
       
  3561     TInt flag = dialog->RunLD();
       
  3562     STIF_ASSERT_EQUALS( 0, flag );
       
  3563     
       
  3564     return KErrNone;
       
  3565     
       
  3566     }
       
  3567 
       
  3568 // -----------------------------------------------------------------------------
       
  3569 // CTestSDKDialogs::TestDGetLabelTextL 
       
  3570 // -----------------------------------------------------------------------------
       
  3571 TInt CTestSDKDialogs::TestDGetLabelTextL( CStifItemParser& aItem )
       
  3572     {
       
  3573     return TestDSetLabelByDesL( aItem );
       
  3574     
       
  3575     }
       
  3576 
       
  3577 // -----------------------------------------------------------------------------
       
  3578 // CTestSDKDialogs::TestDGetEdwinTextL 
       
  3579 // -----------------------------------------------------------------------------
       
  3580 TInt CTestSDKDialogs::TestDGetEdwinTextL( CStifItemParser& aItem )
       
  3581     {
       
  3582     return TestDSetEdwinTextL( aItem );
       
  3583     
       
  3584     }
       
  3585 
       
  3586 // -----------------------------------------------------------------------------
       
  3587 // CTestSDKDialogs::TestDGetTextEditorTextL 
       
  3588 // -----------------------------------------------------------------------------
       
  3589 TInt CTestSDKDialogs::TestDGetTextEditorTextL( CStifItemParser& aItem )
       
  3590     {
       
  3591     return TestDSetTextEditorTextL( aItem );
       
  3592     
       
  3593     }
       
  3594 
       
  3595 // -----------------------------------------------------------------------------
       
  3596 // CTestSDKDialogs::TestDGetSecretEditorTextL 
       
  3597 // -----------------------------------------------------------------------------
       
  3598 TInt CTestSDKDialogs::TestDGetSecretEditorTextL( CStifItemParser& aItem )
       
  3599     {
       
  3600     return TestDResetSecretEditorL( aItem );
       
  3601     
       
  3602     }
       
  3603 
       
  3604 // -----------------------------------------------------------------------------
       
  3605 // CTestSDKDialogs::TestDFloatingPointEditorValueL 
       
  3606 // -----------------------------------------------------------------------------
       
  3607 TInt CTestSDKDialogs::TestDFloatingPointEditorValueL( CStifItemParser& aItem )
       
  3608     {
       
  3609     return TestDSetFloatingPointEditorValueL( aItem );
       
  3610     
       
  3611     }
       
  3612 
       
  3613 // -----------------------------------------------------------------------------
       
  3614 // CTestSDKDialogs::TestDFixedPointEditorValueL 
       
  3615 // -----------------------------------------------------------------------------
       
  3616 TInt CTestSDKDialogs::TestDFixedPointEditorValueL( CStifItemParser& aItem )
       
  3617     {
       
  3618     return TestDSetFixedPointEditorValueL( aItem );
       
  3619     
       
  3620     }
       
  3621 
       
  3622 // -----------------------------------------------------------------------------
       
  3623 // CTestSDKDialogs::TestDFixedPointEditorDecimalL 
       
  3624 // -----------------------------------------------------------------------------
       
  3625 TInt CTestSDKDialogs::TestDFixedPointEditorDecimalL( CStifItemParser& aItem )
       
  3626     {
       
  3627     return TestDSetFixedPointEditorDecimalL( aItem );
       
  3628     
       
  3629     }
       
  3630 
       
  3631 // -----------------------------------------------------------------------------
       
  3632 // CTestSDKDialogs::TestDFloatEditorValueL 
       
  3633 // -----------------------------------------------------------------------------
       
  3634 TInt CTestSDKDialogs::TestDFloatEditorValueL( CStifItemParser& aItem )
       
  3635     {
       
  3636     return TestDSetFloatEditorValueL( aItem );
       
  3637     
       
  3638     }
       
  3639 
       
  3640 // -----------------------------------------------------------------------------
       
  3641 // CTestSDKDialogs::TestDNumberEditorValueL 
       
  3642 // -----------------------------------------------------------------------------
       
  3643 TInt CTestSDKDialogs::TestDNumberEditorValueL( CStifItemParser& aItem )
       
  3644     {
       
  3645     return TestDSetNumberEditorValueL( aItem );
       
  3646     
       
  3647     }
       
  3648 
       
  3649 // -----------------------------------------------------------------------------
       
  3650 // CTestSDKDialogs::TestDRangeEditorValueL 
       
  3651 // -----------------------------------------------------------------------------
       
  3652 TInt CTestSDKDialogs::TestDRangeEditorValueL( CStifItemParser& aItem )
       
  3653     {
       
  3654     return TestDSetRangeEditorValueL( aItem );
       
  3655     
       
  3656     }
       
  3657 
       
  3658 // -----------------------------------------------------------------------------
       
  3659 // CTestSDKDialogs::TestDTTimeEditorValueL 
       
  3660 // -----------------------------------------------------------------------------
       
  3661 TInt CTestSDKDialogs::TestDTTimeEditorValueL( CStifItemParser& aItem )
       
  3662     {
       
  3663     return TestDSetTTimeEditorValueL( aItem );
       
  3664     
       
  3665     }
       
  3666 
       
  3667 // -----------------------------------------------------------------------------
       
  3668 // CTestSDKDialogs::TestDDurationEditorValueL 
       
  3669 // -----------------------------------------------------------------------------
       
  3670 TInt CTestSDKDialogs::TestDDurationEditorValueL( CStifItemParser& aItem )
       
  3671     {
       
  3672     return TestDSetDurationEditorValueL( aItem ); 
       
  3673     
       
  3674     }
       
  3675 
       
  3676 // -----------------------------------------------------------------------------
       
  3677 // CTestSDKDialogs::TestDTimeOffsetEditorValueL 
       
  3678 // -----------------------------------------------------------------------------
       
  3679 TInt CTestSDKDialogs::TestDTimeOffsetEditorValueL( CStifItemParser& aItem )
       
  3680     {
       
  3681     return TestDSetTimeOffsetEditorValueL( aItem );
       
  3682     
       
  3683     }
       
  3684 
       
  3685 // -----------------------------------------------------------------------------
       
  3686 // CTestSDKDialogs::TestDGetAutoValuesFromPageL 
       
  3687 // -----------------------------------------------------------------------------
       
  3688 TInt CTestSDKDialogs::TestDGetAutoValuesFromPageL( CStifItemParser& /*aItem*/ )
       
  3689     {
       
  3690     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3691     CleanupStack::PushL( dialog );
       
  3692     STIF_ASSERT_NOT_NULL( dialog );
       
  3693     CleanupStack::Pop( dialog );
       
  3694     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3695     
       
  3696     CEikCapCArray* lines = NULL;
       
  3697     dialog->GetAutoValuesFromPage( lines );
       
  3698     STIF_ASSERT_NULL( lines );
       
  3699     
       
  3700     TInt flag = dialog->RunLD();
       
  3701     STIF_ASSERT_EQUALS( 0, flag );
       
  3702     
       
  3703     return KErrNone;
       
  3704     
       
  3705     }
       
  3706 
       
  3707 // -----------------------------------------------------------------------------
       
  3708 // CTestSDKDialogs::TestDListBoxCurrentItemL 
       
  3709 // -----------------------------------------------------------------------------
       
  3710 TInt CTestSDKDialogs::TestDListBoxCurrentItemL( CStifItemParser& /*aItem*/ )
       
  3711     {
       
  3712     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3713     CleanupStack::PushL( dialog );
       
  3714     STIF_ASSERT_NOT_NULL( dialog );
       
  3715     CleanupStack::Pop( dialog );
       
  3716     dialog->PrepareLC( R_TESTSDK_LISTBOX );
       
  3717     
       
  3718     TInt currentitem = dialog->ListBoxCurrentItem( EDialogListBox );
       
  3719     STIF_ASSERT_EQUALS( -1, currentitem );
       
  3720     
       
  3721     TInt flag = dialog->RunLD();
       
  3722     STIF_ASSERT_EQUALS( 0, flag );
       
  3723     
       
  3724     return KErrNone;
       
  3725     
       
  3726     }
       
  3727 
       
  3728 // -----------------------------------------------------------------------------
       
  3729 // CTestSDKDialogs::TestDGetFileNameL 
       
  3730 // -----------------------------------------------------------------------------
       
  3731 TInt CTestSDKDialogs::TestDGetFileNameL( CStifItemParser& /*aItem*/ )
       
  3732     {
       
  3733     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3734     CleanupStack::PushL( dialog );
       
  3735     STIF_ASSERT_NOT_NULL( dialog );
       
  3736     CleanupStack::Pop( dialog );
       
  3737     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3738     
       
  3739     _LIT( KFileName, "filenameGet" );
       
  3740     TFileName filenameGet( KFileName );
       
  3741     dialog->GetFileName( &filenameGet, EDialogLine );
       
  3742     STIF_ASSERT_EQUALS( 0, filenameGet.Compare( KFileName ) );
       
  3743     
       
  3744     TInt flag = dialog->RunLD();
       
  3745     STIF_ASSERT_EQUALS( 0, flag );
       
  3746     
       
  3747     return KErrNone;
       
  3748     
       
  3749     }
       
  3750 
       
  3751 // -----------------------------------------------------------------------------
       
  3752 // CTestSDKDialogs::TestDUpdatePageL 
       
  3753 // -----------------------------------------------------------------------------
       
  3754 TInt CTestSDKDialogs::TestDUpdatePageL( CStifItemParser& /*aItem*/ )
       
  3755     {
       
  3756     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3757     CleanupStack::PushL( dialog );
       
  3758     STIF_ASSERT_NOT_NULL( dialog );
       
  3759     CleanupStack::Pop( dialog );
       
  3760     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3761     
       
  3762     dialog->DeleteLine( EDialogLine, EFalse );
       
  3763     dialog->UpdatePageL( ETrue );
       
  3764     
       
  3765     TInt flag = dialog->RunLD();
       
  3766     STIF_ASSERT_EQUALS( 0, flag );
       
  3767     
       
  3768     return KErrNone;
       
  3769     
       
  3770     }
       
  3771 
       
  3772 // -----------------------------------------------------------------------------
       
  3773 // CTestSDKDialogs::TestDHandleDialogPageEventL 
       
  3774 // -----------------------------------------------------------------------------
       
  3775 TInt CTestSDKDialogs::TestDHandleDialogPageEventL( CStifItemParser& /*aItem*/ )
       
  3776     {
       
  3777     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  3778     CleanupStack::PushL( dialog );
       
  3779     STIF_ASSERT_NOT_NULL( dialog );
       
  3780     CleanupStack::Pop( dialog );
       
  3781     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3782     
       
  3783     dialog->HandleDialogPageEventL( MEikDialogPageObserver::EDialogPageTapped );
       
  3784     
       
  3785     TInt flag = dialog->RunLD();
       
  3786     STIF_ASSERT_EQUALS( 0, flag );
       
  3787     dialog = NULL;
       
  3788     
       
  3789     dialog = new (ELeave) CEikDialog;
       
  3790     CleanupStack::PushL( dialog );
       
  3791     STIF_ASSERT_NOT_NULL( dialog );
       
  3792     CleanupStack::Pop( dialog );
       
  3793     
       
  3794     dialog->ConstructAutoDialogLC( EEikDialogFlagCloseDialogWhenTapped, R_AVKON_SOFTKEYS_OK_CANCEL );
       
  3795     CleanupStack::Pop( dialog );
       
  3796     dialog->HandleDialogPageEventL( MEikDialogPageObserver::EDialogPageTapped );
       
  3797     
       
  3798     STIF_ASSERT_EQUALS( 0, flag );
       
  3799     
       
  3800     return KErrNone;
       
  3801     
       
  3802     }
       
  3803 
       
  3804 // -----------------------------------------------------------------------------
       
  3805 // CTestSDKDialogs::TestDPublishDialogL 
       
  3806 // -----------------------------------------------------------------------------
       
  3807 TInt CTestSDKDialogs::TestDPublishDialogL( CStifItemParser& /*aItem*/ )
       
  3808     {
       
  3809     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  3810     CleanupStack::PushL( dialog );
       
  3811     STIF_ASSERT_NOT_NULL( dialog );
       
  3812     CleanupStack::Pop( dialog );
       
  3813     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3814     
       
  3815     dialog->PublishDialogL( 1 );
       
  3816     
       
  3817     TInt flag = dialog->RunLD();
       
  3818     STIF_ASSERT_EQUALS( 0, flag );
       
  3819     
       
  3820     return KErrNone;
       
  3821     
       
  3822     }
       
  3823 
       
  3824 // -----------------------------------------------------------------------------
       
  3825 // CTestSDKDialogs::TestDSetMediatorObserverL 
       
  3826 // -----------------------------------------------------------------------------
       
  3827 TInt CTestSDKDialogs::TestDSetMediatorObserverL( CStifItemParser& /*aItem*/ )
       
  3828     {
       
  3829     CTestSDKDialogsControl* dialog = new (ELeave) CTestSDKDialogsControl;
       
  3830     CleanupStack::PushL( dialog );
       
  3831     STIF_ASSERT_NOT_NULL( dialog );
       
  3832     CleanupStack::Pop( dialog );
       
  3833     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3834     
       
  3835     dialog->CTestSDKSetMediatorObserver();
       
  3836     
       
  3837     TInt flag = dialog->RunLD();
       
  3838     STIF_ASSERT_EQUALS( 0, flag );
       
  3839     
       
  3840     return KErrNone;
       
  3841     
       
  3842     }
       
  3843 
       
  3844 // -----------------------------------------------------------------------------
       
  3845 // CTestSDKDialogs::TestDSlideDialogL 
       
  3846 // -----------------------------------------------------------------------------
       
  3847 TInt CTestSDKDialogs::TestDSlideDialogL( CStifItemParser& /*aItem*/ )
       
  3848     {
       
  3849     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  3850     CleanupStack::PushL( dialog );
       
  3851     STIF_ASSERT_NOT_NULL( dialog );
       
  3852     CleanupStack::Pop( dialog );
       
  3853     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3854     
       
  3855     dialog->SlideDialog();
       
  3856     
       
  3857     TInt flag = dialog->RunLD();
       
  3858     STIF_ASSERT_EQUALS( 0, flag );
       
  3859     
       
  3860     return KErrNone;
       
  3861     
       
  3862     }
       
  3863 
       
  3864 // -----------------------------------------------------------------------------
       
  3865 // CTestSDKDialogs::TestDSetMultilineQueryL 
       
  3866 // -----------------------------------------------------------------------------
       
  3867 TInt CTestSDKDialogs::TestDSetMultilineQueryL( CStifItemParser& /*aItem*/ )
       
  3868     {
       
  3869     CEikDialog* dialog = new (ELeave) CEikDialog;
       
  3870     CleanupStack::PushL( dialog );
       
  3871     STIF_ASSERT_NOT_NULL( dialog );
       
  3872     CleanupStack::Pop( dialog );
       
  3873     dialog->PrepareLC( R_TESTSDK_DIALOG );
       
  3874     
       
  3875     dialog->SetMultilineQuery( EFalse );
       
  3876     dialog->SetMultilineQuery( ETrue );
       
  3877     
       
  3878     TInt flag = dialog->RunLD();
       
  3879     STIF_ASSERT_EQUALS( 0, flag );
       
  3880     
       
  3881     return KErrNone;
       
  3882     
       
  3883     }
       
  3884 //  [End of File]