# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274779726 -10800 # Node ID 326673dff2bfde2809cc5648586f15ef1f26dc48 # Parent 67c4a6333a5940df6d351159b35152b5990194a4 Revision: 201018 Kit: 2010121 diff -r 67c4a6333a59 -r 326673dff2bf csxhelp/HelpEngine/src/CSXHLegacyTOC1.cpp --- a/csxhelp/HelpEngine/src/CSXHLegacyTOC1.cpp Tue Apr 27 16:25:29 2010 +0300 +++ b/csxhelp/HelpEngine/src/CSXHLegacyTOC1.cpp Tue May 25 12:28:46 2010 +0300 @@ -43,7 +43,7 @@ TUid CCSXHLegacyTOC1::GetViewID() const { - return KCSXHToc2ViewID; + return KCSXHToc2AppHelpsViewID; } CCSXHHelpContentBase* CCSXHLegacyTOC1::GetContextTopic(const TDesC& aContextName) diff -r 67c4a6333a59 -r 326673dff2bf csxhelp/inc/CSXHHtmlTopicContainer.h --- a/csxhelp/inc/CSXHHtmlTopicContainer.h Tue Apr 27 16:25:29 2010 +0300 +++ b/csxhelp/inc/CSXHHtmlTopicContainer.h Tue May 25 12:28:46 2010 +0300 @@ -394,13 +394,24 @@ CCSXHHelpContentBase* GetCurrActiveObject(); private: + +/** +* The state type of browser content. +* @see SetContentLoadState() and NeedRefresh. +*/ + enum TContentLoadState + { + ENoContent, + EContentLoading, + EContentLoadFinished + }; /** - @function ConstructL - @since S60 3.2 - Perform the second phase construction of a HtmlTopicContainer object - @param aRect the rectangle this view will be drawn to - */ +* @function ConstructL +* @since S60 3.2 +* @Perform the second phase construction of a HtmlTopicContainer object +* @param aRect the rectangle this view will be drawn to + */ void ConstructL(const TRect& aRect); /** @@ -418,6 +429,18 @@ */ TBool CheckForExternalLinkL(const TDesC& aUrl); +/** +* @function SetContentLoadingState +* Set the state of content loading and refresh the UI id needed +*/ + void SetContentLoadState( const TContentLoadState aLoadState ); + +/** +* @function NeedRefresh +* Judge whether we need to refresh the browser control +*/ + TBool NeedRefresh( const TContentLoadState aNewLoadState ) const; + private: CBrCtlInterface* iBrCtrl; CCSXHHtmlTOC2* iTopic; @@ -435,6 +458,7 @@ TInt32 iPrevPageCount; TBool iBack; + TContentLoadState iContentLoading; }; diff -r 67c4a6333a59 -r 326673dff2bf csxhelp/src/CSXHHtmlTopicContainer.cpp --- a/csxhelp/src/CSXHHtmlTopicContainer.cpp Tue Apr 27 16:25:29 2010 +0300 +++ b/csxhelp/src/CSXHHtmlTopicContainer.cpp Tue May 25 12:28:46 2010 +0300 @@ -69,6 +69,7 @@ CCSXHHtmlTopicContainer::CCSXHHtmlTopicContainer(CCSXHDocument &aDocument,CCSXHHtmlTopicView *aView) : iTopic(NULL),iDocument(aDocument),iView(aView) ,iAppLauncher(NULL), iLoadHtml(EFalse), iPrevPageCount(0), iBack(EFalse) + ,iContentLoading(ENoContent) { // no implementation required @@ -165,6 +166,8 @@ void CCSXHHtmlTopicContainer::LoadHtmlL() { + iBrCtrl->MakeVisible( EFalse ); + SetContentLoadState( EContentLoading ); HBufC8 *htmlBuffer = STATIC_CAST(HBufC8*,iTopic->GetTopicContentL()); if(htmlBuffer) { @@ -272,7 +275,23 @@ { #ifndef __SERIES60_30__ if(iBrCtrl) - iBrCtrl->SetRect(Rect()); + { + if ( iContentLoading != EContentLoading ) + { + iBrCtrl->SetRect(Rect()); + iBrCtrl->MakeVisible(ETrue); + } + else + { + //Update the title bar + CEikStatusPane* sp = CCSXHAppUi::GetInstance()->StatusPane(); + CAknTitlePane* titlePane = STATIC_CAST(CAknTitlePane*, + sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle))); + titlePane->SetTextL(KNullDesC); + + iBrCtrl->SetRect(TRect(0,0,0,0)); + } + } #endif } @@ -420,6 +439,7 @@ { if(aLoadEvent == TBrCtlDefs::EEventLoadFinished) { + SetContentLoadState( EContentLoadFinished ); if ( IsVisible() ) { HBufC* title = iBrCtrl->PageInfoLC(TBrCtlDefs::EPageInfoTitle); @@ -594,3 +614,33 @@ return Result; } +void CCSXHHtmlTopicContainer::SetContentLoadState( TContentLoadState aLoadState ) + { + if ( iContentLoading == aLoadState ) + { + return; + } + else if ( NeedRefresh( aLoadState ) ) + { + iContentLoading = aLoadState; + SizeChanged(); + } + else + { + iContentLoading = aLoadState; + } + } + +TBool CCSXHHtmlTopicContainer::NeedRefresh( const TContentLoadState aNewLoadState ) const + { + if ( + ( iContentLoading == EContentLoading && aNewLoadState != EContentLoading ) + ||( iContentLoading != EContentLoading && aNewLoadState == EContentLoading ) + ) + return ETrue; + else + return EFalse; + } + +//end of the file +