using namespace Tizen::Web::Controls;
static const wchar_t* IDB_SEARCH_INPUT_FIELD_BG = L"I01_toolbar_input_field.9.png";
+static const wchar_t* IDB_FINDWORD_INPUT_FIELD_BG = L"I01_toolbar_input_field_findword.9.png";
static const wchar_t* IDB_BTN_BACK = L"I01_icon_Back.png";
static const wchar_t* IDB_BTN_BACK_PRESS = L"I01_icon_Back_press.png";
static const wchar_t* IDB_CONTRLBAR_ICON_BOOKMARK = L"I01_search_list_icon_favorite.png";
MainForm::MainForm(void)
{
+ __isLongPressedDone = false;
__pAddressbar = null;
// __pMostVisitedSitesPanel = null;
__pMostVisitedListView = null;
delete pBitmapPressed;
}
+ __pItemContextLandscape= new(std::nothrow) ListContextItem();
+ __pItemContextLandscape->Construct();
+ pBitmapNormal = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete.9.png", WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE,HEIGHT_CONTEXT_MENU_BUTTON);
+ pBitmapPressed = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete_press.9.png", WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE, HEIGHT_CONTEXT_MENU_BUTTON);
+
+ if (pBitmapNormal != null && pBitmapPressed != null)
+ {
+ __pItemContextLandscape->AddElement(IDA_CONTEXT_ITEM_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"), *pBitmapNormal, *pBitmapPressed, pBitmapPressed);
+ }
+
+ if (pBitmapNormal != null)
+ {
+ delete pBitmapNormal;
+ }
+
+ if (pBitmapPressed != null)
+ {
+ delete pBitmapPressed;
+ }
+
return E_SUCCESS;
}
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");
return E_FAILURE;
}
- /*pBackButton = static_cast< Button* >(GetControl(L"IDC_PAGEBACK_BUTTON", true));
-
- if ( pBackButton == NULL )
- {
- return E_FAILURE;
- }
-
- pBookmarkButton = static_cast< Button* >(GetControl(L"IDC_BOOKMARK_BUTTON", true));
-
- if ( pBookmarkButton == NULL )
- {
- return E_FAILURE;
- }*/
-
__pMoreButton = static_cast<Button*>(GetControl(L"IDC_MORE_BUTTON",true));
if ( __pMoreButton == NULL )
return E_FAILURE;
}
- /*__pNewWindowButton = static_cast< Button* >(GetControl(L"IDC_NEW_WINDOW",true));
-
- if ( __pNewWindowButton == NULL )
- {
- return E_FAILURE;
- }*/
-
if (__pMultiWindowButton != null)
{
Bitmap* pBitmap = null;
__pMultiWindowButton->SetActionId(IDA_MULTIWINDOWBTN_CLICKED);
}
-
- /*if (pBackButton)
- {
- Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_BTN_BACK);
- Bitmap* pPressedBitmap = AppResource::GetInstance()->GetBitmapN(IDB_BTN_BACK_PRESS);
- if (pBitmap != null)
- {
- // pBitmap->Scale(Dimension(56,56));
-
- Point startPoint((pBackButton->GetWidth() - pBitmap->GetWidth())/2,(pBackButton->GetHeight() - pBitmap->GetHeight())/2 );
- AppLog("startPoint %d,%d pBitmap width height %d %d",startPoint.x,startPoint.y,pBitmap->GetWidth(),pBitmap->GetHeight());
- pBackButton->SetNormalBitmap(startPoint, *pBitmap);
- pBackButton->SetPressedBitmap(startPoint, *pPressedBitmap);
- delete pBitmap;
- }
- pBackButton->AddActionEventListener(*this);
- pBackButton->SetActionId(IDA_BACKBTN_CLICKED);
- }*/
-
- /*if (pBookmarkButton)
- {
- Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_CONTRLBAR_ICON_BOOKMARK);
- Bitmap* pPressedBitmap = AppResource::GetInstance()->GetBitmapN(IDB_CONTRLBAR_ICON_BOOKMARK_PRESS);
- if (pBitmap != null)
- {
- Point startPoint((pBookmarkButton->GetWidth() - pBitmap->GetWidth())/2,(pBookmarkButton->GetHeight() - pBitmap->GetHeight())/2 );
- pBookmarkButton->SetNormalBitmap(startPoint, *pBitmap);
- pBookmarkButton->SetPressedBitmap(startPoint, *pPressedBitmap);
- delete pBitmap;
- }
- pBookmarkButton->AddActionEventListener(*this);
- pBookmarkButton->SetActionId(IDA_BOOKMARKBTN_CLICKED);
- }*/
-
if (__pMoreButton)
{
Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_CONTRLBAR_ICON_MORE);
}
//Add the editfield for url
- __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;
- }
-
- __pFooterUrlField->SetOverlayKeypadCommandButtonVisible(false);
- __pFooterUrlField->SetKeypadAction(KEYPAD_ACTION_GO);
- //__pFooterUrlField->AddFocusEventListener(*this);
- __pFooterUrlField->AddKeypadEventListener(*this);
-
- /*if (__pNewWindowButton)
+ __pFooterUrlField = static_cast<EditField*> (GetControl(L"IDC_URL_EDIT_FIELD",true));
+ if (__pFooterUrlField == NULL)
{
- Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_CONTRLBAR_ICON_NEW_WINDOW);
- Bitmap* pPressedBitmap = AppResource::GetInstance()->GetBitmapN(IDB_CONTRLBAR_ICON_NEW_WINDOW_PRESS);
- if (pBitmap != null)
- {
- Point startPoint((__pNewWindowButton->GetWidth() - pBitmap->GetWidth())/2,(__pNewWindowButton->GetHeight() - pBitmap->GetHeight())/2 );
- __pNewWindowButton->SetNormalBitmap(startPoint, *pBitmap);
- __pNewWindowButton->SetPressedBitmap(startPoint, *pPressedBitmap);
- delete pBitmap;
- }
- __pNewWindowButton->AddActionEventListener(*this);
- __pNewWindowButton->SetActionId(IDA_NEWWINDOWBTN_CLICKED);
- __pNewWindowButton->SetEnabled(true);
- // __pNewWindowButton->Invalidate(true);
- }*/
+ return E_INVALID_KEY;
+ }
- AppLog("checkingwindow count %d",MultipleWindowPresentationModel::GetInstance()->GetAllWindowArrayList()->GetCount());
+ __pFooterUrlField->SetOverlayKeypadCommandButtonVisible(false);
+ __pFooterUrlField->SetKeypadAction(KEYPAD_ACTION_GO);
+ //__pFooterUrlField->AddFocusEventListener(*this);
+ __pFooterUrlField->AddKeypadEventListener(*this);
- /*if (__pNewWindowButton != null && MultipleWindowPresentationModel::GetInstance()->GetAllWindowArrayList()->GetCount() >= 9)
+ if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
{
- Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_CONTROLBAR_ICON_CREATE_DISABLE);
- if (pBitmap != null)
- {
- Point startPoint = Point((__pNewWindowButton->GetWidth() - pBitmap->GetWidth())/2,(__pNewWindowButton->GetHeight() - pBitmap->GetHeight())/2 );
- __pNewWindowButton->SetDisabledBitmap(startPoint,*pBitmap);
- delete pBitmap;
- }
- __pNewWindowButton->SetEnabled(false);
- }*/
+ __pFooterUrlField->SetGuideText(CommonUtil::GetString(L"IDS_BR_BODY_SEARCH_OR_ENTER_URL"));
+ }
+ else if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
+ {
+ __pFooterUrlField->SetGuideText(CommonUtil::GetString(L"IDS_BR_BODY_ABOUT_C_BLANK"));
+ }
+ else
+ {
+ //__pUrlField->SetText(SettingPresentationModel::GetInstance()->GetFavoriteURL());
+ __pFooterUrlField->SetGuideText(CommonUtil::GetString(L"IDS_BR_BODY_SEARCH_OR_ENTER_URL"));
+ }
//Add the go Back Button
__pGoBackBtn = static_cast<Button*> (GetControl(L"IDC_PAGEBACK_BUTTON",true));
__pMenu->AddItem(CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY"), IDA_PRIVATEON_CLICKED,*pBitmap);
delete pBitmap;
}
- r = __pMenu->AddItem(L"Desktop view"/*CommonUtil::GetString(L"IDS_BR_OPT_BOOKMARK")*/, IDA_DESKTOP_VIEW_CLICKED);
- r = __pMenu->AddItem(L"Saved Pages"/*CommonUtil::GetString(L"IDS_BR_OPT_BOOKMARK")*/, IDA_SAVED_PAGES_CLICKED);
r = __pMenu->AddItem(L"History"/*CommonUtil::GetString(L"IDS_BR_OPT_BOOKMARK")*/, IDA_HISTORY_CLICKED);
r = __pMenu->AddItem(CommonUtil::GetString(L"IDS_COM_OPT_BRIGHTNESS"), IDA_BRIGHTNESS_BTN_CLICKED);
r = __pMenu->AddItem(CommonUtil::GetString(L"IDS_COM_BODY_SETTINGS"), IDA_SETTINGS_CLICKED);
AppLogDebug("Findword panel already initialized");
if (__pFindWordBgLabel != null)
{
- Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.9.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
+ Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_FINDWORD_INPUT_FIELD_BG, __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
if (pBitmap != null)
{
- AppLogDebug("InitFindWordPanel: Coming here");
__pFindWordBgLabel->SetBackgroundBitmap(*pBitmap);
delete pBitmap;
}
AppLogException("There is some problem in the xml file. Please check.");
return E_FAILURE;
}
- __pFindWordPanel->AddControl(*__pFindWordControl);
+ AddControl(*__pFindWordControl);
__pFindWordControl->SetBounds(0,0, __pFindWordPanel->GetWidth(), __pFindWordPanel->GetHeight());
- SetControlAlwaysOnTop(*__pFindWordPanel,true);
+ SetControlAlwaysOnTop(*__pFindWordControl,true);
__pFindWordPanel->SetShowState(false);
__pFindWordPanel->Invalidate(false);
return NULL;
}
- if (pHistory->GetFaviconId().GetLength() > 0)
- {
- String bitmapId = pHistory->GetFaviconId();
- Bitmap* pBitmap = FaviconManager::GetInstance()->GetFaviconN(bitmapId);
- if ( pBitmap != NULL)
- {
- pListIconImage = new Bitmap();
- pListIconImage->Construct(*pBitmap,Rectangle(0,0,pBitmap->GetWidth(),pBitmap->GetHeight()));
- delete pBitmap;
- }
+ Bitmap* pBitmap = pHistory->GetFavIconBitmap();
+
+ if ( pBitmap != NULL)
+ {
+ pListIconImage = new Bitmap();
+ pListIconImage->Construct(*pBitmap,Rectangle(0,0,pBitmap->GetWidth(),pBitmap->GetHeight()));
+ delete pBitmap;
}
if(pListIconImage == null)
}
- if ( __pItemContext!= NULL)
+ if(GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
{
- if (pItem != null)
+ if ( __pItemContext!= NULL)
{
- pItem->SetContextItem(__pItemContext);
+ if (pItem != null)
+ {
+ pItem->SetContextItem(__pItemContext);
+ }
+ }
+ }
+ else
+ {
+ if ( __pItemContextLandscape!= NULL)
+ {
+ if (pItem != null)
+ {
+ pItem->SetContextItem(__pItemContextLandscape);
+ }
}
}
if( pListIconImage != NULL)
{
delete __pItemContext;
}
+ if(__pItemContextLandscape)
+ {
+ delete __pItemContextLandscape;
+ }
return r;
}
__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
__pWebViewer->ReleaseBlock();
}
+ */
ShowFindWordPanel(true);
}
break;
pBookmark->SetBookmarkTitle(title);
pBookmark->SetUrl(url);
+ if (__pWebViewer != null && __pWebViewer->GetFaviconN() != null)
+ {
+ pBookmark->SetFavIconBitmap(*(__pWebViewer->GetFaviconN()));
+ }
String id = FaviconManager::GetInstance()->SaveFavicon(*__pWindowInfo->pFavicon, __pWindowInfo->faviconUrl);
pBookmark->SetFaviconId(id);
- r = BookmarkPresentationModel::GetInstance()->SaveBookmark(*pBookmark);
+ //r = BookmarkPresentationModel::GetInstance()->SaveBookmark(*pBookmark);
+ r = BookmarkPresentationModel::GetInstance()->SaveTempBookmark(*pBookmark);
delete pBookmark;
NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
- if(pNotification != null)
+ if (pNotification != null)
{
pNotification->SetText(message);
pNotification->SetPositionDiff(__pFooterPanel->GetHeight());
AppLogDebug("ONACTION_PERFORMED:IDA_BOOKMARKBTN_CLICKED");
SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_BOOKMARK_VIEW, SCENE_TRANSITION_ANIMATION_TYPE_NONE));
}
- break;
+ break;
case IDA_ADD_TO_BOOKMARKBTN_CLICKED:
{
}
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() != 8)
{
__pMenu->InsertItemAt(1,L"Add to Bookmarks"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADDTOBOOKMARK_CLICKED);
- __pMenu->InsertItemAt(2,L"Add to Home"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADD_TO_HOME_CLICKED);
- __pMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED);
- __pMenu->InsertItemAt(4,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED);
- __pMenu->InsertItemAt(7,L"Save"/*CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB")*/, IDA_SAVE_CLICKED);
+// __pMenu->InsertItemAt(2,L"Add to Home"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADD_TO_HOME_CLICKED);
+ __pMenu->InsertItemAt(2,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED);
+ __pMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED);
__pMenu->SetMaxVisibleItemsCount(6);
}
if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE)
__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);
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,__webControlHeight));
+ //__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)));
+ else
+ __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight));
+ // __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,__webControlHeight));
__pWebViewer->Invalidate(true);
}
InitAddressbar();
// hiding the address bar
- __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
+ // __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
__pAddressbar->SetShowState(false);
if(__pWebViewer != null)
{
if (__pAddressbar != null)
{
- // __pAddressbar->UpdateFaviconBitmap(true);
+ // __pAddressbar->UpdateFaviconBitmap(true);
}
}
if (__pAddressbar != null)
{
- // __pAddressbar->UpdateFaviconBitmap(false);
+ // __pAddressbar->UpdateFaviconBitmap(false);
}
}
}
else if(token.Contains("="))
{
- String *pKey = new String();
- String *pValue = new String();
- int index = -1;
- token.IndexOf("=", 0, index);
- if(index != -1)
- {
- token.SubString(0, index, *pKey);
- token.SubString(index + 1, *pValue);
- pMap->Add(pKey, pValue);
+ String *pKey = new String();
+ String *pValue = new String();
+ int index = -1;
+ token.IndexOf("=", 0, index);
+ if(index != -1)
+ {
+ token.SubString(0, index, *pKey);
+ token.SubString(index + 1, *pValue);
+ pMap->Add(pKey, pValue);
+ }
}
}
- }
- if(appId != "")
- {
- AppControl *pAppControl = null;
- String operationId = L"http://tizen.org/appcontrol/operation/main";
- 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
+ if(appId != "")
{
- AppLogException("AppControl not found");
+ AppControl *pAppControl = null;
+ String operationId = L"http://tizen.org/appcontrol/operation/main";
+ 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
+ {
+ AppLogException("AppControl not found");
+ }
+ return;
}
- return;
- }
}
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
+MainForm::OnKeypadOpened(Tizen::Ui::Control& source)
+{
+ if(__pAddressbar != null)
+ {
+ OnAddressBarKeypadOpened(*__pAddressbar);
+ }
}
+
void
MainForm::OnKeypadClosed(Tizen::Ui::Control& source)
{
}
void
+MainForm::OnKeypadBoundsChanged(Tizen::Ui::Control &source)
+{
+ AppLog("KeypadBoundsChanged");
+ RelayoutControls(false);
+}
+
+void
MainForm::OnLoadingErrorOccurred(LoadingErrorType error,
const Tizen::Base::String& reason)
{
void
MainForm::OnLoadingCompleted(void)
{
+ AppLog("MainForm::OnLoadingCompleted start");
DateTime date;
result r = E_SUCCESS;
AppLogDebug("MainForm::OnLoadingCompleted pageUrl = %ls", __pWindowInfo->pageUrl.GetPointer());
}
pHistory->SetVisitedTime(date);
- String id = "";
+ /*String id = "";
if(__pWindowInfo)
id = FaviconManager::GetInstance()->SaveFavicon(*__pWindowInfo->pFavicon, __pWindowInfo->faviconUrl);
- pHistory->SetFaviconId(id);
+ pHistory->SetFaviconId(id);*/
+
+ if (__pWebViewer != null)
+ {
+ AppLog("MainForm::OnLoadingCompleted setting the fav icon 0");
+
+ Bitmap* pTempBitmap = __pWebViewer->GetFaviconN();
+ if (pTempBitmap != null)
+ {
+ AppLog("MainForm::OnLoadingCompleted setting the fav icon 1");
+ pHistory->SetFavIconBitmap(*pTempBitmap);
+ }
+
+ AppLog("MainForm::OnLoadingCompleted setting the fav icon 2");
+ }
+
Canvas* pCanvas = __pWebViewer->GetCanvasN();
Bitmap* pBitmap = new(std::nothrow) Bitmap();
if ( pCanvas != null && pCanvas != null && pBitmap != null)
pBitmap->Scale(Dimension(pBitmap->GetWidth()/4, pBitmap->GetHeight()/4));
pHistory->SetThumbnail(pBitmap);
}
- HistoryPresentationModel::GetInstance()->SaveHistory(*pHistory);
+ Bitmap *pFavIcon = __pWebViewer->GetFaviconN();
+ if(pFavIcon)
+ {
+ pHistory->SetFavIconBitmap(*pFavIcon);
+ delete pFavIcon;
+ }
+
+ HistoryPresentationModel::GetInstance()->SaveTempHistory(*pHistory);
delete pHistory;
}
else
// temperary fixed (webpage can be not loaded)
UpdateFavicon();
}
+ AppLog("MainForm::OnLoadingCompleted done");
}
void
UpdateProgress(progress);
}
+void MainForm::OnFaviconReceived(const Tizen::Graphics::Bitmap& favicon)
+{
+ AppLog("MainForm::OnFaviconReceived");
+ Bitmap* pFavIconBitmap = __pWebViewer->GetFaviconN();
+
+ if (pFavIconBitmap != null)
+ {
+ pFavIconBitmap->GetWidth();
+ pFavIconBitmap->GetHeight();
+ }
+}
+
+void
+MainForm::OnUrlValueChanged(Addressbar&)
+{
+ Invalidate(true);
+}
+
void
MainForm::OnUrlSubmitted(Addressbar& addBar)
{
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
MainForm::LoadUrl(String& url)
{
+ String encodedUrl;
+// UrlEncoder::Encode(url, L"UTF-8", encodedUrl);
AppLogDebug("MainForm::LoadUrl enter");
if (__pWebViewer != null)
}
else
{
- __pWebViewer->LoadUrl(SettingPresentationModel::GetInstance()->GetSearchUrl(url));
+ UrlEncoder::Encode(url, L"UTF-8", encodedUrl);
+ __pWebViewer->LoadUrl(SettingPresentationModel::GetInstance()->GetSearchUrl(encodedUrl));
}
}
if (__pAddressbar != null)
{
result r = E_SUCCESS;
// hiding the address bar
- __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
__pAddressbar->SetShowState(false);
-
- if (__pMostVisitedListView != null && __pMostVisitedListView->GetShowState() == true)
- {
- 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*/));
-
- if (__pMostVisitedListView != null)
- __pMostVisitedListView->Invalidate(true);
- }
- /*else if (__pWebViewer != null && __pWebViewer->GetShowState() == true)
- {
- if (__pWebViewer != null && __pAddressbar != null && __pFooterPanel != null)
- {
- AppLog("MainForm::OnAddressCancelledClicked 2");
- r = __pWebViewer->SetBounds(Rectangle(0,0__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, __webControlHeightGetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14));
- if (r == E_SUCCESS)
- {
- AppLog("MainForm::OnAddressCancelledClicked success");
- }
- else
- {
- AppLog("MainForm::OnAddressCancelledClicked failure");
- }
- }
-
- int yOfWebViewer = __pWebViewer->GetY();
- int heightOfWebViewer = __pWebViewer->GetHeight();
- AppLog("MainForm::OnAddressCancelledClicked yOfWebViewer is %d",yOfWebViewer);
- AppLog("MainForm::OnAddressCancelledClicked heightOfWebViewer is %d",heightOfWebViewer);
-
- __pWebViewer->Invalidate(true);
- }*/
-
__pFooterPanel->SetShowState(true);
- __pFooterPanel->Invalidate(false);
+ RelayoutControls(false);
}
void
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)
+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->SetShowState(true);
- __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)
+ if (__pFindWordControl && __pFindWordControl->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();
+ __pAddressbar->SetShowState(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;
}
ShowFindWordPanel(false);
AppLog("__pAddressbar->GetAddressbarURL() is %ls",__pAddressbar->GetAddressbarURL().GetPointer());
- __pFooterUrlField->SetText(__pAddressbar->GetAddressbarURL());
- __pFooterPanel->Invalidate(true);
+ __pFooterPanel->Invalidate(true);
Uri uriInfo;
uriInfo.SetUri(url);
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
{
MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graphics::Point& startPoint, Tizen::Graphics::Point& endPoint)
{
AppLog("MainForm::OnWebPageBlockSelected");
-
if (__pHitElementResult != null)
{
delete __pHitElementResult;
if (__pWebViewer != null)
{
AppLog("MainForm::OnWebPageBlockSelected web not null");
- __pHitElementResult = __pWebViewer->GetElementByPointN(startPoint);
+ __pHitElementResult = __pWebViewer->GetElementByPointN(endPoint);
}
if (__pHitElementResult == null)
String type = __pHitElementResult->GetAttributeValue("type");
__currentSelectedStr.Clear();
+ AppLog("__currentSelectedStr after clear %ls",__currentSelectedStr.GetPointer());
__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");
- InitSelectTextContextMenu(startPoint,true);
+ InitSelectTextContextMenu(endPoint,true);
__pImageMenu->SetShowState(true);
__pImageMenu->Show();
__pImageMenu->Invalidate(true);
}
- else if (__pHitElementResult->HasUrl() == true || __currentSelectedStr.GetLength() > 0)
+ else if(__isLongPressedDone == true)
{
AppLog("MainForm::OnWebPageBlockSelected no paste option");
__currentSelectedStr.Clear();
__currentSelectedStr = __pHitElementResult->GetUrl();
}
- InitSelectTextContextMenu(startPoint,false);
+ InitSelectTextContextMenu(endPoint,false);
__pImageMenu->SetShowState(true);
__pImageMenu->Show();
__pImageMenu->Invalidate(true);
AppLog("MainForm::OnWebPageBlockSelected tag name is %ls",tagName.GetPointer());
AppLog("MainForm::OnWebPageBlockSelected type name is %ls",type.GetPointer());
}
+
}
void
void
MainForm::RelayoutControls(bool showAddressbar)
{
- if (showAddressbar == false)
+ __webControlPosition.y = 0;
+ __webControlHeight = GetClientAreaBounds().height;
+ AppLog("Client area height: %d", __webControlHeight);
+
+ 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();
+ __pAddressbar->SetBounds(0, 0, __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
}
- else
+ else if(__pFindWordControl != null && __pFindWordControl->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 += __pFindWordControl->GetHeight();
+ __webControlHeight -= __pFindWordControl->GetHeight();
+ __pFindWordControl->SetBounds(0, 0, GetClientAreaBounds().width, __pFindWordControl->GetHeight());
}
- RequestRedraw(true);
+
+ if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true)
+ {
+ __webControlHeight -= __pFooterPanel->GetHeight();
+ __pFooterPanel->SetBounds(0, __webControlPosition.y + __webControlHeight, GetClientAreaBounds().width, __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)
{
- if (__pFindWordPanel == null)
+ if (__pFindWordControl == null)
{
return;
}
__pFindWordEditField->SetText(__currentSearchStr);
//__pFindWordCountLabel->SetText(L"");
__pFindWordCountLabel->SetText(L"0/0");
+ __pFindWordPanel->SetShowState(true);
+ }
+ else
+ {
+ if(__pFindWordControl != null)
+ {
+ __pFindWordControl->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
AppLog("MainForm::OnTextFound totalCount %d",totalCount);
AppLog("MainForm::OnTextFound currentOrdinal %d",currentOrdinal);
-/* if(totalCount == -1 || totalCount == 0)
+ 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)
{
__pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
__pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
}
-*/
+
__maxOccurrances = totalCount;
__currentWordIndex = currentOrdinal;
countStr.Append(L"/");
countStr.Append(__maxOccurrances);
__pFindWordCountLabel->SetText(countStr);
-// __pFindWordCountLabel->SetShowState(true);
+ // __pFindWordCountLabel->SetShowState(true);
__pFindWordCountLabel->Invalidate(false);
//FindNextWord(true);
countStr.Append(L"/");
countStr.Append(__maxOccurrances);
__pFindWordCountLabel->SetText(countStr);
-// __pFindWordCountLabel->SetShowState(true);
+ // __pFindWordCountLabel->SetShowState(true);
__pFindWordCountLabel->Invalidate(false);
if (__currentWordIndex >= __maxOccurrances)
{
MainForm::OnWebKeypadWillOpen(Tizen::Web::Controls::Web& source)
{
AppLog("MainForm::OnWebKeypadWillOpen");
- OnAddressBarKeypadOpened(*__pAddressbar);
+ // OnAddressBarKeypadOpened(*__pAddressbar);
}
void
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->SetBounds(Rectangle(0, 82, GetClientAreaBounds().width,webControlHeight));
+ if(__pAddressbar != null)
+ {
+ __pAddressbar->SetShowState(false);
+ }
+ if(__pFindWordControl != null)
+ {
+ __pFindWordControl->SetShowState(false);
+ }
+ __pFooterPanel->SetShowState(false);
+ __pWebViewer->SetBounds(Rectangle(0, 0,GetClientAreaBounds().width, GetClientAreaBounds().height));
}
+ Invalidate(true);
}
void
MainForm::OnWebKeypadClosed(Tizen::Web::Controls::Web& source)
{
+ __pFooterPanel->SetShowState(true);
OnAddressBarKeypadClosed(*__pAddressbar);
}
__pImageMenu->Show();
__pImageMenu->Invalidate(true);
}
+ __isLongPressedDone = true;
__pWebViewer->SetBlockSelectionPosition(currentPosition);
+
+
}
__inputEventToBeSupressed = true;
}
void
MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
{
- int widthContextItem = 0;
-
- if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
- {
-
- widthContextItem = WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE;
- }
- else
- {
- widthContextItem = WIDTH_CONTEXT_MENU_BUTTON_PORTRAIT;
- }
-
- if( __pItemContext != NULL)
- {
- delete __pItemContext;
- __pItemContext = null;
-
- }
-
- __pItemContext= new(std::nothrow) ListContextItem();
- __pItemContext->Construct();
- Bitmap* pBitmapNormal = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete.9.png", widthContextItem,HEIGHT_CONTEXT_MENU_BUTTON);
- Bitmap* pBitmapPressed = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete_press.9.png", widthContextItem, HEIGHT_CONTEXT_MENU_BUTTON);
-
- if (pBitmapNormal != null && pBitmapPressed != null)
- {
- __pItemContext->AddElement(IDA_CONTEXT_ITEM_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"), *pBitmapNormal, *pBitmapPressed, pBitmapPressed);
- }
-
- if (pBitmapNormal != null)
- {
- delete pBitmapNormal;
- }
+ AppLog("MainForm::OnOrientationChanged GetClientAreaBounds %d, %d",GetClientAreaBounds().width,GetClientAreaBounds().height);
+ int widthContextItem = 0;
- if (pBitmapPressed != null)
- {
- delete pBitmapPressed;
- }
-
-
- if (__pFindWordPanel != null && __pFindWordPanel->GetShowState() == true)
+ Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pFooterLabel->GetWidth(), __pFooterLabel->GetHeight());
+ if (pBitmap != null && __pFooterLabel != null)
{
- __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);
+ __pFooterLabel->SetBackgroundBitmap(*pBitmap);
+ delete pBitmap;
}
- 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);
- Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.9.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
+ Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_FINDWORD_INPUT_FIELD_BG, __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
if (pBitmap != null)
{
__pFindWordBgLabel->SetBackgroundBitmap(*pBitmap);
delete pBitmap;
}
}
- if (__pFooterPanel /*&& __pFooterPanel->GetShowState() == true*/)
+
+ if(__pMenu != null)
+ __pMenu->SetShowState(false);
+ if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+ {
+ widthContextItem = WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE;
+ }
+ else
+ {
+ widthContextItem = WIDTH_CONTEXT_MENU_BUTTON_PORTRAIT;
+ }
+
+ if (__pFooterPanel)
{
AppLog("__pFooterPanel->GetShowState() is true");
InitFooter();
+ __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight());
+ __pFooterPanel->Invalidate(true);
}
InitAddressbar();
__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)
}
}
Invalidate(true);
- if(__pAddressbar != null)
+
+ if (__pAddressbar != null)
{
- __pAddressbar->OrientationChanged();
+ int width = GetClientAreaBounds().width;
+ __pAddressbar->OrientationChanged(width);
}
}
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)
{
- 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;
- }
+ __currentWordIndex = 0;
+ __isLongPressedDone = false;
}
void
MainForm::MoveUiControls()
{
- if(__pAddressbar == NULL || __pAddressbar->GetShowState() == false)
- {
- return;
- }
- __adressPanelPosition.y = __adressPanelPosition.y + __distanceMoved;
- if (__adressPanelPosition.y > 0)
- {
- __adressPanelPosition.y = 0;
- __webControlPosition.y = __pAddressbar->GetHeight() - 12;
- }
- else if (__adressPanelPosition.y < (0-(__pAddressbar->GetHeight() - 12))) // -12 is for the progress label
- {
- __adressPanelPosition.y = 0-(__pAddressbar->GetHeight() - 12);
- __webControlPosition.y = 0;
- }
- else
- {
- __webControlPosition.y = __adressPanelPosition.y + (__pAddressbar->GetHeight() - 12);
- }
-
- AppLogDebug("__adressPanelPosition.y = %d, __webControlPosition.y = %d", __adressPanelPosition.y, __webControlPosition.y);
-
- __pAddressbar->SetBounds(0,__adressPanelPosition.y,__pAddressbar->GetWidth(),__pAddressbar->GetHeight());
- __pAddressbar->Invalidate(false);
-
- if (__pWebViewer != NULL)
- {
- if(__pFooterPanel->GetShowState() == true)
- __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight();
- else
- __webControlHeight = GetClientAreaBounds().height;
- __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight));
- __pWebViewer->Invalidate(false);
- }
}
void
MainForm::OnTextValueChanged (const Tizen::Ui::Control &source)
{
+ if(&source == dynamic_cast<Control*>(__pFooterUrlField) && __pFooterUrlField != null)
+ {
+ if(__pFooterUrlField->GetTextLength() == 0)
+ {
+ __pFooterUrlField->SetKeypadActionEnabled(false);
+ }
+ else
+ {
+ __pFooterUrlField->SetKeypadActionEnabled(true);
+ }
+ }
if (__pFindWordEditField != null)
{
__currentSearchStr = __pFindWordEditField->GetText();
else
{
__currentSearchStr = L"aaaaaaaabbbbbbbccccccc";
- StartWordSearch();
+ StartWordSearch();
AppLogDebug("Enter something");
}
}
__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,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight() , 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,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, GetClientAreaBounds().height - __pAddressbar->GetHeight() + 14));
- else
- __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14));
-
__pMostVisitedListView->UpdateList();
return E_SUCCESS;
break;
case ADDRESSBAR_MODE_READER:
{
- // __pBgPanel->SetPosition(__pGoBackBtn->GetPosition().x + 2* __pGoBackBtn->GetWidth() + 13,__pBgPanel->GetPosition().y);
- // __pSearchLabel->SetShowState(false);
- // __pFaviconLabel->SetShowState(true);
- // __pCancelBtn->SetShowState(false);
- // __pRefreshBtn->SetShowState(false);
__pStopBtn->SetShowState(false);
- // __pReaderBtn->SetShowState(true);
- // __pReaderBtn->Invalidate(true);
- // __pGoForwardBtn->SetShowState(true);
- // __pGoBackBtn->SetShowState(true);
__pClearBtn->SetShowState(false);
}
break;
case ADDRESSBAR_MODE_LOADING:
{
- // __pBgPanel->SetPosition(__pGoBackBtn->GetPosition().x + 2* __pGoBackBtn->GetWidth() + 13,__pBgPanel->GetPosition().y);
- // __pSearchLabel->SetShowState(false);
- // __pFaviconLabel->SetShowState(true);
- // __pCancelBtn->SetShowState(false);
__pRefreshBtn->SetShowState(false);
__pStopBtn->SetShowState(true);
- // __pReaderBtn->SetShowState(false);
- // __pGoForwardBtn->SetShowState(true);
- // __pGoBackBtn->SetShowState(true);
__pClearBtn->SetShowState(false);
}
break;
case ADDRESSBAR_MODE_LOADING_COMPLETE:
{
- // __pBgPanel->SetPosition(__pGoBackBtn->GetPosition().x + 2* __pGoBackBtn->GetWidth() + 13,__pBgPanel->GetPosition().y);
- // __pCancelBtn->SetShowState(false);
-
- if (__pFooterUrlField && __pFooterUrlField->GetText().IsEmpty() == false)
- {
- // __pSearchLabel->SetShowState(false);
- // __pFaviconLabel->SetShowState(true);
- }
- else
- {
- // __pSearchLabel->SetShowState(true);
- // __pFaviconLabel->SetShowState(false);
- }
-
- if (__pFooterUrlField != NULL)
- {
- __pFooterUrlField->SetText(__displayUrl);
- __pFooterUrlField->HideKeypad();
- }
+// SetUrl(__pAddressbar->GetUrl());
__pRefreshBtn->SetShowState(true);
__pStopBtn->SetShowState(false);
- // __pReaderBtn->SetShowState(false);
- // __pGoForwardBtn->SetShowState(true);
- // __pGoBackBtn->SetShowState(true);
__pClearBtn->SetShowState(false);
}
break;
void MainForm::SetUrl(const String& url)
{
-
__displayUrl = url;
- String updatedDisplayUrl;
- updatedDisplayUrl.Clear();
if (__pFooterUrlField != NULL)
{
if (removedHttpUrl.IsEmpty() == false)
{
__pFooterUrlField->SetText(removedHttpUrl);
+ __pAddressbar->SetUrl(__displayUrl);
}
else
{
__pFooterUrlField->SetText(__displayUrl);
+ __pAddressbar->SetUrl(__displayUrl);
}
__pFooterUrlField->Invalidate(false);
+ __pAddressbar->Invalidate(true);
__pFooterUrlField->SetCursorPosition(0);
}
-
}
String