From 646aa84f599d577b317541fdafa0c23664489dd8 Mon Sep 17 00:00:00 2001 From: "rahul.dutt" Date: Fri, 14 Jun 2013 14:14:35 +0530 Subject: [PATCH] N_SE-41079, N_SE-4110, N_SE-41244, N_SE-41185, N_SE-41215, N_SE-41461, N_SE-41326 Change-Id: I8005f30e2cfc9cc1efb32eae330531e2f0d5a7f8 --- inc/IntAddressbar.h | 2 + inc/IntMainForm.h | 7 +- inc/IntSharePopup.h | 1 + res/screen-size-normal/IDL_ADD_BOOKMARK.xml | 146 +++++------ src/IntAddBookmarkForm.cpp | 8 +- src/IntAddressbar.cpp | 41 ++- src/IntBookmarkListForm.cpp | 2 +- src/IntEditBookmarkListForm.cpp | 30 ++- src/IntMainForm.cpp | 381 ++++++++++------------------ src/IntPresentationModelBase.cpp | 3 +- src/IntSharePopup.cpp | 44 +++- 11 files changed, 305 insertions(+), 360 deletions(-) mode change 100644 => 100755 res/screen-size-normal/IDL_ADD_BOOKMARK.xml diff --git a/inc/IntAddressbar.h b/inc/IntAddressbar.h index 18623e5..89820b7 100644 --- a/inc/IntAddressbar.h +++ b/inc/IntAddressbar.h @@ -172,6 +172,7 @@ class Addressbar Tizen::Base::String GetAddressbarURL(); bool HasCurrentFocus(void); + void OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs); private: /** * @brief Updates the progressbar Value. @@ -213,6 +214,7 @@ class Addressbar Tizen::Ui::Controls::Label* __pToolBarLabel; Tizen::Ui::Controls::Label* __pAddressbarURLLabel; Tizen::Ui::Controls::Button* __pAddressBackBtn; + bool __isAppBackGround; }; #endif /* _INT_ADDRESSBAR_H_ */ diff --git a/inc/IntMainForm.h b/inc/IntMainForm.h index 626d2ec..239470b 100644 --- a/inc/IntMainForm.h +++ b/inc/IntMainForm.h @@ -187,8 +187,8 @@ public: void SetJavascriptEnabled(void); - void OnFocusGained(const Tizen::Ui::Control& source); - void OnFocusLost(const Tizen::Ui::Control& source); + virtual void OnFocusGained(const Tizen::Ui::Control& source); + virtual void OnFocusLost(const Tizen::Ui::Control& source); // IListViewItemEventListener /** @@ -287,7 +287,6 @@ private: void FindNextWord(bool next = true); result InitAddressbar(void); result InitFooter(void); - result InitContextMenu(Tizen::Graphics::Point& p); result InitOptionMenu(void); result InitFindWordPanel(void); result InitImageContextMenu(Tizen::Graphics::Point p); @@ -359,7 +358,7 @@ private: Tizen::Ui::Controls::Panel* __pFooterPanel; Tizen::Web::Controls::HitElementResult* __pHitElementResult; Tizen::Ui::Controls::ContextMenu* __pImageMenu; - Tizen::Ui::Controls::ContextMenu* __pMenu; +// Tizen::Ui::Controls::ContextMenu* __pMenu; Tizen::Ui::Controls::OptionMenu* __pOptionMenu; Tizen::Ui::Controls::Button* __pMoreButton; diff --git a/inc/IntSharePopup.h b/inc/IntSharePopup.h index 0905fa0..68e9d99 100644 --- a/inc/IntSharePopup.h +++ b/inc/IntSharePopup.h @@ -26,6 +26,7 @@ #include #include +#include #include diff --git a/res/screen-size-normal/IDL_ADD_BOOKMARK.xml b/res/screen-size-normal/IDL_ADD_BOOKMARK.xml old mode 100644 new mode 100755 index 21ce068..0919e02 --- a/res/screen-size-normal/IDL_ADD_BOOKMARK.xml +++ b/res/screen-size-normal/IDL_ADD_BOOKMARK.xml @@ -1,73 +1,73 @@ - - - - - - 720 -
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + + + + 720 +
+ + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/IntAddBookmarkForm.cpp b/src/IntAddBookmarkForm.cpp index f341684..d2cd781 100644 --- a/src/IntAddBookmarkForm.cpp +++ b/src/IntAddBookmarkForm.cpp @@ -44,7 +44,7 @@ using namespace Tizen::Ui::Scenes; static const int LIST_ITEM_HEIGHT = 112; static const int H_ITEM_HEIGHT = 112; -static const int H_TITLE_ITEM_HEIGHT = 140; +static const int H_TITLE_ITEM_HEIGHT = 150; static const wchar_t* IDB_LIST_LEFT_SIDE = L"ListLeftSide.png"; const int AddBookmarkForm::IDA_CREATE_BOOKMARK_FOLDER = 101; @@ -361,7 +361,7 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId) AppLog("AddBookmarkForm::OnActionPerformed does url exist 2"); if ( exist == true) { - String msg = CommonUtil::GetString(L"IDS_BR_POP_BOOKMARK_ALREADY_EXISTS"); + String msg = CommonUtil::GetString(L"IDS_BR_POP_ALREADY_EXISTS"); CreateMessage(msg); AppLogDebug("Bookmark already exists"); @@ -633,8 +633,8 @@ AddBookmarkForm::CreateItem(int index, int itemWidth) pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); - pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); - pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); + pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED); + pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, ITEM_BACKGROUND_COLOR_HIGHLIGHTED); pItem->SetMainText(CommonUtil::GetString(L"IDS_BR_HEADER_FOLDER")); pItem->SetSubText(__folderName); pItem->Make(); diff --git a/src/IntAddressbar.cpp b/src/IntAddressbar.cpp index 3293c78..4bfdb7f 100644 --- a/src/IntAddressbar.cpp +++ b/src/IntAddressbar.cpp @@ -73,6 +73,7 @@ Addressbar::Addressbar(void) __isClipboardOpen = false; __isKeyboardConnected = false; __isKeyPadOpened = false; + __isAppBackGround = false; } Addressbar::~Addressbar(void) @@ -623,6 +624,19 @@ void Addressbar::OnFocusGained(const Control& source) { AppLog("XYZ::Addressbar::OnFocusGained"); + if(__pAddressbarUrlField && __isAppBackGround == false) + { + String removedHttpUrl = RemoveHttpTextFromDisplayURL(); + if (removedHttpUrl.IsEmpty() == false) + { + __pAddressbarUrlField->SetText(removedHttpUrl); + } + else + { + __pAddressbarUrlField->SetText(__displayUrl); + } + } + if(__pAddressbarUrlField != null) { __pAddressbarUrlField->SetCursorPosition(__pAddressbarUrlField->GetTextLength()); @@ -645,18 +659,7 @@ void Addressbar::OnFocusLost(const Tizen::Ui::Control& source) { AppLog("XYZ::Addressbar::OnFocusLost"); - if(__pAddressbarUrlField) - { - String removedHttpUrl = RemoveHttpTextFromDisplayURL(); - if (removedHttpUrl.IsEmpty() == false) - { - __pAddressbarUrlField->SetText(removedHttpUrl); - } - else - { - __pAddressbarUrlField->SetText(__displayUrl); - } - } + // __editTextUrl = L""; if(__pListener != null) { @@ -705,4 +708,18 @@ bool Addressbar::HasCurrentFocus() { return __pAddressbarUrlField->HasFocus(); +} + + +void +Addressbar::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs) +{ + if (requestId == BACK_GROUND_APP_EVENT) + { + __isAppBackGround = true; + } + else if(requestId == FORE_GROUND_APP_EVENT) + { + __isAppBackGround = false; + } } diff --git a/src/IntBookmarkListForm.cpp b/src/IntBookmarkListForm.cpp index 741aa3e..a78af94 100644 --- a/src/IntBookmarkListForm.cpp +++ b/src/IntBookmarkListForm.cpp @@ -239,7 +239,7 @@ BookmarkListForm::OnInitializing(void) return E_FAILURE; } - r = __pSearchListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height -72 - 30), true, false); + r = __pSearchListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height -72), true, false); TryCatch( !IsFailed(r),,"BookmarkListForm::OnSearchBarModeChanged Update list failed %s",GetErrorMessage(r)); __pSearchListView->SetBackgroundColor(GetBackgroundColor()); diff --git a/src/IntEditBookmarkListForm.cpp b/src/IntEditBookmarkListForm.cpp index a53f67f..db4a3f8 100644 --- a/src/IntEditBookmarkListForm.cpp +++ b/src/IntEditBookmarkListForm.cpp @@ -319,7 +319,14 @@ EditBookmarkListForm::OnActionPerformed(const Tizen::Ui::Control& source, int ac GetFooter()->SetItemEnabled(0,true); GetFooter()->Invalidate(true); - labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() ,__pListview->GetItemCount()); + if(__pListview->GetItemCount() >1) + { + labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __pListview->GetItemCount()); + } + else + { + labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __pListview->GetItemCount()); + } __selectedItemCount = 0; @@ -691,7 +698,16 @@ EditBookmarkListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& labelString.Append(__selectedItemCount); labelString.Append(L")");*/ - labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedItemCount); + if(__selectedItemCount >1) + { + labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __selectedItemCount); + } + else + { + labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedItemCount); + } + + __pInfoLabel->SetText(labelString); __pInfoPanel->Draw(); @@ -813,7 +829,15 @@ EditBookmarkListForm::OnSceneActivatedN(const SceneId& previousSceneId, const Sc labelString.Append(L"("); labelString.Append(__selectedItemCount); labelString.Append(L")");*/ - labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedItemCount); + + if(__selectedItemCount >1) + { + labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __selectedItemCount); + } + else + { + labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedItemCount); + } __pInfoLabel->SetText(labelString); diff --git a/src/IntMainForm.cpp b/src/IntMainForm.cpp index 7187e92..56d277a 100644 --- a/src/IntMainForm.cpp +++ b/src/IntMainForm.cpp @@ -154,7 +154,6 @@ MainForm::MainForm(void) __pWindowInfo = null; __pWebViewer = null; __pImageMenu = null; - __pMenu = null; __pOptionMenu = null; __pFindWordControl = null; __pFindWordPanelLeftToRight = null; @@ -214,6 +213,7 @@ MainForm::MainForm(void) __isWebKeypadOpened = false; __fontSize = 44; __isHwKeySupported = false; + } MainForm::~MainForm(void) @@ -532,7 +532,7 @@ MainForm::InitWebControl() __pWebViewer->SetWebKeypadEventListener(this); __pWebViewer->SetFocus(); __pWebViewer->AddTouchEventListener(*this); - + __pWebViewer->AddFocusEventListener(*this); __pWebViewer->SetCookieEnabled(SettingPresentationModel::GetInstance()->IsCookiesEnabled()); __pWebViewer->SetTextSearchListener(this); } @@ -548,6 +548,7 @@ void MainForm::OnFocusGained(const Control& source) { AppLog("MainForm::OnFocusGained"); + RelayoutControls(false); } void @@ -789,57 +790,6 @@ MainForm::InitFooter(void) } result -MainForm::InitContextMenu(Point& p) -{ - result r = E_SUCCESS; - bool isPrivateBrowsing = false; - Bitmap* pBitmap = null; - - if (__pMenu != null) - { - __pMenu->SetAnchorPosition(p); - __pMenu->Invalidate(true); - return r; - } - - __pMenu = new(std::nothrow) ContextMenu(); - r = __pMenu->Construct(p, CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD); - TryCatch(!IsFailed(r),,"Contextmenu creation failed with%s",GetErrorMessage(r)); - - isPrivateBrowsing = SettingPresentationModel::GetInstance()->GetPrivateOn(); - - - if (isPrivateBrowsing == true) - { - pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_BUTTON_ON); - } - else - { - pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_BUTTON_OFF); - } - - r = __pMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_BOOKMARK"), IDA_BOOKMARKBTN_CLICKED); - - if ( pBitmap != NULL) - { - __pMenu->AddItem(CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"), IDA_PRIVATEON_CLICKED,*pBitmap); - delete pBitmap; - } - r = __pMenu->AddItem(CommonUtil::GetString(L"IDS_BR_TAB_HISTORY"), 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); - - - __pMenu->SetMaxVisibleItemsCount(6); - __pMenu->SetShowState(false); - __pMenu->AddActionEventListener(*this); - SetControlAlwaysOnTop(*__pMenu, true); - - CATCH: - return r; -} - -result MainForm::InitOptionMenu() { result r = E_SUCCESS; @@ -1513,16 +1463,8 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) { __pWebViewer->GoForward(); } - if(__isHwKeySupported == true) - { - __pOptionMenu->SetShowState(false); - __pOptionMenu->Invalidate(false); - } - else - { - __pMenu->SetShowState(false); - __pMenu->Invalidate(false); - } + __pOptionMenu->SetShowState(false); + __pOptionMenu->Invalidate(false); break; case IDA_FINDONPAGE_CLICKED: @@ -1531,16 +1473,8 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) __currentSearchStr.Clear(); InitFindWordPanel(); - if(__isHwKeySupported == true) - { - __pOptionMenu->SetShowState(false); - __pOptionMenu->Invalidate(false); - } - else - { - __pMenu->SetShowState(false); - __pMenu->Invalidate(false); - } + __pOptionMenu->SetShowState(false); + __pOptionMenu->Invalidate(false); ShowFindWordPanel(true); @@ -1605,20 +1539,11 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) __pAddressbar->UpdateFaviconBitmap(true); } } - if(__isHwKeySupported == true) - { - itemIndex = __pOptionMenu->GetItemIndexFromActionId(IDA_PRIVATEON_CLICKED); - r = __pOptionMenu->SetItemAt(itemIndex,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); - AppLog("Result:: %s for index = %d", GetErrorMessage(r),itemIndex); - __pOptionMenu->Invalidate(true); - } - else - { - itemIndex = __pMenu->GetItemIndexFromActionId(IDA_PRIVATEON_CLICKED); - r = __pMenu->SetItemAt(itemIndex,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); - AppLog("Result:: %s for index = %d", GetErrorMessage(r),itemIndex); - __pMenu->Invalidate(true); - } + + itemIndex = __pOptionMenu->GetItemIndexFromActionId(IDA_PRIVATEON_CLICKED); + r = __pOptionMenu->SetItemAt(itemIndex,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); + AppLog("Result:: %s for index = %d", GetErrorMessage(r),itemIndex); + __pOptionMenu->Invalidate(true); if ( pBitmap != NULL ) { delete pBitmap; @@ -1636,16 +1561,9 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) pArgList->Add(*__pWindowInfo); SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_SETTINGS), pArgList); } - if(__isHwKeySupported) - { - __pOptionMenu->SetShowState(false); - __pOptionMenu->Invalidate(false); - } - else - { - __pMenu->SetShowState(false); - __pMenu->Invalidate(false); - } + __pOptionMenu->SetShowState(false); + __pOptionMenu->Invalidate(false); + if (pArgList != null) { delete pArgList; @@ -1713,30 +1631,14 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_ON_TEMP); } } - if(__isHwKeySupported == true) + if (pBitmap != null) { - if (pBitmap != null) - { - r = __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap); - delete pBitmap; - } - } - else - { - if (pBitmap != null) - { - r = __pMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap); - delete pBitmap; - } - } - if(__isHwKeySupported == true) - { - __pOptionMenu->Invalidate(true); - } - else - { - __pMenu->Invalidate(true); + r = __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap); + delete pBitmap; } + + + __pOptionMenu->Invalidate(true); } } @@ -1840,13 +1742,10 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) break; case IDA_MOREBTN_CLICKED: { - AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 1"); - Point p = Point(__pMoreButton->GetX() + __pMoreButton->GetWidth() / 2, GetClientAreaBounds().y + GetClientAreaBounds().height - __pMoreButton->GetHeight()); - AppLog("Anchot pos: %d %d", p.x, p.y); - InitContextMenu(p); + AppLog("IDA_MOREBTN_CLICKED"); + InitOptionMenu(); if (__pWindowInfo != NULL && __pWindowInfo->pageUrl != NULL && __pWebViewer->GetShowState() == true) { - AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 2"); int bookmarkCount=0; bool exist = false; String url=L""; @@ -1870,13 +1769,13 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) } AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 3"); - if (__pMenu->GetItemCount() == 9) + if (__pOptionMenu->GetItemCount() == 9) { - r = __pMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap); + r = __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap); } else { - r = __pMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap); + r = __pOptionMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap); } if (IsFailed(r)) @@ -1886,34 +1785,35 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) return ; } AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 4"); - if (__pMenu->GetItemCount() != 9) + if (__pOptionMenu->GetItemCount() != 9) { - __pMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED); - __pMenu->InsertItemAt(2,CommonUtil::GetString(L"IDS_BR_BODY_PRINT"), IDA_PRINT_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->SetMaxVisibleItemsCount(6); + __pOptionMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED); + __pOptionMenu->InsertItemAt(2,CommonUtil::GetString(L"IDS_BR_BODY_PRINT"), IDA_PRINT_CLICKED); + // __pOptionMenu->InsertItemAt(2,L"Add to Home"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADD_TO_HOME_CLICKED); + __pOptionMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED); + __pOptionMenu->InsertItemAt(4,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED); + __pOptionMenu->SetMaxVisibleItemsCount(6); } if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE) { AppLog(" Orientation landscape"); - __pMenu->SetMaxVisibleItemsCount(5); + __pOptionMenu->SetMaxVisibleItemsCount(5); } else { AppLog(" Orientation potrait"); - __pMenu->SetMaxVisibleItemsCount(6); + __pOptionMenu->SetMaxVisibleItemsCount(6); } AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 5"); delete pBitmap; } AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED end"); - __pMenu->SetShowState(true); - __pMenu->Invalidate(true); - __pMenu->Show(); - } + __pOptionMenu->SetShowState(true); + __pOptionMenu->Invalidate(true); + __pOptionMenu->Show(); + +} break; case IDA_HISTORY_CLICKED: { @@ -2009,10 +1909,21 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) __currentSearchStr = L""; __currentWordIndex = 0; __maxOccurrances = 0; - __pFindWordEditField->SetText(L""); + + if (__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true) + { + __pFindWordEditField->SetText(L""); + __pFindWordCountLabel->SetText(L"0/0"); + } + else if (__pFindWordPanelRightToLeft && __pFindWordPanelRightToLeft->GetShowState() == true) + { + __pFindWordEditFieldRightToLeft->SetText(L""); + __pFindWordCountLabelRightToLeft->SetText(L"0/0"); + } + __pFindWordNext->SetEnabled(false); __pFindWordPrev->SetEnabled(false); - __pFindWordCountLabel->SetText(L"0/0"); + __pWebViewer->SearchText(L"aaaabbbbcccc",true); AppLog("akjshdasd 1"); __pFooterPanel->SetShowState(true); @@ -2021,7 +1932,15 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) break; case IDA_FINDWORD_SEARCH_CLICKED: { - __currentSearchStr = __pFindWordEditField->GetText(); + if (__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true) + { + __currentSearchStr = __pFindWordEditField->GetText(); + } + else if (__pFindWordPanelRightToLeft && __pFindWordPanelRightToLeft->GetShowState() == true) + { + __currentSearchStr = __pFindWordEditFieldRightToLeft->GetText(); + } + if (__currentSearchStr.GetLength() > 0) { StartWordSearch(); @@ -2080,19 +1999,20 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) AppLogDebug("IDA_COPY_IMAGE_CLICKED"); ClipboardItem item; const Bitmap* pBitmap = null; - if (__pHitElementResult != null) + if (__pHitElementResult != null && __pHitElementResult->HasImage()) { pBitmap = __pHitElementResult->GetImage(); } String resourcePath = App::GetInstance()->GetAppResourcePath(); - item.Construct(CLIPBOARD_DATA_TYPE_IMAGE , *pBitmap); - + r = item.Construct(CLIPBOARD_DATA_TYPE_IMAGE , *pBitmap); + AppLog("Platofrm construct failed result %s",GetErrorMessage(r)); // copying the item to clipboard Clipboard* pClipboard = Clipboard::GetInstance(); if (pClipboard != null) { - pClipboard->CopyItem(item); + r = pClipboard->CopyItem(item); + AppLog("Platofrm copy failed result %s",GetErrorMessage(r)); } } break; @@ -2296,22 +2216,11 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) __currentSearchStr.Clear(); __currentSearchStr.Append(__currentSelectedStr); InitFindWordPanel(); - __pFindWordEditField->SetText(__currentSearchStr); - if(__isHwKeySupported) - { - if(__pOptionMenu != null) - { - __pOptionMenu->SetShowState(false); - __pOptionMenu->Invalidate(false); - } - } - else + + if(__pOptionMenu != null) { - if(__pMenu != null) - { - __pMenu->SetShowState(false); - __pMenu->Invalidate(false); - } + __pOptionMenu->SetShowState(false); + __pOptionMenu->Invalidate(false); } __adressPanelPosition.y = 0; @@ -2329,7 +2238,17 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) } ShowFindWordPanel(true); - __pFindWordEditField->SetFocus(); + if (__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true) + { + __pFindWordEditField->SetText(__currentSearchStr); + __pFindWordEditField->SetFocus(); + } + else if(__pFindWordPanelRightToLeft && __pFindWordPanelRightToLeft->GetShowState() == true) + { + __pFindWordEditFieldRightToLeft->SetText(__currentSearchStr); + __pFindWordEditFieldRightToLeft->SetFocus(); + } + if (__currentSearchStr.GetLength() > 0) { StartWordSearch(); @@ -2461,10 +2380,9 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) String url = __pFooterUrlField->GetText(); AppLog("MainForm::OnUrlSubmitted url is %ls", url.GetPointer()); // LoadUrl(url); - __pWebViewer->Reload(); - if (__pAddressbar != null) + if (__pWebViewer != null && __pAddressbar != null) { - //__pAddressbar->SetAddressbarMode((AddressBarMode)ADDRESSBAR_MODE_LOADING); + __pWebViewer->Reload(); SetAddressbarMode((AddressBarMode)ADDRESSBAR_MODE_LOADING); } @@ -2759,30 +2677,15 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, } } - if(__isHwKeySupported == true) + if (__pOptionMenu != null && __pOptionMenu->GetItemCount() != 9) { - if (__pOptionMenu != null && __pOptionMenu->GetItemCount() == 3) - { - __pOptionMenu->SetItemAt(0,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); - } - else if (__pOptionMenu != null ) - { - __pOptionMenu->SetItemAt(3,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); - } - + __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); } - else + else if (__pOptionMenu != null ) { - if (__pMenu != null && __pMenu->GetItemCount() == 3) - { - __pMenu->SetItemAt(0,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); - } - else if (__pMenu != null ) - { - __pMenu->SetItemAt(3,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); - } - + __pOptionMenu->SetItemAt(5,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap); } + if (pBitmap != null) { delete pBitmap; @@ -2858,23 +2761,14 @@ MainForm::OnLoadingStarted(void) } // this is added in case if menu is opened and user load the page - if(__isHwKeySupported == true) + if(__pOptionMenu != null && __pOptionMenu->GetShowState() == true) { - if(__pOptionMenu != null && __pOptionMenu->GetShowState() == true) - { - __pOptionMenu->SetShowState(false); - __pOptionMenu->Invalidate(true); - } - - } - else - { - if(__pMenu != null && __pMenu->GetShowState() == true) - { - __pMenu->SetShowState(false); - __pMenu->Invalidate(true); - } + __pOptionMenu->SetShowState(false); + __pOptionMenu->Invalidate(true); } + + + if(__pImageMenu != null && __pImageMenu->GetShowState() == true) { __pImageMenu->SetShowState(false); @@ -3486,7 +3380,7 @@ MainForm::OnAddressBarFocusLost(const Addressbar& addBar, bool addressbarKeyPadS __pFooterPanel->SetShowState(true); } - RelayoutControls(false); + //RelayoutControls(false); } void @@ -3904,8 +3798,14 @@ MainForm::RelayoutControls(bool showAddressbar,bool relayoutFooter) } if (__pWebViewer != null && __pWebViewer->GetShowState() == true) { - __pWebViewer->SetBounds(0, __webControlPosition.y, GetClientAreaBounds().width, __webControlHeight + 12); - __pWebViewer->Invalidate(false); + if(__pWebViewer->GetX() == 0 && __pWebViewer->GetY() == __webControlPosition.y &&__pWebViewer->GetWidth() == GetClientAreaBounds().width &&__pWebViewer->GetHeight() == __webControlHeight + 12 ) + { + } + else + { + __pWebViewer->SetBounds(0, __webControlPosition.y, GetClientAreaBounds().width, __webControlHeight + 12); + __pWebViewer->Invalidate(false); + } } if(__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null) { @@ -4244,7 +4144,11 @@ MainForm::OnWebKeypadClosed(Tizen::Web::Controls::Web& source) void MainForm::OnWebKeypadBoundsChanged(Tizen::Web::Controls::Web& source) { -// RelativeLayout(false); + // RelativeLayout(false); + if(__pWebViewer != null) + { + __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,GetClientAreaBounds().height)); + } } void @@ -4355,6 +4259,11 @@ MainForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphic { AppLog("MainForm::OnTouchReleased"); + if (__pAddressbar && __pAddressbar->GetShowState() == true) + { + __pAddressbar->SetShowState(false); + } + // Not reuired now. /*HitElementResult* pHitElement = __pWebViewer->GetElementByPointN(currentPosition); if(pHitElement != null && pHitElement->HasUrl() == true && __inputEventToBeSupressed == true) @@ -4490,16 +4399,10 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori } } - if(__isHwKeySupported == true) - { - if(__pOptionMenu != null) - __pOptionMenu->SetShowState(false); - } - else - { - if(__pMenu != null) - __pMenu->SetShowState(false); - } + + if(__pOptionMenu != null) + __pOptionMenu->SetShowState(false); + if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE) { widthContextItem = WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE; @@ -4518,13 +4421,6 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori } InitAddressbar(); - if(__pMoreButton && __pMenu) - { - Point p = Point(__pMoreButton->GetX() + __pMoreButton->GetWidth() / 2, GetBounds().height - __pMoreButton->GetHeight()); - __pMenu->SetAnchorPosition(p); - __pMenu->Invalidate(true); - } - String homePage = SettingPresentationModel::GetInstance()->GetHomepage(); if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0) { @@ -4792,9 +4688,6 @@ MainForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics AppLog("MainForm::OnTouchPressed %d",__pFindWordControl->GetShowState()); // ShowFindWordPanel(__pFindWordControl->GetShowState(), true); } - //__isLongPressedDone = false; - if(__pAddressbar) - __pAddressbar->SetShowState(false); Touch touch; IList* pList = null; @@ -5412,13 +5305,18 @@ void MainForm::OnSharePopupControlStarted(void) __pWebViewer->AddTouchEventListener(*this); } -void MainForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs) +void +MainForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs) { if (requestId == BACK_GROUND_APP_EVENT) { if(__pWebViewer != null) { __pWebViewer->Pause(); + } + if(__pAddressbar != null) + { + __pAddressbar->SendUserEvent(BACK_GROUND_APP_EVENT,NULL); } } else if(requestId == FORE_GROUND_APP_EVENT) @@ -5427,6 +5325,10 @@ void MainForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collectio { __pWebViewer->Resume(); } + if(__pAddressbar != null) + { + __pAddressbar->SendUserEvent(FORE_GROUND_APP_EVENT,NULL); + } } } @@ -5459,21 +5361,6 @@ void MainForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source) { AppLog("MainForm::OnFormMenuRequested called"); - - - - - - - - - - - - - - - InitOptionMenu(); if (__pWindowInfo != NULL && __pWindowInfo->pageUrl != NULL && __pWebViewer->GetShowState() == true) { @@ -5543,13 +5430,5 @@ MainForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source) __pOptionMenu->SetShowState(true); __pOptionMenu->Invalidate(true); __pOptionMenu->Show(); - - - - - - - - - -} + +} \ No newline at end of file diff --git a/src/IntPresentationModelBase.cpp b/src/IntPresentationModelBase.cpp index 25783e7..f2b95ec 100644 --- a/src/IntPresentationModelBase.cpp +++ b/src/IntPresentationModelBase.cpp @@ -996,7 +996,8 @@ PresentationModelBase::GetCurrentDateTime(DateTime& dt) result r = E_FAILURE; TimeZone tz; - r = SystemTime::GetCurrentTime(UTC_TIME, dtNow); + r = SystemTime::GetCurrentTime(dt); + return true; if (IsFailed(r)) { return false; diff --git a/src/IntSharePopup.cpp b/src/IntSharePopup.cpp index a7294b8..b9e580c 100644 --- a/src/IntSharePopup.cpp +++ b/src/IntSharePopup.cpp @@ -387,12 +387,7 @@ SharePopup::StartEmailAppControl(void) delete pAc; } - if (pShareInfo != null) - { - delete pShareInfo; - } delete pDataList; - } void @@ -480,12 +475,6 @@ SharePopup::StartMessageAppControl(void) delete pAc; } - - - if (pShareInfo != null) - { - delete pShareInfo; - } if(pDataList) { delete pDataList; @@ -502,6 +491,39 @@ SharePopup::OnAppControlCompleted(const Tizen::Base::String& providerId, const T void SharePopup::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData) { AppLog("SharePopup::OnAppControlCompleteResponseReceived"); + + ShareInfo* pShareInfo = null; + result r = E_FAILURE; + + if (__pShareList != null) + { + pShareInfo = dynamic_cast(__pShareList->GetAt(0)); + } + + String attachVal; + bool imageAttachment = false; + if (pShareInfo != null) + { + imageAttachment = pShareInfo->GetImageAttached(); + if (imageAttachment) + { + attachVal = pShareInfo->GetImagePath(); + AppLog("SharePopup:: imagePath is %S",attachVal.GetPointer()); + r = File::Remove(attachVal); + if(r == E_SUCCESS) + { + AppLog("removed success"); + } + else + { + AppLog("removed failure"); + } + } + if (pShareInfo != null) + { + delete pShareInfo; + } + } Popup::SetShowState(false); Popup::Show(); __appControlOngoing = false; -- 2.7.4