browserui/browser/BrowserAppSrc/BrowserContentView.cpp
branchRCL_3
changeset 39 08ffbd51e3fd
parent 36 c9249d037530
child 40 3154c14a33db
equal deleted inserted replaced
37:25214794fad6 39:08ffbd51e3fd
   251         {
   251         {
   252         iWasContentFullScreenMode = iContentFullScreenMode;
   252         iWasContentFullScreenMode = iContentFullScreenMode;
   253         EnableFullScreenModeL( EFalse );
   253         EnableFullScreenModeL( EFalse );
   254         }
   254         }
   255 
   255 
       
   256     // resume js timers 
       
   257     ApiProvider().BrCtlInterface().HandleCommandL((TInt)TBrCtlDefs::ECommandIdBase + (TInt)TBrCtlDefs::ECommandResumeScriptTimers );
       
   258     
   256 #ifdef RD_SCALABLE_UI_V2
   259 #ifdef RD_SCALABLE_UI_V2
   257     // Close the extended toolbar whenever any item on it is selected
   260     // Close the extended toolbar whenever any item on it is selected
   258     if ( iPenEnabled && Toolbar()->ToolbarExtension()->IsShown() )
   261     if ( iPenEnabled && Toolbar()->ToolbarExtension()->IsShown() )
   259         {
   262         {
   260         Toolbar()->ToolbarExtension()->SetShown( EFalse );
   263         Toolbar()->ToolbarExtension()->SetShown( EFalse );
   346                 eikCba->EnableItemSpecificSoftkey( EFalse );
   349                 eikCba->EnableItemSpecificSoftkey( EFalse );
   347                 }
   350                 }
   348 #endif  
   351 #endif  
   349 			iContainer->GotoPane()->SetGotoPaneActiveL();
   352 			iContainer->GotoPane()->SetGotoPaneActiveL();
   350             LaunchGotoAddressEditorL();
   353             LaunchGotoAddressEditorL();
       
   354             
       
   355             // pause js timer to allow quicke vkb response
       
   356             ApiProvider().BrCtlInterface().HandleCommandL((TInt)TBrCtlDefs::ECommandIdBase + (TInt)TBrCtlDefs::ECommandPauseScriptTimers );
   351             break;
   357             break;
   352             }
   358             }
   353 
   359 
   354         case EWmlCmdGotoPaneCancel:
   360         case EWmlCmdGotoPaneCancel:
   355             {
   361             {
  1067             UpdateTitleL(ApiProvider());
  1073             UpdateTitleL(ApiProvider());
  1068             ApiProvider().Display().RestoreTitleL();
  1074             ApiProvider().Display().RestoreTitleL();
  1069             StatusPane()->ApplyCurrentSettingsL();
  1075             StatusPane()->ApplyCurrentSettingsL();
  1070             if ( resIdChanged || sizeChangedCba || sizeChangedSP  )
  1076             if ( resIdChanged || sizeChangedCba || sizeChangedSP  )
  1071                 {
  1077                 {
  1072                 iContainer->SetRect( ClientRect() );
  1078                 
  1073                 }
  1079                 SetContentContainerRect();
  1074             }
  1080                 }
  1075         }
  1081             }
       
  1082         }
       
  1083     }
       
  1084 
       
  1085 TRect CBrowserContentView::ResizeClientRect()
       
  1086     {
       
  1087     TRect clientRect = ClientRect();
       
  1088         
       
  1089     if (Layout_Meta_Data::IsLandscapeOrientation() &&
       
  1090          StatusPane()->IsVisible() && !Cba()->IsVisible())
       
  1091         {
       
  1092         TRect screenRect;
       
  1093         AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, screenRect);
       
  1094         clientRect.iBr.iY = screenRect.iBr.iY;
       
  1095     
       
  1096         }
       
  1097     
       
  1098     return clientRect;
       
  1099     }
       
  1100 
       
  1101 void CBrowserContentView::SetContentContainerRect()
       
  1102     {
       
  1103     TRect clientRect = ResizeClientRect();
       
  1104     iContainer->SetRect(clientRect);
  1076     }
  1105     }
  1077 
  1106 
  1078 // -----------------------------------------------------------------------------
  1107 // -----------------------------------------------------------------------------
  1079 // CBrowserContentView::SetFullScreenOffL
  1108 // CBrowserContentView::SetFullScreenOffL
  1080 // -----------------------------------------------------------------------------
  1109 // -----------------------------------------------------------------------------
  1273                                             CEikMenuPane* aMenuPane )
  1302                                             CEikMenuPane* aMenuPane )
  1274     {
  1303     {
  1275     LOG_ENTERFN("CBrowserContentView::DynInitMenuPaneL");
  1304     LOG_ENTERFN("CBrowserContentView::DynInitMenuPaneL");
  1276     __ASSERT_DEBUG(aMenuPane, Util::Panic(Util::EUninitializedData));
  1305     __ASSERT_DEBUG(aMenuPane, Util::Panic(Util::EUninitializedData));
  1277 
  1306 
       
  1307     // pasue js timers
       
  1308     ApiProvider().BrCtlInterface().HandleCommandL((TInt)TBrCtlDefs::ECommandIdBase + (TInt)TBrCtlDefs::ECommandPauseScriptTimers );
       
  1309     
  1278     if ( aResourceId == R_MENU_PANE )
  1310     if ( aResourceId == R_MENU_PANE )
  1279         {
  1311         {
  1280         // web feeds
  1312         // web feeds
  1281         #ifndef __RSS_FEEDS
  1313         #ifndef __RSS_FEEDS
  1282         aMenuPane->SetItemDimmed( EWmlCmdShowSubscribeList, ETrue );
  1314         aMenuPane->SetItemDimmed( EWmlCmdShowSubscribeList, ETrue );
  1762             TBrCtlDefs::EPageInfoUrl );
  1794             TBrCtlDefs::EPageInfoUrl );
  1763     if ( url && url->Length() )
  1795     if ( url && url->Length() )
  1764        {
  1796        {
  1765             iContainer->GotoPane()->SetTextL(*url);
  1797             iContainer->GotoPane()->SetTextL(*url);
  1766             iContainer->GotoPane()->SelectAllL();
  1798             iContainer->GotoPane()->SelectAllL();
  1767             CleanupStack::PopAndDestroy(); // url
       
  1768        }
  1799        }
  1769     else
  1800     else
  1770         {
  1801         {
  1771             // nor url; use default name.
  1802             // nor url; use default name.
  1772             // set "http://www." per Browser UI spec
  1803             // set "http://www." per Browser UI spec
  1773             iContainer->GotoPane()->SetTextL(KWWWString  );
  1804             iContainer->GotoPane()->SetTextL(KWWWString  );
  1774         }
  1805         }
       
  1806     CleanupStack::PopAndDestroy(); // url
  1775     iContainer->GotoPane()->SetFocus( ETrue );
  1807     iContainer->GotoPane()->SetFocus( ETrue );
  1776     UpdateCbaL();
  1808     UpdateCbaL();
  1777 
  1809 
  1778     if (iPenEnabled)
  1810     if (iPenEnabled)
  1779         {
  1811         {
  2209 //  CBrowserContentView::HandleStatusPaneSizeChange
  2241 //  CBrowserContentView::HandleStatusPaneSizeChange
  2210 // ---------------------------------------------------------------------------
  2242 // ---------------------------------------------------------------------------
  2211 //
  2243 //
  2212 void CBrowserContentView::HandleStatusPaneSizeChange()
  2244 void CBrowserContentView::HandleStatusPaneSizeChange()
  2213     {
  2245     {
  2214     iContainer->SetRect(ClientRect());
  2246     SetContentContainerRect();
  2215     }
  2247     }
  2216 
  2248 
  2217 // ---------------------------------------------------------------------------
  2249 // ---------------------------------------------------------------------------
  2218 // CBrowserContentView::StateChanged
  2250 // CBrowserContentView::StateChanged
  2219 // ---------------------------------------------------------------------------
  2251 // ---------------------------------------------------------------------------
  2400 void CBrowserContentView::HandleCommandL(
  2432 void CBrowserContentView::HandleCommandL(
  2401     TBrCtlDefs::TBrCtlClientCommands aCommand,
  2433     TBrCtlDefs::TBrCtlClientCommands aCommand,
  2402     const CArrayFix<TPtrC>& /*aAttributesNames*/,
  2434     const CArrayFix<TPtrC>& /*aAttributesNames*/,
  2403     const CArrayFix<TPtrC>& aAttributeValues)
  2435     const CArrayFix<TPtrC>& aAttributeValues)
  2404     {
  2436     {
       
  2437     
       
  2438     // resume js timers
       
  2439     ApiProvider().BrCtlInterface().HandleCommandL((TInt)TBrCtlDefs::ECommandIdBase + (TInt)TBrCtlDefs::ECommandResumeScriptTimers );
       
  2440     
  2405     switch(aCommand)
  2441     switch(aCommand)
  2406         {
  2442         {
  2407         case TBrCtlDefs::EClientCommandLaunchFindKeyword:
  2443         case TBrCtlDefs::EClientCommandLaunchFindKeyword:
  2408             {
  2444             {
  2409             // Find Keyword not initiated from options menu so don't set menupane to visible.
  2445             // Find Keyword not initiated from options menu so don't set menupane to visible.
  3166     }
  3202     }
  3167     iContentFullScreenMode = ETrue;
  3203     iContentFullScreenMode = ETrue;
  3168     UpdateFullScreenL();
  3204     UpdateFullScreenL();
  3169   }
  3205   }
  3170   else {
  3206   else {
       
  3207         TInt command( KErrNotFound );
       
  3208         command = TBrCtlDefs::ECommandLeaveFullscreenBrowsing;
       
  3209         ApiProvider().BrCtlInterface().HandleCommandL(
       
  3210             command + (TInt)TBrCtlDefs::ECommandIdBase );
  3171     TRAP_IGNORE(AppUi()->SetOrientationL(iOrientation));
  3211     TRAP_IGNORE(AppUi()->SetOrientationL(iOrientation));
  3172     if (iPenEnabled) {
  3212     if (iPenEnabled) {
  3173       Toolbar()->SetToolbarVisibility( ETrue, EFalse );
  3213       Toolbar()->SetToolbarVisibility( ETrue, EFalse );
  3174     }
  3214     }
  3175     iContentFullScreenMode = EFalse;
  3215     iContentFullScreenMode = EFalse;
  3176     SetFullScreenOffL();
  3216     SetFullScreenOffL();
       
  3217         if (iPenEnabled)
       
  3218            {
       
  3219            StartAutoFullScreenIdleTimer();
  3177   }
  3220   }
  3178 
  3221         }
  3179 }
  3222 }
  3180 
  3223 
  3181 // -----------------------------------------------------------------------------
  3224 // -----------------------------------------------------------------------------
  3182 // CBrowserContentView::ShowFsStatusPane
  3225 // CBrowserContentView::ShowFsStatusPane
  3183 // -----------------------------------------------------------------------------
  3226 // -----------------------------------------------------------------------------
  3190 #ifdef RD_SCALABLE_UI_V2
  3233 #ifdef RD_SCALABLE_UI_V2
  3191         if ( Layout_Meta_Data::IsLandscapeOrientation() )
  3234         if ( Layout_Meta_Data::IsLandscapeOrientation() )
  3192            StatusPane()->SwitchLayoutL(R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS);
  3235            StatusPane()->SwitchLayoutL(R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT_NO_SOFTKEYS);
  3193 #endif
  3236 #endif
  3194         StatusPane()->MakeVisible( ETrue );
  3237         StatusPane()->MakeVisible( ETrue );
  3195         iContainer->SetRect(ClientRect());
  3238         
       
  3239         SetContentContainerRect();
       
  3240         
  3196         // Remove any timer that has already been set
  3241         // Remove any timer that has already been set
  3197         if ( iPeriodic )
  3242         if ( iPeriodic )
  3198             {
  3243             {
  3199             iPeriodic->Cancel();
  3244             iPeriodic->Cancel();
  3200             }
  3245             }
  3229     {
  3274     {
  3230     iPeriodic->Cancel();
  3275     iPeriodic->Cancel();
  3231     if (iContentFullScreenMode && ApiProvider().LastActiveViewId() == KUidBrowserContentViewId )
  3276     if (iContentFullScreenMode && ApiProvider().LastActiveViewId() == KUidBrowserContentViewId )
  3232         {
  3277         {
  3233         StatusPane()->MakeVisible( EFalse );
  3278         StatusPane()->MakeVisible( EFalse );
  3234         iContainer->SetRect(ClientRect());
  3279         
       
  3280         SetContentContainerRect();
  3235         }
  3281         }
  3236     }
  3282     }
  3237 // -----------------------------------------------------------------------------
  3283 // -----------------------------------------------------------------------------
  3238 // CBrowserContentView::StartAutoFullScreenTimer
  3284 // CBrowserContentView::StartAutoFullScreenTimer
  3239 // -----------------------------------------------------------------------------
  3285 // -----------------------------------------------------------------------------