examples/sfexamples/Wikipedia/src/BrowserView.cpp

00001 // 
00002 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00003 // All rights reserved.
00004 // This component and the accompanying materials are made available
00005 // under the terms of the License "Eclipse Public License v1.0"
00006 // which accompanies this distribution, and is available
00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00008 // 
00009 // Initial Contributors:
00010 // Nokia Corporation - initial contribution.
00011 // 
00012 // Contributors:
00013 // 
00014 // Description:
00015 // 
00016 
00017 
00018 // INCLUDE FILES
00019 #include "BrowserView.h"
00020 #include "AboutContainer.h"
00021 #include "DetailContainer.h"
00022 #include <aknviewappui.h>
00023 #include <aknconsts.h>
00024 #include <aknnotewrappers.h>
00025 #include <SqlSrvDemo.rsg>
00026 #include "SqlSrvDemo.hrh"
00027 //#include <stringloader.h>
00028 
00029 // ========================= MEMBER FUNCTIONS ==================================
00030 
00031 // -----------------------------------------------------------------------------
00032 // CBrowserView::Id()
00033 // Returns View's ID.
00034 // -----------------------------------------------------------------------------
00035 //
00036 TUid CBrowserView::Id() const
00037     {
00038     return iIdentifier;
00039     }
00040 
00041 // -----------------------------------------------------------------------------
00042 // CBrowserView::HandleCommandL()
00043 // Takes care of Command handling.
00044 // -----------------------------------------------------------------------------
00045 //
00046 void CBrowserView::HandleCommandL( TInt aCommand )
00047     {
00048     switch ( aCommand )
00049             {
00050             case EAknSoftkeyBack:
00051                 AppUi()->ActivateLocalViewL( TUid::Uid( ESearchViewId ) );
00052                 break;
00053                 
00054             default:
00055                 AppUi()->HandleCommandL( aCommand );    
00056                 break;
00057             }
00058     }
00059 
00060 // -----------------------------------------------------------------------------
00061 // CBrowserView::HandleSizeChange()
00062 // Called by HandleResourceChangeL() from CSqlSrvDemoAppUi when layout is 
00063 // changed.
00064 // -----------------------------------------------------------------------------
00065 //
00066 void CBrowserView::HandleSizeChange( TInt aType )
00067     {
00068     if( iContainer )
00069         {
00070         iContainer->HandleResourceChange( aType );
00071         
00072         if ( aType==KEikDynamicLayoutVariantSwitch )
00073             {        
00074             TRect rect;
00075             AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
00076             iContainer->SetRect(rect);
00077             }
00078         }         
00079     }
00080 
00081 
00082 // -----------------------------------------------------------------------------
00083 // CBrowserView::DynInitMenuPaneL()
00084 // Dynamically initialises a menu pane
00085 // -----------------------------------------------------------------------------
00086 //
00087 void CBrowserView::DynInitMenuPaneL( TInt /* aResourceId */, CEikMenuPane* /* aMenuPane */ )
00088         {
00089         // No implementation necessary
00090         }
00091 
00092 // -----------------------------------------------------------------------------
00093 // CBrowserView::DoActivateL()
00094 // Activate a CBrowserView
00095 // -----------------------------------------------------------------------------
00096 //
00097 void CBrowserView::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
00098                                     TUid /*aCustomMessageId*/,
00099                                     const TDesC8& /*aCustomMessage*/ )
00100     {
00101    ConstructContainerL();
00102    AppUi()->AddToStackL( iContainer );    
00103     }
00104 
00105 // -----------------------------------------------------------------------------
00106 // CBrowserView::DoDeactivate()
00107 // DeActivate a CBrowserView
00108 // -----------------------------------------------------------------------------
00109 //
00110 void CBrowserView::DoDeactivate()
00111     {
00112     if ( iContainer )
00113         {
00114         AppUi()->RemoveFromStack( iContainer );
00115         delete iContainer;
00116         iContainer = NULL;
00117         }
00118     }

Generated by  doxygen 1.6.2