uifw/AvKon/tsrc/bc/S60_SDK3.0/bctestptieng/src/bctestptiengview.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2006 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 #include <aknviewappui.h>
       
    20 
       
    21 #include "BCTestPtiEng.hrh"
       
    22 #include <bctestptieng.rsg>
       
    23 #include "BCTestPtiEngview.h"
       
    24 #include "BCTestPtiEngcontainer.h"
       
    25 #include "bctestutil.h"
       
    26 #include "BCTestuserdict.h"
       
    27 #include "bctestlan.h"
       
    28 #include "bctestkeymap.h"
       
    29 #include "bctestqwertymap.h"
       
    30 #include "bctestlandb.h"
       
    31 #include "bctestptiengine.h"
       
    32 
       
    33 // ======== MEMBER FUNCTIONS ========
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // Symbian 2nd static Constructor
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 CBCTestPtiEngView* CBCTestPtiEngView::NewL()
       
    40     {
       
    41     CBCTestPtiEngView* self = new( ELeave ) CBCTestPtiEngView();
       
    42     CleanupStack::PushL( self );
       
    43     self->ConstructL();
       
    44     CleanupStack::Pop( self );
       
    45     return self;
       
    46     }
       
    47 
       
    48 // ---------------------------------------------------------------------------
       
    49 // C++ default Constructor
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 CBCTestPtiEngView::CBCTestPtiEngView()
       
    53     {
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // Symbian 2nd Constructor
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 void CBCTestPtiEngView::ConstructL()
       
    61     {
       
    62     BaseConstructL( R_BCTESTPTIENG_VIEW );
       
    63 
       
    64     iContainer = new( ELeave ) CBCTestPtiEngContainer();
       
    65     iContainer->SetMopParent( this );
       
    66     iContainer->ConstructL( ClientRect() );
       
    67     AppUi()->AddToStackL( *this, iContainer );
       
    68     iContainer->MakeVisible( ETrue );
       
    69 
       
    70     iTestUtil = CBCTestUtil::NewL();
       
    71 
       
    72     iTestUtil->AddTestCaseL( CBCTestUserDict::NewL( iContainer ),
       
    73         _L("Test Pti User Dict") );
       
    74 	iTestUtil->AddTestCaseL( CBCTestLanguage::NewL(), 
       
    75 		_L("Test Pti Language") );
       
    76 	iTestUtil->AddTestCaseL( CBCTestKeymap::NewL(), 
       
    77 		_L("Test Pti Keymap") );
       
    78 	iTestUtil->AddTestCaseL( CBCTestQwertyMap::NewL(), 
       
    79 		_L("Test Qwerty map") );
       
    80 	iTestUtil->AddTestCaseL( CBCTestLanDB::NewL(), 
       
    81 		_L("Test Language Database") );
       
    82 	iTestUtil->AddTestCaseL( CBCTestPtiEngine::NewL(), 
       
    83 		_L("Test Pti Engine") );
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // Destructor
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 CBCTestPtiEngView::~CBCTestPtiEngView()
       
    91     {
       
    92     if ( iContainer )
       
    93         {
       
    94         AppUi()->RemoveFromStack( iContainer );
       
    95         }
       
    96     delete iContainer;
       
    97     delete iTestUtil;
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // CBCTestPtiEngView::Id
       
   102 // ---------------------------------------------------------------------------
       
   103 //
       
   104 TUid CBCTestPtiEngView::Id() const
       
   105     {
       
   106     return KBCTestPtiEngViewId;
       
   107     }
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // CBCTestPtiEngView::DoActivateL
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 void CBCTestPtiEngView::DoActivateL( const TVwsViewId&, TUid, const TDesC8& )
       
   114     {
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // CBCTestPtiEngView::DoDeactivate
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void CBCTestPtiEngView::DoDeactivate()
       
   122     {
       
   123     }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // CBCTestPtiEngView::HandleCommandL
       
   127 // ---------------------------------------------------------------------------
       
   128 //
       
   129 void CBCTestPtiEngView::HandleCommandL( TInt aCommand )
       
   130     {
       
   131     switch ( aCommand )
       
   132         {
       
   133         case EProgCmdAutoTest:
       
   134             iTestUtil->RunL();
       
   135             break;
       
   136         default:
       
   137             if ( aCommand > EBCTestCmdEmptyOutline &&
       
   138                  aCommand < EBCTestCmdMaxOutline )
       
   139                 {
       
   140                 iTestUtil->RunL( aCommand );
       
   141                 }
       
   142             break;
       
   143         }
       
   144     }