os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/src/MainViewview.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/src/MainViewview.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,96 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* Series 60 version of Hindi Demo application
    1.19 +* Implementation of CMainViewView
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +#include <e32std.h>
    1.25 +#include <aknviewappui.h>
    1.26 +#include <aknconsts.h>
    1.27 +
    1.28 +#include "HindiDemoappui.h"
    1.29 +#include "MainViewview.h"
    1.30 +#include "MainViewcontainer.h"
    1.31 +#include "HindiDemo.hrh"
    1.32 +#include <HindiDemo.rsg>
    1.33 +
    1.34 +const TUid EDefaultViewId = { EMainViewViewId };
    1.35 +
    1.36 +CMainViewView* CMainViewView::NewL()
    1.37 +{
    1.38 +  CMainViewView* self = CMainViewView::NewLC();
    1.39 +  CleanupStack::Pop(self);
    1.40 +  return self;
    1.41 +}
    1.42 +
    1.43 +CMainViewView* CMainViewView::NewLC()
    1.44 +{
    1.45 +  CMainViewView* self = new (ELeave) CMainViewView();
    1.46 +  CleanupStack::PushL(self);
    1.47 +  self->ConstructL();
    1.48 +  return self;
    1.49 +}
    1.50 +
    1.51 +CMainViewView::CMainViewView()
    1.52 +{
    1.53 +}
    1.54 +
    1.55 +CMainViewView::~CMainViewView()
    1.56 +{
    1.57 +}
    1.58 +
    1.59 +void CMainViewView::ConstructL()
    1.60 +{
    1.61 +  BaseConstructL(R_MAINVIEW);
    1.62 +}
    1.63 +
    1.64 +TUid CMainViewView::Id() const
    1.65 +{
    1.66 +  return EDefaultViewId;
    1.67 +}
    1.68 +
    1.69 +void CMainViewView::DoActivateL(const TVwsViewId& aPrevViewId,
    1.70 +                                   TUid aCustomMessageId,
    1.71 +                                   const TDesC8& aCustomMessage)
    1.72 +{
    1.73 +  ASSERT(iContainer == NULL);
    1.74 +  iContainer = CMainViewContainer::NewL(ClientRect());
    1.75 +  iContainer->SetMopParent(this);
    1.76 +  AppUi()->AddToStackL(*this, iContainer);
    1.77 +}
    1.78 +
    1.79 +void CMainViewView::DoDeactivate()
    1.80 +{
    1.81 +  if (iContainer)
    1.82 +  {
    1.83 +    AppUi()->RemoveFromStack(iContainer);
    1.84 +    delete iContainer;
    1.85 +    iContainer = NULL;
    1.86 +  }
    1.87 +}
    1.88 +
    1.89 +void CMainViewView::HandleCommandL(TInt aCommand)
    1.90 +{
    1.91 +  if (iContainer && iContainer->DispatchViewCommandEvents(aCommand))
    1.92 +  {
    1.93 +    return;
    1.94 +  }
    1.95 +  else
    1.96 +  {
    1.97 +    AppUi()->HandleCommandL(aCommand);
    1.98 +  }
    1.99 +}