classicui_pub/tsrc/bc/apps/S60_SDK3.1/bctestmisc/src/bctestmiscview.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     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 #include <bctestmisc.rsg>
       
    28 
       
    29 #include "bctestmisc.hrh"
       
    30 #include "bctestmiscview.h"
       
    31 #include "bctestmisccontainer.h"
       
    32 #include "bctestutil.h"
       
    33 
       
    34 
       
    35 // ======== MEMBER FUNCTIONS ========
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // Symbian 2nd static Constructor
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 CBCTestMiscView* CBCTestMiscView::NewL(CBCTestUtil* aUtil)
       
    42     {
       
    43     CBCTestMiscView* self = new( ELeave ) CBCTestMiscView();
       
    44     CleanupStack::PushL( self );
       
    45     self->ConstructL(aUtil);
       
    46     CleanupStack::Pop( self );
       
    47     return self;
       
    48     }
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // C++ default Constructor
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 CBCTestMiscView::CBCTestMiscView()
       
    55     {
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 // Symbian 2nd Constructor
       
    60 // ---------------------------------------------------------------------------
       
    61 //
       
    62 void CBCTestMiscView::ConstructL(CBCTestUtil* aUtil)
       
    63     {
       
    64     BaseConstructL( R_BCTESTMISC_VIEW );
       
    65 
       
    66     iContainer = new( ELeave ) CBCTestMiscContainer();
       
    67     iContainer->SetMopParent( this );
       
    68     iContainer->ConstructL( ClientRect() );
       
    69     AppUi()->AddToStackL( *this, iContainer );
       
    70     iContainer->MakeVisible( ETrue );
       
    71 
       
    72     iTestUtil = aUtil;
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // Destructor
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 CBCTestMiscView::~CBCTestMiscView()
       
    80     {
       
    81     if ( iContainer )
       
    82         {
       
    83         AppUi()->RemoveFromStack( iContainer );
       
    84         }
       
    85     delete iContainer;
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------------------------
       
    89 // CBCTestMiscView::Id
       
    90 // ---------------------------------------------------------------------------
       
    91 //
       
    92 TUid CBCTestMiscView::Id() const
       
    93     {
       
    94     return KBCTestMiscViewId;
       
    95     }
       
    96 
       
    97 // ---------------------------------------------------------------------------
       
    98 // CBCTestMiscView::DoActivateL
       
    99 // ---------------------------------------------------------------------------
       
   100 //
       
   101 void CBCTestMiscView::DoActivateL( const TVwsViewId&, TUid, const TDesC8& )
       
   102     {
       
   103     }
       
   104 
       
   105 // ---------------------------------------------------------------------------
       
   106 // CBCTestMiscView::DoDeactivate
       
   107 // ---------------------------------------------------------------------------
       
   108 //
       
   109 void CBCTestMiscView::DoDeactivate()
       
   110     {
       
   111     }
       
   112 
       
   113 // ---------------------------------------------------------------------------
       
   114 // CBCTestMiscView::Container
       
   115 // ---------------------------------------------------------------------------
       
   116 //
       
   117 CBCTestMiscContainer* CBCTestMiscView::Container()
       
   118     {
       
   119 	return iContainer;
       
   120     }
       
   121 
       
   122 // ---------------------------------------------------------------------------
       
   123 // CBCTestMiscView::HandleCommandL
       
   124 // ---------------------------------------------------------------------------
       
   125 //
       
   126 void CBCTestMiscView::HandleCommandL( TInt aCommand )
       
   127     {
       
   128     switch ( aCommand )
       
   129         {
       
   130         case EProgCmdAutoTest:
       
   131             iTestUtil->RunL();
       
   132             break;
       
   133         default:
       
   134             if ( aCommand > EBCTestCmdEmptyOutline &&
       
   135                  aCommand < EBCTestCmdMaxOutline )
       
   136                 {
       
   137                 iTestUtil->RunL( aCommand );
       
   138                 }
       
   139             break;
       
   140         }
       
   141     }