|         |      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 the License "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 *      Implementation of CBrowserInitialView. | 
|         |     16 * | 
|         |     17 * | 
|         |     18 */ | 
|         |     19  | 
|         |     20  | 
|         |     21 // INCLUDE FILES | 
|         |     22 #include <avkon.hrh> | 
|         |     23 #include <BrowserNG.rsg> | 
|         |     24 #include <FeatMgr.h> | 
|         |     25 #include <ApUtils.h> | 
|         |     26 #include "BrowserInitialView.h" | 
|         |     27 #include "BrowserInitialContainer.h" | 
|         |     28 #include "BrowserBookmarksView.h" | 
|         |     29 #include "BrowserAppUi.h" | 
|         |     30 #include "CommonConstants.h" | 
|         |     31 #include "Browser.hrh" | 
|         |     32  | 
|         |     33 // ================= MEMBER FUNCTIONS ======================= | 
|         |     34  | 
|         |     35 // ---------------------------------------------------------------------------- | 
|         |     36 // CBrowserInitialView::NewLC | 
|         |     37 // ---------------------------------------------------------------------------- | 
|         |     38 // | 
|         |     39 CBrowserInitialView* CBrowserInitialView::NewLC( MApiProvider& aApiProvider) | 
|         |     40     { | 
|         |     41     CBrowserInitialView* view = new (ELeave) CBrowserInitialView( aApiProvider ); | 
|         |     42     CleanupStack::PushL( view ); | 
|         |     43     view->ConstructL( ); | 
|         |     44     return view; | 
|         |     45     } | 
|         |     46  | 
|         |     47 // --------------------------------------------------------- | 
|         |     48 // CBrowserInitialView::ConstructL(const TRect& aRect) | 
|         |     49 // --------------------------------------------------------- | 
|         |     50 // | 
|         |     51 void CBrowserInitialView::ConstructL() | 
|         |     52     { | 
|         |     53     BaseConstructL( R_BROWSERINITIAL_VIEW ); | 
|         |     54     } | 
|         |     55  | 
|         |     56 // --------------------------------------------------------- | 
|         |     57 // CBrowserInitialView::CBrowserInitialView() | 
|         |     58 // --------------------------------------------------------- | 
|         |     59 // | 
|         |     60 CBrowserInitialView::CBrowserInitialView( MApiProvider& aApiProvider ): | 
|         |     61 CBrowserViewBase( aApiProvider ) | 
|         |     62     { | 
|         |     63     } | 
|         |     64  | 
|         |     65 // --------------------------------------------------------- | 
|         |     66 // CBrowserInitialView::~CBrowserInitialView() | 
|         |     67 // destructor | 
|         |     68 // --------------------------------------------------------- | 
|         |     69 // | 
|         |     70 CBrowserInitialView::~CBrowserInitialView() | 
|         |     71     { | 
|         |     72     if ( iContainer ) | 
|         |     73         { | 
|         |     74         AppUi()->RemoveFromViewStack( *this, iContainer ); | 
|         |     75         } | 
|         |     76  | 
|         |     77     delete iContainer; | 
|         |     78     delete iEnteredURL; | 
|         |     79     } | 
|         |     80  | 
|         |     81 // --------------------------------------------------------- | 
|         |     82 // TUid CBrowserInitialView::Id() | 
|         |     83 // --------------------------------------------------------- | 
|         |     84 // | 
|         |     85 TUid CBrowserInitialView::Id() const | 
|         |     86     { | 
|         |     87     return KUidBrowserInitialViewId; | 
|         |     88     } | 
|         |     89  | 
|         |     90 // --------------------------------------------------------- | 
|         |     91 // CBrowserInitialView::HandleCommandL | 
|         |     92 // --------------------------------------------------------- | 
|         |     93 // | 
|         |     94 void CBrowserInitialView::HandleCommandL(TInt aCommand) | 
|         |     95     { | 
|         |     96     AppUi()->HandleCommandL( aCommand ); | 
|         |     97     } | 
|         |     98  | 
|         |     99 // --------------------------------------------------------- | 
|         |    100 // CBrowserInitialView::HandleClientRectChange() | 
|         |    101 // --------------------------------------------------------- | 
|         |    102 // | 
|         |    103 void CBrowserInitialView::HandleClientRectChange() | 
|         |    104     { | 
|         |    105     if ( iContainer ) | 
|         |    106         { | 
|         |    107         iContainer->SetRect( ClientRect() ); | 
|         |    108         } | 
|         |    109     } | 
|         |    110  | 
|         |    111 // --------------------------------------------------------------------------- | 
|         |    112 // CBrowserInitialView::CommandSetResourceIdL | 
|         |    113 // --------------------------------------------------------------------------- | 
|         |    114 TInt CBrowserInitialView::CommandSetResourceIdL() | 
|         |    115     { | 
|         |    116     return R_BROWSERINITIAL_CBA_OPTIONS_EXIT; | 
|         |    117     } | 
|         |    118  | 
|         |    119 // --------------------------------------------------------- | 
|         |    120 // CBrowserInitialView::DoActivateL | 
|         |    121 // --------------------------------------------------------- | 
|         |    122 // | 
|         |    123 void CBrowserInitialView::DoActivateL( const TVwsViewId& /*aPrevViewId*/, | 
|         |    124                                        TUid /*aCustomMessageId*/, | 
|         |    125                                        const TDesC8& /*aCustomMessage*/ ) | 
|         |    126     { | 
|         |    127     iPreviousViewID = ApiProvider().LastActiveViewId(); | 
|         |    128  	ApiProvider().SetLastActiveViewId( Id() ); | 
|         |    129     if (!iContainer) | 
|         |    130         { | 
|         |    131         iContainer = new (ELeave) CBrowserInitialContainer( this ); | 
|         |    132         iContainer->SetMopParent(this); | 
|         |    133         iContainer->ConstructL( ClientRect() ); | 
|         |    134         AppUi()->AddToViewStackL( *this, iContainer ); | 
|         |    135         iContainer->GotoPane()->SetGPObserver( this ); | 
|         |    136         } | 
|         |    137     UpdateCbaL(); | 
|         |    138    } | 
|         |    139  | 
|         |    140 // --------------------------------------------------------- | 
|         |    141 // CBrowserInitialView::DynInitMenuPaneL | 
|         |    142 // --------------------------------------------------------- | 
|         |    143 // | 
|         |    144 void CBrowserInitialView::DynInitMenuPaneL( TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/ ) | 
|         |    145     { | 
|         |    146     } | 
|         |    147  | 
|         |    148 // --------------------------------------------------------- | 
|         |    149 // CBrowserInitialView::DoDeactivate() | 
|         |    150 // --------------------------------------------------------- | 
|         |    151 // | 
|         |    152 void CBrowserInitialView::DoDeactivate() | 
|         |    153     { | 
|         |    154     if ( iContainer ) | 
|         |    155         { | 
|         |    156         AppUi()->RemoveFromViewStack( *this, iContainer ); | 
|         |    157         } | 
|         |    158  | 
|         |    159     delete iContainer; | 
|         |    160     iContainer = NULL; | 
|         |    161     } | 
|         |    162  | 
|         |    163 // --------------------------------------------------------- | 
|         |    164 // CBrowserInitialView::LaunchGotoAddressEditorL | 
|         |    165 // --------------------------------------------------------- | 
|         |    166 // | 
|         |    167 void CBrowserInitialView::LaunchGotoAddressEditorL() | 
|         |    168     { | 
|         |    169     } | 
|         |    170  | 
|         |    171 void CBrowserInitialView::HandleGotoPaneEventL( CBrowserGotoPane* /*aGotoPane*/, TEvent /*aEvent*/ ) | 
|         |    172     { | 
|         |    173     // | 
|         |    174     } | 
|         |    175  | 
|         |    176 // --------------------------------------------------------- | 
|         |    177 // CBrowserInitialView::GotoUrlInGotoPaneL | 
|         |    178 // --------------------------------------------------------- | 
|         |    179 // | 
|         |    180 void CBrowserInitialView::GotoUrlInGotoPaneL() | 
|         |    181     { | 
|         |    182     } | 
|         |    183  | 
|         |    184 // --------------------------------------------------------- | 
|         |    185 // CBrowserInitialView::UpdateGotoPaneL | 
|         |    186 // --------------------------------------------------------- | 
|         |    187 // | 
|         |    188 void CBrowserInitialView::UpdateGotoPaneL() | 
|         |    189     { | 
|         |    190     } | 
|         |    191 // End of File |