MainForm::MainForm(void)
{
+ __isLongPressedDone = false;
__pAddressbar = null;
// __pMostVisitedSitesPanel = null;
__pMostVisitedListView = null;
if (__pAddressbar == null || __pFooterPanel == null)
return E_FAILURE;
- const int Y_WEBCONTROL_POSITION = __pAddressbar->GetY() + __pAddressbar->GetHeight() - 12;
+ const int Y_WEBCONTROL_POSITION = 0;
__webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight();
if (__pMostVisitedListView)
{
__pWebViewer->SetTextSearchListener(this);
}
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,__webControlHeight));
AppLogDebug("MainForm :before return");
Invalidate(true);
AppLogDebug("MainForm::InitWebControl Exit");
__pFooterUrlField = static_cast<EditField*> (GetControl(L"IDC_URL_EDIT_FIELD",true));
if (__pFooterUrlField == NULL)
{
- AppLogDebug("__pFooterUrlField Control not found returning E_INVALID_KEY");
return E_INVALID_KEY;
}
__pMenu->SetShowState(false);
__pMenu->Invalidate(false);
- /*__adressPanelPosition.y = 0 ;
-
- if (__pAddressbar != null && __pWebViewer != NULL)
- {
- __webControlPosition.y = __pAddressbar->GetHeight();
- //__pAddressbar->SetBounds(0,__adressPanelPosition.y,GetClientAreaBounds().width,__pAddressbar->GetHeight());
- //__pAddressbar->Invalidate(true);
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,__webControlHeight));
- __pWebViewer->Invalidate(true);
- }*/
+ __pFindWordEditField->SetFocus();
if (__pWebViewer != null)
{
// releasing the set block
}
AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 3");
- if (__pMenu->GetItemCount() == 12)
+ if (__pMenu->GetItemCount() == 9)
{
r = __pMenu->SetItemAt(1,L"Add to Bookmarks"/*CommonUtil::GetString(L"IDS_BR_OPT_BOOKMARK")*/, IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
}
return ;
}
AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 4");
- if (__pMenu->GetItemCount() != 12)
+ if (__pMenu->GetItemCount() != 9)
{
__pMenu->InsertItemAt(1,L"Add to Bookmarks"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADDTOBOOKMARK_CLICKED);
__pFindWordEditField->SetText(L"");
__currentSearchStr = L"aaaaaabbbbbbccccccc";
StartWordSearch();
+ __currentSearchStr = L"";
__pFindWordNext->SetEnabled(false);
__pFindWordPrev->SetEnabled(false);
__pFindWordPanel->Invalidate(true);
if (__pAddressbar != null && __pWebViewer != NULL)
{
__webControlPosition.y = __pAddressbar->GetHeight() - 12;
- __pAddressbar->SetBounds(0,__adressPanelPosition.y,GetClientAreaBounds().width,__pAddressbar->GetHeight());
- __pAddressbar->Invalidate(true);
- __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight() - ( __pAddressbar->GetY() + __pAddressbar->GetHeight() - 12);
+ //__pAddressbar->SetBounds(0,__adressPanelPosition.y,GetClientAreaBounds().width,__pAddressbar->GetHeight());
+ //__pAddressbar->Invalidate(true);
+ __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight() - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeight() - 12);
- if(__pFooterPanel->GetShowState() == false)
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height - ( __pAddressbar->GetY() + __pAddressbar->GetHeight() - 12)));
+ if (__pFooterPanel->GetShowState() == false)
+ __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeight() - 12)));
else
__pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight));
// __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,__webControlHeight));
}
}
Bitmap* pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
- __pAddressbar->SetFaviconBitmap(*pBitmap);
+ if(pBitmap != null)
+ {
+ __pAddressbar->SetFaviconBitmap(*pBitmap);
+ }
delete pBitmap;
if (__adressPanelPosition.y < (0 - __pAddressbar->GetHeight() + 12))
{
AppLog("MainForm::OnKeypadWillOpen");
if (__pAddressbar != null)
{
- OnAddressBarKeypadOpened(*__pAddressbar);
+ OnAddressBarKeypadWillOpen(*__pAddressbar);
}
- //__pAddressbar->SetAddressbarURLFocus();
-
}
void
{
if(__pAddressbar != null)
{
- OnAddressBarKeypadClosed(*__pAddressbar, false);
+ OnAddressBarKeypadOpened(*__pAddressbar);
}
}
}
void
+MainForm::OnKeypadBoundsChanged(Tizen::Ui::Control &source)
+{
+ AppLog("KeypadBoundsChanged");
+ RelayoutControls(false);
+}
+
+void
MainForm::OnLoadingErrorOccurred(LoadingErrorType error,
const Tizen::Base::String& reason)
{
String url = addBar.GetUrl();
AppLog("MainForm::OnUrlSubmitted url is %ls", url.GetPointer());
- LoadUrl(url);
__pFooterPanel->SetShowState(true);
- __pFooterPanel->Invalidate(true);
- RequestRedraw(true);
+// __pAddressbar->SetShowState(false);
+// RelayoutControls(false);
+ LoadUrl(url);
}
void
String encodedUrl;
// UrlEncoder::Encode(url, L"UTF-8", encodedUrl);
AppLogDebug("MainForm::LoadUrl enter");
- encodedUrl = url;
+
if (__pWebViewer != null)
{
__pWebViewer->SetShowState(true);
__pWebViewer->Invalidate(true);
}
- if (encodedUrl.CompareTo(L"") == 0)
+ if (url.CompareTo(L"") == 0)
{
return;
}
secondRegex.Construct(secondPattern, REGEX_CASELESS);
// Match
- ret = firstRegex.Match(encodedUrl, false); // This returns true value
- flag = secondRegex.Match(encodedUrl, false); // Checks whether URL typed is of type abc.com (i.e without protocol in front of it)
+ ret = firstRegex.Match(url, false); // This returns true value
+ flag = secondRegex.Match(url, false); // Checks whether URL typed is of type abc.com (i.e without protocol in front of it)
if (ret == true && __pWebViewer != null)
{
- __pWebViewer->LoadUrl(encodedUrl);
+ __pWebViewer->LoadUrl(url);
}
else if(__pWebViewer != null)
{
String tempUrl = L"http://";
- tempUrl.Append(encodedUrl);
+ tempUrl.Append(url);
if (flag == true)
{
}
else
{
+ UrlEncoder::Encode(url, L"UTF-8", encodedUrl);
__pWebViewer->LoadUrl(SettingPresentationModel::GetInstance()->GetSearchUrl(encodedUrl));
}
}
{
AppLog("MainForm::OnAddressCancelledClicked 1");
if (__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null)
- __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, __pMostVisitedListView->GetHeight()/*GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14*/));
+ __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, GetClientAreaBounds().height - __pFooterPanel->GetHeight()));
if (__pMostVisitedListView != null)
__pMostVisitedListView->Invalidate(true);
if (__pAddressbar != null)
{
- //__curAddressBarMode = __pAddressbar->GetAddressbarMode();
__curAddressBarMode = GetAddressbarMode();
}
__adressPanelPosition.y = 0;
if (__pAddressbar != null)
{
-
- __webControlPosition.y = 0;//__pAddressbar->GetHeight() - 12;
- __pAddressbar->SetBounds(Rectangle(0,__pAddressbar->GetY() - __pAddressbar->GetHeight(),GetClientAreaBounds().width,__pAddressbar->GetHeight()));
+ __webControlPosition.y = 0;
+ __pAddressbar->SetBounds(Rectangle(0, __pAddressbar->GetY() - __pAddressbar->GetHeight(), GetClientAreaBounds().width, __pAddressbar->GetHeight()));
__pAddressbar->Invalidate(true);
}
}
- if (__pWebViewer != null)
- {
- if(__pFooterPanel->GetShowState() == false)
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height - ( __pAddressbar->GetY() + __pAddressbar->GetHeight() - 12)));
- else
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight));
- __pWebViewer->Invalidate(true);
- }
}
void
MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState)
{
-
- if(__pFooterPanel != null)
- {
- String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
- if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
- {
- InitMostVisitedSitesView(GetOrientationStatus());
- }
- __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight());
- __pFooterPanel->SetShowState(footerState);
- __pFooterPanel->Invalidate(false);
- }
-
-
-
- //AppLogDebug("MainForm::OnAddressBarKeypadClosed enterd");
-
- if (__pWebViewer != null && __pFooterPanel != null)
- {
- AppLog("MainForm::OnAddressBarKeypadClosed GetClientAreaBounds().height %d ", GetClientAreaBounds().height);
- __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight();
-
- if(__pFooterPanel->GetShowState() == false)
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height));
- else
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight));
- __pWebViewer->Invalidate(false);
- //__pWebViewer->SetBounds(Rectangle(0, 82, GetClientAreaBounds().width,webControlHeight));
- }
- if(__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null)
- __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14));
-
+ __pFooterPanel->SetShowState(true);
+ RelayoutControls(false);
}
void
MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar)
{
- AppLog("MainForm::OnAddressBarKeypadOpened");
-
if (__pFindWordPanel && __pFindWordPanel->GetShowState() == true)
{
__pAddressbar->SetShowState(false);
- __pAddressbar->Invalidate(true);
}
else
{
if (__pAddressbar != null && __pAddressbar->GetShowState() == false)
{
__pAddressbar->SetShowState(true);
- __pAddressbar->Invalidate(true);
__pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight()));
__pAddressbar->SetAddressbarURLFocus();
}
}
- // setting the
- //__pAddressbar->SetBounds(__pAddressbar->GetX(), 0, __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
-
-
- if (__pMostVisitedListView && __pMostVisitedListView->GetShowState() == true)
- {
- AppLog("MainForm::OnAddressBarKeypadOpened 1");
- if (__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null)
- __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, /*__pMostVisitedListView->GetHeight()*/GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14));
-
- if(__pMostVisitedListView != null)
- __pMostVisitedListView->Invalidate(true);
- }
- else if (__pWebViewer != null && __pWebViewer->GetShowState() == true)
- {
- AppLog("MainForm::OnAddressBarKeypadOpened 2");
- if (__pWebViewer != null && __pAddressbar != null && __pFooterPanel != null)
- __pWebViewer->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, /*__pWebViewer->GetHeight()*/GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14));
-
- if(__pWebViewer != null)
- __pWebViewer->Invalidate(true);
- }
-
- /*else
- {
- if (__pWebViewer != null)
- {
- __pWebViewer->SetShowState(false);
- __pWebViewer->Invalidate(true);
- }
-
- __pMostVisitedListView->SetShowState(true);
- if (__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null)
- __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, __pMostVisitedListView->GetHeight()GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14));
-
- if(__pMostVisitedListView != null)
- __pMostVisitedListView->Invalidate(true);
-
- }*/
-
-
- __pFooterPanel->SetShowState(false);
- __pFooterPanel->Invalidate(true);
+ RelayoutControls(false);
}
void
MainForm::OnAddressBarKeypadWillOpen(const Addressbar& addBar)
{
__pFooterPanel->SetShowState(false);
- __pFooterPanel->Invalidate(false);
+}
+
+void
+MainForm::OnAddressBarKeypadBoundsChanged(const Addressbar& addBar)
+{
+ AppLog("KeypadBoundsChanged");
+ RelayoutControls(false);
}
void
if (__pAddressbar != null && __pWebViewer != null)
{
SetUrl(__pWebViewer->GetUrl());
- //__pAddressbar->SetUrl(__pWebViewer->GetUrl());
- //__pAddressbar->UpdateFaviconBitmap(SettingPresentationModel::GetInstance()->GetPrivateOn());
__pAddressbar->Invalidate(true);
}
-
}
void
{
if (__pWindowInfo->pFavicon != NULL)
{
- // delete __pWindowInfo->pFavicon;
__pWindowInfo->pFavicon = null;
}
__pWindowInfo->pFavicon = new(std::nothrow) Bitmap();
__pWindowInfo->pFavicon->Construct(*pBitmap,Rectangle(0,0,pBitmap->GetWidth(),pBitmap->GetHeight()));
- //bool isPrivateBrowsing = __pWebViewer->IsPrivateBrowsingEnabled();
__pAddressbar->SetFaviconBitmap(*__pWindowInfo->pFavicon);
}
else
{
- __pAddressbar->SetFaviconBitmap(*FaviconManager::GetInstance()->GetDefaultFaviconN());
+ Bitmap *pDefaultBmp = FaviconManager::GetInstance()->GetDefaultFaviconN();
+ if(pDefaultBmp != null)
+ {
+ __pAddressbar->SetFaviconBitmap(*pDefaultBmp);
+ }
}
-
- AppLogDebug("Favicon download requested: url: %ls", url.ToString().GetPointer());
}
delete tempPath;
}
pAppControl = dynamic_cast<AppControl*>(AppManager::FindAppControlN(appId, operationId));
if(pAppControl)
{
- AppLog("Starting AppControl");
result r = pAppControl->Start(null, null, pMap, null);
- AppLog("Result of Start %s", GetErrorMessage(r));
}
else
{
__currentSelectedStr = __pWebViewer->GetTextFromBlock();
AppLog("__currentSelectedStr after GetTextFromBlock %ls",__currentSelectedStr.GetPointer());
- if ((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0)
+ if (((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) && __isLongPressedDone == true)
{
AppLog("MainForm::OnWebPageBlockSelected show paste option");
__pImageMenu->Show();
__pImageMenu->Invalidate(true);
}
- else /*if (__pHitElementResult->HasUrl() == true )*/
+ else if(__isLongPressedDone == true)
{
AppLog("MainForm::OnWebPageBlockSelected no paste option");
void
MainForm::RelayoutControls(bool showAddressbar)
{
- if (showAddressbar == false)
+ __webControlPosition.y = 0;
+ __webControlHeight = GetClientAreaBounds().height;
+
+ AppLog("Client area height: %d", __webControlHeight);
+ if(__pAddressbar != null && __pAddressbar->GetShowState() == true)
{
- __pAddressbar->SetShowState(false);
- __pWebViewer->SetBounds(__pWebViewer->GetX(), 0, __pWebViewer->GetWidth(), __webControlHeight);
- __pFooterPanel->SetBounds(__pFooterPanel->GetX(), GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight());
+ __webControlPosition.y += __pAddressbar->GetHeight();
+ __webControlHeight -= __pAddressbar->GetHeight();
}
- else
+ else if(__pFindWordPanel != null && __pFindWordPanel->GetShowState() == true)
{
- __pAddressbar->SetShowState(true);
- __pWebViewer->SetBounds(__pWebViewer->GetX(), __pWebViewer->GetY(), __pWebViewer->GetWidth(), __webControlHeight);
- __pFooterPanel->SetBounds(__pFooterPanel->GetX(), GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight());
+ __webControlPosition.y += __pFindWordPanel->GetHeight();
+ __webControlHeight -= __pFindWordPanel->GetHeight();
}
- RequestRedraw(true);
+
+ if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true)
+ {
+ __webControlHeight -= __pFooterPanel->GetHeight();
+ }
+ if (__pWebViewer != null && __pWebViewer->GetShowState() == true)
+ {
+ __pWebViewer->SetBounds(0, __webControlPosition.y, GetClientAreaBounds().width, __webControlHeight);
+ __pWebViewer->Invalidate(false);
+ }
+ if(__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null)
+ __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__webControlPosition.y , GetClientAreaBounds().width, __webControlHeight));
+
+ Invalidate(true);
}
void MainForm::ShowFindWordPanel(bool show , bool isTouchPressed)
__pFindWordEditField->SetText(__currentSearchStr);
//__pFindWordCountLabel->SetText(L"");
__pFindWordCountLabel->SetText(L"0/0");
+ __pFindWordPanel->SetShowState(true);
+ }
+ else
+ {
+ if(__pFindWordPanel != null)
+ {
+ __pFindWordPanel->SetShowState(false);
+ }
}
AppLog("MainForm::ShowFindWordPanel %d",show);
__pFindWordEditField->HideKeypad();
}
- if (__pAddressbar != null)
- {
- __pAddressbar->SetBounds(__pAddressbar->GetX(), 0 - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
- __pAddressbar->SetShowState(false);
- __pAddressbar->Invalidate(true);
- }
- if (__pFindWordPanel != null)
- {
- __pFindWordPanel->SetShowState(show);
- __pFindWordPanel->Invalidate(true);
- }
- Invalidate(true);
+ RelayoutControls(false);
}
void
if(totalCount == -1 || totalCount == 0)
{
- __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),4,__pFindWordCountLabel->GetHeight());
+ __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),64,__pFindWordCountLabel->GetHeight());
__pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),214+80,__pFindWordEditField->GetHeight());
- return;
+// return;
}
else if(totalCount > 100)
{
__pImageMenu->Show();
__pImageMenu->Invalidate(true);
}
+ __isLongPressedDone = true;
__pWebViewer->SetBlockSelectionPosition(currentPosition);
AppLog("MainForm::OnOrientationChanged GetClientAreaBounds %d, %d",GetClientAreaBounds().width,GetClientAreaBounds().height);
int widthContextItem = 0;
- Bitmap *pBitmap = null;
-
+ Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pFooterLabel->GetWidth(), __pFooterLabel->GetHeight());
if (pBitmap != null && __pFooterLabel != null)
{
- pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pFooterLabel->GetWidth(), __pFooterLabel->GetHeight());
__pFooterLabel->SetBackgroundBitmap(*pBitmap);
delete pBitmap;
}
widthContextItem = WIDTH_CONTEXT_MENU_BUTTON_PORTRAIT;
}
- if (__pFindWordPanel != null && __pFindWordPanel->GetShowState() == true)
- {
- __pFindWordPanel->SetBounds(0,0,GetClientAreaBounds().width,__pFindWordPanel->GetHeight());
- __pFindWordControl->SetBounds(0,0, __pFindWordPanel->GetWidth(), __pFindWordPanel->GetHeight());
- __pFindWordControl->SetShowState(true);
- __pFindWordControl->Invalidate(true);
- __pFindWordPanel->SetShowState(true);
- __pFindWordPanel->Invalidate(true);
- }
-
- if (__pWebViewer != null && __pFooterPanel != null)
- {
- AppLog("MainForm::OnOrientationChanged GetClientAreaBounds().height %d ", GetClientAreaBounds().height);
- __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight();
-
- if(__pFooterPanel->GetShowState() == false)
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height));
- else
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight));
- __pWebViewer->Invalidate(true);
-
- //__pWebViewer->SetBounds(Rectangle(0, 82, GetClientAreaBounds().width,webControlHeight));
- }
- if (__pAddressbar != null)
- {
- if(__pAddressbar->GetShowState() == false)
- {
- __pAddressbar->SetBounds(__pAddressbar->GetX(), 0 - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
- }
- else
- {
- __pAddressbar->SetBounds(__pAddressbar->GetX(), 0, __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
- }
- //__pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight()));
- //__pAddressbar->SetAddressbarMode(__pAddressbar->GetAddressbarMode());
- SetAddressbarMode(GetAddressbarMode());
- // __pAddressbar->UpdateFaviconBitmap(SettingPresentationModel::GetInstance()->GetPrivateOn());
- }
if (__pFindWordBgLabel != null)
{
// __pFindWordBgLabel->SetSize(GetClientAreaBounds().width,GetClientAreaBounds().height);
delete pBitmap;
}
}
- if (__pFooterPanel /*&& __pFooterPanel->GetShowState() == true*/)
+ if (__pFooterPanel)
{
AppLog("__pFooterPanel->GetShowState() is true");
InitFooter();
__pMenu->Invalidate(true);
}
- if (__pFooterPanel)
- {
- __pFooterPanel->Invalidate(true);
- }
String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
{
InitMostVisitedSitesView(orientationStatus);
}
- if(__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null)
- {
- if(__pAddressbar != null && __pAddressbar->GetShowState() == true)
- {
- __pMostVisitedListView->SetBounds(__pAddressbar->GetX(),__pAddressbar->GetY()+__pAddressbar->GetHeight(),GetClientAreaBounds().width,GetClientAreaBounds().height - __pAddressbar->GetHeight()- __pFooterPanel->GetHeight());
- }
- else if(__pAddressbar != null && __pAddressbar->GetShowState() == false)
- {
- __pMostVisitedListView->SetBounds(__pAddressbar->GetX(),__pAddressbar->GetY()+__pAddressbar->GetHeight(),GetClientAreaBounds().width,GetClientAreaBounds().height - __pFooterPanel->GetHeight());
- }
- }
+ RelayoutControls(false);
if (__pArticleReaderPanel != null)
{
if (__pArticleReaderPanel->GetShowState() == true)
AppLog("MainForm::OnTouchPressed %d",__pFindWordPanel->GetShowState());
ShowFindWordPanel(__pFindWordPanel->GetShowState(), true);
}
+ __isLongPressedDone = false;
Touch touch;
IList* pList = null;
void
MainForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
{
- __pWebViewer->ReleaseBlock();
__currentWordIndex = 0;
- AppLog("Start MainForm::OnTouchMoved MoveUiControls");
- if(__pFindWordPanel)
- {
- AppLog("MainForm::OnTouchPressed %d",__pFindWordPanel->GetShowState());
- ShowFindWordPanel(__pFindWordPanel->GetShowState(), true);
- }
-
- if (__pFindWordEditField != null)
- {
- __pFindWordEditField->HideKeypad();
- }
-
- /*if (__pAddressbar->GetAddressbarMode() == ADDRESSBAR_MODE_EDIT)
- {
- return;
- }*/
- if (GetAddressbarMode() == ADDRESSBAR_MODE_EDIT)
- {
- return;
- }
- static int Count=0;
- Touch touch;
- IList* pList = null;
- pList = touch.GetTouchInfoListN(source);
-
- if (pList != null)
- {
- int count = pList->GetCount();
- if (count == 1)
- {
- AppLogDebug("MainForm::OnTouchMoved count 1");
- TouchInfo* pTouchInfo = static_cast<TouchInfo*>(pList->GetAt(0));
-
- if( pTouchInfo == NULL )
- {
- return;
- }
- pTouchInfo->position.y += __pWebViewer->GetY();
- AppLog("MainForm::OnTouchMoved MoveUiControls %d,%d",pTouchInfo->position.x,pTouchInfo->position.y);
-
- if (__isLoaded == false)
- return;
-
- __distanceMoved = pTouchInfo->position.y - __touchPoint1.y;
- __touchPoint1 = pTouchInfo->position;
-
- // move the address bar and web control according to distance moved
- MoveUiControls();
- }
- else if (count == 2)
- {
- AppLogDebug("MainForm::OnTouchMoved count 2");
-
- if(Count == 10)
- {
- TouchInfo* pTouchInfo = static_cast<TouchInfo*>(pList->GetAt(0));
-
- if( pTouchInfo == NULL )
- {
- return;
- }
- Point firstPoint = pTouchInfo->position;
-
- pTouchInfo = static_cast<TouchInfo*>(pList->GetAt(1));
- if( pTouchInfo == NULL )
- {
- return;
- }
- Point secondPoint = pTouchInfo->position;
-
- if (__touchPoint1 == Point(-1,-1) || __touchPoint2 == Point(-1,-1))
- {
- __touchPoint1 = firstPoint;
- __touchPoint2 = secondPoint;
- delete pList;
- return;
- }
-
- int currX1 = firstPoint.x;
- int currY1 = firstPoint.y;
- int currX2 = secondPoint.x;
- int currY2 = secondPoint.y;
-
- double prevDist = findDistance(__touchPoint1.x,__touchPoint1.y,__touchPoint2.x,__touchPoint2.y);
- double dist = findDistance(currX1, currY1, currX2, currY2);
- __distanceMoved = prevDist - dist;
-
- __touchPoint1 = firstPoint;
- __touchPoint2 = secondPoint;
- MoveUiControls();
- Count = 0;
- }
- }
- Count++;
- delete pList;
- }
+ __isLongPressedDone = false;
}
__webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight();
__pMostVisitedListView = new(std::nothrow) ListView();
- if(__pFooterPanel->GetShowState() == false)
+
+ int height = GetClientAreaBounds().height;
+
+ if(__pFooterPanel->GetShowState() == true)
{
- r = __pMostVisitedListView->Construct(Tizen::Graphics::Rectangle(0,0 , GetClientAreaBounds().width, GetClientAreaBounds().height),true,false);
+ height = height - __pFooterPanel->GetHeight();
}
- else
+ if(__pAddressbar->GetShowState() == true)
{
- r = __pMostVisitedListView->Construct(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight() , GetClientAreaBounds().width, __webControlHeight),true,false);
+ height -= __pAddressbar->GetHeight();
}
+ r = __pMostVisitedListView->Construct(Tizen::Graphics::Rectangle(0,0 , GetClientAreaBounds().width, height),true,false);
+
if (r != E_SUCCESS)
{
delete __pMostVisitedListView;
__pMostVisitedListView->AddListViewItemEventListener(*this);
__pMostVisitedListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_RECENTLY_VISITED_SITES"));
AddControl(*__pMostVisitedListView);
- AppLog("__pMostVisitedSitesPanel addcontrol %s",GetErrorMessage(r));
- if(__pFooterPanel->GetShowState() == false)
- __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,0, GetClientAreaBounds().width, GetClientAreaBounds().height - __pAddressbar->GetHeight() + 14));
- else
- __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,0, GetClientAreaBounds().width, GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14));
-
__pMostVisitedListView->UpdateList();
return E_SUCCESS;
break;
case ADDRESSBAR_MODE_LOADING_COMPLETE:
{
- SetUrl(__pAddressbar->GetUrl());
+// SetUrl(__pAddressbar->GetUrl());
__pRefreshBtn->SetShowState(true);
__pStopBtn->SetShowState(false);