classicui_pub/common_file_dialogs_api/tsrc/src/testsdkcfdblocksmemoryselectionsettingitem.cpp
branchGCC_SURGE
changeset 44 484cb5040995
parent 32 512f698a535d
parent 40 7165f928e888
equal deleted inserted replaced
32:512f698a535d 44:484cb5040995
     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 CAknMemorySelectionSettingItem.h
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // [INCLUDE FILES]
       
    20 #include <aknsettingitemlist.h> 
       
    21 #include <testsdkcfd.rsg>
       
    22 
       
    23 #include "testsdkcfd.h"
       
    24 #include "testsdkcfdsettingitem.h"
       
    25 
       
    26 // CONSTS
       
    27 const TInt KBufSize = 64;
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CTestSDKCFD::TestSettingItemConstructorL
       
    33 // -----------------------------------------------------------------------------
       
    34 //
       
    35 TInt CTestSDKCFD::TestSettingItemConstructorL(CStifItemParser& /*aItem*/)
       
    36     {
       
    37     _LIT( Ktestsdkcfd, "testsdkcfd" );
       
    38     _LIT( KExample, "In TestSettingItemConstructorL" );
       
    39     TestModuleIf().Printf( 0, Ktestsdkcfd, KExample );
       
    40     iLog->Log(KExample);
       
    41 
       
    42     iSettingItemList = new (ELeave) CTestSettingItemList;
       
    43     iSettingItemList->ConstructL();
       
    44     STIF_ASSERT_NOT_NULL( iSettingItemList );
       
    45     return KErrNone;
       
    46     }
       
    47 // -----------------------------------------------------------------------------
       
    48 // CTestSDKCFD::TestSettingItemDeconstructorL
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 TInt CTestSDKCFD::TestSettingItemDeconstructorL(CStifItemParser& /*aItem*/)
       
    52     {
       
    53     _LIT( Ktestsdkcfd, "testsdkcfd" );
       
    54     _LIT( KExample, "In TestSettingItemDeconstructorL" );
       
    55     TestModuleIf().Printf( 0, Ktestsdkcfd, KExample );
       
    56     iLog->Log(KExample);
       
    57     
       
    58     CTestSettingItemList* temp = new (ELeave) CTestSettingItemList;
       
    59     CleanupStack::PushL( temp );
       
    60     temp->ConstructL();
       
    61     CleanupStack::PopAndDestroy( temp );
       
    62     
       
    63     return KErrNone;
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CTestSDKCFD::TestSettingItemCompleteConstructionL
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 TInt CTestSDKCFD::TestSettingItemCompleteConstructionL(CStifItemParser& /*aItem*/)
       
    71     {
       
    72     _LIT( Ktestsdkcfd, "testsdkcfd" );
       
    73     _LIT( KExample, "In TestSettingItemCompleteConstructionL" );
       
    74     TestModuleIf().Printf( 0, Ktestsdkcfd, KExample );
       
    75     iLog->Log(KExample);
       
    76     
       
    77     if ( !iSettingItemList )
       
    78         {
       
    79         iSettingItemList = new (ELeave) CTestSettingItemList;
       
    80         iSettingItemList->ConstructL();
       
    81         }
       
    82 //    iSettingItemList->iItem->CompleteConstructionL();
       
    83     CAknMemorySelectionSettingPage* temp= NULL;
       
    84     temp = iSettingItemList->iItem->GetSettingPagePointer();
       
    85     STIF_ASSERT_NOT_NULL( temp );
       
    86     temp = NULL;
       
    87     return KErrNone;
       
    88 
       
    89     }
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // CTestSDKCFD::TestSettingItemEditItemL
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 TInt CTestSDKCFD::TestSettingItemEditItemL(CStifItemParser& /*aItem*/)
       
    96     {
       
    97     _LIT( Ktestsdkcfd, "testsdkcfd" );
       
    98     _LIT( KExample, "In TestSettingItemEditItemL" );
       
    99     TestModuleIf().Printf( 0, Ktestsdkcfd, KExample );
       
   100     iLog->Log(KExample);
       
   101     if ( !iSettingItemList )
       
   102         {
       
   103         iSettingItemList = new (ELeave) CTestSettingItemList;
       
   104         iSettingItemList->ConstructL();
       
   105         }
       
   106     iSettingItemList->EditItemL(0, ETrue);
       
   107     return KErrNone;
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CTestSDKCFD::TestSettingItemLoadL
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 TInt CTestSDKCFD::TestSettingItemLoadL(CStifItemParser& /*aItem*/)
       
   115     {
       
   116     _LIT( Ktestsdkcfd, "testsdkcfd" );
       
   117     _LIT( KExample, "In TestSettingItemLoadL" );
       
   118     TestModuleIf().Printf( 0, Ktestsdkcfd, KExample );
       
   119     iLog->Log(KExample);
       
   120 
       
   121     if ( !iSettingItemList )
       
   122         {
       
   123         iSettingItemList = new (ELeave) CTestSettingItemList;
       
   124         iSettingItemList->ConstructL();
       
   125         }
       
   126     
       
   127     CAknMemorySelectionDialog::TMemory backtpye = iSettingItemList->iItem->GetInternalData();
       
   128     STIF_ASSERT_EQUALS( CAknMemorySelectionDialog::EPhoneMemory, backtpye );
       
   129     return KErrNone;
       
   130     }
       
   131 
       
   132 // -----------------------------------------------------------------------------
       
   133 // CTestSDKCFD::TestSettingItemStoreL
       
   134 // -----------------------------------------------------------------------------
       
   135 //
       
   136 TInt CTestSDKCFD::TestSettingItemStoreL(CStifItemParser& /*aItem*/)
       
   137     {
       
   138     _LIT( Ktestsdkcfd, "testsdkcfd" );
       
   139     _LIT( KExample, "In TestSettingItemStoreL" );
       
   140     TestModuleIf().Printf( 0, Ktestsdkcfd, KExample );
       
   141     iLog->Log(KExample);
       
   142 
       
   143     if ( !iSettingItemList )
       
   144             {
       
   145             iSettingItemList = new (ELeave) CTestSettingItemList;
       
   146             iSettingItemList->ConstructL();
       
   147             }
       
   148     iSettingItemList->StoreSettingsL();
       
   149     CAknMemorySelectionDialog::TMemory backtpye = iSettingItemList->iItem->GetExternalData();
       
   150     STIF_ASSERT_EQUALS( CAknMemorySelectionDialog::EPhoneMemory, backtpye );
       
   151     return KErrNone;
       
   152     }
       
   153 
       
   154 // -----------------------------------------------------------------------------
       
   155 // CTestSDKCFD::TestSettingItemSettingTextL
       
   156 // -----------------------------------------------------------------------------
       
   157 //
       
   158 TInt CTestSDKCFD::TestSettingItemSettingTextL(CStifItemParser& /*aItem*/)
       
   159     {
       
   160     _LIT( Ktestsdkcfd, "testsdkcfd" );
       
   161     _LIT( KExample, "In TestSettingItemSettingTextL" );
       
   162     TestModuleIf().Printf( 0, Ktestsdkcfd, KExample );
       
   163     iLog->Log(KExample);
       
   164 
       
   165     if ( !iSettingItemList )
       
   166             {
       
   167             iSettingItemList = new (ELeave) CTestSettingItemList;
       
   168             iSettingItemList->ConstructL();
       
   169             }
       
   170     
       
   171     iSettingItemList->iItem->GetSettingText();
       
   172     TBuf<KBufSize> buf;
       
   173     iSettingItemList->iItem->GetText( buf );
       
   174 // sth need to do
       
   175     return KErrNone;
       
   176     }
       
   177 
       
   178 // End of File