classicui_pub/tsrc/bc/apps/S60_SDK3.0/bctestcmdlg/src/bctestcmdlgview.cpp
changeset 22 75713bee6484
parent 21 558113899881
child 26 62ef28f7b435
child 28 d33307312dfe
equal deleted inserted replaced
21:558113899881 22:75713bee6484
     1 /*
       
     2 * Copyright (c) 2006-2009 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:         view class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 #include <aknviewappui.h>
       
    27 
       
    28 #include "BCTestCmDlg.hrh"
       
    29 #include <bctestcmdlg.rsg>
       
    30 #include "BCTestCmDlgview.h"
       
    31 #include "BCTestCmDlgcontainer.h"
       
    32 #include "bctestutil.h"
       
    33 #include "BCTestCmDlgcase.h"
       
    34 #include "bctestmemselpage.h"
       
    35 #include "bctestfileseldlg.h"
       
    36 #include "bctestfilenamedlg.h"
       
    37 #include "bctestcommondlg.h"
       
    38 #include "bctestmemselitem.h"
       
    39 
       
    40 // ======== MEMBER FUNCTIONS ========
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // Symbian 2nd static Constructor
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 CBCTestCmDlgView* CBCTestCmDlgView::NewL()
       
    47     {
       
    48     CBCTestCmDlgView* self = new( ELeave ) CBCTestCmDlgView();
       
    49     CleanupStack::PushL( self );
       
    50     self->ConstructL();
       
    51     CleanupStack::Pop( self );
       
    52     return self;
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // C++ default Constructor
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 CBCTestCmDlgView::CBCTestCmDlgView()
       
    60     {
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // Symbian 2nd Constructor
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void CBCTestCmDlgView::ConstructL()
       
    68     {
       
    69     BaseConstructL( R_BCTESTCMDLG_VIEW );
       
    70 
       
    71     iContainer = new( ELeave ) CBCTestCmDlgContainer();
       
    72     iContainer->SetMopParent( this );
       
    73     iContainer->ConstructL( ClientRect() );
       
    74     AppUi()->AddToStackL( *this, iContainer );
       
    75     iContainer->MakeVisible( ETrue );
       
    76 
       
    77     iTestUtil = CBCTestUtil::NewL();
       
    78 
       
    79     // Add test case here.
       
    80     iTestUtil->AddTestCaseL( CBCTestCmDlgCase::NewL(),
       
    81         _L("Mem selection dialog") );
       
    82 	iTestUtil->AddTestCaseL( CBCTestMemSelSettingPage::NewL(),
       
    83         _L("Mem selection setting page") );
       
    84 	iTestUtil->AddTestCaseL( CBCTestFileSelDlg::NewL(),
       
    85         _L("File selection dialog") );
       
    86 	iTestUtil->AddTestCaseL( CBCTestFileNameDlg::NewL(),
       
    87         _L("File name prompt dialog") );
       
    88 	iTestUtil->AddTestCaseL( CBCTestCommonDlg::NewL(),
       
    89         _L("Common dialog") );
       
    90 	iTestUtil->AddTestCaseL( CBCTestMemSelSettingItem::NewL(),
       
    91         _L("Mem selection setting item") );
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // Destructor
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 CBCTestCmDlgView::~CBCTestCmDlgView()
       
    99     {
       
   100     if ( iContainer )
       
   101         {
       
   102         AppUi()->RemoveFromStack( iContainer );
       
   103         }
       
   104     delete iContainer;
       
   105     delete iTestUtil;
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------------------------
       
   109 // CBCTestCmDlgView::Id
       
   110 // ---------------------------------------------------------------------------
       
   111 //
       
   112 TUid CBCTestCmDlgView::Id() const
       
   113     {
       
   114     return KBCTestCmDlgViewId;
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // CBCTestCmDlgView::DoActivateL
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void CBCTestCmDlgView::DoActivateL( const TVwsViewId&, TUid, const TDesC8& )
       
   122     {
       
   123     }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // CBCTestCmDlgView::DoDeactivate
       
   127 // ---------------------------------------------------------------------------
       
   128 //
       
   129 void CBCTestCmDlgView::DoDeactivate()
       
   130     {
       
   131     }
       
   132 
       
   133 // ---------------------------------------------------------------------------
       
   134 // CBCTestCmDlgView::HandleCommandL
       
   135 // ---------------------------------------------------------------------------
       
   136 //
       
   137 void CBCTestCmDlgView::HandleCommandL( TInt aCommand )
       
   138     {
       
   139     switch ( aCommand )
       
   140         {
       
   141         case EProgCmdAutoTest:
       
   142             iTestUtil->RunL();
       
   143             break;
       
   144         default:
       
   145             if ( aCommand > EBCTestCmdEmptyOutline &&
       
   146                  aCommand < EBCTestCmdMaxOutline )
       
   147                 {
       
   148                 iTestUtil->RunL( aCommand );
       
   149                 }
       
   150             break;
       
   151         }
       
   152     }