mapnavproviderrefapp/src/mnrpappview.cpp
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     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:  CMnrpAppView class implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "mnrp.hrh"
       
    20 #include "mnrpappui.h"
       
    21 #include "mnrpappcontrol.h"
       
    22 #include "mnrpappview.h"
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 CMnrpAppView::CMnrpAppView()
       
    30     {
       
    31     }
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 CMnrpAppView::~CMnrpAppView()
       
    37     {
       
    38     delete iControl;
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CMnrpAppView* CMnrpAppView::NewL()
       
    45     {
       
    46     CMnrpAppView* self = new ( ELeave ) CMnrpAppView();
       
    47     CleanupStack::PushL( self );
       
    48     self->ConstructL();
       
    49     CleanupStack::Pop( self );
       
    50     return self;
       
    51     }
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 void CMnrpAppView::ConstructL()
       
    57     {
       
    58     BaseConstructL();
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 TUid CMnrpAppView::Id() const
       
    65     {
       
    66     return TUid::Uid( EMnrpAppViewId );
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 void CMnrpAppView::DoActivateL(
       
    73     const TVwsViewId& /*aPrevViewId*/,
       
    74     TUid /* aCustomMessageId */,
       
    75     const TDesC8& /* aCustomMessage */)
       
    76     {
       
    77     if ( !iControl )
       
    78         {
       
    79         iControl = CMnrpAppControl::NewL( *this, ClientRect() );
       
    80         iControl->SetMopParent( this );
       
    81         }
       
    82 
       
    83     // Enable receiving of keyboard events.
       
    84     CMnrpAppUi* ui = ( CMnrpAppUi* ) AppUi();
       
    85     ui->AddToStackL( *this, iControl );
       
    86 
       
    87     _LIT( KEmpty, "" );
       
    88     ui->SetNaviPaneTitleL( KEmpty );
       
    89 
       
    90     // Make view visible.
       
    91     iControl->MakeVisible( ETrue );
       
    92     }
       
    93 
       
    94 // -----------------------------------------------------------------------------
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97 void CMnrpAppView::DoDeactivate()
       
    98     {
       
    99     if ( iControl )
       
   100         {
       
   101         // Hide view.
       
   102         iControl->MakeVisible( EFalse );
       
   103 
       
   104         // Disable receiving keyboard events.
       
   105         AppUi()->RemoveFromStack( iControl );
       
   106         }
       
   107     }