From 3f90ea73005a08885aa0b5965f0ebe693a6137ca Mon Sep 17 00:00:00 2001 From: Manoj Das Date: Sun, 31 Mar 2013 19:45:37 +0530 Subject: [PATCH] NABI issues Change-Id: I6f0e9b13e8882a3774f763426ae5798f504cb5bc --- inc/IntAddressbar.h | 4 + res/screen-size-normal/IDL_ADDRESSBAR.xml | 32 +- res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml | 30 +- res/screen-size-normal/IDL_FORM.xml | 54 +-- src/IntAddressbar.cpp | 117 ++----- src/IntBookmarkListForm.cpp | 10 +- src/IntEditBookmarkListForm.cpp | 4 +- src/IntMainForm.cpp | 395 +++++++--------------- src/IntMultipleWindowForm.cpp | 6 + src/IntMultipleWindowPresentationModel.cpp | 1 + src/IntPresentationModelBase.cpp | 24 +- 11 files changed, 262 insertions(+), 415 deletions(-) diff --git a/inc/IntAddressbar.h b/inc/IntAddressbar.h index 9d995ef..583ecc8 100644 --- a/inc/IntAddressbar.h +++ b/inc/IntAddressbar.h @@ -42,6 +42,7 @@ class Addressbar , public Tizen::Ui::IActionEventListener , public Tizen::Ui::IKeypadEventListener , public Tizen::Ui::IFocusEventListener + , public Tizen::Ui::ITextEventListener { public: /** @@ -66,6 +67,9 @@ class Addressbar void OnFocusGained(const Tizen::Ui::Control& source); void OnFocusLost(const Tizen::Ui::Control& source){} + virtual void OnTextValueChanged(const Tizen::Ui::Control& source); + virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source){} + /** * @brief Initializes this instance of Addressbar with the specified parameters. */ diff --git a/res/screen-size-normal/IDL_ADDRESSBAR.xml b/res/screen-size-normal/IDL_ADDRESSBAR.xml index 6b299af..b05aca3 100644 --- a/res/screen-size-normal/IDL_ADDRESSBAR.xml +++ b/res/screen-size-normal/IDL_ADDRESSBAR.xml @@ -3,7 +3,7 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + @@ -14,36 +14,41 @@ + - + + - + - - diff --git a/res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml b/res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml index e66e1e2..44739db 100644 --- a/res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml +++ b/res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml @@ -3,30 +3,30 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + - - - + + + - - + + diff --git a/res/screen-size-normal/IDL_FORM.xml b/res/screen-size-normal/IDL_FORM.xml index 0c98456..dde62bc 100644 --- a/res/screen-size-normal/IDL_FORM.xml +++ b/res/screen-size-normal/IDL_FORM.xml @@ -3,7 +3,7 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + 720
@@ -25,55 +25,55 @@ + + - - - - - - - - + + + + + diff --git a/src/IntAddressbar.cpp b/src/IntAddressbar.cpp index 96f52d2..b7eb241 100644 --- a/src/IntAddressbar.cpp +++ b/src/IntAddressbar.cpp @@ -144,62 +144,6 @@ Addressbar::Initialize(const Rectangle& rect) } __pProgressbarLabel->SetShowState(false); - //Add the go Back Button - /*__pGoBackBtn = static_cast (GetControl(L"IDC_BACKWARD_BUTTON",true)); - if (__pGoBackBtn == NULL) - { - AppLogDebug("Control not found returning E_INVALID_KEY"); - return E_INVALID_KEY; - } - __pGoBackBtn->SetActionId(IDA_GO_BACK); - __pGoBackBtn->AddActionEventListener(*this); - __pGoBackBtn->SetEnabled(false); - - //Add the go forward Button - __pGoForwardBtn = static_cast (GetControl(L"IDC_FORWARD_BUTTON",true)); - if (__pGoForwardBtn == NULL) - { - AppLogDebug("Control not found returning E_INVALID_KEY"); - return E_INVALID_KEY; - } - __pGoForwardBtn->SetActionId(IDA_GO_FORWARD); - __pGoForwardBtn->AddActionEventListener(*this); - __pGoForwardBtn->SetEnabled(false);*/ - - - //Add the favicon - /*__pFaviconLabel = static_cast (GetControl(L"IDC_FAVICON_BUTTON",true)); - if (__pFaviconLabel == NULL) - { - AppLogDebug("Control not found returning E_INVALID_KEY"); - return E_INVALID_KEY; - } - - __pFaviconLabel->SetShowState(false);*/ - - //Add the search icon - /*__pSearchLabel = static_cast (GetControl(L"IDC_SEARCH_BUTTON",true)); - if (__pSearchLabel == NULL) - { - AppLogDebug("Control not found returning E_INVALID_KEY"); - return E_INVALID_KEY; - } - - __pSearchLabel->SetShowState(true);*/ - - //Add the refresh button - /*__pRefreshBtn = static_cast (GetControl(L"IDC_REFRESH_BUTTON",true)); - if (__pRefreshBtn == NULL) - { - AppLogDebug("Control not found returning E_INVALID_KEY"); - return E_INVALID_KEY; - } - - __pRefreshBtn->SetActionId(IDA_REFRESH_BTN_CLICKED); - __pRefreshBtn->AddActionEventListener(*this); - __pRefreshBtn->SetShowState(true);*/ - - //Add the stop button __pStopBtn = static_cast (GetControl(L"IDC_STOP_BUTTON",true)); if (__pStopBtn == NULL) @@ -212,19 +156,6 @@ Addressbar::Initialize(const Rectangle& rect) __pStopBtn->SetShowState(false); - //Add the reader button - /*__pReaderBtn = static_cast (GetControl(L"IDC_READER_BUTTON",true)); - if (__pReaderBtn == NULL) - { - AppLogDebug("Control not found returning E_INVALID_KEY"); - return E_INVALID_KEY; - } - - __pReaderBtn->SetActionId(IDA_READER_BTN_CLICKED); - __pReaderBtn->AddActionEventListener(*this); - __pReaderBtn->SetShowState(false); -*/ - __pClearBtn = static_cast (GetControl(L"IDC_CLEAR_BUTTON",true)); if (__pClearBtn == NULL) { @@ -246,6 +177,15 @@ Addressbar::Initialize(const Rectangle& rect) __pAddressbarUrlField->SetOverlayKeypadCommandButtonVisible(false); __pAddressbarUrlField->SetKeypadAction(KEYPAD_ACTION_GO); __pAddressbarUrlField->AddFocusEventListener(*this); + __pAddressbarUrlField->AddTextEventListener(*this); + if(__pAddressbarUrlField->GetTextLength() == 0) + { + __pAddressbarUrlField->SetKeypadActionEnabled(false); + } + else + { + __pAddressbarUrlField->SetKeypadActionEnabled(true); + } __pToolBarLabel = static_cast (GetControl(L"IDC_TOOLBAR_LABEL",true)); if (__pToolBarLabel == NULL) @@ -274,16 +214,6 @@ Addressbar::Initialize(const Rectangle& rect) __pAddressBackBtn->SetShowState(true); //IDC_ADDRESS_BACK_BUTTON - /*//Add the Cancel Button - __pCancelBtn = static_cast (GetControl(L"IDC_CANCEL_BUTTON",true)); - if (__pCancelBtn == NULL) - { - AppLogDebug("Control not found returning E_INVALID_KEY"); - return E_INVALID_KEY; - } - __pCancelBtn->SetActionId(IDA_CANCEL); - __pCancelBtn->AddActionEventListener(*this); - __pCancelBtn->SetShowState(false);*/ // Added to get the favorite url if not set then address bar is about blank if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0) @@ -830,7 +760,7 @@ Addressbar::OnKeypadClosed(Tizen::Ui::Control& source) void Addressbar::OnKeypadOpened(Tizen::Ui::Control& source) { -// __pListener->OnAddressBarKeypadOpened(*this); + __pListener->OnAddressBarKeypadClosed(*this,false); } @@ -896,7 +826,7 @@ Addressbar::GetLockedImageN(void) } void -Addressbar::OnFocusGained(const Tizen::Ui::Control& source) +Addressbar::OnFocusGained(const Control& source) { //SetAddressbarMode(ADDRESSBAR_MODE_EDIT); // SetAddressbarMode(__prevAddMode); @@ -908,6 +838,31 @@ Addressbar::OnFocusGained(const Tizen::Ui::Control& source) } void +Addressbar::OnTextValueChanged(const Control& source) +{ + if(__pAddressbarUrlField != null) + { + if(__pAddressbarUrlField->GetTextLength() == 0) + { + if(__pAddressbarUrlField->IsKeypadActionEnabled() == true) + { + __pAddressbarUrlField->SetKeypadActionEnabled(false); + GetParent()->GetParent()->Invalidate(true); + } + } + else + { + if(__pAddressbarUrlField->IsKeypadActionEnabled() == false) + { + __pAddressbarUrlField->SetKeypadActionEnabled(true); + GetParent()->GetParent()->Invalidate(true); + } + } + } + +} + +void Addressbar::SetAddressbarURLFocus() { __pAddressbarUrlField->SetFocus(); diff --git a/src/IntBookmarkListForm.cpp b/src/IntBookmarkListForm.cpp index 1ace66f..9d7074e 100644 --- a/src/IntBookmarkListForm.cpp +++ b/src/IntBookmarkListForm.cpp @@ -629,12 +629,12 @@ BookmarkListForm::CreateItem(int index, int itemWidth) AppLog("rahul bitmap is null"); } - if (pBitmap == null) + //pBitmap = FaviconManager::GetInstance()->GetFaviconN(bitmapId); + /*if (pBitmap == null) { AppLogDebug("BookmarkListForm::CreateItem bitmap is null"); - pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN(); // we need to display default bookmark icon when favicon is not exist. - } - + pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN(); + }*/ pItem->AddElement(Rectangle(x_Margin_Icon, y_Margin_Icon, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null); pItem->AddElement(Rectangle(x_Margin_Title, 0, width_Title, itemHeight - height_Url), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(),44,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT) @@ -1036,8 +1036,10 @@ BookmarkListForm::OnKeypadClosed(Tizen::Ui::Control& source) GetFooter()->SetShowState(true); GetFooter()->Invalidate(true); __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()); + __pListview->SetBounds(__pSearchListView->GetX(), __pSearchBar->GetY() + __pSearchBar->GetHeight(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()); __pSearchListView->Invalidate(false); __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight())); + Invalidate(true); } void diff --git a/src/IntEditBookmarkListForm.cpp b/src/IntEditBookmarkListForm.cpp index a81da5a..09e2a59 100644 --- a/src/IntEditBookmarkListForm.cpp +++ b/src/IntEditBookmarkListForm.cpp @@ -79,12 +79,12 @@ EditBookmarkListForm::~EditBookmarkListForm(void) { if (__pData != null) { - __pData->RemoveAll(true); + __pData->RemoveAll(false); delete __pData; } if(__pSelectedList != null) { - __pSelectedList->RemoveAll(true); + __pSelectedList->RemoveAll(false); delete __pSelectedList; } } diff --git a/src/IntMainForm.cpp b/src/IntMainForm.cpp index 74d4079..b3f6d2f 100644 --- a/src/IntMainForm.cpp +++ b/src/IntMainForm.cpp @@ -608,40 +608,6 @@ MainForm::InitFooter(void) __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); @@ -659,48 +625,31 @@ MainForm::InitFooter(void) } //Add the editfield for url - __pFooterUrlField = static_cast (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 (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); - }*/ + AppLogDebug("__pFooterUrlField Control not found returning E_INVALID_KEY"); + 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 (GetControl(L"IDC_PAGEBACK_BUTTON",true)); @@ -1462,7 +1411,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) 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: { @@ -1833,11 +1782,11 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) __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)); + 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); } @@ -2061,7 +2010,7 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, 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) { @@ -2121,7 +2070,7 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, if (__pAddressbar != null) { - // __pAddressbar->UpdateFaviconBitmap(true); + // __pAddressbar->UpdateFaviconBitmap(true); } } @@ -2136,7 +2085,7 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, if (__pAddressbar != null) { - // __pAddressbar->UpdateFaviconBitmap(false); + // __pAddressbar->UpdateFaviconBitmap(false); } } @@ -2250,35 +2199,35 @@ MainForm::OnLoadingStarted(void) } 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(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(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); @@ -2716,29 +2665,6 @@ MainForm::OnAddressCancelledClicked(const Addressbar& addBar) 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); @@ -2801,6 +2727,7 @@ MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState) { InitMostVisitedSitesView(GetOrientationStatus()); } + __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight()); __pFooterPanel->SetShowState(footerState); __pFooterPanel->Invalidate(false); } @@ -2840,10 +2767,10 @@ MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar) { 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->Invalidate(true); + __pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight())); + __pAddressbar->SetAddressbarURLFocus(); } } @@ -2858,7 +2785,7 @@ MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar) __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); + __pMostVisitedListView->Invalidate(true); } else if (__pWebViewer != null && __pWebViewer->GetShowState() == true) { @@ -2867,7 +2794,7 @@ MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar) __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); + __pWebViewer->Invalidate(true); } /*else @@ -2999,8 +2926,7 @@ MainForm::OnLoadingRequested(const Tizen::Base::String& url, 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); @@ -3104,61 +3030,61 @@ MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graph { AppLog("MainForm::OnWebPageBlockSelected"); if (__pHitElementResult != null) - { - delete __pHitElementResult; - __pHitElementResult = null; - } + { + delete __pHitElementResult; + __pHitElementResult = null; + } - if (__pWebViewer != null) - { - AppLog("MainForm::OnWebPageBlockSelected web not null"); - __pHitElementResult = __pWebViewer->GetElementByPointN(endPoint); - } + if (__pWebViewer != null) + { + AppLog("MainForm::OnWebPageBlockSelected web not null"); + __pHitElementResult = __pWebViewer->GetElementByPointN(endPoint); + } - if (__pHitElementResult == null) - { - return; - } + if (__pHitElementResult == null) + { + return; + } - if (__pHitElementResult->HasImage() != true) - { - String tagName = __pHitElementResult->GetTagName(); - String type = __pHitElementResult->GetAttributeValue("type"); + if (__pHitElementResult->HasImage() != true) + { + String tagName = __pHitElementResult->GetTagName(); + String type = __pHitElementResult->GetAttributeValue("type"); - __currentSelectedStr.Clear(); - AppLog("__currentSelectedStr after clear %ls",__currentSelectedStr.GetPointer()); - __currentSelectedStr = __pWebViewer->GetTextFromBlock(); - AppLog("__currentSelectedStr after GetTextFromBlock %ls",__currentSelectedStr.GetPointer()); + __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) - { - AppLog("MainForm::OnWebPageBlockSelected show paste option"); + if ((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) + { + AppLog("MainForm::OnWebPageBlockSelected show paste option"); - InitSelectTextContextMenu(endPoint,true); - __pImageMenu->SetShowState(true); - __pImageMenu->Show(); - __pImageMenu->Invalidate(true); - } - else /*if (__pHitElementResult->HasUrl() == true )*/ - { - AppLog("MainForm::OnWebPageBlockSelected no paste option"); + InitSelectTextContextMenu(endPoint,true); + __pImageMenu->SetShowState(true); + __pImageMenu->Show(); + __pImageMenu->Invalidate(true); + } + else /*if (__pHitElementResult->HasUrl() == true )*/ + { + AppLog("MainForm::OnWebPageBlockSelected no paste option"); - if(__pHitElementResult->GetUrl().GetLength() > 0) - { - __currentSelectedStr.Clear(); - __currentSelectedStr = __pHitElementResult->GetUrl(); - } - InitSelectTextContextMenu(endPoint,false); - __pImageMenu->SetShowState(true); - __pImageMenu->Show(); - __pImageMenu->Invalidate(true); + if(__pHitElementResult->GetUrl().GetLength() > 0) + { + __currentSelectedStr.Clear(); + __currentSelectedStr = __pHitElementResult->GetUrl(); } - - AppLog("MainForm::OnWebPageBlockSelected block text is %ls",__currentSelectedStr.GetPointer()); - AppLog("MainForm::OnWebPageBlockSelected tag name is %ls",tagName.GetPointer()); - AppLog("MainForm::OnWebPageBlockSelected type name is %ls",type.GetPointer()); + InitSelectTextContextMenu(endPoint,false); + __pImageMenu->SetShowState(true); + __pImageMenu->Show(); + __pImageMenu->Invalidate(true); } + AppLog("MainForm::OnWebPageBlockSelected block text is %ls",__currentSelectedStr.GetPointer()); + AppLog("MainForm::OnWebPageBlockSelected tag name is %ls",tagName.GetPointer()); + AppLog("MainForm::OnWebPageBlockSelected type name is %ls",type.GetPointer()); + } + } void @@ -3336,7 +3262,7 @@ void MainForm::OnTextFound(int totalCount, int currentOrdinal) countStr.Append(L"/"); countStr.Append(__maxOccurrances); __pFindWordCountLabel->SetText(countStr); -// __pFindWordCountLabel->SetShowState(true); + // __pFindWordCountLabel->SetShowState(true); __pFindWordCountLabel->Invalidate(false); //FindNextWord(true); @@ -3375,7 +3301,7 @@ MainForm::FindNextWord(bool next) countStr.Append(L"/"); countStr.Append(__maxOccurrances); __pFindWordCountLabel->SetText(countStr); -// __pFindWordCountLabel->SetShowState(true); + // __pFindWordCountLabel->SetShowState(true); __pFindWordCountLabel->Invalidate(false); if (__currentWordIndex >= __maxOccurrances) { @@ -3402,7 +3328,7 @@ void MainForm::OnWebKeypadWillOpen(Tizen::Web::Controls::Web& source) { AppLog("MainForm::OnWebKeypadWillOpen"); -// OnAddressBarKeypadOpened(*__pAddressbar); + // OnAddressBarKeypadOpened(*__pAddressbar); } void @@ -3413,7 +3339,7 @@ MainForm::OnWebKeypadOpened(Tizen::Web::Controls::Web& source) { AppLog("MainForm::OnOrientationChanged GetClientAreaBounds().height %d ", GetClientAreaBounds().height); -// __pFooterPanel->SetShowState(false); + // __pFooterPanel->SetShowState(false); __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height)); @@ -3631,7 +3557,7 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori //__pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight())); //__pAddressbar->SetAddressbarMode(__pAddressbar->GetAddressbarMode()); SetAddressbarMode(GetAddressbarMode()); - // __pAddressbar->UpdateFaviconBitmap(SettingPresentationModel::GetInstance()->GetPrivateOn()); + // __pAddressbar->UpdateFaviconBitmap(SettingPresentationModel::GetInstance()->GetPrivateOn()); } if (__pFindWordBgLabel != null) { @@ -3647,6 +3573,8 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori { AppLog("__pFooterPanel->GetShowState() is true"); InitFooter(); + __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight()); + __pFooterPanel->Invalidate(true); } InitAddressbar(); @@ -4034,45 +3962,22 @@ MainForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics:: 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(__pFooterUrlField) && __pFooterUrlField != null) + { + if(__pFooterUrlField->GetTextLength() == 0) + { + __pFooterUrlField->SetKeypadActionEnabled(false); + } + else + { + __pFooterUrlField->SetKeypadActionEnabled(true); + } + } if (__pFindWordEditField != null) { __currentSearchStr = __pFindWordEditField->GetText(); @@ -4091,7 +3996,7 @@ MainForm::OnTextValueChanged (const Tizen::Ui::Control &source) else { __currentSearchStr = L"aaaaaaaabbbbbbbccccccc"; - StartWordSearch(); + StartWordSearch(); AppLogDebug("Enter something"); } } @@ -4357,60 +4262,23 @@ void MainForm::SetAddressbarMode(AddressBarMode addMode) 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; @@ -4435,10 +4303,7 @@ AddressBarMode MainForm::GetAddressbarMode(void) void MainForm::SetUrl(const String& url) { - __displayUrl = url; - String updatedDisplayUrl; - updatedDisplayUrl.Clear(); if (__pFooterUrlField != NULL) { @@ -4446,16 +4311,18 @@ void MainForm::SetUrl(const String& url) 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 diff --git a/src/IntMultipleWindowForm.cpp b/src/IntMultipleWindowForm.cpp index c44d91b..047c5cd 100644 --- a/src/IntMultipleWindowForm.cpp +++ b/src/IntMultipleWindowForm.cpp @@ -514,6 +514,12 @@ MultipleWindowForm::CreateItem(int index, int itemWidth) pageURL = L"<"+ nourl +">"; } + if (pageTitle.GetLength() == 0) + { + String nourl; + pAppResource->GetString(L"IDS_BR_BODY_ABOUT_C_BLANK", pageTitle); + } + Rectangle screenBounds = GetBounds(); r = pItem->Construct(Dimension(itemWidth, 128), style); if (IsFailed(r)) diff --git a/src/IntMultipleWindowPresentationModel.cpp b/src/IntMultipleWindowPresentationModel.cpp index 4b7afb6..46a2b86 100644 --- a/src/IntMultipleWindowPresentationModel.cpp +++ b/src/IntMultipleWindowPresentationModel.cpp @@ -54,6 +54,7 @@ WindowInfo::WindowInfo(void) faviconFilePath = ""; faviconUrl = ""; pageUrl = L""; + pageTitle = ""; pFavicon = FaviconManager::GetInstance()->GetDefaultFaviconN(); pCurrentWeb = null; pWebCanvasBitmap = null; diff --git a/src/IntPresentationModelBase.cpp b/src/IntPresentationModelBase.cpp index 458426a..c0fa1f4 100644 --- a/src/IntPresentationModelBase.cpp +++ b/src/IntPresentationModelBase.cpp @@ -453,12 +453,18 @@ PresentationModelBase::ExecuteBookmarkQuery(const Tizen::Base::String& formatQue __pDbStatement->BindString(4,dt.ToString()); __pDbStatement->BindString(5,dt.ToString()); - if(bookmark.GetFavIconBuffer() != null) // When favicon is exist, we save favicon to db. + if(bookmark.GetFavIconBuffer() != null) { __pDbStatement->BindBlob(6,*(bookmark.GetFavIconBuffer())); - __pDbStatement->BindInt(7,bookmark.GetFavIconWidth()); - __pDbStatement->BindInt(8,bookmark.GetFavIconHeight()); } + else + { + ByteBuffer buff; + buff.Construct(10); + __pDbStatement->BindBlob(6,buff); + } + __pDbStatement->BindInt(7,bookmark.GetFavIconWidth()); + __pDbStatement->BindInt(8,bookmark.GetFavIconHeight()); __pDataBase->ExecuteStatementN(*__pDbStatement); @@ -570,12 +576,18 @@ PresentationModelBase::ExecuteHistoryQuery(const Tizen::Base::String& formatQuer __pDbStatement->BindString(0,historyUrl); __pDbStatement->BindString(1,historyTitle); __pDbStatement->BindDateTime(2, date); - if(history.GetFavIconBuffer() != null) // When favicon is exist, we save favicon to db. + if(history.GetFavIconBuffer() != null) { __pDbStatement->BindBlob(3,*(history.GetFavIconBuffer())); - __pDbStatement->BindInt(4,history.GetFavIconWidth()); - __pDbStatement->BindInt(5,history.GetFavIconHeight()); } + else + { + ByteBuffer buff; + buff.Construct(10); + __pDbStatement->BindBlob(3,buff); + } + __pDbStatement->BindInt(4,history.GetFavIconWidth()); + __pDbStatement->BindInt(5,history.GetFavIconHeight()); __pDataBase->ExecuteStatementN(*__pDbStatement); -- 2.7.4