os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/src/HindiDemoview.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 CHindiDemoView
    17 *
    18 */
    19 
    20 
    21 #include <e32std.h>
    22 #include <aknviewappui.h>
    23 #include <aknconsts.h>
    24 
    25 #include "HindiDemoappui.h"
    26 #include "HindiDemoview.h"
    27 #include "HindiDemocontainer.h"
    28 #include "HindiDemo.hrh"
    29 #include <HindiDemo.rsg>
    30 
    31 const TUid EDefaultViewId = { EHindiDemoViewId };
    32 
    33 CHindiDemoView* CHindiDemoView::NewL()
    34 {
    35   CHindiDemoView* self = CHindiDemoView::NewLC();
    36   CleanupStack::Pop(self);
    37   return self;
    38 }
    39 
    40 CHindiDemoView* CHindiDemoView::NewLC()
    41 {
    42   CHindiDemoView* self = new (ELeave) CHindiDemoView();
    43   CleanupStack::PushL(self);
    44   self->ConstructL();
    45   return self;
    46 }
    47 
    48 CHindiDemoView::CHindiDemoView()
    49 {
    50 }
    51 
    52 CHindiDemoView::~CHindiDemoView()
    53 {
    54 }
    55 
    56 void CHindiDemoView::ConstructL()
    57 {
    58   BaseConstructL(R_HINDIDEMO);
    59 }
    60 
    61 TUid CHindiDemoView::Id() const
    62 {
    63   return EDefaultViewId;
    64 }
    65 
    66 void CHindiDemoView::DoActivateL(const TVwsViewId& aPrevViewId,
    67                                    TUid aCustomMessageId,
    68                                    const TDesC8& aCustomMessage)
    69 {
    70   ASSERT(iContainer == NULL);
    71   iContainer = new (ELeave) CHindiDemoContainer;
    72   iContainer->InitComponentsL();
    73   iContainer->SetMopParent(this);
    74   iContainer->ConstructFromResourceL(R_HINDIDEMO_SETTINGITEMLIST);
    75   AppUi()->AddToStackL(*this, iContainer);
    76   iContainer->SetRect(ClientRect());
    77   iContainer->ActivateL();
    78 }
    79 
    80 void CHindiDemoView::DoDeactivate()
    81 {
    82   if (iContainer)
    83   {
    84     AppUi()->RemoveFromStack(iContainer);
    85     delete iContainer;
    86     iContainer = NULL;
    87   }
    88 }
    89 
    90 void CHindiDemoView::HandleCommandL(TInt aCommand)
    91 {
    92   if (iContainer && iContainer->DispatchViewCommandEvents(aCommand))
    93   {
    94     return;
    95   }
    96   else
    97   {
    98     AppUi()->HandleCommandL(aCommand);
    99   }
   100 }