From: Vinay Sachdeva Date: Wed, 7 Aug 2013 20:51:39 +0000 (+0530) Subject: Fixed Nabi Issues X-Git-Tag: 2.2_release~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2bb3ef902eccd5b6c9e6a97af407caaa2543b49;p=apps%2Fosp%2FInternet.git Fixed Nabi Issues Change-Id: Ib3b9ed236f1249bbc9d97cd89fdcc2985b7ce315 Signed-off-by: Vinay Sachdeva --- diff --git a/inc/IntMultipleWindowPresentationModel.h b/inc/IntMultipleWindowPresentationModel.h index 692e8f1..8270041 100644 --- a/inc/IntMultipleWindowPresentationModel.h +++ b/inc/IntMultipleWindowPresentationModel.h @@ -232,7 +232,7 @@ private: static Tizen::Base::Collection::ArrayList* __pAllWindowList; static WindowInfo* __pCurWindowInfo; static MultipleWindowPresentationModel* __pMultiWindowManager; - Tizen::Ui::Controls::MessageBox* __pMessageBox; + bool __isShowInProcess; }; #endif // _INT_MULTIPLE_WINDOW_PRESENTATION_MODEL_H_ diff --git a/res/screen-density-xhigh/00_circle_bg_ef.png b/res/screen-density-xhigh/00_circle_bg_ef.png new file mode 100644 index 0000000..169d98d Binary files /dev/null and b/res/screen-density-xhigh/00_circle_bg_ef.png differ diff --git a/res/screen-density-xhigh/00_circle_bg_ef_press.png b/res/screen-density-xhigh/00_circle_bg_ef_press.png new file mode 100644 index 0000000..507ee99 Binary files /dev/null and b/res/screen-density-xhigh/00_circle_bg_ef_press.png differ diff --git a/src/IntBookmarkListForm.cpp b/src/IntBookmarkListForm.cpp index c073daf..bdb34bf 100644 --- a/src/IntBookmarkListForm.cpp +++ b/src/IntBookmarkListForm.cpp @@ -1057,7 +1057,6 @@ BookmarkListForm::OnKeypadOpened(Tizen::Ui::Control& source) { AppLog("ABCD::BookmarkListForm::OnKeypadOpened"); GetFooter()->SetShowState(false); - AppLog("ABCD::BookmarkListForm::OnKeypadOpened"); __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()); __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight())); Invalidate(true); @@ -1118,9 +1117,10 @@ BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui: void BookmarkListForm::OnKeypadBoundsChanged(Tizen::Ui::Control& source) { + AppLog("ABCD::BookmarkListForm::OnKeypadBoundsChanged"); FloatRectangle clientRect; clientRect = GetClientAreaBoundsF(); - AppLogDebug("SearchBarForm::OnKeypadBoundsChanged ClientBounds(%f, %f, %f, %f)",clientRect.x, clientRect.y, clientRect.width, clientRect.height); + AppLogDebug("ABCD::SearchBarForm::OnKeypadBoundsChanged ClientBounds(%f, %f, %f, %f)",clientRect.x, clientRect.y, clientRect.width, clientRect.height); __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); __pListview->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); diff --git a/src/IntBookmarkListForm.cpp~ b/src/IntBookmarkListForm.cpp~ deleted file mode 100644 index f049ae8..0000000 --- a/src/IntBookmarkListForm.cpp~ +++ /dev/null @@ -1,1228 +0,0 @@ -// -// Copyright (c) 2012 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.1 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -//!Internet -/*@file: IntBookmarkListForm - *@brief: This class defines BookmarkListForm - * - */ - -#include -#include "IntBookmarkData.h" -#include "IntBookmarkListForm.h" -#include "IntBookmarkPresentationModel.h" -#include "IntCommonLib.h" -#include "IntConfirmationPopup.h" -#include "IntFaviconManager.h" -#include "IntMultipleWindowPresentationModel.h" -#include "IntSceneRegister.h" -#include "IntTypes.h" - - -using namespace Tizen::App; -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; -using namespace Tizen::Base::Runtime; -using namespace Tizen::Graphics; -using namespace Tizen::Ui; -using namespace Tizen::Ui::Controls; -using namespace Tizen::Ui::Scenes; -using namespace Tizen::Media; - -const wchar_t* DEFAULT_VALUE_PARENTID = L"0"; -static const wchar_t* IDB_TAB_ICON_BOOKMARK = L"I01_tab_icon_bookmarks.png"; -static const wchar_t* IDB_TAB_ICON_HISTORY = L"I01_tab_icon_history.png"; -static const wchar_t* IDB_NO_CONTENT_BOOKMARK = L"I01_Nocontents_Bookmarks.png"; -static const wchar_t* IDB_ICON_FOLDER_OPEN = L"I01_icon_folder_open.png"; - -const int BookmarkListForm::IDA_TABBAR_ITEM_1 = 101; -const int BookmarkListForm::IDA_TABBAR_ITEM_2 = 102; -const int BookmarkListForm::IDA_FOOTER_ITEM1 = 103; -const int BookmarkListForm::IDA_FOOTER_ITEM2 = 104; -const int BookmarkListForm::IDA_FOOTER_ITEM_ADDBOOKMARK = 105; -const int BookmarkListForm::IDA_FORMAT_FOLDER = 106; -const int BookmarkListForm::IDA_FORMAT_SITE = 107; -const int BookmarkListForm::IDA_CONTEXT_ITEM_FOLDER_EDIT = 108; -const int BookmarkListForm::IDA_CONTEXT_ITEM_FOLDER_DELETE = 109; -const int BookmarkListForm::IDA_CONTEXT_ITEM_EDIT = 110; -const int BookmarkListForm::IDA_CONTEXT_ITEM_SHARE = 111; -const int BookmarkListForm::IDA_CONTEXT_ITEM_DELETE = 112; -const int BookmarkListForm::IDA_FORMAT_ICON = 113; -const int BookmarkListForm::IDA_FORMAT_URL = 114; - -//const int BookmarkListForm::IDA_CONFIRMATION_NO = 1000; -//const int BookmarkListForm::IDA_CONFIRMATION_YES = 1001; - -BookmarkListForm::BookmarkListForm(void) -{ - __pItemContextFolder = null ; - __pItemContextSite = null ; - __pListview = null; - __pData = null; - __pSearchListView = null; - __pSearchBar = null; - __searchBookmark = false; - __parentID = DEFAULT_VALUE_PARENTID; - __noBookmarks = true; - __selectedindex = 0; - __searchText = L""; - __previousSceneId = L""; - __fontSize = 44; -} - -BookmarkListForm::~BookmarkListForm(void) -{ - - if (__pData != null) - { - __pData->RemoveAll(true); - delete __pData; - __pData = NULL; - } - - if (__pItemContextFolder != null) - { - delete __pItemContextFolder; - __pItemContextFolder = null; - } - - if (__pItemContextSite != null) - { - delete __pItemContextSite; - __pItemContextSite = null; - } -} - -result -BookmarkListForm::OnTerminating(void) -{ - result r = E_SUCCESS; - - if (__pData != null) - { - __pData->RemoveAll(true); - delete __pData; - __pData = NULL; - } - - return r; -} - - -bool -BookmarkListForm::Initialize(void) -{ - Construct(L"IDL_BOOKMARK_LIST"); - return true; -} - -result -BookmarkListForm::OnInitializing(void) -{ - result r = E_SUCCESS; - HeaderItem bookmark; - HeaderItem history; - Header *pHeader = GetHeader(); - Bitmap *pIconBitmap = null; - AppResource* pAppResource = UiApp::GetInstance()->GetAppResource(); - int bookmarkCount = 0; - const int WIDTH_CONTEXT_MENU_TWO_BUTTON = 336; - const int WIDTH_CONTEXT_MENU_THREE_BUTTON = 160; - const int HEIGHT_CONTEXT_MENU_BUTTON = 72; - - - // Setup back event listener - SetFormBackEventListener(this); - AddOrientationEventListener(*this); - - SceneManager::GetInstance()->AddSceneEventListener(IDSCN_BOOKMARK_VIEW, *this); - GetHeader()->AddActionEventListener(*this); - GetFooter()->AddActionEventListener(*this); - - if ( pAppResource == NULL ) - { - return E_FAILURE; - } - - __fontSize = CommonUtil::GetFontSize(); - __pItemContextFolder = new(std::nothrow) ListContextItem(); - __pItemContextFolder->Construct(); - __pItemContextFolder->AddElement(IDA_CONTEXT_ITEM_FOLDER_EDIT, CommonUtil::GetString(L"IDS_BR_SK_EDIT")); - - __pItemContextFolder->AddElement(IDA_CONTEXT_ITEM_FOLDER_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"), true); - __pItemContextFolder->SetElementBackgroundColor(IDA_CONTEXT_ITEM_FOLDER_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_NORMAL , CONTEXT_ITEM_DELETE_COLOR); - __pItemContextFolder->SetElementBackgroundColor(IDA_CONTEXT_ITEM_FOLDER_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_HIGHLIGHTED , CONTEXT_ITEM_DELETE_COLOR); - __pItemContextFolder->SetElementBackgroundColor(IDA_CONTEXT_ITEM_FOLDER_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_PRESSED , CONTEXT_ITEM_DELETE_COLOR); - - __pItemContextSite = new(std::nothrow) ListContextItem(); - __pItemContextSite->Construct(); - __pItemContextSite->AddElement(IDA_CONTEXT_ITEM_EDIT, CommonUtil::GetString(L"IDS_BR_SK_EDIT")); - __pItemContextSite->AddElement(IDA_CONTEXT_ITEM_SHARE, CommonUtil::GetString(L"IDS_BR_OPT_SHARE")); - - __pItemContextSite->AddElement(IDA_CONTEXT_ITEM_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"), true); - __pItemContextSite->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_NORMAL , CONTEXT_ITEM_DELETE_COLOR); - __pItemContextSite->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_HIGHLIGHTED , CONTEXT_ITEM_DELETE_COLOR); - __pItemContextSite->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_PRESSED , CONTEXT_ITEM_DELETE_COLOR); - - __pListview = static_cast< ListView* >(GetControl("IDC_LISTVIEW1")); - - if (__pListview == null) - { - return E_FAILURE; - } - __pSearchBar = static_cast< SearchBar* >(GetControl(L"IDC_SEARCHBAR1")); - - if (__pSearchBar == null) - { - return E_FAILURE; - } - - __pSearchBar->AddFocusEventListener(*this); - if (__pListview != null) - { - __pListview->SetBackgroundColor(GetBackgroundColor()); - // __pListview->SetBounds(__pListview->GetX(), __pListview->GetY(), GetClientAreaBounds().width, GetClientAreaBounds().height); - __pListview->AddFastScrollListener(*this); - __pListview->AddListViewItemEventListener(*this); - __pListview->SetItemProvider(*this); - __pListview->UpdateList(); - } - - __pPopUp = new(std::nothrow) SharePopup(); - - if (__pPopUp != null) - { - __pPopUp->Initialize(); -// AddControl(__pPopUp); - } - - __pSearchListView = new(std::nothrow) ListView(); - - if (__pSearchListView == null) - { - return E_FAILURE; - } - - 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()); - __pSearchListView->SetItemProvider(*this); - __pSearchListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_RESULTS_FOUND")); - __pSearchListView->SetTextColorOfEmptyList(Color::GetColor(COLOR_ID_BLACK)); - __pSearchListView->SetShowState(false); - __pSearchListView->AddListViewItemEventListener(*this); - - __pSearchBar->AddSearchBarEventListener(*this); - __pSearchBar->AddKeypadEventListener(*this); - __pSearchBar->SetContent(__pSearchListView); - - BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID, bookmarkCount); - if(bookmarkCount <= 0) - { - __pSearchBar->SetShowState(false); - //__pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pSearchBar->GetWidth(),GetClientAreaBounds().height - __pSearchBar->GetPosition().y); - __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pListview->GetWidth(),GetClientAreaBounds().height); - } - else - { - __pSearchBar->SetShowState(true); - } - - - if (pHeader != null) - { - pHeader->SetStyle(HEADER_STYLE_TAB); - bookmark.Construct(IDA_TABBAR_ITEM_1); - String strbookmark; - pAppResource->GetString(L"IDS_BR_TAB_BOOKMARKS", strbookmark); - bookmark.SetText(strbookmark); - pIconBitmap = pAppResource->GetBitmapN(IDB_TAB_ICON_BOOKMARK); - bookmark.SetIcon(HEADER_ITEM_STATUS_NORMAL, pIconBitmap); - bookmark.SetIcon(HEADER_ITEM_STATUS_PRESSED, pIconBitmap); - pHeader->AddItem(bookmark); - - if (pIconBitmap != NULL) - { - delete pIconBitmap; - } - - history.Construct(IDA_TABBAR_ITEM_2); - String strhistory; - pAppResource->GetString(L"IDS_BR_TAB_HISTORY", strhistory); - history.SetText(strhistory); - pIconBitmap = pAppResource->GetBitmapN(IDB_TAB_ICON_HISTORY); - history.SetIcon(HEADER_ITEM_STATUS_NORMAL, pIconBitmap); - history.SetIcon(HEADER_ITEM_STATUS_PRESSED, pIconBitmap); - pHeader->AddItem(history); - pHeader->SetItemSelected(0); - pHeader->SetTabEditModeEnabled(false); - - if (pIconBitmap != NULL) - { - delete pIconBitmap; - } - } - - - CATCH:return r; -} - -void -BookmarkListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) -{ - AppLogDebug("BookmarkListForm::OnActionPerformed actionId = %d",actionId); - String bookmarkId; - int id = 0; - BookmarkData* pBookMark = null; - - switch (actionId) - { - case IDA_FOOTER_ITEM1: - { - __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL); - GetHeader()->SetItemSelected(0); - GetHeader()->Invalidate(true); - SceneManager* pSceneManager = SceneManager::GetInstance(); - pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(__selectedindex)); - - if ( pBookMark == NULL ) - { - return; - } - - ArrayList* pArgList = null; - pArgList = new(std::nothrow) ArrayList(); - if (pArgList != null) - { - pArgList->Construct(); - pArgList->Add(*new(std::nothrow) String(pBookMark->GetParentId())); - } - //pArgList->Add(*new(std::nothrow) String(pBookmark->); - if (pSceneManager != null) - { - if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_EDIT_BOOKMARK_LIST),pArgList) != E_SUCCESS) - { - AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed"); - pArgList->RemoveAll(true); - delete pArgList; - pArgList = null; - return; - } - } - - if ( pArgList != NULL) - { - pArgList->RemoveAll(true); - delete pArgList; - } - } - - break; - case IDA_TABBAR_ITEM_2: - { - // GetHeader()->SetItemSelected(0); - // GetHeader()->Invalidate(true); - - SceneManager* pSceneManager = SceneManager::GetInstance(); - - if (pSceneManager != null) - { - if(__previousSceneId.CompareTo(IDSCN_HISTORY_LIST) != 0) - { - if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_LEFT)) != E_SUCCESS) - { - AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed"); - return; - } - } - else - { - - if(pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT))!= E_SUCCESS) - { - AppLogDebug("BookmarkListForm::OnActionPerformed GoBackward failed"); - return; - } - - } - } - } - break; - case IDA_FOOTER_ITEM2: - { - SceneManager* pSceneManager = SceneManager::GetInstance(); - - if (pSceneManager) - { - if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER)) != E_SUCCESS) - { - AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed"); - return; - } - } - } - break; - case IDA_FOOTER_ITEM_ADDBOOKMARK: - { - SceneManager* pSceneManager = SceneManager::GetInstance(); - - // send array list 0-for add, 1 for edit with parent ID - ArrayList* pArgList = null; - pArgList = new(std::nothrow) ArrayList(); - if (pArgList != null) - { - pArgList->Construct(); - pArgList->Add(*new(std::nothrow) String(L"0")); - pArgList->Add(*new(std::nothrow) String(__parentID)); - } - - if (pSceneManager) - { - if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ADD_BOOKMARK),pArgList) != E_SUCCESS) - { - AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed"); - pArgList->RemoveAll(true); - delete pArgList; - return; - } - } - - if (pArgList != null) - { - pArgList->RemoveAll(true); - delete pArgList; - } - - } - break; - case IDA_BUTTON_NO: - __pConfirmationPopup->SetShowState(false); - __pConfirmationPopup->Show(); - break; - case IDA_BUTTON_YES: - pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(__selectedindex)); - if ( pBookMark== null) - return; - bookmarkId=pBookMark->GetBookmarkId(); - Integer::Parse(bookmarkId,id); - if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER) - BookmarkPresentationModel::GetInstance()->DeleteFolder(id); - else - BookmarkPresentationModel::GetInstance()->DeleteBookmark(id); - if (__pListview == null) - { - return; - } - AppLogDebug("__pListview GetBounds %d,%d,%d,%d",__pListview->GetBounds().x,__pListview->GetBounds().y,__pListview->GetBounds().width,__pListview->GetBounds().height); - __pSearchListView->UpdateList(); - __pListview->UpdateList(); - - if (__pListview->GetItemCount() == 0) - { - GetFooter()->SetItemEnabled(1,false); - __pSearchBar->SetShowState(false); - __pSearchBar->Invalidate(true); - } - - if (__noBookmarks == true) - { - Bitmap* emptyListBmp = AppResource::GetInstance()->GetBitmapN(IDB_NO_CONTENT_BOOKMARK); - GetFooter()->SetItemEnabled(1,false); - __pSearchBar->SetShowState(false); - __pSearchBar->Invalidate(true); - // __pListview->SetBounds(__pSearchBar->GetPosition().x,__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height); - __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height); - __pListview->SetBitmapOfEmptyList(emptyListBmp); - if (emptyListBmp) - { - delete emptyListBmp; - emptyListBmp = null; - } - __pListview->UpdateList(); - - } - else - { - GetFooter()->SetItemEnabled(1,true); - - if (__parentID.CompareTo(L"0") == 0) - { - __pSearchBar->SetShowState(true); - __pSearchBar->Invalidate(true); - } - } - - GetFooter()->Invalidate(true); - __pConfirmationPopup->SetShowState(false); - __pConfirmationPopup->Show(); - __selectedindex = 0; - - break; - default: - break; - } -} - -void -BookmarkListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) -{ - AppLogDebug("BrowserApplicationForm::OnFormBackRequested"); - - UiApp* pApp = UiApp::GetInstance(); - if (pApp == null) - { - return; - } - - if (__parentID != DEFAULT_VALUE_PARENTID) - { - __parentID = DEFAULT_VALUE_PARENTID; - __pSearchBar->SetShowState(true); - __pListview->SetBounds(__pListview->GetX() ,__pSearchBar->GetPosition().y + __pSearchBar->GetHeight(),__pListview->GetWidth(),GetClientAreaBounds().height - (__pSearchBar->GetY() + __pSearchBar->GetHeight())); - __pListview->UpdateList(); - __pFooter = GetFooter(); - GetFooter()->SetItemEnabled(2,true); - GetFooter()->Invalidate(true); - } - else - { - SceneManager* pSceneManager = SceneManager::GetInstance(); - if (pSceneManager != null) - { - if(__previousSceneId.CompareTo(IDSCN_HISTORY_LIST) != 0) - { - pSceneManager->GoBackward(BackwardSceneTransition()); - } - else - { - pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT)); - } - } - } - - if (__noBookmarks == true) - { - GetFooter()->SetItemEnabled(1,false); - } - else - { - GetFooter()->SetItemEnabled(1,true); - } -} - -Tizen::Ui::Controls::ListItemBase* -BookmarkListForm::CreateItem(int index, int itemWidth) -{ - - AppLog("BookmarkListForm::CreateItem index %d , itemWidth %d",index, itemWidth); - AppLog("listviewwidth %d",__pListview->GetWidth()); - result r = E_FAILURE; - ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL; - if(__pData == null) - { - return null; - } - CustomItem* pItem = new(std::nothrow) CustomItem(); - - BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index)); - Bitmap* pBitmap = null; - Dimension dim; - - Image* pImage = null; - pImage = new Image(); - pImage->Construct(); - - const int x_Margin_Icon = 16; // local as there used only in this function - const int y_Margin_Icon = 28; - const int height_Icon = 72; - const int width_Icon = 72 ; - const int x_Margin_Title = 104 ; - const int y_Margin_Title = 10; - const int width_Title = GetClientAreaBounds().width - 108 - 52 - 40; - const int x_Margin_Url = 104 ; - const int y_Margin_Url = 70 ; - const int width_Url = GetClientAreaBounds().width - 108 - 52 ; - const int height_Url = 48; - const int itemHeight = 128; - const int textSize = 32; - String bitmapId; - - if( pBookMark == NULL ) - { - delete pItem; - pItem = null; - delete pImage; - pImage = null; - return NULL; - } - if ( pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER ) - { - r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth,112 - 44 + __fontSize), LIST_ANNEX_STYLE_DETAILED); - TryCatch(!IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r)); - - pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_FOLDER_OPEN); - if (pBitmap != null) - { - pItem->AddElement(Rectangle(x_Margin_Icon, 20+(__fontSize - 44)/2, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null); - delete pBitmap; - } - - pItem->AddElement(Rectangle(x_Margin_Title, 26, width_Title, 72 + (__fontSize - 44) ), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(),__fontSize, CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); - - if ( __pItemContextFolder != NULL) - { - pItem->SetContextItem(__pItemContextFolder); - } - } - else - { - r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, itemHeight - 44 + __fontSize), style); - TryCatch( !IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r)); - - AppLogDebug("BookmarkListForm::faviconid %ls",pBookMark->GetFaviconId().GetPointer()); - bitmapId = pBookMark->GetFaviconId(); - - dim = Dimension(pBookMark->GetFavIconWidth(), pBookMark->GetFavIconHeight()); - - AppLog("BookmarkListForm::CreateItem check 0"); - - // get fav icon bitmap - ByteBuffer* pFavIconBuffer = null; - pFavIconBuffer = pBookMark->GetFavIconBuffer(); - - AppLog("BookmarkListForm::CreateItem check 0"); - - if (pFavIconBuffer != null) - { - AppLog("BookmarkListForm::CreateItem pFavIconBuffer is not null"); - } - else - { - AppLog("BookmarkListForm::CreateItem pFavIconBuffer is null"); - } - - pBitmap = pImage->DecodeN(*pFavIconBuffer, IMG_FORMAT_PNG, BITMAP_PIXEL_FORMAT_ARGB8888); - - AppLog("BookmarkListForm::CreateItem check 1"); - - if (pBitmap != null) - { - AppLog("rahul bitmap is not null"); - int width = pBitmap->GetWidth(); - int height = pBitmap->GetHeight(); - AppLog("rahul bitmap width is %d", width); - AppLog("rahul bitmap height is %d", height); - AppLog("rahul favicon width is %d", pBookMark->GetFavIconWidth()); - AppLog("rahul favicon height is %d", pBookMark->GetFavIconHeight()); - } - else - { - AppLog("rahul bitmap is null"); - } - - if (pBitmap == null) - { - AppLogDebug("BookmarkListForm::CreateItem bitmap is null"); - pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN(); - } - pItem->AddElement(Rectangle(x_Margin_Icon, y_Margin_Icon +(__fontSize - 44)/2, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null); - pItem->AddElement(Rectangle(x_Margin_Title, 0, width_Title, itemHeight - height_Url - 44 + __fontSize), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(),__fontSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); -// if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT) -// pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); -// else - pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url - 44 + __fontSize, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true); - - if (pBitmap != null) - { - delete pBitmap; - } - if ( __pItemContextSite != NULL) - { - pItem->SetContextItem(__pItemContextSite); - } - } - - delete pImage; - return pItem; - - CATCH: - - delete pImage; - delete pItem; - pItem = null; - return null; - -} - -bool -BookmarkListForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth) -{ - delete pItem; - pItem = null; - return true; -} - -int -BookmarkListForm::GetItemCount(void) -{ - int count = 0; - - if (__pData != NULL ) - { - __pData->RemoveAll(true); - delete __pData; - __pData = null; - } - __pData = new(std::nothrow) Collection::ArrayList(); - __pData->Construct(); - - if (__searchBookmark == false) - { - BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID, count); - BookmarkPresentationModel::GetInstance()->GetFoldersBookmarks(__parentID, 0, count, *__pData); - } - else - { - if (__searchText.GetLength() > 0) - { - __searchText.Replace(L"%", L"/%"); - __searchText.Replace(L"_", L"/_"); - } - BookmarkPresentationModel::GetInstance()->GetSearchFolderBookmarkCount(count,__searchText); - BookmarkPresentationModel::GetInstance()->GetSearchFoldersBookmarks(0, count, *__pData, __searchText); - } - - AppLogDebug("Count = %d parentId = %ls __searchText %ls", count, __parentID.GetPointer() , __searchText.GetPointer()); - - if (count <= 0) - { - __noBookmarks = true; - GetFooter()->SetItemEnabled(1,false); - } - else - { - __noBookmarks = false; - GetFooter()->SetItemEnabled(1,true); - } - - AppLogDebug("Result: %s", GetErrorMessage(GetLastResult())); - GetFooter()->Invalidate(true); - if (__pData != null && __pData->GetCount() >= 1) - { - // __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL); - __pSearchBar->SetShowState(true); - __pSearchBar->Invalidate(true); - } - else if (__searchBookmark == false) - { - __pSearchBar->SetShowState(false); - __pSearchBar->Invalidate(true); - } - - if (__parentID.CompareTo(L"0") != 0) - { - __pSearchBar->SetShowState(false); - __pSearchBar->Invalidate(true); - } - if (__noBookmarks == true) - { - __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetPosition().y,__pSearchBar->GetWidth() ,GetClientAreaBounds().height); - Bitmap* pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_NO_CONTENT_BOOKMARK); - - if ( pBitmap != NULL) - { - __pListview->SetBitmapOfEmptyList(pBitmap); - delete pBitmap; - } - } - else - { - if (__parentID.CompareTo(L"0") == 0) - { - __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetHeight(),GetClientAreaBounds().width ,GetClientAreaBounds().height - __pSearchBar->GetY() - __pSearchBar->GetHeight()); - } - else - { - __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pSearchBar->GetWidth() ,GetClientAreaBounds().height); - - } - - } - __pListview->Invalidate(true); - return count; - -} - -void -BookmarkListForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status) -{ - AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged int index %d, int elementId %d, Tizen::Ui::Controls::ListContextItemStatus status %d",index,elementId,status); - - String deleteText = CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"); - deleteText.Append(L"? "); - int timeOut = 25000; - result r = E_SUCCESS; - - switch(elementId) - { - case IDA_CONTEXT_ITEM_FOLDER_EDIT: - { - ArrayList* pArgList = null; - String* pEdit = null; - - SceneManager* pSceneManager = SceneManager::GetInstance(); - BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index)); - if (pBookMark != null && pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER) - { - pArgList = new(std::nothrow) ArrayList(); - if (pArgList != null) - { - pEdit= new(std::nothrow) String(CommonUtil::GetString(L"IDS_BR_SK_EDIT")); - pArgList->Construct(); - pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark)); - pArgList->Add(*pEdit); - if ( pSceneManager != null) - { - result r; - r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER), pArgList); - } - - if (pArgList != null) - { - delete pArgList; - pArgList = null; - } - if(IsFailed(r)) - { - AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged GoForward failed %s",GetErrorMessage(r)); - return; - } - } - } - - } - break; - - case IDA_CONTEXT_ITEM_FOLDER_DELETE: - case IDA_CONTEXT_ITEM_DELETE: - { - __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); - __pConfirmationPopup->Initialize(); - __pConfirmationPopup->RemoveActionListener(*this); - __pConfirmationPopup->AddActionListener(*this); - __pConfirmationPopup->setMessage(deleteText); - __pConfirmationPopup->Show(); - __selectedindex = index; - } - break; - - case IDA_CONTEXT_ITEM_EDIT: - { - ArrayList* pArgList = null; - SceneManager* pSceneManager = SceneManager::GetInstance(); - BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index)); - if (pBookMark!= null && pBookMark->GetBookmarkType() == BOOKMARK_TYPE_URL) - { - AppLogDebug("ID_CONTEXT_ITEM_SITE_1 BOOKMARK_TYPE_URL"); - pArgList = new(std::nothrow) ArrayList(); - if (pArgList != null) - { - pArgList->Construct(); - pArgList->Add(*new(std::nothrow) String(L"1")); - pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark)); - if ( pSceneManager != null) - { - result r; - r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ADD_BOOKMARK), pArgList); - if (pArgList != null) - { - delete pArgList; - pArgList = null; - } - if(IsFailed(r)) - { - AppLogDebug("BookmarkListForm::OnListViewContextItemStateChanged GoForward failed %s",GetErrorMessage(r)); - return; - } - } - } - } - } - break; - case IDA_CONTEXT_ITEM_SHARE: - { - AppLogDebug("OnListViewContextItemStateChanged Share"); - if (__pPopUp != null) - { - delete __pPopUp; - __pPopUp = null; - } - __pPopUp = new(std::nothrow) SharePopup(); - __pPopUp->Initialize(); - BookmarkData* pBookmark = dynamic_cast(__pData->GetAt(index)); - if (pBookmark != null) - { - ShareInfo* pShareInfo = new(std::nothrow) ShareInfo(); - pShareInfo->SetPageTitle(pBookmark->GetBookmarkTitle()); - pShareInfo->SetPageUrl(pBookmark->GetUrl()); - pShareInfo->SetImageAttached(false); - __pPopUp->RemoveAllShareInfo(); - __pPopUp->AddShareInfo(pShareInfo); - } - - if (__pPopUp != null) - { - __pPopUp->SetShowState(true); - __pPopUp->Show(); - } - } - break; - default: - break; - } - -} - -void -BookmarkListForm::OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback) -{ - -} - -void -BookmarkListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status) -{ - AppLogDebug("BookmarkListForm::OnListViewItemStateChanged"); - - result r = E_FAILURE; - ArrayList *pArgList = null; - SceneManager* pSceneManager = SceneManager::GetInstance(); - BookmarkData* pBookmark = dynamic_cast< BookmarkData* >(__pData->GetAt(index)); - - if ( pBookmark == NULL ) - { - return; - } - - switch (pBookmark->GetBookmarkType()) - { - case BOOKMARK_TYPE_FOLDER: - - __parentID = pBookmark->GetBookmarkId(); - AppLogDebug("BOOKMARK_TYPE_FOLDER parent ID is %ls",__parentID.GetPointer()); - - listView.UpdateList(); - if (listView.GetItemCount() == 0) - { - GetFooter()->SetItemEnabled(1,false); - } - else - { - GetFooter()->SetItemEnabled(1,true); - } - GetFooter()->SetItemEnabled(2,false); - GetFooter()->Invalidate(true); - __pSearchBar->HideKeypad(); - __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL); - __pSearchBar->SetShowState(false); - __pSearchBar->Invalidate(true); - __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetY(),__pListview->GetWidth() ,GetClientAreaBounds().height); - break; - - case BOOKMARK_TYPE_URL: - - pArgList = new(std::nothrow) ArrayList(); - if (pArgList != null) - { - r = pArgList->Construct(); - TryCatch(!IsFailed(r), L"BookmarkListForm::OnListViewItemStateChanged pArgList Construct failed %s", GetErrorMessage(r)); - - AppLogDebug("bookmark url = %ls",pBookmark->GetUrl().GetPointer()); - r = pArgList->Add(*MultipleWindowPresentationModel::GetInstance()->GetActiveWindowInfo()); - pArgList->Add(*new(std::nothrow) String(pBookmark->GetUrl())); - - if (pSceneManager != null) - { - AppLogDebug("pSceneManager exists"); - String prevSceneId; - MultipleWindowPresentationModel::GetInstance()->GetCurrentSceneId(prevSceneId); - r = pSceneManager->GoBackward(BackwardSceneTransition(prevSceneId), pArgList); - TryCatch(!IsFailed(r), L"BookmarkListForm::OnListViewItemStateChanged pArgList Construct failed %s", GetErrorMessage(r)); - } - delete pArgList; - } - break; - - default: - break; - } - - return; - CATCH: - if(pArgList) - { - pArgList->RemoveAll(true); - delete pArgList; - } - -} - -void -BookmarkListForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction) -{ - - -} - -void -BookmarkListForm::OnFastScrollIndexSelected(Tizen::Ui::Control& source, Tizen::Base::String& index) -{ - -} - -void -BookmarkListForm::OnFocusGained(const Tizen::Ui::Control& source) -{ - __pSearchListView->SetEnabled(false); -} - -void -BookmarkListForm::OnFocusLost(const Tizen::Ui::Control& source) -{ - __pSearchListView->SetEnabled(true); - __searchBookmark = false; -} - -void -BookmarkListForm::OnSearchBarModeChanged(Tizen::Ui::Controls::SearchBar& source, Tizen::Ui::Controls::SearchBarMode mode) -{ - result r = E_FAILURE; - AppLog("ABCD::BookmarkListForm::OnSearchBarModeChanged"); - - if (mode == SEARCH_BAR_MODE_NORMAL) - { - __pSearchListView->SetShowState(false); - __pSearchListView->UpdateList(); - __pListview->SetShowState(true); - Invalidate(true); - __searchBookmark = false; - r = __pListview->UpdateList(); -// __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight()); - __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight())); - TryCatch( !IsFailed(r),,"BookmarkListForm::OnSearchBarModeChanged Update list failed %s",GetErrorMessage(r)); - CATCH:return; - } - else - { - __pSearchListView->SetShowState(true); - __pSearchListView->SetEnabled(false); - __pListview->SetShowState(false); - - if(__pSearchBar) - { - r = __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight())); - __pSearchBar->SetText(L""); - } - AppLog("OnSearchBarModeChanged SetContentAreaSize heihgt %d, %d",__pSearchListView->GetHeight() , GetClientAreaBounds().height - __pSearchBar->GetHeight()); - __pListview->UpdateList(); - __pSearchListView->UpdateList(); - } -} - -void -BookmarkListForm::OnKeypadWillOpen(Tizen::Ui::Control& source) -{ - AppLog("ABCD::BookmarkListForm::OnKeypadWillOpen"); - GetFooter()->SetShowState(false); - __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), GetClientAreaBounds().width, GetClientAreaBounds().height - __pSearchBar->GetHeight()); - __pSearchListView->SetEnabled(false); - __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight())); - Invalidate(true); -} - -void -BookmarkListForm::OnKeypadOpened(Tizen::Ui::Control& source) -{ - AppLog("ABCD::BookmarkListForm::OnKeypadOpened"); - GetFooter()->SetShowState(false); - AppLog("ABCD::BookmarkListForm::OnKeypadOpened"); - __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()); - __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight())); - Invalidate(true); -} - -void -BookmarkListForm::OnKeypadClosed(Tizen::Ui::Control& source) -{ - AppLog("ABCD::BookmarkListForm::OnKeypadClosed"); - AppLog("jahsjkdad %d",Clipboard::GetInstance()->IsPopupVisible()); - if(Clipboard::GetInstance()->IsPopupVisible() == true) - { - return; - } - GetFooter()->SetShowState(true); - __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()); - __pSearchListView->Invalidate(false); - __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight())); - __pListview->SetBounds(0, __pSearchBar->GetY() + __pSearchBar->GetHeight(), GetClientAreaBounds().width, GetClientAreaBounds().height - __pSearchBar->GetHeight()); - Invalidate(true); -} - -void -BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction) -{ - AppLog("BookmarkListForm::OnKeypadActionPerformed %d",keypadAction); - - if (__pSearchBar != null) - { - __pSearchBar->HideKeypad(); - } - if ( __pSearchBar != null && keypadAction == KEYPAD_ACTION_SEARCH) - { -// if (__pSearchBar->GetText().GetLength() == 0) -// { -// return; -// } - - if (__pSearchBar != null) - { - __pSearchBar->HideKeypad(); - } - - __searchText = __pSearchBar->GetText(); - AppLog("SearchbarGettext result %s %ls",GetErrorMessage(GetLastResult()),__searchText.GetPointer()); - __searchBookmark = true; - __pListview->SetShowState(false); - __pSearchListView->SetEnabled(true); - __pSearchListView->SetShowState(true); - __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight()); - __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), __pSearchListView->GetHeight())); - __pSearchListView->UpdateList(); - - } - Invalidate(true); -} - -void -BookmarkListForm::OnKeypadBoundsChanged(Tizen::Ui::Control& source) -{ - FloatRectangle clientRect; - clientRect = GetClientAreaBoundsF(); - AppLogDebug("SearchBarForm::OnKeypadBoundsChanged ClientBounds(%f, %f, %f, %f)",clientRect.x, clientRect.y, clientRect.width, clientRect.height); - __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); - __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); - __pListview->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); -// __pListview->SetEnabled(false); - Invalidate(true); -} - -void -BookmarkListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs) -{ - AppLogDebug("BookmarkListForm::OnSceneActivatedN called"); - ArrayListT * pList = dynamic_cast* >(SceneManager::GetInstance()->GetSceneHistoryN()); - if(pList != null) - { - pList->GetAt(pList->GetCount()-1,__previousSceneId); - } - - __searchBookmark = false; - GetFooter()->SetShowState(true); - GetFooter()->Invalidate(true); - GetHeader()->SetItemSelected(0); - GetHeader()->Invalidate(true); - - /* if (previousSceneId != IDSCN_HISTORY_LIST && previousSceneId != IDSCN_CREATE_BOOKMARK_FOLDER && previousSceneId != IDSCN_EDIT_BOOKMARK_LIST) - { - __previousSceneId = previousSceneId; - }*/ - - if (pList) - { - delete pList; - pList = null; - } - - if (__pListview != null) - { - __pListview->UpdateList(); - } - - return; -} - -void -BookmarkListForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus) -{ - AppLog("BookmarkListForm::OnOrientationChanged start"); - __pListview->SetBackgroundColor(GetBackgroundColor()); - __pSearchListView->SetBackgroundColor(GetBackgroundColor()); - if (__pListview) - { - if(__pSearchBar->GetShowState()) - { - __pListview->SetBounds(__pListview->GetX(),__pSearchBar->GetHeight(),GetClientAreaBounds().width ,GetClientAreaBounds().height - __pSearchBar->GetY() - __pSearchBar->GetHeight()); - } - else - { - __pListview->SetBounds(__pListview->GetX(),0,GetClientAreaBounds().width ,GetClientAreaBounds().height); - } - __pListview->UpdateList(); - } - - if (__pSearchListView && __pListview) - { - AppLog("__pListview->GetBounds() %d, %d, %d, %d",__pListview->GetBounds().x,__pListview->GetBounds().y,__pListview->GetBounds().width,__pListview->GetBounds().height); - __pSearchListView->SetBounds(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height -__pSearchBar->GetHeight()); - - __pSearchListView->UpdateList(); - } - - if (__pSearchListView && __pData != null ) - { - if (__parentID != DEFAULT_VALUE_PARENTID) - { - AppLog("BookmarkListForm::OnOrientationChanged parent id true"); - __pSearchBar->SetShowState(false); - __pSearchBar->Invalidate(true); - } - - __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight())); - } - -// -// -// -// FloatRectangle clientRect; -// clientRect = GetClientAreaBoundsF(); -// -// __pSearchBar->SetContentAreaSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); -// __pListview->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); -// __pSearchListView->SetSize(FloatDimension(clientRect.width, clientRect.height - __pSearchBar->GetHeightF())); -// Invalidate(true); -// - - Invalidate(true); -} - -void -BookmarkListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId) -{ - __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL); - return; -} - diff --git a/src/IntEditBookmarkListForm.cpp b/src/IntEditBookmarkListForm.cpp index 261a32d..a8891d1 100644 --- a/src/IntEditBookmarkListForm.cpp +++ b/src/IntEditBookmarkListForm.cpp @@ -44,7 +44,8 @@ using namespace Tizen::Ui::Scenes; static const wchar_t* IDB_ICON_FOLDER_OPEN = L"I01_icon_folder_open.png"; static const wchar_t* IDB_ITEM = L"edit_item.png"; -static const wchar_t* IDB_RIGHT_ARROW = L"I01_right_arrow.png"; +static const wchar_t* IDB_RIGHT_ARROW = L"00_circle_bg_ef.png"; +static const wchar_t* IDB_RIGHT_ARROW_PRESS = L"00_circle_bg_ef_press.png"; const int EditBookmarkListForm::IDA_BUTTON_CHECKED = 101; @@ -497,11 +498,13 @@ EditBookmarkListForm::CreateItem(int index, int itemWidth) //pBitmap = AppResource::GetInstance()->GetBitmapN("I01_picker_arrow_right.png"); pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_RIGHT_ARROW); - if (pBitmap != null) + Bitmap* pPressedBitmap = AppResource::GetInstance()->GetBitmapN(IDB_RIGHT_ARROW_PRESS); + if (pBitmap != null && pPressedBitmap != null) { - pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 84, 32 + (__fontSize - 44)/2, 64, 64), IDA_FORMAT_BITMAP, *pBitmap, null, null); + pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 84-4, 32 + (__fontSize - 44)/2-4, 72, 72), IDA_FORMAT_BITMAP, *pBitmap, pPressedBitmap, null); pItem->SetElementSelectionEnabled(IDA_FORMAT_BITMAP, true); delete pBitmap; + delete pPressedBitmap; } } return pItem; diff --git a/src/IntInternetApp.cpp b/src/IntInternetApp.cpp index afc198e..4121f6d 100644 --- a/src/IntInternetApp.cpp +++ b/src/IntInternetApp.cpp @@ -240,6 +240,8 @@ InternetApp::OnForeground(void) { pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_FULL_SCREEN); } + AppLog("InternetApp::OnForeground called"); + AppLog("InternetApp::OnForeground"); AppRegistry* pAppRegistry = App::GetInstance()->GetAppRegistry(); diff --git a/src/IntMainForm.cpp b/src/IntMainForm.cpp index c7c8599..74744da 100644 --- a/src/IntMainForm.cpp +++ b/src/IntMainForm.cpp @@ -753,6 +753,8 @@ MainForm::InitFooter(void) } else __pFooterPanel->SetShowState(false); + + SetAddressbarMode(GetAddressbarMode()); AppLogDebug("MainForm::InitFooter exit"); return E_SUCCESS; } @@ -892,6 +894,8 @@ MainForm::InitSelectTextContextMenu(Point p, bool pasteOption, bool onlyPasteOpt delete __pImageMenu; __pImageMenu = null; } +// Point q(0,0); +// __pWebViewer->GetBlockRange(p,q); if(p.y < 150) { @@ -975,7 +979,8 @@ MainForm::InitSelectTextContextMenuF(FloatPoint p, bool pasteOption, bool onlyPa delete __pImageMenu; __pImageMenu = null; } - +// FloatPoint q(0.0,0.0); +// __pWebViewer->GetBlockRange(p,q); if(p.y < 150) { p.y = p.y + 50; @@ -2501,6 +2506,12 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) String nameElement = __pHitElementResult->GetAttributeValue(L"name"); String tagElement = __pHitElementResult->GetTagName(); AppLog("MainForm::IDA_PASTE_TEXT_CLICKED id is %ls",idElement.GetPointer()); + String str = L"document.getElementsByName('"; + str.Append(nameElement); + str.Append("').length"); + String* pCount = __pWebViewer->EvaluateJavascriptN(str); + AppLog("pCount %ls",pCount->GetPointer()); + String script; if(idElement.GetLength() != 0) @@ -2513,9 +2524,11 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) script.Append(*pString); script.Append("\");"); } - else if (nameElement.GetLength() != 0) + + + else if (nameElement.GetLength() != 0 && pCount->Equals("1",false) == true) { - script = L"function insertAtCursor(myField, myValue) { if (document.selection) { document.getElementByName(myField)[0].focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0'){ var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length); } else { document.getElementByName(myField)[0].value += myValue; } } "; + script = L"function insertAtCursor(myField, myValue) { if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0'){ var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } "; script.Append("insertAtCursor(document.getElementsByName('"); script.Append(nameElement); script.Append("')[0],"); @@ -2523,7 +2536,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) script.Append(*pString); script.Append("\");"); } - else//adding for twitter post page + else if(tagElement.GetLength() != 0) //adding for twitter post page { script = L"function insertAtCursor(myField, myValue) { if (document.selection) { document.getElementsByTagName(myField)[0].focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0'){ var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length); } else { document.getElementsByTagName(myField)[0].value += myValue; } } "; script.Append("insertAtCursor(document.getElementsByTagName('"); @@ -2692,7 +2705,7 @@ MainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) return; } r = pAllWindowList->RemoveAt(count, true); -// __pWindowInfo = null; + __pWindowInfo = null; if (IsFailed(r)) { AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r)); @@ -3730,6 +3743,10 @@ MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState) __pFooterPanel->SetShowState(true); } __isKeypadOpened = false; + if(__pNotification && __pNotification->GetShowState()) + { + __pNotification->SetPosition(0,GetClientAreaBounds().height - __pNotification->GetHeight()); + } RelayoutControls(false,footerState); } @@ -3739,6 +3756,10 @@ MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar) { AppLog("XYZ::MainForm::OnAddressBarKeypadOpened"); __isKeypadOpened = true; + if(__pNotification && __pNotification->GetShowState()) + { + __pNotification->SetPosition(0,GetClientAreaBounds().height - __pNotification->GetHeight()); + } RelayoutControls(false); } @@ -4455,12 +4476,25 @@ MainForm::OnWebKeypadOpened(Tizen::Web::Controls::Web& source) void MainForm::OnWebKeypadClosed(Tizen::Web::Controls::Web& source) { + AppLog("abcde::MainForm::OnWebKeypadClosed"); AppLog("xyz::MainForm::OnWebKeypadClosed"); AppLog("akjshdasd 4"); __pFooterPanel->SetShowState(true); // OnAddressBarKeypadClosed(*__pAddressbar); RelayoutControls(false); __isKeypadOpened = false; + + + if(__pImageMenu && __pImageMenu->GetShowState() == true) + { + AppLog("abcde: imagemenu visible."); + Point p(0,0); + Point q(0,0); + __pWebViewer->GetBlockRange(p,q); + __pImageMenu->SetAnchorPosition(p); + __pImageMenu->Show(); + Invalidate(true); + } } void diff --git a/src/IntMultipleWindowPresentationModel.cpp b/src/IntMultipleWindowPresentationModel.cpp index c5c1b09..37bd4bc 100644 --- a/src/IntMultipleWindowPresentationModel.cpp +++ b/src/IntMultipleWindowPresentationModel.cpp @@ -74,7 +74,7 @@ WindowInfo::~WindowInfo(void) MultipleWindowPresentationModel::MultipleWindowPresentationModel(void) { - __pMessageBox = null; + __isShowInProcess = false; } MultipleWindowPresentationModel::~MultipleWindowPresentationModel(void) @@ -274,15 +274,15 @@ MultipleWindowPresentationModel::GetActiveWindowInfo() void MultipleWindowPresentationModel::ShowPopup(String& pTitle, String& pText) { - if(__pMessageBox != null) - { - delete __pMessageBox; - __pMessageBox = null; - } - __pMessageBox = new(std::nothrow) MessageBox(); - __pMessageBox->Construct(pTitle, pText,MSGBOX_STYLE_OK,3000); - int modalResult = 0; + if(__isShowInProcess) + return; - __pMessageBox->ShowAndWait(modalResult); + MessageBox* pMessageBox = new(std::nothrow) MessageBox(); + pMessageBox->Construct(pTitle, pText,MSGBOX_STYLE_OK,3000); + int modalResult = 0; + __isShowInProcess = true; + pMessageBox->ShowAndWait(modalResult); + __isShowInProcess = false; + delete pMessageBox; } diff --git a/src/IntSettingForm.cpp b/src/IntSettingForm.cpp index 94f627e..7dc1c48 100644 --- a/src/IntSettingForm.cpp +++ b/src/IntSettingForm.cpp @@ -326,12 +326,22 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr else break; } - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); + for(int iter = 0; iter < settingInfo[effectiveIndex].childCount; iter++) + { + listView.RefreshList(groupIndex, itemIndex + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY); + } + +// listView.UpdateList(); } else { settingInfo[effectiveIndex].isOpen = false; - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); + for(int iter = 0; iter < settingInfo[effectiveIndex].childCount; iter++) + { + listView.RefreshList(groupIndex, itemIndex + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY); + } } } else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO) @@ -344,6 +354,8 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr } settingInfo[parentIndex].subText = settingInfo[effectiveIndex].titleText; + listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex), LIST_REFRESH_TYPE_ITEM_MODIFY); +// listView.RefreshList(groupIndex, parentIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); for (int iter = 0; iter < settingInfo[parentIndex].childCount; iter++) { if (parentIndex + iter + 1 != effectiveIndex) @@ -361,7 +373,7 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr settingInfo[SETTING_CURRENT_PAGE].isSelected = false; settingInfo[SETTING_FAVORITE_URL].isSelected = true; } - //listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex) + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY); + listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex) + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY); } // listView.UpdateList(); //listView.ScrollToItem(groupIndex, itemIndex, LIST_SCROLL_ITEM_ALIGNMENT_TOP); @@ -396,19 +408,19 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr SettingPresentationModel::GetInstance()->SetFavoriteValue(__currentURL); settingInfo[SETTING_FAVORITE_URL].titleText = __currentURL; // listView.RefreshList(groupIndex, effectiveIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); } break; case SETTING_BLANK_PAGE: //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_BLANK_PAGE].titleText); SettingPresentationModel::GetInstance()->SetHomepage((L"IDS_BR_BODY_BLANK_PAGE")); AppLog("GetHomepage() %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer()); - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); break; case SETTING_MOST_VISITED_SITE: SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES"); - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); break; case SETTING_FAVORITE_URL: @@ -418,12 +430,12 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr case SETTING_FIT_TO_WIDTH: SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_FIT_TO_WIDTH"); - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); break; case SETTING_READABLE: SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_READABLE"); - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); break; case SETTING_RUN_JAVASCRIPT: @@ -476,17 +488,17 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr case SETTING_SEARCH_ENGINE_YAHOO: SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText); - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); break; case SETTING_SEARCH_ENGINE_NAVER: SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText); - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); break; case SETTING_SEARCH_ENGINE_GOOGLE: SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText); - listView.UpdateList(); + listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); break; case SETTING_RESET_TO_DEFAULT: diff --git a/src/IntSharePopup.cpp b/src/IntSharePopup.cpp index 2c6636f..2183e8b 100644 --- a/src/IntSharePopup.cpp +++ b/src/IntSharePopup.cpp @@ -258,6 +258,11 @@ SharePopup::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, default: break; } + Frame* pCurrentFrame = null; + pCurrentFrame = Application::GetInstance()->GetAppFrame()->GetFrame(); + + if (pCurrentFrame != null) + { pCurrentFrame->SetEnabled(false); } } void @@ -567,6 +572,11 @@ void SharePopup::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& a } Popup::SetShowState(false); Popup::Show(); + Frame* pCurrentFrame = null; + pCurrentFrame = Application::GetInstance()->GetAppFrame()->GetFrame(); + + if (pCurrentFrame != null) + { pCurrentFrame->SetEnabled(true); } __appControlOngoing = false; }