os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/src/MainViewview.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2005-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: 
    15 * Series 60 version of Hindi Demo application
    16 * Implementation of CMainViewView
    17 *
    18 */
    19 
    20 
    21 #include <e32std.h>
    22 #include <aknviewappui.h>
    23 #include <aknconsts.h>
    24 
    25 #include "HindiDemoappui.h"
    26 #include "MainViewview.h"
    27 #include "MainViewcontainer.h"
    28 #include "HindiDemo.hrh"
    29 #include <HindiDemo.rsg>
    30 
    31 const TUid EDefaultViewId = { EMainViewViewId };
    32 
    33 CMainViewView* CMainViewView::NewL()
    34 {
    35   CMainViewView* self = CMainViewView::NewLC();
    36   CleanupStack::Pop(self);
    37   return self;
    38 }
    39 
    40 CMainViewView* CMainViewView::NewLC()
    41 {
    42   CMainViewView* self = new (ELeave) CMainViewView();
    43   CleanupStack::PushL(self);
    44   self->ConstructL();
    45   return self;
    46 }
    47 
    48 CMainViewView::CMainViewView()
    49 {
    50 }
    51 
    52 CMainViewView::~CMainViewView()
    53 {
    54 }
    55 
    56 void CMainViewView::ConstructL()
    57 {
    58   BaseConstructL(R_MAINVIEW);
    59 }
    60 
    61 TUid CMainViewView::Id() const
    62 {
    63   return EDefaultViewId;
    64 }
    65 
    66 void CMainViewView::DoActivateL(const TVwsViewId& aPrevViewId,
    67                                    TUid aCustomMessageId,
    68                                    const TDesC8& aCustomMessage)
    69 {
    70   ASSERT(iContainer == NULL);
    71   iContainer = CMainViewContainer::NewL(ClientRect());
    72   iContainer->SetMopParent(this);
    73   AppUi()->AddToStackL(*this, iContainer);
    74 }
    75 
    76 void CMainViewView::DoDeactivate()
    77 {
    78   if (iContainer)
    79   {
    80     AppUi()->RemoveFromStack(iContainer);
    81     delete iContainer;
    82     iContainer = NULL;
    83   }
    84 }
    85 
    86 void CMainViewView::HandleCommandL(TInt aCommand)
    87 {
    88   if (iContainer && iContainer->DispatchViewCommandEvents(aCommand))
    89   {
    90     return;
    91   }
    92   else
    93   {
    94     AppUi()->HandleCommandL(aCommand);
    95   }
    96 }