MainForm::MainForm(void)
{
__isLongPressedDone = false;
+ __pHistory = null;
__pAddressbar = null;
// __pMostVisitedSitesPanel = null;
__pMostVisitedListView = null;
{
__pAddressbar->SetAddressbarEventListener(null);
}
+
+ if(__pHistory != null)
+ {
+ delete __pHistory;
+ __pHistory = null;
+ }
+
if (__pReaderData != null)
{
delete __pReaderData;
return r;
}
__pAddressbar->SetAddressbarEventListener(this);
- AddControl(*__pAddressbar);
+ AddControl(__pAddressbar);
__pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight()));
SetControlAlwaysOnTop(*__pAddressbar, true);
__adressPanelPosition = __pAddressbar->GetPosition();
__pArticleReaderLabel = new Label();
__pArticleReaderLabel->Construct(Rectangle(__pArticleReaderPanel->GetX(),__pArticleReaderPanel->GetY(),__pArticleReaderPanel->GetWidth(),__pArticleReaderPanel->GetHeight()),L"");
- __pBlankPanel->AddControl(*__pArticleReaderLabel);
- __pBlankPanel->AddControl(*__pArticleReaderPanel);
- AddControl(*__pBlankPanel);
+ __pBlankPanel->AddControl(__pArticleReaderLabel);
+ __pBlankPanel->AddControl(__pArticleReaderPanel);
+ AddControl(__pBlankPanel);
__pBlankPanel->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height);
__pArticleReaderPanel->SetBounds((GetClientAreaBounds().width - __pArticleReaderPanel->GetWidth())/2,(GetClientAreaBounds().height - __pArticleReaderPanel->GetHeight())/2, __pArticleReaderPanel->GetWidth(), __pArticleReaderPanel->GetHeight());
__pArticleReaderLabel->SetBounds(__pArticleReaderPanel->GetX(),__pArticleReaderPanel->GetY(),__pArticleReaderPanel->GetWidth(),__pArticleReaderPanel->GetHeight());
- __pArticleReaderPanel->AddControl(*__pWebReader);
+ __pArticleReaderPanel->AddControl(__pWebReader);
__pWebReader->SetBounds(Rectangle(2,2, __pArticleReaderPanel->GetWidth()-2,__pArticleReaderPanel->GetHeight() - 96 -2));
Bitmap* pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_popup_bg.9.png",__pArticleReaderPanel->GetWidth(),__pArticleReaderPanel->GetHeight());
Bitmap* pSrcBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_popup_bottom_bg.9.png",__pArticleReaderPanel->GetWidth(),__pArticleReaderPanel->GetHeight());
}
else
{
- r = AddControl(*__pWebViewer);
+ r = AddControl(__pWebViewer);
if (IsFailed(r))
{
AppLogException("There is some problem in the xml file. Please check.");
return E_FAILURE;
}
- AddControl(*__pFindWordControl);
+ AddControl(__pFindWordControl);
__pFindWordControl->SetBounds(0,0, __pFindWordControl->GetWidth(), __pFindWordControl->GetHeight());
SetControlAlwaysOnTop(*__pFindWordControl,true);
__pFindWordControl->SetShowState(false);
{
//__pArticleReaderPanel->SetShowState(false);
//__pArticleReaderPanel->Show();
- RemoveControl(*__pBlankPanel);
+ RemoveControl(__pBlankPanel);
//RemoveControl(*__pArticleReaderPanel);
__pArticleReaderPanel = null;
__pBlankPanel = null;
InitFooter();
InitAddressbar();
+ __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), GetClientAreaBounds().width, __pFooterPanel->GetHeight());
+
// hiding the address bar
// __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
__pAddressbar->SetShowState(false);
{
InitMostVisitedSitesView(GetOrientationStatus());
}
+ else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
+ {
+ if(__pMostVisitedListView != null)
+ {
+ __pMostVisitedListView->SetShowState(false);
+ }
+ }
if (__pAddressbar != null && pArgs != null && (previousSceneId == IDSCN_BOOKMARK_VIEW || previousSceneId == IDSCN_HISTORY_LIST))
{
bool isPrivateBrowsing = SettingPresentationModel::GetInstance()->GetPrivateOn();
if (isPrivateBrowsing == false)
{
- History* pHistory = new(std::nothrow) History;
+ if(__pHistory != null)
+ {
+ delete __pHistory;
+ __pHistory = null;
+ }
+ __pHistory = new(std::nothrow) History;
HistoryPresentationModel::GetCurrentDateTime(date);
- if(__pWindowInfo)
+ if (__pWindowInfo)
{
- pHistory->SetHistoryTitle(__pWindowInfo->pageTitle);
+ __pHistory->SetHistoryTitle(__pWindowInfo->pageTitle);
AppLogDebug("MainForm::OnLoadingCompleted pagetitle = %ls", __pWindowInfo->pageTitle.GetPointer());
- pHistory->SetHistoryUrl(__pWindowInfo->pageUrl);
+ __pHistory->SetHistoryUrl(__pWindowInfo->pageUrl);
AppLogDebug("MainForm::OnLoadingCompleted pageUrl = %ls", __pWindowInfo->pageUrl.GetPointer());
}
- pHistory->SetVisitedTime(date);
- /*String id = "";
- if(__pWindowInfo)
- id = FaviconManager::GetInstance()->SaveFavicon(*__pWindowInfo->pFavicon, __pWindowInfo->faviconUrl);
- pHistory->SetFaviconId(id);*/
+ __pHistory->SetVisitedTime(date);
if (__pWebViewer != null)
{
if (pTempBitmap != null)
{
AppLog("MainForm::OnLoadingCompleted setting the fav icon 1");
- pHistory->SetFavIconBitmap(*pTempBitmap);
+ __pHistory->SetFavIconBitmap(*pTempBitmap);
}
AppLog("MainForm::OnLoadingCompleted setting the fav icon 2");
{
pBitmap->Construct(*pCanvas, pCanvas->GetBounds());
pBitmap->Scale(Dimension(pBitmap->GetWidth()/4, pBitmap->GetHeight()/4));
- pHistory->SetThumbnail(pBitmap);
+ __pHistory->SetThumbnail(pBitmap);
}
Bitmap *pFavIcon = __pWebViewer->GetFaviconN();
- if(pFavIcon)
+ if (pFavIcon)
{
- pHistory->SetFavIconBitmap(*pFavIcon);
+ __pHistory->SetFavIconBitmap(*pFavIcon);
delete pFavIcon;
}
- HistoryPresentationModel::GetInstance()->SaveTempHistory(*pHistory);
- delete pHistory;
+ HistoryPresentationModel::GetInstance()->SaveTempHistory(*__pHistory);
+ //delete pHistory;
}
else
{
void MainForm::OnFaviconReceived(const Tizen::Graphics::Bitmap& favicon)
{
AppLog("MainForm::OnFaviconReceived");
- Bitmap* pFavIconBitmap = __pWebViewer->GetFaviconN();
-
- if (pFavIconBitmap != null)
+ if (__pWebViewer != null && __pHistory != null)
{
- pFavIconBitmap->GetWidth();
- pFavIconBitmap->GetHeight();
+ Bitmap* pFavIconBitmap = __pWebViewer->GetFaviconN();
+
+ HistoryPresentationModel::GetInstance()->UpdateHistoryFavIcon(*__pHistory, *(__pWebViewer->GetFaviconN()));
}
}
__pAddressbar->SetShowState(false);
- RelayoutControls(false);
+ RelayoutControls(false,false);
}
{
__pFooterUrlField->SetFocusable(true);
}
- RelayoutControls(false);
+ RelayoutControls(false,footerState);
}
void
}
void
-MainForm::RelayoutControls(bool showAddressbar)
+MainForm::RelayoutControls(bool showAddressbar,bool relayoutFooter)
{
__webControlPosition.y = 0;
__webControlHeight = GetClientAreaBounds().height;
__pFindWordControl->SetBounds(0, 0, GetClientAreaBounds().width, __pFindWordControl->GetHeight());
}
- if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true)
+ if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true && relayoutFooter == true)
{
__webControlHeight -= __pFooterPanel->GetHeight();
+
__pFooterPanel->SetBounds(0, __webControlPosition.y + __webControlHeight, GetClientAreaBounds().width, __pFooterPanel->GetHeight());
}
if (__pWebViewer != null && __pWebViewer->GetShowState() == true)
if (__pMostVisitedListView != null)
{
- RemoveControl(*__pMostVisitedListView);
+ RemoveControl(__pMostVisitedListView);
}
if(__pMostVisitedSites != null)
{
__pMostVisitedListView->SetItemProvider(*this);
__pMostVisitedListView->AddListViewItemEventListener(*this);
__pMostVisitedListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_RECENTLY_VISITED_SITES"));
- AddControl(*__pMostVisitedListView);
+ AddControl(__pMostVisitedListView);
__pMostVisitedListView->UpdateList();
return E_SUCCESS;