From 06372d9557fd613262a21fe287bcb36b40e14fd0 Mon Sep 17 00:00:00 2001 From: Albert Malewski Date: Mon, 14 Sep 2015 14:12:12 +0200 Subject: [PATCH 01/16] Removed inheritance of AbstractUIComponent in MainUI and SimpleURI classes [Issue] https://bugs.tizen.org/jira/browse/TT-157 [Problem] MainUI and SimpleURI classes are not UI components in fact. They are not suspected to call AbstractUIComponent's methods. [Cause] N/A [Solution] Removed inheritance of AbstractUIComponent in MainUI and SimpleURI classes. [Verify] This patch does not change browser's behaviour. Change-Id: I048c6ad288df7af331efda6552565b83a112af08 --- services/MainUI/MainUI.h | 3 +-- services/SimpleURI/SimpleURI.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/services/MainUI/MainUI.h b/services/MainUI/MainUI.h index 94fa9d9..0ebc78d 100644 --- a/services/MainUI/MainUI.h +++ b/services/MainUI/MainUI.h @@ -34,8 +34,7 @@ namespace base_ui{ //TODO: This class name is not revelant to what this class actually does. //Rename this class and file to "QuickAccessUI". class BROWSER_EXPORT MainUI - : public tizen_browser::interfaces::AbstractUIComponent - , public tizen_browser::core::AbstractService + : public tizen_browser::core::AbstractService { public: MainUI(); diff --git a/services/SimpleURI/SimpleURI.h b/services/SimpleURI/SimpleURI.h index 77ec107..e28abed 100644 --- a/services/SimpleURI/SimpleURI.h +++ b/services/SimpleURI/SimpleURI.h @@ -34,8 +34,7 @@ namespace tizen_browser{ namespace base_ui{ class BROWSER_EXPORT SimpleURI - : public tizen_browser::interfaces::AbstractUIComponent - , public tizen_browser::core::AbstractService + : public tizen_browser::core::AbstractService { public: enum IconType{ -- 2.7.4 From aadbbcd9df9a8a91e392602f4541dd3f0ef086e6 Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Mon, 14 Sep 2015 18:16:49 +0200 Subject: [PATCH 02/16] TabUI Implementing new AbstractUIComponent methods. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class needs AbstractUIComponent to have some view managing functions. [Cause:] N/A [Solution:] Implemented needed methods: void init(Evas_Object* parent) Evas_Object* getContent() void showUI() void hideUI() [Verify:] Change is not affecting browsers behaviour. Change-Id: I6d4a91af909722050564690510f64e9c331b7fe5 --- services/TabUI/TabUI.cpp | 90 +++++++++++++++++++++++++++++++++++++----------- services/TabUI/TabUI.h | 8 +++++ 2 files changed, 77 insertions(+), 21 deletions(-) diff --git a/services/TabUI/TabUI.cpp b/services/TabUI/TabUI.cpp index e93f03e..a3e0916 100644 --- a/services/TabUI/TabUI.cpp +++ b/services/TabUI/TabUI.cpp @@ -76,17 +76,59 @@ void TabUI::createTabItemClass() void TabUI::show(Evas_Object* parent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + init(parent); + m_tab_layout = createTabUILayout(m_parent); + showUI(); +} + +void TabUI::showUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_tab_layout); + evas_object_show(m_tab_layout); + //regenerate gengrid + m_gengrid = createGengrid(m_tab_layout); + elm_object_part_content_set(m_tab_layout, "tab_gengrid", m_gengrid); + evas_object_show(m_gengrid); + + evas_object_show(elm_layout_content_get(m_tab_layout, "action_bar")); + evas_object_show(elm_layout_content_get(m_tab_layout, "top_bar")); +} + +void TabUI::hideUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_tab_layout); + evas_object_hide(m_tab_layout); + + //delete gengrid + evas_object_del(m_gengrid); + m_gengrid = nullptr; + + evas_object_hide(elm_layout_content_get(m_tab_layout, "action_bar")); + evas_object_hide(elm_layout_content_get(m_tab_layout, "top_bar")); +} + +void TabUI::init(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); M_ASSERT(parent); m_parent = parent; - //TODO:check if there is no some memory leak due to not destroying previous instance of this UI element. - m_tab_layout = createTabUILayout(parent); - evas_object_show(m_tab_layout); +} + +Evas_Object* TabUI::getContent() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + if(!m_tab_layout) + m_tab_layout = createTabUILayout(m_parent); + return m_tab_layout; } Evas_Object* TabUI::createTabUILayout(Evas_Object* parent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - M_ASSERT(parent); + Evas_Object* tab_layout = elm_layout_add(parent); elm_layout_file_set(tab_layout, m_edjFilePath.c_str(), "tab-layout"); evas_object_size_hint_weight_set(tab_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -98,31 +140,34 @@ Evas_Object* TabUI::createTabUILayout(Evas_Object* parent) buttonBar = createActionBar(tab_layout); elm_object_part_content_set(tab_layout, "action_bar", buttonBar); + return tab_layout; +} - //create gengrid containing tabs - m_gengrid = elm_gengrid_add(tab_layout); - elm_object_part_content_set(tab_layout, "tab_gengrid", m_gengrid); +Evas_Object* TabUI::createGengrid(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parent); - M_ASSERT(m_parent); - elm_gengrid_align_set(m_gengrid, 0, 0); - elm_gengrid_select_mode_set(m_gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_gengrid_multi_select_set(m_gengrid, EINA_FALSE); - elm_gengrid_horizontal_set(m_gengrid, EINA_TRUE); - elm_gengrid_highlight_mode_set(m_gengrid, EINA_TRUE); - elm_scroller_policy_set(m_gengrid, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF); - elm_scroller_page_size_set(m_gengrid, 0, 327); + Evas_Object* gengrid = elm_gengrid_add(parent); - evas_object_size_hint_weight_set(m_gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_gengrid_align_set(gengrid, 0, 0); + elm_gengrid_select_mode_set(gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_gengrid_multi_select_set(gengrid, EINA_FALSE); + elm_gengrid_horizontal_set(gengrid, EINA_TRUE); + elm_gengrid_highlight_mode_set(gengrid, EINA_TRUE); + elm_scroller_policy_set(gengrid, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF); + elm_scroller_page_size_set(gengrid, 0, 327); + + evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); double efl_scale = elm_config_scale_get() / elm_app_base_scale_get(); - elm_gengrid_item_size_set(m_gengrid, 364 * efl_scale, 320 * efl_scale); - evas_object_event_callback_add(m_gengrid, EVAS_CALLBACK_MOUSE_IN, _focus_in, this); + elm_gengrid_item_size_set(gengrid, 364 * efl_scale, 320 * efl_scale); + evas_object_event_callback_add(gengrid, EVAS_CALLBACK_MOUSE_IN, _focus_in, this); - return tab_layout; + return gengrid; } - Evas_Object* TabUI::createActionBar(Evas_Object* parent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -170,6 +215,7 @@ void TabUI::_close_clicked(void* data, Evas_Object*, void*) void TabUI::hide() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); evas_object_hide(elm_layout_content_get(m_tab_layout, "action_bar")); evas_object_hide(elm_layout_content_get(m_tab_layout, "top_bar")); evas_object_hide(elm_layout_content_get(m_tab_layout, "tab_gengrid")); @@ -368,6 +414,7 @@ void TabUI::clearItems() Evas_Object* TabUI::createNoHistoryLabel() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); Evas_Object *label = elm_label_add(m_parent); elm_object_text_set(label, "No favorite websites."); evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -389,6 +436,7 @@ void TabUI::closeAllTabs() void TabUI::setEmptyGengrid(bool setEmpty) { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); if (setEmpty) { elm_object_part_content_set(m_gengrid, "elm.swallow.empty", createNoHistoryLabel()); } else { diff --git a/services/TabUI/TabUI.h b/services/TabUI/TabUI.h index 21cd5b2..d650052 100644 --- a/services/TabUI/TabUI.h +++ b/services/TabUI/TabUI.h @@ -36,6 +36,12 @@ class BROWSER_EXPORT TabUI public: TabUI(); ~TabUI(); + //AbstractUIComponent interface implementation + void showUI(); + void hideUI(); + void init(Evas_Object *parent); + Evas_Object* getContent(); + void show(Evas_Object *parent); virtual std::string getName(); void clearItems(); @@ -54,6 +60,7 @@ public: boost::signals2::signal tabsCount; private: + static char* _grid_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object * _tab_grid_content_get(void *data, Evas_Object *obj, const char *part); static void _itemSelected(void * data, Evas_Object * obj, void * event_info); @@ -72,6 +79,7 @@ private: Evas_Object* createTabUILayout(Evas_Object* parent); Evas_Object* createActionBar(Evas_Object* parent); + Evas_Object* createGengrid(Evas_Object* parent); Evas_Object* createTopButtons(Evas_Object* parent); Evas_Object* createNoHistoryLabel(); void createTabItemClass(); -- 2.7.4 From 67476fe16d898eb94f7baa0d32a870cf054e1834 Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Mon, 14 Sep 2015 15:48:57 +0200 Subject: [PATCH 03/16] MoreMenuUI Implementing new AbstractUIComponent methods. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class needs AbstractUIComponent to have some view managing functions. [Cause:] N/A [Solution:] Implemented needed methods: void init(Evas_Object* parent) Evas_Object* getContent() void showUI() void hideUI() [Verify:] Change is not affecting browsers behaviour. Change-Id: I4aef907e35f5240be86c259f4d6705a43c93ee4a --- services/MoreMenuUI/MoreMenuUI.cpp | 130 +++++++++++++++++++++++++++---------- services/MoreMenuUI/MoreMenuUI.h | 16 +++++ 2 files changed, 112 insertions(+), 34 deletions(-) diff --git a/services/MoreMenuUI/MoreMenuUI.cpp b/services/MoreMenuUI/MoreMenuUI.cpp index 7489ab6..4db8fd8 100644 --- a/services/MoreMenuUI/MoreMenuUI.cpp +++ b/services/MoreMenuUI/MoreMenuUI.cpp @@ -45,55 +45,113 @@ typedef struct _MoreItemData } MoreMenuItemData; MoreMenuUI::MoreMenuUI() - : m_gengrid(NULL) - , m_parent(NULL) - , m_item_class(NULL) + : m_gengrid(nullptr) + , m_parent(nullptr) + , m_item_class(nullptr) + , m_mm_layout(nullptr) , m_desktopMode(true) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_edjFilePath = EDJE_DIR; m_edjFilePath.append("MoreMenuUI/MoreMenu.edj"); + m_item_class = crateItemClass(); } MoreMenuUI::~MoreMenuUI() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (m_item_class) + elm_gengrid_item_class_free(m_item_class); } -void MoreMenuUI::show(Evas_Object* parent, bool desktopMode) +Elm_Gengrid_Item_Class* MoreMenuUI::crateItemClass() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + Elm_Gengrid_Item_Class* item_class = elm_gengrid_item_class_new(); + item_class->item_style = "menu_item"; + item_class->func.text_get = _grid_text_get; + item_class->func.content_get = _grid_content_get; + item_class->func.state_get = NULL; + item_class->func.del = NULL; + return item_class; +} + +void MoreMenuUI::init(Evas_Object* parent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parent); m_parent = parent; - m_desktopMode = desktopMode; - elm_theme_extension_add(NULL, m_edjFilePath.c_str()); - m_mm_layout = elm_layout_add(parent); - elm_layout_file_set(m_mm_layout, m_edjFilePath.c_str(), "moremenu-layout"); - evas_object_size_hint_weight_set(m_mm_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_mm_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(m_mm_layout); - - m_gengrid = elm_gengrid_add(m_mm_layout); - elm_object_part_content_set(m_mm_layout, "elm.swallow.grid", m_gengrid); - - if (!m_item_class) { - m_item_class = elm_gengrid_item_class_new(); - m_item_class->item_style = "menu_item"; - m_item_class->func.text_get = _grid_text_get; - m_item_class->func.content_get = _grid_content_get; - m_item_class->func.state_get = NULL; - m_item_class->func.del = NULL; - } +} - elm_gengrid_align_set(m_gengrid, 0, 0); - elm_gengrid_select_mode_set(m_gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_gengrid_multi_select_set(m_gengrid, EINA_FALSE); - elm_gengrid_horizontal_set(m_gengrid, EINA_FALSE); - elm_scroller_policy_set(m_gengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); - elm_scroller_page_size_set(m_gengrid, 0, 327); - evas_object_size_hint_weight_set(m_gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_gengrid_item_size_set(m_gengrid, 364 * efl_scale, 320 * efl_scale); +void MoreMenuUI::show(Evas_Object* parent, bool desktopMode) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + init(parent); + //TODO: move this function call to SimpleUI::initUIServices after introducing new window managment. + setDesktopMode(desktopMode); + m_mm_layout=createMoreMenuLayout(parent); + showUI(); +} +void MoreMenuUI::showUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + evas_object_show(getContent()); + //regenerate gengrid + m_gengrid=createGengrid(getContent()); addItems(); + elm_object_part_content_set(getContent(), "elm.swallow.grid", m_gengrid); +} + +void MoreMenuUI::hideUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_mm_layout); + evas_object_hide(getContent()); + //destroy gengrid + evas_object_del(m_gengrid); +} + + +Evas_Object* MoreMenuUI::getContent() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + if(!m_mm_layout) + m_mm_layout = createMoreMenuLayout(m_parent); + return m_mm_layout; +} + +Evas_Object* MoreMenuUI::createMoreMenuLayout(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + elm_theme_extension_add(NULL, m_edjFilePath.c_str()); + Evas_Object* mm_layout = elm_layout_add(parent); + elm_layout_file_set(mm_layout, m_edjFilePath.c_str(), "moremenu-layout"); + evas_object_size_hint_weight_set(mm_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(mm_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + + evas_object_show(mm_layout); + return mm_layout; +} + +Evas_Object* MoreMenuUI::createGengrid(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + Evas_Object* gengrid = elm_gengrid_add(parent); + elm_object_part_content_set(parent, "elm.swallow.grid", gengrid); + + elm_gengrid_align_set(gengrid, 0, 0); + elm_gengrid_select_mode_set(gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_gengrid_multi_select_set(gengrid, EINA_FALSE); + elm_gengrid_horizontal_set(gengrid, EINA_FALSE); + elm_scroller_policy_set(gengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); + elm_scroller_page_size_set(gengrid, 0, 327); + evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_gengrid_item_size_set(gengrid, 364 * efl_scale, 320 * efl_scale); + return gengrid; } void MoreMenuUI::showCurrentTab() @@ -138,6 +196,7 @@ void MoreMenuUI::setFavIcon(std::shared_ptr void MoreMenuUI::setDocIcon() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); if(m_icon) evas_object_del(m_icon); @@ -188,7 +247,7 @@ void MoreMenuUI::_close_clicked(void* data, Evas_Object*, void*) void MoreMenuUI::AddBookmarkPopupCalled() { - + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_add_bookmark_popup = std::make_shared(m_mm_layout); m_add_bookmark_popup->show(); m_add_bookmark_popup->addBookmarkFolderItems(m_map_bookmark_folder_list); @@ -234,8 +293,8 @@ void MoreMenuUI::CancelClicked(Evas_Object*) void MoreMenuUI::addToBookmarks(int folder_id) { - AddBookmarkInput(folder_id); BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + AddBookmarkInput(folder_id); m_add_bookmark_popup->hide(); m_add_bookmark_popup.reset(); } @@ -476,6 +535,9 @@ void MoreMenuUI::_thumbSelected(void* data, Evas_Object*, void*) case EXIT_BROWSER: _exitClicked(); break; + default: + BROWSER_LOGD("[%s:%d] Warning: Unhandled button.", __PRETTY_FUNCTION__, __LINE__); + break; } } } diff --git a/services/MoreMenuUI/MoreMenuUI.h b/services/MoreMenuUI/MoreMenuUI.h index 06e4017..4b0fccb 100644 --- a/services/MoreMenuUI/MoreMenuUI.h +++ b/services/MoreMenuUI/MoreMenuUI.h @@ -61,10 +61,21 @@ class BROWSER_EXPORT MoreMenuUI public: MoreMenuUI(); ~MoreMenuUI(); + + //AbstractUIComponent interface methods + void init(Evas_Object* parent); + Evas_Object* getContent(); + void showUI(); + void hideUI(); + + void setDesktopMode(bool desktopMode) {m_desktopMode = desktopMode;} + void show(Evas_Object *main_layout, bool desktopMode); + //TODO: remove this function after new view managment introduction. void showCurrentTab(); virtual std::string getName(); void addItems(); + //TODO: remove this function after new view managment introduction. void hide(); void clearItems(); void getBookmarkFolderList(std::vector > ); @@ -75,14 +86,19 @@ public: boost::signals2::signal addToBookmarkClicked; boost::signals2::signal AddBookmarkInput; boost::signals2::signal BookmarkFolderCreated; + //TODO: remove redundant argument from this signal. boost::signals2::signal bookmarkManagerClicked; boost::signals2::signal BookmarkFoldersListImport; boost::signals2::signal historyUIClicked; boost::signals2::signal settingsClicked; + //TODO: remove redundant argument from this signal. boost::signals2::signal closeMoreMenuClicked; boost::signals2::signal switchToMobileMode; boost::signals2::signal switchToDesktopMode; private: + Elm_Gengrid_Item_Class* crateItemClass(); + Evas_Object* createMoreMenuLayout(Evas_Object* parent); + Evas_Object* createGengrid(Evas_Object* parent); static char* _grid_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object * _grid_content_get(void *data, Evas_Object *obj, const char *part); static void _thumbSelected(void * data, Evas_Object * obj, void * event_info); -- 2.7.4 From cce3446c1bc84eafa4f047511e071bd50c5e24e2 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Tue, 15 Sep 2015 10:33:12 +0200 Subject: [PATCH 04/16] Remove unused classes. [Issue#] N/A [Problem] These classes were unused. [Cause] N/A [Solution] Delete classes and theirs references. [Verify] Run browser, check if page browsing works. Change-Id: I11bd790c0cec58dfa7e13f7b9d553a8b822e69a3 Signed-off-by: Maciej Skrzypkowski --- services/MainUI/MainUI.cpp | 7 +- services/MainUI/edc/MainUI.edc | 20 +- services/SimpleUI/CMakeLists.txt | 25 -- services/SimpleUI/HistoryList.cpp | 317 -------------- services/SimpleUI/HistoryList.h | 95 ----- services/SimpleUI/NetworkErrorHandler.cpp | 57 --- services/SimpleUI/NetworkErrorHandler.h | 65 --- services/SimpleUI/RelatedWebPages.cpp | 156 ------- services/SimpleUI/RelatedWebPages.h | 54 --- services/SimpleUI/Settings.cpp | 334 --------------- services/SimpleUI/Settings.h | 92 ----- services/SimpleUI/SimpleScroller.cpp | 68 --- services/SimpleUI/SimpleScroller.h | 43 -- services/SimpleUI/SimpleUI.cpp | 76 ---- services/SimpleUI/SimpleUI.h | 28 -- services/SimpleUI/TabList.cpp | 288 ------------- services/SimpleUI/TabList.h | 84 ---- services/SimpleUI/WebTitleBar.cpp | 122 ------ services/SimpleUI/WebTitleBar.h | 76 ---- services/SimpleUI/ZoomList.cpp | 144 ------- services/SimpleUI/ZoomList.h | 72 ---- services/SimpleUI/edc/EntryPopup.edc | 51 --- services/SimpleUI/edc/HistoryItem.edc | 660 ------------------------------ services/SimpleUI/edc/RelatedPages.edc | 298 -------------- services/SimpleUI/edc/Settings.edc | 574 -------------------------- services/SimpleUI/edc/TabItem.edc | 513 ----------------------- services/SimpleUI/edc/WebTitleBar.edc | 116 ------ services/SimpleUI/edc/ZoomItem.edc | 221 ---------- 28 files changed, 20 insertions(+), 4636 deletions(-) delete mode 100644 services/SimpleUI/HistoryList.cpp delete mode 100644 services/SimpleUI/HistoryList.h delete mode 100644 services/SimpleUI/NetworkErrorHandler.cpp delete mode 100644 services/SimpleUI/NetworkErrorHandler.h delete mode 100644 services/SimpleUI/RelatedWebPages.cpp delete mode 100644 services/SimpleUI/RelatedWebPages.h delete mode 100644 services/SimpleUI/Settings.cpp delete mode 100644 services/SimpleUI/Settings.h delete mode 100644 services/SimpleUI/SimpleScroller.cpp delete mode 100644 services/SimpleUI/SimpleScroller.h delete mode 100644 services/SimpleUI/TabList.cpp delete mode 100644 services/SimpleUI/TabList.h delete mode 100644 services/SimpleUI/WebTitleBar.cpp delete mode 100644 services/SimpleUI/WebTitleBar.h delete mode 100644 services/SimpleUI/ZoomList.cpp delete mode 100644 services/SimpleUI/ZoomList.h delete mode 100644 services/SimpleUI/edc/EntryPopup.edc delete mode 100644 services/SimpleUI/edc/HistoryItem.edc delete mode 100644 services/SimpleUI/edc/RelatedPages.edc delete mode 100644 services/SimpleUI/edc/Settings.edc delete mode 100644 services/SimpleUI/edc/TabItem.edc delete mode 100644 services/SimpleUI/edc/WebTitleBar.edc delete mode 100644 services/SimpleUI/edc/ZoomItem.edc diff --git a/services/MainUI/MainUI.cpp b/services/MainUI/MainUI.cpp index 3822075..d5bec80 100644 --- a/services/MainUI/MainUI.cpp +++ b/services/MainUI/MainUI.cpp @@ -277,8 +277,8 @@ void MainUI::addHistoryItem(std::shared_ptr hi) void MainUI::addHistoryItems(std::shared_ptr items) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); + clearHistoryGenlist(); int i = 0; - m_historyItems.clear(); for (auto it = items->begin(); it != items->end(); ++it) { i++; if (i > MAX_TILES_NUMBER) @@ -364,9 +364,12 @@ void MainUI::clearHistoryGenlist() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - for (auto it = m_tiles.begin(); it != m_tiles.end(); ++it) + for (auto it = m_tiles.begin(); it != m_tiles.end(); ++it) { edje_object_signal_callback_del(elm_layout_edje_get(*it), "mouse,clicked,1", "over", _thumbClicked); + evas_object_del(*it); + } + m_tiles.clear(); m_historyItems.clear(); } diff --git a/services/MainUI/edc/MainUI.edc b/services/MainUI/edc/MainUI.edc index 0625a90..8dfe2be 100644 --- a/services/MainUI/edc/MainUI.edc +++ b/services/MainUI/edc/MainUI.edc @@ -46,6 +46,16 @@ group{ } } } + programs{ + program { + name: "mouse_click"; + signal: "mouse,clicked,1"; + source: "over"; + script { + emit("elm,action,click", ""); + } + } + } } group { name: "elm/button/base/thumbButton"; @@ -222,7 +232,7 @@ group { name: "mv_bookmarks"; min: 784 614; max: 784 614; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { relative: 0 0; to: "center_rect"; @@ -244,7 +254,7 @@ group { name: "mv_bookmarks"; min: 378 294; max: 378 294; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { to: "center_rect"; @@ -269,7 +279,7 @@ group { name: "mv_bookmarks"; min: 378 294; max: 378 294; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { to: "center_rect"; @@ -294,7 +304,7 @@ group { name: "mv_bookmarks"; min: 378 294; max: 378 294; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { to: "center_rect"; @@ -319,7 +329,7 @@ group { name: "mv_bookmarks"; min: 378 294; max: 378 294; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { to: "center_rect"; diff --git a/services/SimpleUI/CMakeLists.txt b/services/SimpleUI/CMakeLists.txt index 0e0a5fd..af5a134 100644 --- a/services/SimpleUI/CMakeLists.txt +++ b/services/SimpleUI/CMakeLists.txt @@ -1,35 +1,17 @@ project(SimpleUI) set(SimpleUI_SRCS - NetworkErrorHandler.cpp - HistoryList.cpp SimpleUI.cpp ButtonBar.cpp SimplePopup.cpp - ZoomList.cpp - TabList.cpp BookmarksManager.cpp - Settings.cpp - SimpleScroller.cpp - WebTitleBar.cpp - RelatedWebPages.cpp - CustomPopup.cpp ) set(SimpleUI_HEADERS - NetworkErrorHandler.h SimpleUI.h ButtonBar.h SimplePopup.h - ZoomList.h - TabList.h BookmarksManager.h - Settings.h - SimpleScroller.h - HistoryList.h - WebTitleBar.h - RelatedWebPages.h - CustomPopup.h ) include(Coreheaders) @@ -101,17 +83,10 @@ set(edcFiles LeftButtonBar.edc RightButtonBar.edc AuthenticationPopup.edc - TabItem.edc - ZoomItem.edc BookmarksManager.edc - Settings.edc ScrollerDefault.edc - HistoryItem.edc - WebTitleBar.edc ErrorMessage.edc - RelatedPages.edc Tooltip.edc - CustomPopup.edc ) foreach(edec ${edcFiles}) diff --git a/services/SimpleUI/HistoryList.cpp b/services/SimpleUI/HistoryList.cpp deleted file mode 100644 index 508ae8f..0000000 --- a/services/SimpleUI/HistoryList.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include "HistoryList.h" -#include "BrowserAssert.h" -#include "BrowserLogger.h" -#include "HistoryItem.h" -#include "EflTools.h" -#include - -#if MERGE_ME -#include -#include -#include -#include -#endif - -namespace tizen_browser -{ -namespace base_ui -{ - - -HistoryList::HistoryList(std::shared_ptr mainWindow, Evas_Object* parentButton) - : MenuButton(mainWindow, parentButton) - ,m_genList(NULL) - ,m_itemClass(NULL) - ,m_lastFocusedItem(NULL) - ,m_deleteSelected(false) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleUI/HistoryItem.edj"); - elm_theme_extension_add(0, edjFilePath.c_str()); - - itemWidth = atoi(edje_file_data_get(edjFilePath.c_str(),"item_width")); - itemHeight = atoi(edje_file_data_get(edjFilePath.c_str(),"item_height")); - parentItemHeight = atoi(edje_file_data_get(edjFilePath.c_str(),"parent_item_height")); - itemsCounter = 0; - parentItemsCounter = 0; - - m_genList = elm_genlist_add(m_window.get()); - elm_object_style_set(m_genList, "history"); - elm_genlist_homogeneous_set(m_genList, EINA_FALSE); - elm_genlist_multi_select_set(m_genList, EINA_FALSE); - elm_genlist_select_mode_set(m_genList, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_genlist_mode_set(m_genList, ELM_LIST_LIMIT); - elm_genlist_decorate_mode_set(m_genList, EINA_TRUE); - evas_object_size_hint_weight_set(m_genList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - evas_object_smart_callback_add(m_genList, "item,focused", focusItem, this); - evas_object_smart_callback_add(m_genList, "item,unfocused", unFocusItem, NULL); - - m_itemClass = elm_genlist_item_class_new(); - m_itemClass->item_style = "history_item"; - m_itemClass->func.text_get = &listItemTextGet; - m_itemClass->func.content_get = &listItemContentGet; - m_itemClass->func.state_get = 0; - m_itemClass->func.del = 0; - - m_itemClassNoFavicon = elm_genlist_item_class_new(); - m_itemClassNoFavicon->item_style = "history_item_no_favicon"; - m_itemClassNoFavicon->func.text_get = &listItemTextGet; - m_itemClassNoFavicon->func.content_get = &listItemContentGet; - m_itemClassNoFavicon->func.state_get = 0; - m_itemClassNoFavicon->func.del = 0; - - m_parentItemClass= elm_genlist_item_class_new(); - m_parentItemClass->item_style = "history_parent_item"; - m_parentItemClass->func.text_get = &listParentItemTextGet; - m_parentItemClass->func.content_get = 0; - m_parentItemClass->func.state_get = 0; - m_parentItemClass->func.del = 0; -} - -HistoryList::~HistoryList() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); -} - -void HistoryList::addItem(const std::shared_ptr item) -{ - BROWSER_LOGD("[%s:%d]:%s ", __PRETTY_FUNCTION__, __LINE__, item->getTitle().c_str()); - //first check if ther's a date item. - GroupIterator parenIter = m_groupParent.find(item->getLastVisit().date()); - Elm_Object_Item* groupParent; - - ItemData * id = new ItemData; - id->h_list = this; - id->h_item = item.get(); - if(parenIter == m_groupParent.end()){ - groupParent = elm_genlist_item_append(m_genList, //genlist - m_parentItemClass, //item Class - //id.get(), //item data - id, - 0, //parent item - ELM_GENLIST_ITEM_GROUP,//item type - paretn_item_clicked_cb, - NULL //data passed to above function - ); - elm_object_item_disabled_set(groupParent, EINA_TRUE); - m_groupParent[item->getLastVisit().date()] = groupParent; - ++parentItemsCounter; - } else { - groupParent = parenIter->second; - } - - Elm_Object_Item* elmItem = elm_genlist_item_append(m_genList, //genlist - item->getFavIcon()->dataSize ? m_itemClass : m_itemClassNoFavicon, //item Class - //id.get(), //item data - id, - groupParent, //parent item - ELM_GENLIST_ITEM_NONE,//item type - NULL, - NULL //data passed to above function - ); - id->e_item = elmItem; - -// m_items.push_back(item); - ++itemsCounter; -} - -void HistoryList::clearList() -{ - elm_genlist_clear(m_genList); - itemsCounter = 0; - parentItemsCounter = 0; - m_groupParent.clear(); -} - -void HistoryList::addItems(tzSrv::HistoryItemVector items) -{ - clearList(); - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - tzSrv::HistoryItemVectorConstIter end = items.end(); - for(tzSrv::HistoryItemVectorConstIter item = items.begin(); item!=end; item++){ - addItem(*item); - } -} - -Evas_Object* HistoryList::getContent() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - return m_genList; -} - -MenuButton::ListSize HistoryList::calculateSize() -{ - ListSize result; - - result.width = itemWidth; - - result.height = itemsCounter*itemHeight + parentItemsCounter*parentItemHeight + 16; //"16" is size of frame - if (result.height > 868) - result.height = 868; - - return result; -} - -Evas_Object* HistoryList::getFirstFocus() -{ - return m_genList; -} - -Evas_Object* HistoryList::listItemContentGet(void* data, Evas_Object* obj, const char* part) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ItemData * id = static_cast(data); - if(!strcmp(part, "favicon") && id->h_item->getFavIcon()) - { - return tizen_browser::tools::EflTools::getEvasImage(id->h_item->getFavIcon(), obj); - } - else if(!strcmp(part, "content_click")) - { - Evas_Object *content_click = elm_button_add(obj); - elm_object_style_set(content_click, "invisible_button"); - evas_object_smart_callback_add(content_click, "clicked", HistoryList::item_clicked_cb, id); - return content_click; - } - else if(!strcmp(part, "del_click")) - { - Evas_Object *del_click = elm_button_add(obj); - elm_object_style_set(del_click, "invisible_button"); - evas_object_smart_callback_add(del_click, "clicked", HistoryList::item_delete_clicked_cb, id); - return del_click; - } - return NULL; -} - -char* HistoryList::listItemTextGet(void* data, Evas_Object* /* obj */, const char* part) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ItemData * id = static_cast(data); - if(!strcmp(part, "page_title")) - { - if(!id->h_item->getTitle().empty()){ - return strdup(id->h_item->getTitle().c_str()); - } - } - else if(!strcmp(part, "page_url")) - { - if(!id->h_item->getUrl().empty()){ - return strdup(id->h_item->getUrl().c_str()); - } - } -#if MERGE_ME - else if(!strcmp(part, "page_time")) - { - std::string retstr = boost::posix_time::to_simple_string(id->h_item->getLastVisit().time_of_day()); - return strdup(retstr.c_str()); - } -#endif - return strdup(""); -} - -void HistoryList::item_clicked_cb(void* data, Evas_Object* /* obj */, void* /* event_info */) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ItemData * id = static_cast(data); - id->h_list->clickedHistoryItem(id->h_item->getUrl()); -} - -void HistoryList::item_delete_clicked_cb(void* data, Evas_Object* /* obj */, void* /* event_info */) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ItemData * id = static_cast(data); - id->h_list->deleteHistoryItem(id->h_item->getUrl()); - elm_object_item_del(id->e_item); - elm_genlist_item_update(id->e_item); - BROWSER_LOGD("[%s:%d] Genlist count: %d", __PRETTY_FUNCTION__, __LINE__, elm_genlist_items_count(id->h_list->m_genList)); -} - -char* HistoryList::listParentItemTextGet(void* data, Evas_Object* /* obj */, const char* /* part */ ) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ///\todo fix year out of range - ItemData * id = static_cast(data); - std::string retstr = boost::gregorian::to_simple_string(id->h_item->getLastVisit().date()); - return strdup(retstr.c_str()); - -} - -void HistoryList::paretn_item_clicked_cb(void* /* data */, Evas_Object* /* obj */, void* /* event_info */) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); -} - -void HistoryList::focusItem(void* data, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,in", "content_click"); - - HistoryList *self = static_cast(data); - self->m_lastFocusedItem = item; -} - -void HistoryList::unFocusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - ItemData * id = reinterpret_cast(elm_object_item_data_get(item)); - M_ASSERT(id); - elm_object_item_signal_emit(item, "mouse,out", "content_click"); - elm_object_item_signal_emit(item, "mouse,out", "del_click"); - id->h_list->m_deleteSelected = false; -} - -void HistoryList::rightPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,in", "del_click"); - m_deleteSelected = true; - } -} - -void HistoryList::leftPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,out", "del_click"); - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,in", "content_click"); - m_deleteSelected = false; - } -} - -void HistoryList::enterPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - - ItemData * id = reinterpret_cast(elm_object_item_data_get(m_lastFocusedItem)); - M_ASSERT(id); - if(m_deleteSelected) { - deleteHistoryItem(id->h_item->getUrl()); - elm_object_item_del(m_lastFocusedItem); - elm_genlist_item_update(m_lastFocusedItem); - } - else - clickedHistoryItem(id->h_item->getUrl()); - } -} - -} /* end of namespace base_ui */ -} /* end of namespace tizen_browser */ diff --git a/services/SimpleUI/HistoryList.h b/services/SimpleUI/HistoryList.h deleted file mode 100644 index 098f41f..0000000 --- a/services/SimpleUI/HistoryList.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#ifndef HISTORYLIST_H -#define HISTORYLIST_H -#include -#include -#include -#include - -#include -#include -#include - -#include "MenuButton.h" - -#include "HistoryItem.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -namespace tzSrv = tizen_browser::services; - -class HistoryList : public MenuButton -{ -public: - HistoryList(std::shared_ptr mainWindow, Evas_Object* parentButton); - ~HistoryList(); - void addItems(tzSrv::HistoryItemVector items); - void addItem(const std::shared_ptr item); - virtual Evas_Object *getContent(); - virtual ListSize calculateSize(); - virtual Evas_Object* getFirstFocus(); - boost::signals2::signal clickedHistoryItem; - boost::signals2::signal deleteHistoryItem; - void clearList(); - - void rightPressed(); - void leftPressed(); - void enterPressed(); - -private: - - static Evas_Object* listItemContentGet(void *data, Evas_Object *obj, const char *part); - static char* listItemTextGet(void *data, Evas_Object *obj, const char *part); - static char* listParentItemTextGet(void *data, Evas_Object *obj, const char *part); - - static void paretn_item_clicked_cb(void *data, Evas_Object *obj, void *event_info); - static void item_clicked_cb(void *data, Evas_Object *obj, void *event_info); - static void item_delete_clicked_cb(void *data, Evas_Object *obj, void *event_info); - -private: - struct ItemData{ - tizen_browser::base_ui::HistoryList * h_list; - tizen_browser::services::HistoryItem * h_item; - Elm_Object_Item * e_item; - }; - Evas_Object *m_genList; - Elm_Genlist_Item_Class *m_itemClass; - Elm_Genlist_Item_Class *m_itemClassNoFavicon; - Elm_Genlist_Item_Class *m_parentItemClass; - int itemsCounter; - int parentItemsCounter; - int itemHeight; - int itemWidth; - int parentItemHeight; - std::map m_groupParent; - typedef std::map::iterator GroupIterator; - - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); - - Elm_Object_Item *m_lastFocusedItem; - bool m_deleteSelected; -}; - -} /* end of namespace base_ui */ -} /* end of namespace tizen_browser */ - -#endif // HISTORYLIST_H diff --git a/services/SimpleUI/NetworkErrorHandler.cpp b/services/SimpleUI/NetworkErrorHandler.cpp deleted file mode 100644 index 0c6f148..0000000 --- a/services/SimpleUI/NetworkErrorHandler.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include "NetworkErrorHandler.h" - -#if PLATFORM(TIZEN) -#include -#endif - -namespace tizen_browser -{ -namespace basic_ui -{ - -NetworkErrorHandler::NetworkErrorHandler() -{ -#if PLATFORM(TIZEN) - connection_create(&connection); - connection_set_type_changed_cb(connection, onConnectionStateChanged, this); -#endif -} - -NetworkErrorHandler::~NetworkErrorHandler() -{ -#if PLATFORM(TIZEN) - connection_unset_type_changed_cb(connection); - connection_destroy(connection); -#endif -} - -#if PLATFORM(TIZEN) -void NetworkErrorHandler::onConnectionStateChanged(connection_type_e type, void* user_data) -{ - NetworkErrorHandler *self = static_cast(user_data); - if(type == CONNECTION_TYPE_DISCONNECTED){ - self->networkError(); - }else{ - self->networkConnected(); - } -} -#endif - -} /* end of namespace basic_ui */ -} /* end of namespace tizen_browser */ diff --git a/services/SimpleUI/NetworkErrorHandler.h b/services/SimpleUI/NetworkErrorHandler.h deleted file mode 100644 index 2b39f92..0000000 --- a/services/SimpleUI/NetworkErrorHandler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#ifndef NETWORKINGERRORHANDLER_H -#define NETWORKINGERRORHANDLER_H - -#include "browser_config.h" -#include - -#if PLATFORM(TIZEN) -#include -#endif - -#include - -namespace tizen_browser -{ -namespace basic_ui -{ - - - -class NetworkErrorHandler -{ - -public: - NetworkErrorHandler(); - ~NetworkErrorHandler(); - - boost::signals2::signal networkError; - boost::signals2::signal networkConnected; - -private: -#if PLATFORM(TIZEN) - static void onConnectionStateChanged(connection_type_e type, void* user_data); -#endif - - /** - * @brief Typedef, RAI for connection ptr. - * - * dlopen return void* - * dlclose return int - */ -#if PLATFORM(TIZEN) - connection_h connection; -#endif -}; - -} /* end of namespace basic_ui */ -} /* end of namespace tizen_browser */ - -#endif // NETWORKINGERRORHANDLER_H diff --git a/services/SimpleUI/RelatedWebPages.cpp b/services/SimpleUI/RelatedWebPages.cpp deleted file mode 100644 index 7a52a86..0000000 --- a/services/SimpleUI/RelatedWebPages.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include "RelatedWebPages.h" -#include "BrowserLogger.h" -#include "BrowserAssert.h" -#include "Tools/EflTools.h" - -namespace tizen_browser{ -namespace base_ui{ - -typedef struct _BookmarkItemData -{ - std::shared_ptr item; - std::shared_ptr relatedWebPages; -} BookmarkItemData; - -RelatedWebPages::RelatedWebPages() : m_parent(NULL), m_gengrid(NULL), m_item_class(NULL), m_gengridSetup(false) -{ - -} - -void RelatedWebPages::init(Evas_Object* p) -{ - m_parent = p; - m_gengrid = elm_gengrid_add(m_parent); - - evas_object_smart_callback_add(m_gengrid, "item,focused", focusItem, NULL); - evas_object_smart_callback_add(m_gengrid, "item,unfocused", unFocusItem, NULL); - - if (!m_item_class) { - m_item_class = elm_genlist_item_class_new(); - m_item_class->item_style = "rel_page_item"; - m_item_class->func.text_get = NULL; - m_item_class->func.content_get = _grid_content_get; - m_item_class->func.state_get = NULL; - m_item_class->func.del = NULL; - } -} - -void RelatedWebPages::addRelatedPage(std::shared_ptr bi) -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - BookmarkItemData *itemData = new BookmarkItemData(); - itemData->item = bi; - itemData->relatedWebPages = std::shared_ptr(this); - /*Elm_Object_Item* bookmarkView =*/ elm_gengrid_item_append(m_gengrid, m_item_class, itemData, NULL, this); - //m_map_bookmark_views.insert(std::pair(bi->getAddress(),bookmarkView)); - - //setEmptyGengrid(false); -} - -Evas_Object * RelatedWebPages::_grid_content_get(void *data, Evas_Object *obj, const char *part) -{ - BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part); - BookmarkItemData *itemData = reinterpret_cast(data); - - if (!strcmp(part, "elm.thumbnail")) { - if (itemData->item->getThumbnail()) { - Evas_Object * thumb = tizen_browser::tools::EflTools::getEvasImage(itemData->item->getThumbnail(), itemData->relatedWebPages->m_parent); - return thumb; - } - else { - return NULL; - } - } - else if (!strcmp(part, "elm.label")) { - Evas_Object *label = elm_label_add(obj); - elm_object_style_set(label, "rel_pages_label"); - elm_object_text_set(label, itemData->item->getTittle().c_str()); - return label; - } - else if (!strcmp(part, "elm.thumbButton")) { - Evas_Object *thumbButton = elm_button_add(obj); - elm_object_style_set(thumbButton, "thumbButton"); - evas_object_smart_callback_add(thumbButton, "clicked", RelatedWebPages::_thumbSelected, data); - return thumbButton; - } - return NULL; -} - -Evas_Object * RelatedWebPages::getContent() -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - M_ASSERT(m_parent); - - /*if(!elm_gengrid_items_count(m_gengrid)) - elm_object_part_content_set(m_gengrid, "elm.swallow.empty", createNoBookmarksLabel());*/ - - if(!m_gengridSetup) { - std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleUI/RelatedPages.edj"); - elm_theme_extension_add(NULL, edjFilePath.c_str()); - - - elm_object_style_set(m_gengrid, "rel_pages"); - - elm_gengrid_align_set(m_gengrid, 0, 0); - elm_gengrid_item_size_set(m_gengrid, 252, 222); - elm_gengrid_select_mode_set(m_gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_gengrid_multi_select_set(m_gengrid, EINA_FALSE); - elm_gengrid_horizontal_set(m_gengrid, EINA_FALSE); - elm_gengrid_highlight_mode_set(m_gengrid, EINA_TRUE); - elm_scroller_policy_set(m_gengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); - elm_scroller_page_size_set(m_gengrid, 0, 327); - - evas_object_size_hint_weight_set(m_gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); - - m_gengridSetup = true; - } - return m_gengrid; -} - -void RelatedWebPages::deleteAllItems() -{ - BROWSER_LOGD("Deleting all items from gengrid"); - elm_gengrid_clear(m_gengrid); -} - -void RelatedWebPages::_thumbSelected(void * data, Evas_Object * /*obj*/, void * /*event_info*/) -{ - BookmarkItemData * itemData = reinterpret_cast(data); - itemData->relatedWebPages->bookmarkClicked(itemData->item); -} - -void RelatedWebPages::focusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,in", "over2"); -} - -void RelatedWebPages::unFocusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,out", "over2"); -} - -} - -} diff --git a/services/SimpleUI/RelatedWebPages.h b/services/SimpleUI/RelatedWebPages.h deleted file mode 100644 index 0be0119..0000000 --- a/services/SimpleUI/RelatedWebPages.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#ifndef RELATEDWEBPAGES_H -#define RELATEDWEBPAGES_H - -#include -#include "BookmarkItem.h" - -#include - -namespace tizen_browser{ -namespace base_ui{ - -class RelatedWebPages -{ -public: - RelatedWebPages(); - void init(Evas_Object* p); - Evas_Object* getContent(); - void addRelatedPage(std::shared_ptr bi); - void deleteAllItems(); - - boost::signals2::signal)> bookmarkClicked; - -private: - Evas_Object *m_parent, *m_gengrid; - Elm_Gen_Item_Class *m_item_class; - bool m_gengridSetup; - - static Evas_Object* _grid_content_get(void *data, Evas_Object *obj, const char *part); - static void _thumbSelected(void * data, Evas_Object * obj, void * event_info); - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); -}; - -} - -} - -#endif // RELATEDWEBPAGES_H diff --git a/services/SimpleUI/Settings.cpp b/services/SimpleUI/Settings.cpp deleted file mode 100644 index db9c61b..0000000 --- a/services/SimpleUI/Settings.cpp +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include "Settings.h" -#include -#include -#include -#include -#include -#include "BrowserLogger.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -SettingsItem::SettingsItem() - : action(std::make_shared()) -{ - -} -SettingsItem::SettingsItem( std::shared_ptr action) - : action(action) -{ - -} - - -SettingsItem::SettingsItem(const SettingsItem& source) - : action(source.action) -{ - -} -SettingsItem::SettingsItem(const SettingsItem* source) - : action(source->action) -{ - -} - - -SettingsItem::~SettingsItem() -{ - //elm_genlist_item_class_free(m_itemClass);?? -} - -Settings::Settings(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton) - : MenuButton(mainWindow, parentButton) - , m_genlist(0) - , m_itemClass(0) - , m_internalPopup(0) - , m_internalPopupVisible(false) - , m_pointerModeEnabled(true) -{ - std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleUI/Settings.edj"); - elm_theme_extension_add(0, edjFilePath.c_str()); - - m_genlist = elm_genlist_add(m_window.get()); - - evas_object_smart_callback_add(m_genlist, "item,focused", focusItem, NULL); - evas_object_smart_callback_add(m_genlist, "item,unfocused", unFocusItem, NULL); - - elm_object_style_set(m_genlist, "settings"); - elm_genlist_homogeneous_set(m_genlist, EINA_TRUE); - elm_genlist_multi_select_set(m_genlist, EINA_FALSE); - - elm_genlist_select_mode_set(m_genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); - - m_itemClass = elm_genlist_item_class_new(); - m_itemClass->item_style = "settings_item"; - - m_itemClass->func.text_get = &gridTextGet; - m_itemClass->func.content_get = &gridOptionLabelGet; - m_itemClass->func.state_get = 0; - m_itemClass->func.del = 0; -} - -Settings::~Settings() -{ - -} - -Evas_Object* Settings::getContent() -{ - return m_genlist; -} - -tizen_browser::base_ui::MenuButton::ListSize Settings::calculateSize() -{ - ListSize result; - - result.width = 490; - result.height = 426; - - return result; -} - -Evas_Object* Settings::getFirstFocus() -{ - return m_genlist; -} - -void Settings::addAction(sharedAction action) -{ - std::shared_ptr settingsItem = std::make_shared(action); - BROWSER_LOGD("[%s] %x: %s", __func__ , settingsItem.get(), settingsItem->action->getText().c_str() ); - Elm_Object_Item* elmItem= elm_genlist_item_append(m_genlist, //genlist - m_itemClass, //item Class - settingsItem.get(), //item data - 0, //parent item - ELM_GENLIST_ITEM_NONE,//item type - itemClicked, - this - ); - m_settingsItemsMap[elmItem] = settingsItem; - BROWSER_LOGD("[%s:%d] \n\t %x:%s ", __PRETTY_FUNCTION__, __LINE__, elmItem, settingsItem->action->getText().c_str()); - if(!settingsItem->action->isEnabled()){ - elm_object_item_disabled_set(elmItem, EINA_TRUE); - } - if(settingsItem->action->isCheckable()){ - elm_object_item_signal_emit(elmItem, - (settingsItem->action->isChecked() ? "switch,on" : "switch,off") - , "SettingsModel"); - } else { - elm_object_item_signal_emit(elmItem, "switch,hide", "SettingsModel"); - } - action->enabledChanged.connect(boost::bind(&Settings::onEnabledChanged, this, action)); - m_actionButtonMap[action] = elmItem; -} - -void Settings::onEnabledChanged(sharedAction action) -{ - BROWSER_LOGD("[%s]", __func__); - refreshAction(action); -} - -void Settings::refreshAction(sharedAction action) -{ - BROWSER_LOGD("[%s]", __func__); - if(action->isEnabled()) - elm_object_item_disabled_set(m_actionButtonMap[action], EINA_FALSE); - else - elm_object_item_disabled_set(m_actionButtonMap[action], EINA_TRUE); -} - -char* Settings::gridTextGet(void* data, Evas_Object* /*obj*/, const char* part) -{ - BROWSER_LOGD("[%s]", __func__); - SettingsItem *settingsItem =reinterpret_cast(data); - if(!strcmp(part, "optionName")){ - if(!settingsItem->action->getText().empty()){ - return strdup(settingsItem->action->getText().c_str()); - } - } - return strdup(""); -} - -Evas_Object* Settings::gridOptionLabelGet(void* data, Evas_Object* obj, const char* part) -{ - SettingsItem *settingsItem =reinterpret_cast(data); - if(!strcmp(part, "optionValue")){ - if(settingsItem->action->isEnabled() && settingsItem->action->isCheckable()){ - Evas_Object *label = elm_label_add(obj); - elm_object_text_set(label, (settingsItem->action->isChecked() ? "On" :"Off" )); - elm_object_style_set(label, "settings_label"); - return label; - } - } - return NULL; - -} - -void Settings::itemClicked(void* data, Evas_Object* /*o*/, void* event_info) -{ - BROWSER_LOGD("[%s]", __func__); - - Settings* settings = reinterpret_cast(data); - Elm_Object_Item* elmItem = reinterpret_cast(event_info); - BROWSER_LOGD("[%s:%d] \n\t %x", __PRETTY_FUNCTION__, __LINE__, elmItem); - if(settings->m_settingsItemsMap.count(elmItem)){ - std::shared_ptr settingsItem(settings->m_settingsItemsMap[elmItem]);// elm_object_item_data_get(elmItem) - if(settingsItem->action->isEnabled()){ - if(settingsItem->action->isCheckable()) { - settings->showInternalPopup(elmItem); - } else{ - settingsItem->action->trigger(); - } - } - } -} - -void Settings::showInternalPopup(Elm_Object_Item* listItem) -{ - BROWSER_LOGD("[%s]", __func__); - m_internalPopupVisible = true; - m_trackedItem = listItem; - - if(!m_internalPopup){ - m_internalPopup = elm_ctxpopup_add(m_window.get()); - evas_object_smart_callback_add(m_internalPopup, "dismissed", Settings::dismissedCtxPopup, this); - } - Evas_Object * buttonBox = elm_box_add(m_internalPopup); - Evas_Object * radioOn = elm_radio_add(m_internalPopup); - Evas_Object * radioOff = elm_radio_add(m_internalPopup); - - - elm_object_text_set(radioOn, "On"); - elm_object_text_set(radioOff, "Off"); - - elm_object_style_set(radioOn, "settings_radio"); - elm_object_style_set(radioOff, "settings_radio"); - - elm_box_pack_end(buttonBox, radioOn); - elm_box_pack_end(buttonBox, radioOff); - - m_checkState = (m_settingsItemsMap[m_trackedItem]->action->isChecked() ? CheckStateOn : CheckStateOff ); - - elm_radio_state_value_set(radioOn, CheckStateOn);//true - elm_radio_value_pointer_set(radioOn, reinterpret_cast(&m_checkState)); - - elm_radio_state_value_set(radioOff, CheckStateOff);//false - elm_radio_value_pointer_set(radioOff, reinterpret_cast(&m_checkState)); - - elm_radio_group_add(radioOff, radioOn); - - evas_object_smart_callback_add(radioOn, "changed", radioChanged, this); - evas_object_smart_callback_add(radioOff, "changed", radioChanged, this); - - evas_object_size_hint_weight_set(buttonBox, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(buttonBox, EVAS_HINT_FILL, EVAS_HINT_FILL); - - evas_object_show(buttonBox); - evas_object_show(radioOn); - evas_object_show(radioOff); - - - elm_object_content_set(m_internalPopup, buttonBox); - elm_ctxpopup_direction_priority_set(m_internalPopup, - ELM_CTXPOPUP_DIRECTION_DOWN, - ELM_CTXPOPUP_DIRECTION_DOWN, - ELM_CTXPOPUP_DIRECTION_DOWN, - ELM_CTXPOPUP_DIRECTION_DOWN); - Evas_Coord w,h,x,y; - -#if PLATFORM(TIZEN) - evas_object_geometry_get(elm_object_item_track(m_trackedItem), &x, &y, &w, &h); - - BROWSER_LOGD("[%s:%d] \n\tx:%d; y:%d; w:%d; h:%d ", __PRETTY_FUNCTION__, __LINE__, - x, y, w, h); - evas_object_move(m_internalPopup, x + 354, y);//354 is proper value -#endif - - elm_object_style_set(m_internalPopup, "settings_button"); - evas_object_show(m_internalPopup); - if(!m_pointerModeEnabled) - elm_object_focus_set(radioOn, EINA_TRUE); - elm_object_item_signal_emit(m_trackedItem, "selected", "SettingsModel"); - elm_object_signal_emit(m_genlist, "show_popup", "SettingsModel"); -} - -void Settings::dismissedCtxPopup(void* data, Evas_Object* obj, void* /*event_info*/) -{ - BROWSER_LOGD("[%s]", __func__); - Settings* settings = static_cast(data); - evas_object_hide(obj); - settings->m_internalPopup = 0; - elm_object_signal_emit(settings->m_genlist, "hide_popup", "SettingsModel"); - elm_object_item_signal_emit(settings->m_trackedItem, "unselected", "SettingsModel"); - -#if PLATFORM(TIZEN) - elm_object_item_untrack(settings->m_trackedItem); -#endif - settings->m_internalPopupVisible = false; -} - -void Settings::radioChanged(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Settings *settings = static_cast(data); - std::shared_ptr settingsItem(settings->m_settingsItemsMap[settings->m_trackedItem]); - settingsItem->action->toggle(); - elm_object_item_signal_emit(settings->m_trackedItem, - (settingsItem->action->isChecked() ? "switch,on" : "switch,off") - , "SettingsModel"); - elm_genlist_item_update(settings->m_trackedItem); - elm_object_signal_emit(settings->m_internalPopup, "elm,state,hide", "elm"); -} - -void Settings::focusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,in", "option*"); -} - -void Settings::unFocusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,out", "option*"); -} - -void Settings::setPointerModeEnabled (bool enabled) -{ - m_pointerModeEnabled = enabled; -} - -bool Settings::canBeDismissed() -{ - BROWSER_LOGD("[%s]", __func__); - bool internalPopupVisible = m_internalPopup && m_internalPopupVisible; - if(internalPopupVisible) { - elm_ctxpopup_dismiss(m_internalPopup); - return false; - } - return true; -} - -}//namespace base_ui - -}//namespace tizen_browser diff --git a/services/SimpleUI/Settings.h b/services/SimpleUI/Settings.h deleted file mode 100644 index f8a086e..0000000 --- a/services/SimpleUI/Settings.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#ifndef SETTINGS_H -#define SETTINGS_H -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Action.h" -#include "MenuButton.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -struct SettingsItem{ - std::shared_ptr action; - SettingsItem(); - SettingsItem(std::shared_ptr action); - SettingsItem(const SettingsItem& source); - SettingsItem(const SettingsItem* source); - ~SettingsItem(); -}; - - -class Settings: public MenuButton -{ -public: - Settings(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton); - ~Settings(); - virtual Evas_Object *getContent(); - virtual ListSize calculateSize(); - virtual Evas_Object* getFirstFocus(); - void addAction(sharedAction action); - void onEnabledChanged(sharedAction action); - void refreshAction(sharedAction action); - void setPointerModeEnabled (bool enabled); - - virtual bool canBeDismissed(); -private: - static char *gridTextGet(void *data, Evas_Object* obj, const char *part); - static Evas_Object *gridOptionLabelGet(void* data, Evas_Object* /*obj*/, const char* part); - static void itemClicked(void *data, Evas_Object *o, void *event_info); - - void showInternalPopup(Elm_Object_Item* parent); - static void dismissedCtxPopup(void* data, Evas_Object* obj, void* event_info); - static void radioChanged(void *data, Evas_Object *obj, void *event_info); - -private: - Evas_Object *m_genlist; - Evas_Object *m_internalPopup; - Elm_Object_Item *m_trackedItem; - Elm_Genlist_Item_Class *m_itemClass; - bool m_internalPopupVisible; - bool m_pointerModeEnabled; - std::map> m_settingsItemsMap; - std::map m_actionButtonMap; - enum CheckState{ - CheckStateOn=1 - ,CheckStateOff=2 - }; - CheckState m_checkState; - - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); -}; - -}//namespace base_ui - -}//namespace tizen_browser - -#endif // SETTINGS_H diff --git a/services/SimpleUI/SimpleScroller.cpp b/services/SimpleUI/SimpleScroller.cpp deleted file mode 100644 index beff98c..0000000 --- a/services/SimpleUI/SimpleScroller.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include "SimpleScroller.h" -#include "BrowserLogger.h" - -namespace tizen_browser{ -namespace base_ui{ - -SimpleScroller::SimpleScroller(Evas_Object* parent, Evas_Object *content) -{ - m_scroller = elm_scroller_add(parent); - elm_scroller_propagate_events_set(m_scroller, EINA_TRUE); - evas_object_smart_callback_add(m_scroller, "edge,top", _scrollTopReached, m_scroller); - evas_object_smart_callback_add(m_scroller, "edge,bottom", _scrollBottomReached, m_scroller); - evas_object_smart_callback_add(m_scroller, "scroll,down", _scrollDown, m_scroller); - evas_object_smart_callback_add(m_scroller, "scroll,up", _scrollUp, m_scroller); - elm_object_focus_allow_set(m_scroller, EINA_FALSE); - elm_scroller_policy_set(m_scroller, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_AUTO); - elm_scroller_content_min_limit(m_scroller, EINA_FALSE, EINA_FALSE); - elm_object_content_set(m_scroller, content); - evas_object_show(m_scroller); -} - -Evas_Object* SimpleScroller::getEvasObjectPtr() -{ - return m_scroller; -} - -void SimpleScroller::_scrollTopReached(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("Top"); - elm_object_signal_emit(reinterpret_cast(data), "hide,top,shadow", ""); -} - -void SimpleScroller::_scrollBottomReached(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("Bottom"); - elm_object_signal_emit(reinterpret_cast(data), "hide,bottom,shadow", ""); -} - -void SimpleScroller::_scrollDown(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("Down"); - elm_object_signal_emit(reinterpret_cast(data), "show,top,shadow", ""); -} - -void SimpleScroller::_scrollUp(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("Up"); - elm_object_signal_emit(reinterpret_cast(data), "show,bottom,shadow", ""); -} - -} -} diff --git a/services/SimpleUI/SimpleScroller.h b/services/SimpleUI/SimpleScroller.h deleted file mode 100644 index 6a6c32d..0000000 --- a/services/SimpleUI/SimpleScroller.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#ifndef SIMPLESCROLLER_H -#define SIMPLESCROLLER_H - -#include "Elementary.h" - -namespace tizen_browser{ -namespace base_ui{ - -class SimpleScroller -{ -public: - SimpleScroller(Evas_Object* parent, Evas_Object *content); - //void setContent(Evas_Object *content); - Evas_Object* getEvasObjectPtr(); -private: - Evas_Object *m_scroller; - - static void _scrollTopReached(void *data, Evas_Object *obj, void *event_info); - static void _scrollBottomReached(void *data, Evas_Object *obj, void *event_info); - static void _scrollDown(void *data, Evas_Object *obj, void *event_info); - static void _scrollUp(void *data, Evas_Object *obj, void *event_info); -}; - -} -} - -#endif // SIMPLESCROLLER_H diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 6d39786..9ee8eae 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -46,7 +46,6 @@ #include "BookmarkItem.h" #include "boost/date_time/gregorian/gregorian.hpp" #include "boost/date_time/posix_time/posix_time.hpp" -#include "NetworkErrorHandler.h" #include "SqlStorage.h" #include "DetailPopup.h" @@ -64,14 +63,12 @@ SimpleUI::SimpleUI() , m_mainLayout(nullptr) , m_progressBar(nullptr) , m_popup(nullptr) - , m_settings() , m_moreMenuUI() , m_tabUI() , m_bookmarkManagerUI() , m_mainUI() , m_initialised(false) , m_isHomePageActive(false) - , m_currentZoom(ZOOM_TYPE_100) , items_vector() , m_networkErrorPopup(0) , m_wvIMEStatus(false) @@ -270,11 +267,6 @@ void SimpleUI::loadUIServices() std::dynamic_pointer_cast (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.mainui")); - - m_netErrorHandler = - std::unique_ptr - - (new tizen_browser::basic_ui::NetworkErrorHandler); } void SimpleUI::connectUISignals() @@ -377,8 +369,6 @@ void SimpleUI::connectModelSignals() void SimpleUI::loadThemes() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - elm_theme_extension_add(nullptr, edjePath("SimpleUI/ZoomItem.edj").c_str()); - elm_theme_extension_add(nullptr, edjePath("SimpleUI/TabItem.edj").c_str()); elm_theme_extension_add(nullptr, edjePath("SimpleUI/ErrorMessage.edj").c_str()); elm_theme_overlay_add(0, edjePath("SimpleUI/ScrollerDefault.edj").c_str()); @@ -841,72 +831,6 @@ void SimpleUI::webEngineURLChanged(const std::string url) bookmarkCheck(); } -void SimpleUI::showZoomMenu() -{ - if(!m_zoomList){ - BROWSER_LOGD("[%s:%d] - create ", __PRETTY_FUNCTION__, __LINE__); - m_zoomList = std::make_shared(m_window, - rightButtonBar->getButton("zoom_in_button")); - m_zoomList->addItem("300%", ZOOM_TYPE_300); - m_zoomList->addItem("200%", ZOOM_TYPE_200); - m_zoomList->addItem("150%", ZOOM_TYPE_150); - m_zoomList->addItem("100%", ZOOM_TYPE_100); - m_zoomList->addItem("75%", ZOOM_TYPE_75); - m_zoomList->addItem("50%", ZOOM_TYPE_50); - - m_zoomList->zoomChanged.connect(boost::bind(&SimpleUI::zoomLevelChanged, this, _1)); - } - - zoom_type currentZoomType; - - currentZoomType = static_cast (m_webEngine->getZoomFactor()); - - //Handling Initial case - if(m_webEngine->getZoomFactor() == 0){ - m_webEngine->setZoomFactor(100); - m_currentZoom = static_cast (100); - currentZoomType = ZOOM_TYPE_100; - } - //each tab may have another zoom, but there is only one instance of zoomlist - //so we should refresh value of zoom every time - m_zoomList->setZoom(currentZoomType); - BROWSER_LOGD("Current zoom factor from webkit %d%%", m_webEngine->getZoomFactor()); - - m_platformInputManager->returnPressed.disconnect_all_slots(); - m_platformInputManager->returnPressed.connect(boost::bind(&SimpleUI::onReturnPressed, this, m_zoomList.get())); - hidePopup.connect(boost::bind(&SimpleUI::onReturnPressed, this, m_zoomList.get())); - m_zoomList->showPopup(); -} - -void SimpleUI::zoomLevelChanged(int zoom_level) -{ - m_webEngine->setZoomFactor(zoom_level); - m_currentZoom = static_cast (zoom_level); -} - -void SimpleUI::AddBookmarkPopup(std::string& str) -{ - BROWSER_LOGD("[%s]", __func__); - if(!m_bookmarks_manager){ - m_bookmarks_manager = std::make_shared(m_window, - rightButtonBar->getButton("bookmark_button")); - m_bookmarks_manager->addAction( m_bookmarks_manager_Add_NewFolder); - m_bookmarks_manager->addAction( m_bookmarks_manager_BookmarkBar); - m_bookmarks_manager->addAction( m_bookmarks_manager_Folder1); - m_bookmarks_manager->addAction( m_bookmarks_manager_Folder2); - m_bookmarks_manager->addAction( m_bookmarks_manager_Folder3); - } - m_platformInputManager->returnPressed.disconnect_all_slots(); - m_platformInputManager->returnPressed.connect(boost::bind(&SimpleUI::onReturnPressed, this, m_bookmarks_manager.get())); - hidePopup.connect(boost::bind(&SimpleUI::onReturnPressed, this, m_bookmarks_manager.get())); - m_bookmarks_manager->showPopup(); -} - -void SimpleUI::AddNewFolderPopup(std::string& str) -{ - BROWSER_LOGD("[%s]", __func__); -} - void SimpleUI::showTabUI() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index ce52557..9a8b7db 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -43,8 +43,6 @@ #include "HistoryService.h" #include "BookmarkManagerUI.h" #include "SimpleURI.h" -#include "SimpleScroller.h" -#include "WebTitleBar.h" #include "PlatformInputManager.h" #include "SessionStorage.h" #include "SqlStorage.h" @@ -53,13 +51,7 @@ #include "Action.h" #include "SimplePopup.h" #include "WebConfirmation.h" -#include "ZoomList.h" -#include "TabList.h" #include "BookmarksManager.h" -#include "Settings.h" -#include "HistoryList.h" -#include "NetworkErrorHandler.h" -#include "CustomPopup.h" #include "Config.h" namespace tizen_browser{ @@ -223,17 +215,8 @@ private: */ void deleteBookmark(void); - /** - * \brief shows Zoom showZoomMenu - */ - void showZoomMenu(); - - void zoomLevelChanged(int zoom_level); - void showHistory(); void hideHistory(); - void AddBookmarkPopup(std::string& str); - void AddNewFolderPopup(std::string& str); void addBookmarkFolders(); void newFolderBookmarkManager(const char* title, int by_user); @@ -300,14 +283,10 @@ private: Evas_Object *m_popup; Evas_Object *m_entry; Evas_Object *m_errorLayout; - CustomPopup *m_ownPopup; - SimpleScroller *m_scroller; std::shared_ptr> m_webEngine; std::shared_ptr m_simpleURI; std::shared_ptr leftButtonBar; - std::shared_ptr webviewbar; - std::shared_ptr rightButtonBar; std::shared_ptr m_favoriteService; std::shared_ptr m_historyService; @@ -317,18 +296,12 @@ private: std::shared_ptr m_historyUI; std::shared_ptr m_settingsUI; std::shared_ptr m_tabUI; - std::shared_ptr m_zoomList; - std::shared_ptr m_tabList; std::shared_ptr m_platformInputManager; std::shared_ptr m_sessionService; tizen_browser::Session::Session m_currentSession; std::shared_ptr m_bookmarks_manager; - std::shared_ptr m_settings; - std::shared_ptr m_historyList; - std::shared_ptr webTitleBar; bool m_initialised; bool m_isHomePageActive; - zoom_type m_currentZoom; int m_tabLimit; int m_favoritesLimit; bool m_wvIMEStatus; @@ -339,7 +312,6 @@ private: Ewk_Context *m_ewkContext; std::vector> items_vector; - std::unique_ptr m_netErrorHandler; SimplePopup* m_networkErrorPopup; void searchWebPage(std::string &text, int flags); diff --git a/services/SimpleUI/TabList.cpp b/services/SimpleUI/TabList.cpp deleted file mode 100644 index 5ea4930..0000000 --- a/services/SimpleUI/TabList.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include "TabList.h" -#include "BrowserAssert.h" -#include "BrowserLogger.h" -#include "EflTools.h" -#include -#include - -namespace tizen_browser -{ -namespace base_ui -{ - -const int TabList::ScrollBorderValue = 8; - -TabList::TabList(std::shared_ptr< Evas_Object > parent, Evas_Object* parentButton) - : MenuButton(parent, parentButton) - , m_list(NULL) - , m_box(NULL) - , m_deleteSelected(false) -{ - m_box = elm_box_add(m_window.get()); - evas_object_size_hint_align_set(m_box, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(m_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(m_box); - - m_newTabBtn = elm_button_add(m_box); - elm_object_style_set(m_newTabBtn, "new_tab_elem"); - evas_object_smart_callback_add(m_newTabBtn, "clicked", TabList::_newTab_clicked_cb, (void*)this); - //evas_object_smart_callback_add(m_newTabBtn, "focused", TabList::newButtonFocused, this); - //evas_object_smart_callback_add(m_newTabBtn, "unfocused", TabList::newButtonUnFocused, this); - evas_object_show(m_newTabBtn); - - m_list = elm_list_add(m_box); - evas_object_size_hint_align_set(m_list, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(m_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_list_mode_set(m_list, ELM_LIST_SCROLL); - elm_list_multi_select_set(m_list, EINA_FALSE); - elm_list_select_mode_set(m_list, ELM_OBJECT_SELECT_MODE_ALWAYS); - - evas_object_smart_callback_add(m_list, "item,focused", TabList::focusItem, this); - evas_object_smart_callback_add(m_list, "item,unfocused", TabList::unFocusItem, this); - - elm_object_focus_next_object_set(m_newTabBtn, m_list, ELM_FOCUS_DOWN); - - elm_object_style_set(m_list, "tab_list"); - - elm_box_pack_end(m_box, m_newTabBtn); - elm_box_pack_end(m_box, m_list); - - elm_list_go(m_list); - - //elm_object_focus_next_object_set(m_newTabBtn, m_list, ELM_FOCUS_DOWN); - - evas_object_show(m_list); -} - -void TabList::addItem(std::shared_ptr tab) -{ - tab_data *data = new tab_data(); - data->id = tab->getId(); - data->tab_list = this; - - Evas_Object *end = elm_button_add(m_list); - Evas_Object *icon = elm_button_add(m_list); - - - elm_object_focus_allow_set(end, EINA_TRUE); - elm_object_focus_allow_set(icon, EINA_TRUE); - - elm_object_style_set(end, "invisible_button"); - elm_object_style_set(icon, "invisible_button"); - - Evas_Object * thumbnail = tizen_browser::tools::EflTools::getEvasImage(tab->getThumbnail(), icon); - if (thumbnail) - elm_object_part_content_set(icon, "e.swallow.icon", thumbnail); - else - BROWSER_LOGD("[%s] Empty thumbnail added to tabs vector", __func__); - - evas_object_smart_callback_add(icon, "clicked", TabList::_item_clicked_cb, (void *)data); - evas_object_smart_callback_add(end, "clicked", TabList::_deleteTab_clicked_cb, (void *)data); - Elm_Object_Item *item = elm_list_item_append(m_list, tab->getTitle().c_str(), icon, end, NULL, data); - - elm_object_focus_next_object_set(elm_list_item_object_get(item), - elm_object_item_part_content_get(item, "elm.swallow.end"), ELM_FOCUS_RIGHT); - - m_items[tab->getId()] = item; - - elm_list_go(m_list); -} - -void TabList::addItems(std::vector> items) -{ - clearItems(); - for (std::vector >::iterator it = items.begin(); it != items.end(); ++it) { - addItem(*it); - } -} - -void TabList::clearItems() -{ - m_items.clear(); - - /* - * Calling elm_list_clear in this case makes that list cannot receive focus anymore. - * So deleting item by item is necessary. - */ - Elm_Object_Item *item; - while((item = elm_list_first_item_get(m_list))) - elm_object_item_del(item); -} - -void TabList::replaceItems(std::vector< std::shared_ptr< basic_webengine::TabContent > > items) -{ - clearItems(); - addItems(items); -} - -int TabList::getItemcCount() -{ - return m_items.size(); -} - -Evas_Object* TabList::getContent() -{ - return m_box; -} - -MenuButton::ListSize TabList::calculateSize() -{ - elm_object_focus_allow_set(m_list, m_items.size() ? EINA_TRUE : EINA_FALSE); - - ListSize result; - - result.width = 390; - - result.height = 89 * (getItemcCount()+1) + 8; - - int x, y, w, h; - Evas_Object *focusDown = elm_object_focus_next_object_get(m_newTabBtn, ELM_FOCUS_DOWN); - evas_object_geometry_get(focusDown, &x, &y, &w, &h); - BROWSER_LOGD("%d %d %d %d\n", x, y, w, h); - - const int listMaxHeight = atoi(edje_file_data_get((std::string(EDJE_DIR) + "SimpleUI/TabItem.edj").c_str(),"list_max_height")); - if (result.height > listMaxHeight) - result.height = listMaxHeight; - - return result; -} - -void TabList::_item_clicked_cb(void* data, Evas_Object */*obj*/, void */*event_info*/) -{ - tab_data *tab = static_cast(data); - tab->tab_list->tabClicked(tab->id); - tab->tab_list->hidePopup(); -} - -void TabList::_newTab_clicked_cb(void* data, Evas_Object */*obj*/, void */*event_info*/) -{ - TabList *self = reinterpret_cast(data); - self->newTabClicked(); - self->hidePopup(); -} - -void TabList::_deleteTab_clicked_cb(void* data, Evas_Object */*obj*/, void */*event_info*/) -{ - tab_data *tab = static_cast(data); - tab->tab_list->tabDelete(tab->id); - tab->tab_list->hidePopup(); -} - -void TabList::setCurrentTabId(tizen_browser::basic_webengine::TabId currentTabId) -{ - m_currentTabId = currentTabId; -} - -void TabList::disableNewTabBtn(bool disabled) -{ - elm_object_disabled_set(m_newTabBtn, disabled); -} - -void TabList::onPopupShow() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - - if(m_items.find(m_currentTabId) != m_items.end()) - elm_object_item_signal_emit(m_items[m_currentTabId], "highlight,selected", ""); -} - -Evas_Object* TabList::getFirstFocus() -{ - BROWSER_LOGD("[%s:%d] m_newTabBtn: %x ", __PRETTY_FUNCTION__, __LINE__, m_newTabBtn); - return m_newTabBtn; -} - -void TabList::focusItem(void* data, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - TabList *self = reinterpret_cast(data); - Elm_Object_Item *item = reinterpret_cast(event_info); - BROWSER_LOGD("[%s:%d] Item: %s ", __PRETTY_FUNCTION__, __LINE__, elm_object_item_part_text_get(item,"elm.text")); - //elm_object_signal_emit(elm_object_item_ item, "mouse,in", "elm.swallow.icon"); - elm_object_item_signal_emit( item, "mouse,in", "elm.swallow.icon"); - //elm.swallow.end - //Evas_Object* delIcon = elm_object_part_content_get(item, "elm.swallow.end"); - self->m_lastFocusedItem = item; -} - -void TabList::unFocusItem(void* data, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - TabList *self = reinterpret_cast(data); - Elm_Object_Item *item = reinterpret_cast(event_info); - BROWSER_LOGD("[%s:%d] Item: %s ", __PRETTY_FUNCTION__, __LINE__, elm_object_item_part_text_get(item,"elm.text")); - //elm_object_signal_emit(elm_object_item_ item, "mouse,in", "elm.swallow.icon"); - elm_object_item_signal_emit(item, "mouse,out", "elm.swallow.end"); - elm_object_item_signal_emit(item, "mouse,out", "elm.swallow.icon"); - - self->m_deleteSelected = false; -} - -void TabList::newButtonFocused(void* /*data*/, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); -} - -void TabList::newButtonUnFocused(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - TabList *self = reinterpret_cast(data); - //EFL BUG workaround: it looks like button do not get "unfocus" signal each time. - elm_object_signal_emit(self->m_newTabBtn, "elm,action,unfocus","elm"); -} - -void TabList::rightPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,out", "elm.swallow.icon"); - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,in", "elm.swallow.end"); - m_deleteSelected = true; - } -} - -void TabList::leftPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,out", "elm.swallow.end"); - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,in", "elm.swallow.icon"); - m_deleteSelected = false; - } -} - -void TabList::enterPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - - tab_data *td = static_cast(elm_object_item_data_get(m_lastFocusedItem)); - M_ASSERT(td); - - if(m_deleteSelected) { - tabDelete(td->id); - } - else { - tabClicked(td->id); - } - hidePopup(); - } -} - -} - -} diff --git a/services/SimpleUI/TabList.h b/services/SimpleUI/TabList.h deleted file mode 100644 index 81c0fca..0000000 --- a/services/SimpleUI/TabList.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#ifndef TABLIST_H -#define TABLIST_H - -#include -#include - -#include "TabId.h" -#include "SimpleScroller.h" - -#include "MenuButton.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -class TabList:public MenuButton{ - -public: - TabList(std::shared_ptr parent, Evas_Object* parentButton); - void addItem(std::shared_ptr); - void addItems(std::vector>); - void clearItems(); - void replaceItems(std::vector< std::shared_ptr< tizen_browser::basic_webengine::TabContent > > items); - virtual Evas_Object *getContent(); - virtual ListSize calculateSize(); - virtual Evas_Object* getFirstFocus(); - boost::signals2::signal newTabClicked; - boost::signals2::signal tabClicked; - boost::signals2::signal tabDelete; - int getItemcCount(); - void setCurrentTabId(tizen_browser::basic_webengine::TabId currentTabId); - void disableNewTabBtn(bool disabled); - void onPopupShow(); - - void rightPressed(); - void leftPressed(); - void enterPressed(); -private: - std::map m_items; - tizen_browser::basic_webengine::TabId m_currentTabId; - Evas_Object *m_list, *m_box, *m_newTabBtn; - static void _item_clicked_cb(void* data, Evas_Object *obj, void *event_info); - static void _newTab_clicked_cb(void* data, Evas_Object *obj, void *event_info); - static void _deleteTab_clicked_cb(void* data, Evas_Object *obj, void *event_info); - static void focusItem(void* data, Evas_Object* obj, void *event_info); - static void unFocusItem(void* data, Evas_Object* obj, void *event_info); - static void newButtonFocused(void* data, Evas_Object* obj, void *event_info); - static void newButtonUnFocused(void* data, Evas_Object* obj, void *event_info); - struct tab_data{ - tizen_browser::basic_webengine::TabId id; - TabList *tab_list; - }; - - Elm_Object_Item *m_lastFocusedItem; - bool m_deleteSelected; - - /** - * Above this size tablist is scrolled. - */ - static const int ScrollBorderValue; -}; - -} - -} - -#endif //TABLIST_H diff --git a/services/SimpleUI/WebTitleBar.cpp b/services/SimpleUI/WebTitleBar.cpp deleted file mode 100644 index c610d9e..0000000 --- a/services/SimpleUI/WebTitleBar.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include -#include "BrowserLogger.h" -#include "EflTools.h" - -#include "WebTitleBar.h" - -// show bar by this time (seconds) - due to IA Guidline -#define DELAY_TIME 4.0 - -namespace tizen_browser -{ -namespace base_ui -{ - -WebTitleBar::WebTitleBar(Evas_Object *parent, const std::string &edjFile, const std::string &groupName) : - m_timer(NULL) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - std::string edjFilePath = EDJE_DIR; - edjFilePath.append(edjFile); - elm_theme_extension_add(NULL, edjFilePath.c_str()); - m_layout = elm_layout_add(parent); - Eina_Bool layoutSetResult = elm_layout_file_set(m_layout, edjFilePath.c_str(), groupName.c_str()); - if(!layoutSetResult) - BROWSER_LOGE("[%s:%d]: Layout file not found: ", __func__, __LINE__, edjFilePath.c_str()); - evas_object_size_hint_weight_set(m_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); -} - -WebTitleBar::~WebTitleBar() -{ - if(m_timer) - ecore_timer_del(m_timer); -} - -void WebTitleBar::setFavIcon(std::shared_ptr favicon) -{ - BROWSER_LOGD("[%s:%d] faviconType:%d ", __PRETTY_FUNCTION__, __LINE__, favicon->imageType); - if(favicon->imageType != tools::BrowserImage::ImageTypeNoImage){ - m_icon = tizen_browser::tools::EflTools::getEvasImage(favicon, m_layout); - if(m_icon){ - evas_object_image_fill_set(m_icon, 0, 0, 37, 37); - evas_object_resize(m_icon, 37, 37); - elm_object_part_content_set(m_layout, "favicon", m_icon); - evas_object_show(m_icon); - } else { - removeFavIcon(); - } - } else { - removeFavIcon(); - } -} - -void WebTitleBar::removeFavIcon() -{ - Evas_Object * favicon = elm_object_part_content_unset(m_layout, "favicon"); - evas_object_hide(favicon); - if (favicon) { - evas_object_del(favicon); - } -} - - -void WebTitleBar::show(const std::string & title) -{ - setTitle(title); - - if(m_timer) - ecore_timer_del(m_timer); - - m_timer = ecore_timer_add(0.7, show_cb, this); -} - -Eina_Bool WebTitleBar::show_cb(void * data) -{ - WebTitleBar * self = static_cast (data); - if(self->m_timer) - ecore_timer_del(self->m_timer); - self->m_timer = ecore_timer_add(DELAY_TIME, hide_cb, self); - elm_object_signal_emit(self->m_layout, "show_webtitle_bar", "web"); - return ECORE_CALLBACK_CANCEL; -} - -void WebTitleBar::setTitle(const std::string & title) -{ - BROWSER_LOGD("Changing title on WebTitle bar to: %s", title.c_str()); - elm_object_part_text_set(m_layout, "text", title.c_str()); -} - -void WebTitleBar::hide() -{ - hide_cb(this); -} - -Eina_Bool WebTitleBar::hide_cb(void * data) -{ - WebTitleBar * self = static_cast (data); - elm_object_signal_emit(self->m_layout, "hide_webtitle_bar", "web"); - if(self->m_timer) - ecore_timer_del(self->m_timer); - self->m_timer = NULL; - return ECORE_CALLBACK_CANCEL; -} - -} /* end of base_ui */ -} /* end of tizen_browser */ diff --git a/services/SimpleUI/WebTitleBar.h b/services/SimpleUI/WebTitleBar.h deleted file mode 100644 index 8d7ca2e..0000000 --- a/services/SimpleUI/WebTitleBar.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#ifndef WEBTITLEBAR_H -#define WEBTITLEBAR_H - -#include - -namespace tizen_browser -{ -namespace base_ui -{ - -class WebTitleBar -{ -public: - WebTitleBar(Evas_Object * parent, const std::string &edjFile, const std::string &groupName); - ~WebTitleBar(); - - /** - * @brief Return layout of the Web Title bar - */ - Evas_Object * getContent() { return m_layout; }; - - /** - * @brief Show Web Title bar - * - * @param url title of webpage - */ - void show(const std::string & title); - - /** - * @brief Set favicon on Web tittle bar - * - * @param favicon Favicon image - */ - void setFavIcon(std::shared_ptr favicon); - - /** - * @brief remove favicon properly, and update view - * - */ - void removeFavIcon(); - - /** - * @brief Hide Web tittle bar - */ - void hide(); - -private: - void setTitle(const std::string & title); - static Eina_Bool show_cb(void * data); - static Eina_Bool hide_cb(void * data); - Evas_Object * m_layout; - Evas_Object * m_icon; - Ecore_Timer * m_timer; - -}; - -} /* end of base_ui */ -} /* end of tizen_browser */ - -#endif // WEBTITLEBAR_H diff --git a/services/SimpleUI/ZoomList.cpp b/services/SimpleUI/ZoomList.cpp deleted file mode 100644 index 03d1600..0000000 --- a/services/SimpleUI/ZoomList.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include "ZoomList.h" -#include "BrowserAssert.h" -#include "BrowserLogger.h" -#include -#include - -namespace tizen_browser -{ -namespace base_ui -{ - - -ZoomList::ZoomList(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton) - : MenuButton(mainWindow, parentButton) - , m_trackFirst(0) - , m_items(0) -{ - BROWSER_LOGD("[%s:%d] this: %x", __PRETTY_FUNCTION__, __LINE__, this); - m_list = elm_list_add(m_window.get()); - - evas_object_smart_callback_add(m_list, "item,focused", focusItem, this); - evas_object_smart_callback_add(m_list, "item,unfocused", unFocusItem, this); - evas_object_smart_callback_add(m_list, "activated", _item_clicked_cb, this); - - elm_object_style_set(m_list, "zoom_list"); - elm_list_mode_set(m_list, ELM_LIST_EXPAND); - evas_object_size_hint_align_set(m_list, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(m_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_list_go(m_list); - evas_object_show(m_list); -} - -ZoomList::~ZoomList() -{ -} - - -void ZoomList::addItem(const char* text, zoom_type value) -{ - zoom_data *data = new zoom_data(); - data->value = value; - data->zoom_list = this; - - elm_list_item_append(m_list, text, NULL, NULL, ZoomList::_item_clicked_cb, (void *)data); - elm_list_go(m_list); - - m_items++; -} - -void ZoomList::setZoom(zoom_type value) -{ - Elm_Object_Item * item = elm_list_first_item_get(m_list); - while (item != NULL) - { - zoom_type *elem_zoom = (zoom_type*)elm_object_item_data_get(item); - edje_object_signal_emit(elm_list_item_object_get(item), "unchecked", ""); - if (*elem_zoom == value) - { - edje_object_signal_emit(elm_list_item_object_get(item), "default_checked", ""); - current_zoom = value; - } - item = elm_list_item_next(item); - } -} - -Evas_Object* ZoomList::getContent() -{ - evas_object_resize(m_list, 390, 0); - return m_list; -} - -MenuButton::ListSize ZoomList::calculateSize() -{ - ListSize result; - - result.width = 390; - result.height = 590; - - return result; -} - -void ZoomList::_item_clicked_cb(void* /*data*/, Evas_Object */*obj*/, void *event_info) -{ - Elm_Object_Item *item = static_cast(event_info); - zoom_data *zoom = static_cast(elm_object_item_data_get(item)); - M_ASSERT(zoom); - if (zoom->value != zoom->zoom_list->current_zoom) - { - zoom->zoom_list->zoomChanged(zoom->value); - edje_object_signal_emit(elm_list_item_object_get(item), "checked", ""); - item = elm_list_first_item_get(zoom->zoom_list->m_list); - while (item != NULL) - { - zoom_type *elem_zoom = (zoom_type*)elm_object_item_data_get(item); - if (*elem_zoom == zoom->zoom_list->current_zoom) - { - edje_object_signal_emit(elm_list_item_object_get(item), "unchecked", ""); - zoom->zoom_list->current_zoom = zoom->value; - break; - } - item = elm_list_item_next(item); - } - } - zoom->zoom_list->hidePopup(); -} - -Evas_Object* ZoomList::getFirstFocus() -{ - return m_list; -} - -void ZoomList::focusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,in", "over2"); -} - -void ZoomList::unFocusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,out", "over2"); -} - -} - -} diff --git a/services/SimpleUI/ZoomList.h b/services/SimpleUI/ZoomList.h deleted file mode 100644 index 5210ce3..0000000 --- a/services/SimpleUI/ZoomList.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#ifndef ZOOMLIST_H -#define ZOOMLIST_H - -#include -#include -#include -#include "MenuButton.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -typedef enum { - ZOOM_TYPE_50 = 50, - ZOOM_TYPE_75 = 75, - ZOOM_TYPE_100 = 100, - ZOOM_TYPE_150 = 150, - ZOOM_TYPE_200 = 200, - ZOOM_TYPE_300 = 300, -} zoom_type; - - -class ZoomList:public MenuButton{ - -public: - ZoomList(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton); - ~ZoomList(); - void addItem(const char* text, zoom_type value); - void setZoom(zoom_type value); - virtual Evas_Object *getContent(); - virtual ListSize calculateSize(); - boost::signals2::signal zoomChanged; - - virtual Evas_Object* getFirstFocus(); - -private: - Evas_Object *m_list; - Evas_Object *m_trackFirst; - zoom_type current_zoom; - int m_items; - static void _item_clicked_cb(void* data, Evas_Object *obj, void *event_info); - struct zoom_data{ - zoom_type value; - ZoomList *zoom_list; - }; - - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); -}; - -} - -} - -#endif //ZOOMLIST_H diff --git a/services/SimpleUI/edc/EntryPopup.edc b/services/SimpleUI/edc/EntryPopup.edc deleted file mode 100644 index 95ea129..0000000 --- a/services/SimpleUI/edc/EntryPopup.edc +++ /dev/null @@ -1,51 +0,0 @@ -collections { - group { - name: "entry_popup"; - parts { - part { - name: "label"; - type : TEXT; - scale:1; - description { - state: "default" 0.0; - visible: 1; - //align: 0.0 0.0; - rel1 { relative: 0.0 0.0;} - rel2 { relative: 1.0 1.0;} - min: 200 60; - max: 200 60; - text { - text: "Label"; - min: 0 1; - max: 1 1; - size: 20; - } - } - } - part { - name: "entry"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - min: 200 60; - max: 200 60; - rel1 { relative: 0.0 1.0; to: "label"; } - rel2 { relative: 1.0 1.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - } -} \ No newline at end of file diff --git a/services/SimpleUI/edc/HistoryItem.edc b/services/SimpleUI/edc/HistoryItem.edc deleted file mode 100644 index d95f69c..0000000 --- a/services/SimpleUI/edc/HistoryItem.edc +++ /dev/null @@ -1,660 +0,0 @@ -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 128; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } -#define SPACER_ITEM_BR(spacer_name, W, H, elem) \ - part { name: spacer_name; \ - type: RECT; \ - scale:1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - align: 0 1; \ - min: W H; \ - max: W H; \ - fixed: 1 1; \ - color: 255 255 255 10; \ - rel1 { relative: 0.0 1.0; to: elem;} \ - rel2 { relative: 1.0 1.0; to: elem;} \ - } \ - } -#define WIDTH 436 -#define HEIGHT 136 -#define ITEM_WIDTH 374 -#define PARENT_ITEM_HEIGHT 36 -data { item: "item_width" ITEM_WIDTH; item: "item_height" HEIGHT; item: "parent_item_height" PARENT_ITEM_HEIGHT;} -collections { - group{ - name: "history"; - min: WIDTH 0; - max: WIDTH 868; - parts{ - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "background"; - type: RECT; - description{ - state: "default" 0.0; - color: 0 0 0 0; - rel1{ - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - mouse_events: 1; - description{ - state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; - rel1{ - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "elm.swallow.empty"; - type: SWALLOW; - description{ - state: "default" 0.0; - fixed: 1 1; - rel1{ - relative: 0 0; - } - rel2{ - relative: 0 0; - } - } - } - }//parts - }//group - group { - name: "elm/genlist/item/history_item/default"; - alias: "elm/genlist/item_odd/history_item/default"; - alias: "elm/genlist/item_compress/history_item/default"; - alias: "elm/genlist/item_compress_odd/history_item/default"; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - images { - image: "ico_delete.png" COMP; - image: "thumbnail.png" COMP; - } - data.item: "texts" "page_title page_url page_time"; - data.item: "contents" "favicon content_click del_click"; - color_classes{ - color_class{ - name: "defaultBgColor"; - color: 18 22 34 255; - } - color_class{ - name: "focusBgColor"; - color: 69 143 255 255; - } - color_class{ - name: "highlightBgColor"; - color: 69 143 255 102; - } - color_class{ - name: "imageHighlight"; - color: 255 255 255 102; - } - color_class{ - name: "focusDelBgColor"; - color: 96 114 146 255; - } - color_class{ - name: "defaultTextColor"; - color: 211 211 211 255; - } - color_class{ - name: "focusTextColor"; - color: 255 255 255 255; - } - color_class{ - name: "highlightTextColor"; - color: 255 255 255 51; - } - color_class{ - name: "dateTextColor"; - color: 211 211 211 204; - } - color_class{ - name: "transparent"; - color: 0 0 0 0; - } - } - parts { - part { - name: "bg_clipper"; - scale:1; - mouse_events: 1; - type: SWALLOW; - description { - state: "default" 0.0; - color: 0 0 0 0; - align: 0 0; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - } - } - part { - name: "item_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: ITEM_WIDTH HEIGHT; - max: ITEM_WIDTH HEIGHT; - align: 0 1; - rel1 { relative: 0.0 0.0;to: "bg_clipper";} - rel2 { relative: 1.0 1.0;to: "bg_clipper";} - color_class: defaultBgColor; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusBgColor; - } - } - SPACER_ITEM_BR("horizontal_line", ITEM_WIDTH, 2, "bg_clipper") - part { - name: "favicon_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 0; - min: 37 37; - max: 37 37; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "item_bg"; offset: 25 25;} - rel2 { relative: 1.0 1.0; to: "item_bg";} - color_class: transparent; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: imageHighlight; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - } - part { - name: "favicon"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 37 37; - max: 37 37; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "favicon_bg";} - rel2 { relative: 1.0 1.0; to: "favicon_bg";} - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: imageHighlight; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - } - part { - name: "page_title"; - scale: 1; - type: TEXT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 275 40; - max: 275 40; - align: 0 0; - rel1 { relative: 0.0 0.0; to: item_bg; offset:74 20;} - rel2 { relative: 1.0 1.0; to: item_bg;} - color_class: defaultTextColor; - text { - text: "Web page title"; - font: "font_name"; - size: 30; - align: 0 1; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: highlightTextColor; - } - } - part { - name: "page_url"; - scale: 1; - type: TEXT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 275 22; - max: 275 22; - align: 1 0; - rel1 { relative: 0.0 1.0; to: "page_title";} - rel2 { relative: 1.0 1.0; to: "page_title";} - color_class: defaultTextColor; - text { - text: "http:/onet.pl"; - font: "font_name"; - size: 22; - align: 0 0.5; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: highlightTextColor; - } - } - part { - name: "page_time"; - scale: 1; - type: TEXT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 275 22; - max: 275 22; - align: 1 0; - rel1 { relative: 0.0 1.0; to: "page_url";} - rel2 { relative: 1.0 1.0; to: "page_url";} - color_class: defaultTextColor; - text { - text: "10:25 AM"; - font: "font_name"; - size: 22; - align: 0 0.5; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: highlightTextColor; - } - } - part { - name: "del_bg"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0 0; - min: 54 HEIGHT; - max: 54 HEIGHT; - rel1 { relative: 1.0 0.0; to: "item_bg";} - rel2 { relative: 1.0 1.0;to: "bg_clipper";} - color_class: transparent; - } - description { - state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: focusBgColor; - visible: 1; - } - description { - state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusDelBgColor; - visible: 1; - } - } - part { - name: "del_icon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 0.5; - min: 40 40; - max: 40 40; - rel1 { relative: 0.0 0.0; to: "del_bg";} - rel2 { relative: 1.0 1.0; to: "del_bg";} - image.normal: "ico_delete.png"; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "focus" 0.0; - inherit: "highlight" 0.0; - } - } - part { - name: "over"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: ITEM_WIDTH HEIGHT; - max: ITEM_WIDTH HEIGHT; - rel1 { relative: 0.0 0.0; to: "item_bg";} - rel2 { relative: 1.0 1.0; to: "item_bg";} - color_class: transparent; - } - description { - state: "highlight" 0.0; - inherit: "default" 0 0; - color_class: highlightBgColor; - visible: 1; - } - } - part { - name: "content_click"; - scale:1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: ITEM_WIDTH HEIGHT; - max: ITEM_WIDTH HEIGHT; - rel1 { relative: 0.0 0.0; to: "over";} - rel2 { relative: 1.0 1.0; to: "over";} - color_class: transparent; - } - } - part { - name: "del_over"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: 54 HEIGHT; - max: 54 HEIGHT; - rel1 { relative: 0.0 0.0; to: "del_bg";} - rel2 { relative: 1.0 1.0; to: "del_bg";} - color_class: transparent; - } - } - part { - name: "del_click"; - scale:1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: 54 HEIGHT; - max: 54 HEIGHT; - rel1 { relative: 0.0 0.0; to: "del_over";} - rel2 { relative: 1.0 1.0; to: "del_over";} - color_class: transparent; - } - } - } - programs{ - program { - name: "mouse_in_content_click"; - signal: "mouse,in"; - source: "content_click"; - script { - emit("mouse_in_content_click", ""); - } - } - program { - name: "mouse_out_content_click"; - signal: "mouse,out"; - source: "content_click"; - script { - emit("mouse_out_content_click", ""); - } - } - program { - name: "mouse_in_content"; - signal: "mouse_in_content_click"; - source: ""; - action: STATE_SET "focus" 0.0; - target: "item_bg"; - target: "favicon"; - target: "page_title"; - target: "page_url"; - target: "page_time"; - target: "del_bg"; - target: "del_icon"; - } - program { - name: "mouse_out_content"; - signal: "mouse_out_content_click"; - source: ""; - action: STATE_SET "default" 0.0; - target: "item_bg"; - target: "favicon"; - target: "page_title"; - target: "page_url"; - target: "page_time"; - target: "del_bg"; - target: "del_icon"; - } - program { - name: "mouse_in_del_click"; - signal: "mouse,in"; - source: "del_click"; - script { - emit("mouse_in_del_click", ""); - } - } - program { - name: "mouse_out_del_click"; - signal: "mouse,out"; - source: "del_click"; - script { - emit("mouse_out_del_click", ""); - } - } - program { - name: "mouse_in_del"; - signal: "mouse_in_del_click"; - source: ""; - action: STATE_SET "highlight" 0.0; - target: "item_bg"; - target: "favicon"; - target: "page_title"; - target: "page_url"; - target: "page_time"; - target: "del_bg"; - target: "del_icon"; - target: "over"; - } - program { - name: "mouse_out_del"; - signal: "mouse_out_del_click"; - source: ""; - action: STATE_SET "default" 0.0; - target: "item_bg"; - target: "favicon"; - target: "page_title"; - target: "page_url"; - target: "page_time"; - target: "del_bg"; - target: "del_icon"; - target: "over"; - } - } - } - - - group { - name: "elm/genlist/item/history_item_no_favicon/default"; - alias: "elm/genlist/item_odd/history_item_no_favicon/default"; - alias: "elm/genlist/item_compress/history_item_no_favicon/default"; - alias: "elm/genlist/item_compress_odd/history_item_no_favicon/default"; - inherit: "elm/genlist/item/history_item/default"; - images { - image: "ico_page_37.png" COMP; - } - parts { - part { - name: "no_favicon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 37 37; - max: 37 37; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "favicon_bg";} - rel2 { relative: 1.0 1.0; to: "favicon_bg";} - image.normal: "ico_page_37.png"; - } - } - } - } - - /* ----------------------------------------------------------------- */ - group { - name: "elm/genlist/item/history_parent_item/default"; - data.item: "texts" "date_text"; - min: WIDTH PARENT_ITEM_HEIGHT; - max: WIDTH PARENT_ITEM_HEIGHT; - parts { - part { - name: "bg_clipper"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 0; - align: 0 0; - color: 0 0 0 0; - min: WIDTH PARENT_ITEM_HEIGHT; - max: WIDTH PARENT_ITEM_HEIGHT; - } - } - part { - name: "text_bg"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - color: 18 22 34 245; - min: ITEM_WIDTH PARENT_ITEM_HEIGHT; - max: ITEM_WIDTH PARENT_ITEM_HEIGHT; - } - } - part { - name: "date_text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - min: 324 PARENT_ITEM_HEIGHT; - max: 324 PARENT_ITEM_HEIGHT; - fixed: 1 1; - align: 0 0; - color_class: dateTextColor; - rel1 { relative: 0.0 0.0; to: "text_bg"; offset: 25 0;} - rel2 { relative: 1.0 1.0; to: "text_bg";} - text { - text: "March. 19. 2014"; - font: "font_name"; - size: 22; - align: 0 0.5; - } - } - } - } - } - /* ----------------------------------------------------------------- */ - group{ - name: "elm/button/base/invisible_button"; - parts{ - part{ - name: "button"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - color: 0 0 0 0; - } - } - part{ - name: "over"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "button";} - rel2 { relative: 1.0 1.0;to: "button";} - color: 0 0 0 0; - } - } - } - programs{ - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - } - } -} \ No newline at end of file diff --git a/services/SimpleUI/edc/RelatedPages.edc b/services/SimpleUI/edc/RelatedPages.edc deleted file mode 100644 index bb3dabf..0000000 --- a/services/SimpleUI/edc/RelatedPages.edc +++ /dev/null @@ -1,298 +0,0 @@ -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 128; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } - -collections { - -group { name: "elm/label/base/rel_pages_label"; - styles { - style { name: "textblock_white"; - base: "font=Sans font_size="24" color=#D3D3D3 ellipsis=1"; - } - } - styles { - style { name: "textblock_white_bold"; - base: "font=Sans:style=Bold font_size="24" color=#D3D3D3 ellipsis=1"; - } - } - - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - fixed: 1 1; - min: 208 55; - max: 208 55; - text { - style: "textblock_white"; - max: 1 1; - } - } - description { state: "bold" 0.0; - inherit: "default" 0.0; - text { - style: "textblock_white_bold"; - max: 1 1; - } - } - } - } -} - -group { - name: "elm/button/base/thumbButton"; - images { - image: "ico_delete.png" COMP; - } - parts { - part { name: "elm.swallow.content"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 1; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - } - } - } - - programs { - program { name: "mouse,clicked"; - signal: "mouse,down,1"; - source: "elm.swallow.content"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - } -} - -group { - name: "elm/gengrid/base/rel_pages"; - data { - item: "focus_highlight" "off"; - } - - parts { - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part { name: "background"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 42 50 64 0; - rel1 { - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1 {relative: 0.0 0.0;} - rel2 {relative: 1.0 1.0; offset: 14 14;} - } - } - part { name: "elm.swallow.empty"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 0.5; - rel1 { - relative: 0.5 0.5; - } - rel2 { - relative: 0.5 0.5; - } - } - } - } - } -group { name: "elm/gengrid/item/rel_page_item/default"; - data.item: "texts" "elm.text"; - data.item: "contents" "elm.thumbnail elm.text elm.label elm.thumbButton"; - images { - image: "web_frame_selected.png" COMP; - } - parts { - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "elm.thumbnail"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.0; - min: 238 153; - max: 238 153; - rel1 { - relative: 0.0 0.0; - } - rel2 { - relative: 1.0 1.0; - } - } - description { state: "selected"; - inherit: "default" 0.0; - } - } - part { name: "focus_highlight"; - type: IMAGE; - description { state: "default" 0.0; - rel1 { - to: "elm.thumbnail"; - relative: 0.0 0.0; - } - rel2 { - to: "elm.thumbnail"; - relative: 1.0 1.0; - } - image.normal: "web_frame_selected.png"; - image.border: 8 8 8 0; - image.border_scale: 1; - image.middle: NONE; - visible: 0; - } - description { state: "selected"; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "background"; - clip_to: "disclip"; - type: RECT; - description { state: "default" 0.0; - min: 238 55; - max: 238 55; - align: 0.0 0.0; - color: 30 38 50 255; - rel1 { - to: "elm.thumbnail"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 70 143 254 255; - } - } - part { name: "label_spacer"; - type: SPACER; -description { -state: "default" 0.0; -min: 15 55; -max: 15 55; -align: 0.0 0.0; -rel1{to: "background"; relative: 0.0 0.0;} -} -} - part { name: "elm.label"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - min: 208 55; - max: 208 55; - align: 0.0 0.0; - rel1 { to: "label_spacer"; - relative: 1.0 0.0; - } - rel2 { - to: "elm.thumbnail"; - relative: 1.0 1.0; - } - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.thumbButton"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - } - } - part { name: "over2"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "bg"; - rel2.to: "background"; - } - } - part { name: "over3"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "background"; - rel2.to: "background"; - } - } - } - programs{ - program { - name: "mouse_in"; - signal: "mouse,in"; - source: "over2"; - action: STATE_SET "selected" 0.0; - target: "background"; - target: "focus_highlight"; - target: "elm.thumbnail"; - } - program { - name: "mouse_out"; - signal: "mouse,out"; - source: "over2"; - action: STATE_SET "default" 0.0; - target: "background"; - target: "focus_highlight"; - target: "elm.thumbnail"; - } - } -} -} \ No newline at end of file diff --git a/services/SimpleUI/edc/Settings.edc b/services/SimpleUI/edc/Settings.edc deleted file mode 100644 index 3b8ab9f..0000000 --- a/services/SimpleUI/edc/Settings.edc +++ /dev/null @@ -1,574 +0,0 @@ -#define WIDTH 473 -#define HEIGHT 490 -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 128; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } -data { item: "width" WIDTH; item: "height" HEIGHT; } -color_classes{ - color_class{ - name: "defaultFontColor"; - color: 211 211 211 255; - } - color_class{ - name: "disabledFontColor"; - color: 60 60 60 160; - } - color_class{ - name: "selectedItemFontColor"; - color: 255 255 255 255; - } - color_class{ - name: "transparent"; - color: 0 0 0 0; - } - color_class{ - name: "selectedBackground"; - color: 69 143 255 255; - } - color_class{ - name: "dimmColor"; - color: 0 0 0 128; - } - color_class{ - name: "on_offBackgroundColor"; - color: 255 255 255 255; - } -} -collections { - group{ name: "elm/genlist/base/settings"; - min: 473 426; - max: 473 426; - parts{ - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "background"; - type: RECT; - description{ - state: "default" 0.0; - color: 18 22 34 255; - rel1{ - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - mouse_events: 1; - description{ - state: "default" 0.0; - align: 0.5 0.5; - fixed: 1 1; - rel1{ - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "elm.swallow.empty"; - type: SWALLOW; - description{ - state: "default" 0.0; - fixed: 1 1; - rel1{ - relative: 0.5 0.5; - } - rel2{ - relative: 0.5 0.5; - } - } - } - part{ name: "dimmer"; - type: RECT; - description{ - state: "default" 0.0; - color: 0 0 0 128; - visible: 0; - } - description{ - state: "popup_show" 0.0; - inherit: "default"; - visible:1; - } - } - }//parts - programs{ - program{ - name: "show_popup"; - signal: "show_popup"; - source: "SettingsModel"; - action: STATE_SET "popup_show" 0.0; - target: "dimmer"; - } - program{ - name: "hide_popup"; - signal: "hide_popup"; - source: "SettingsModel"; - action: STATE_SET "default" 0.0; - target: "dimmer"; - } - } - }//group - group{ name: "elm/genlist/item/settings_item/default"; - alias: "elm/genlist/item_odd/settings_item/default"; - alias: "elm/genlist/item_compress/settings_item/default"; - alias: "elm/genlist/item_compress_odd/settings_item/default"; - min: 473 80; - max: 473 80; - data.item: "texts" "optionName"; - data.item: "contents" "optionValue"; - parts{ - part{ - name: "value_helper"; - mouse_events:0; - description{ - state: "default" 0.0; - color: 0 0 0 0; - } - description{ - state: "on" 0.0; - color: 0 0 0 0; - } - description{ - state: "off" 0.0; - color: 0 0 0 0; - } - } - part{ - name: "optionBackground"; - type: RECT; - mouse_events: 1; - description{ - state: "default" 0.0; - color_class: "transparent"; - rel1{ - relative: 0.0 0.0; - } - rel2{ - relative: 1.0 1.0; - } - } - description{ - state: "mouseOver" 0.0; - inherit: "default"; - color_class: "selectedBackground"; - } - description{ - state: "mouseOut" 0.0; - inherit: "default"; - } - description{ - state: "selected" 0.0; - inherit: "mouseOver"; - } - } - part{ name:"optionName"; - type: TEXT; - description{ - state: "default" 0.0; - align: 0 0.5; - min: 298 80; - max: 298 80; - color_class: "defaultFontColor"; - rel1{ - relative: 0.0 0.0; - offset: 25 0; - } - rel2.relative: 1.0 1.0; - text{ - size: 30; - align: 0 0.5; - } - } - description{ - state: "mouseOut" 0.0; - inherit: "default"; - } - description{ - state: "mouseOver" 0.0; - inherit: "default" 0.0; - color_class: "selectedItemFontColor"; - } - description{ - state: "disabled" 0.0; - inherit: "default" 0.0; - color_class: "disabledFontColor"; - } - } - part{ name: "optionValue"; - type: SWALLOW; - description{ - state: "default" 0.0; - align: 0 0.5; - fixed: 1 1; - min: 100 40; - max: 100 40; - visible: 1; - rel1{ - relative: 1.0 0.0; - to: "optionName"; - offset: 25 0; - } - rel2{ - relative: 1.0 1.0; - } - } - } - programs{ - program{ name: "mouse_in"; - signal: "mouse,in"; - source: "option*"; - script{ - new cur_state_helper[31]; - new Float:index; - get_state(PART:"optionName", cur_state_helper, 30, index); - if(!strcmp(cur_state_helper,"default")){ - set_state(PART:"optionBackground", "mouseOver", 0.0); - } - } - } - program{ name: "mouse_out"; - signal: "mouse,out"; - source: "option*"; - script{ - new st[31]; - new Float:vl - get_state(PART:"optionBackground", st, 30, vl); - if(strcmp(st,"selected")){ - set_state(PART:"optionBackground", "mouseOut", 0.0); - } - } - } - program{ signal: "selected"; - source: "SettingsModel"; - action: STATE_SET "selected" 0.0; - target: "optionBackground"; - } - program{ signal: "unselected"; - source: "SettingsModel"; - action: STATE_SET "mouseOut" 0.0; - target: "optionBackground"; - } - program{ name: "go_disabled"; - signal: "elm,state,disabled"; source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "optionName"; - } - program{ name: "go_enabled"; - signal: "elm,state,enabled"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "optionName"; - } - program{ name: "go_Off"; - signal: "switch,off"; - source: "SettingsModel"; - action: STATE_SET "off" 0.0; - target: "value_helper"; - } - program{ name: "go_On"; - signal: "switch,on"; - source: "SettingsModel"; - action: STATE_SET "on" 0.0; - target: "value_helper"; - } - program{ name: "go_switch_hide"; - signal: "switch,hide"; - source: "SettingsModel"; - action: STATE_SET "default" 0.0; - target: "value_helper"; - } - }//programs - }//parts - }//group - group{ name: "elm/ctxpopup/bg/settings_button"; - parts { - part{ - name: "base_bg"; - type: RECT; - mouse_events: 1; - description{ - state: "default" 0.0; - color: 0 0 0 0; - } - } - } - programs{ - program { - signal: "mouse,clicked,*"; - source: "base_bg"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - } - }//group: "elm/ctxpopup/bg/settings_button"; - group{ name: "elm/ctxpopup/base/settings_button"; - max: 0 0; - parts{ - part{ - name: "base"; - scale: 1; - type: RECT; - description{ - state: "default" 0.0; - min: 185 164; - max: 185 164; - //color: 0 0 0 0; - color_class: "transparent"; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - color_class: "on_offBackgroundColor"; - visible: 1; - } - } - part{ - name: "elm.swallow.content"; - scale: 1; - type: SWALLOW; - description{ - state: "default" 0.0; - rel1{ - to:"base"; - relative: 0 0; - } - rel2{ - to:"base"; - relative:1 1; - } - } - } - } - programs { - program { - signal: "elm,state,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - transition: LINEAR 0.2; - target: "base"; - } - program { - signal: "elm,state,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.3; - target: "base"; - after: "hide2"; - } - program { name: "hide2"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - } - }//group "elm/ctxpopup/base/settings_button"; - group{ name: "elm/radio/base/settings_radio"; - images.image: "check_foc.png" COMP; - images.image: "check_nor.png" COMP; - parts{ - part{name: "item_bg"; type: RECT; mouse_events:0; - scale: 1; - description{ - state: "default" 0.0; - color_class: "transparent"; - min: 185 82; - max: 185 82; - } - description{ - state: "mouse_over" 0.0; - inherit: "default"; - color_class: "selectedBackground"; - } - } - part{name: "left_spacer"; type: SPACER; - scale: 1; - description{ - state: "default" 0.0; - min: 20 82; - max: 20 82; - align: 0 0; - rel1{ - relative:0 0; - to: item_bg; - } - } - } - part{name: "elm.text"; type: TEXT; mouse_events: 0; - scale: 1; - description{ - state: "default" 0.0; - color_class: "defaultFontColor"; - align: 0 0.5; - rel1{ - relative: 1 0; - to: "left_spacer"; - } - rel2{ - relative: 0 1; - to_x: "indicator"; - to_y: "right_spacer"; - } - text{ - size: 30; - align: 0 0.5; - } - } - description{ - state: "mouse_over" 0.0; - inherit: "default"; - color_class: "selectedItemFontColor"; - } - } - part { name: "indicator"; mouse_events: 0; - scale: 1; - type: IMAGE; - description { state: "default" 0.0; - align: 1 0.5; - rel2{ - relative: 0 1; - to: "right_spacer"; - } - min: 38 38; - max: 38 38; - visible: 0; - } - description { - state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - image.normal: "check_foc.png"; - } - description{ - state: "selected_mouse_over" 0.0; - inherit: "selected"; - image.normal: "check_nor.png"; - } - } - part{ name: "right_spacer"; type: SPACER; - scale: 1; - description{ - state: "default" 0.0; - min: 20 82; - max: 20 82; - align: 1 1; - rel2{ - relative:1 1; - to: item_bg; - } - } - } - part{ name: "event"; type: RECT; - description{ - state: "default" 0.0; - color: 0 0 0 0; - } - } - }//parts - script { - public mouse_in() { - new st[31]; - new Float:vl - get_state(PART:"indicator", st, 30, vl) - if(!strcmp(st,"selected")) - set_state(PART:"indicator", "selected_mouse_over", 0.0); - set_state(PART:"item_bg", "mouse_over", 0.0); - set_state(PART:"elm.text", "mouse_over", 0.0); - } - public mouse_out() { - new st[31]; - new Float:vl - get_state(PART:"indicator", st, 30, vl) - if(!strcmp(st,"selected_mouse_over")) - set_state(PART:"indicator", "selected", 0.0); - set_state(PART:"item_bg", "default", 0.0); - set_state(PART:"elm.text", "default", 0.0); - } - } - programs{ - program{ - signal: "mouse,clicked,1"; source: "event"; - action: SIGNAL_EMIT "elm,action,radio,toggle" ""; - } - program{ - signal: "mouse,in"; source: "event"; - script{ - mouse_in(); - } - } - program{ - signal: "mouse,out"; source: "event"; - script{ - mouse_out(); - } - } - program{ - signal: "elm,action,focus"; source: "elm"; - script{ - mouse_in(); - } - } - program{ - signal: "elm,action,unfocus"; source: "elm"; - script{ - mouse_out(); - } - } - program{ - signal: "elm,state,radio,on"; source: "elm"; - action: STATE_SET "selected" 0.0; - target: "indicator"; - } - program{ - signal: "elm,state,radio,off"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "indicator"; - } - } - }//group "elm/radio/base/settings_radio"; - - group { name: "elm/label/base/settings_label"; - styles { - style { name: "label_style"; - base: "font="FNBD" font_size=30 text_class=tb_plain align=center color=#d3d3d3ff"; - tag: "br" "\n"; - tag: "hilight" "+ font="FNBD" color=#d3d3d3ff text_class=tb_plain"; - tag: "b" "+ font="FNBD" color=#d3d3d3ff text_class=tb_light"; - } - } - parts { - part { name: "elm.text"; type: TEXTBLOCK; - scale: 1; - description { state: "default" 0.0; - text { style: "label_style"; - min: 1 1; - } - } - } - } - } -}//collections \ No newline at end of file diff --git a/services/SimpleUI/edc/TabItem.edc b/services/SimpleUI/edc/TabItem.edc deleted file mode 100644 index 54952f8..0000000 --- a/services/SimpleUI/edc/TabItem.edc +++ /dev/null @@ -1,513 +0,0 @@ -#define SPACER_ITEM_BR(spacer_name, W, H, elem) \ - part { name: spacer_name; \ - type: RECT; \ - scale:1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - align: 0 0; \ - min: W H; \ - max: W H; \ - fixed: 1 1; \ - color: 18 22 34 245; \ - rel1 { relative: 0.0 0.0; to: elem;} \ - rel2 { relative: 1.0 1.0; to: elem;} \ - } \ - } -#define WIDTH 436 -#define HEIGHT 89 -data { item: "width" WIDTH; item: "height" HEIGHT; item: "list_max_height" 868;} -collections { - group { - name: "elm/list/item/tab_list"; - alias: "elm/list/item_odd/tab_list"; - alias: "elm/list/item_compress/tab_list"; - alias: "elm/list/item_compress_odd/tab_list"; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - images { - image: "ico_delete.png" COMP; - image: "thumbnail.png" COMP; - } - parts { - part { - name: "bg_clipper"; - scale:1; - mouse_events: 1; - type: SWALLOW; - description { - state: "default" 0.0; - color: 0 0 0 0; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - } - } - part { - name: "tab_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 374 87; - max: 374 87; - align: 0 1; - rel1 { relative: 0.0 0.0;to: "bg_clipper";} - rel2 { relative: 1.0 1.0;to: "bg_clipper";} - color: 18 22 34 255; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - } - } - SPACER_ITEM_BR("horizontal_line", 374, 2, "bg_clipper") - part { - name: "elm.text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.5; - min: 249 79; - max: 249 79; - rel1 { relative: 0.0 0.0; to: "tab_bg"; offset: 100 0;} - rel2 { relative: 1.0 1.0; to: "tab_bg";} - color: 200 200 200 255; - text { - text: ""; - font: "font_name"; - size: 30; - align: 0 0.5; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - text { - text: ""; - font: "Tizen:style=Bold"; - size: 30; - align: 0 0.5; - } - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color: 255 255 255 51; - } - } - part { - name: "elm.del.bg"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0 0; - min: 54 87; - max: 54 87; - rel1 { relative: 1.0 0.0; to: "tab_bg";} - rel2 { relative: 1.0 1.0;to: "bg_clipper";} - color: 96 114 146 255; - } - description { - state: "highlight" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - visible: 1; - } - description { - state: "focus" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "elm.del.icon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 0.5; - min: 40 40; - max: 40 40; - rel1 { relative: 0.0 0.0; to: "elm.del.bg";} - rel2 { relative: 1.0 1.0; to: "elm.del.bg";} - color: 255 255 255 255; - image.normal: "ico_delete.png"; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "focus" 0.0; - inherit: "highlight" 0.0; - } - } - part { - name: "elm.swallow.icon"; - scale: 1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: 374 87; - max: 374 87; - rel1 { relative: 0.0 0.0; to: "tab_bg";} - rel2 { relative: 1.0 1.0; to: "tab_bg";} - color: 0 0 0 0; - } - } - part { - name: "elm.swallow.end"; - scale: 1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0 0; - min: 54 87; - max: 54 87; - rel1 { relative: 1.0 0.0; to: "elm.swallow.icon";} - rel2 { relative: 1.0 1.0; to: "elm.swallow.icon";} - } - } - part { - name: "over"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 0; - align: 0 0; - fixed: 1 1; - min: 374 87; - max: 374 87; - rel1 { relative: 0.0 0.0; to: "tab_bg";} - rel2 { relative: 1.0 1.0; to: "tab_bg";} - color: 0 0 0 0; - } - description { - state: "highlight" 0.0; - inherit: "default" 0 0; - color: 69 143 255 51; - visible: 1; - } - } - } - programs{ - program { - name: "mouse_in_tab"; - signal: "mouse,in"; - source: "elm.swallow.icon"; - action: STATE_SET "focus" 0.0; - target: "tab_bg"; - target: "elm.del.bg"; - target: "elm.del.icon"; - } - program { - name: "mouse_out_tab"; - signal: "mouse,out"; - source: "elm.swallow.icon"; - action: STATE_SET "default" 0.0; - target: "tab_bg"; - target: "elm.del.bg"; - target: "elm.del.icon"; - } - program { - name: "mouse_in_del"; - signal: "mouse,in"; - source: "elm.swallow.end"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(strcmp(st, "selected")) { - set_state(PART:"elm.text", "highlight", 0.0); - } - set_state(PART:"elm.del.bg", "highlight", 0.0); - set_state(PART:"elm.del.icon", "highlight", 0.0); - set_state(PART:"over", "highlight", 0.0); - } - } - program { - name: "mouse_out_del"; - signal: "mouse,out"; - source: "elm.swallow.end"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(strcmp(st, "selected")) { - set_state(PART:"elm.text", "default", 0.0); - } - set_state(PART:"elm.del.bg", "default", 0.0); - set_state(PART:"elm.del.icon", "default", 0.0); - set_state(PART:"over", "default", 0.0); - } - } - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "elm.swallow.icon"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "mouse_click2"; - signal: "mouse,clicked,1"; - source: "elm.swallow.end"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "highlight_selected_tab"; - signal: "highlight,selected"; - source: ""; - action: STATE_SET "selected" 0.0; - target: "elm.text"; - } - program { - name: "focused"; - signal: "item,focused"; - //signal: "elm,state,selected"; - source: ""; - //action: SIGNAL_EMIT "mouse,in" "elm.swallow.icon"; - action: STATE_SET "focus" 0.0; - target: "tab_bg"; - target: "elm.del.bg"; - target: "elm.del.icon"; - } - program { - name: "unfocused"; - signal: "item,unfocused"; - //signal: "elm,state,unselected"; - source: ""; - //action: SIGNAL_EMIT "mouse,out" "elm.swallow.icon"; - action: STATE_SET "default" 0.0; - target: "tab_bg"; - target: "elm.del.bg"; - target: "elm.del.icon"; - } - } - } - /* ----------------------------------------------------------------- */ - group { - name: "elm/button/base/new_tab_elem"; - parts { - part { - name: "bg_clipper"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - color: 0 0 0 0; - min: WIDTH 80; - max: WIDTH 80; - } - } - part { - name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - min: 374 80; - max: 374 80; - align: 0 0; - fixed: 1 1; - color: 18 22 34 255; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - } - } - part { - name: "elm.text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.5; - min: 324 80; - max: 324 80; - rel1 { relative: 0.0 0.0; to: "bg"; offset: 25 0;} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 255 255 255 255; - text { - text: "+ New tab"; - font: "font_name"; - size: 30; - align: 0 0.5; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color: 255 255 255 51; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 60 60 60 160; - } - } - part { - name: "over"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - rel1 { relative: 0.0 0.0; to: "bg";} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 0 0 0 0; - } - } - } - programs{ - program { - name: "mouse_in"; - signal: "mouse,in"; - source: "over"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(strcmp(st, "disabled")) { - set_state(PART:"bg", "focus", 0.0); - } - } - } - program { - name: "mouse_out"; - signal: "mouse,out"; - source: "over"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { - name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { - name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - //action: SIGNAL_EMIT "mouse,in" "elm.swallow.icon"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(strcmp(st, "disabled")) { - set_state(PART:"bg", "focus", 0.0); - } - } - } - program { - name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - //action: SIGNAL_EMIT "mouse,in" "elm.swallow.icon"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - } - } - /* ----------------------------------------------------------------- */ - group{ - name: "elm/button/base/invisible_button"; - parts{ - part{ - name: "button"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - color: 0 0 0 0; - } - } - part { - name: "e.swallow.icon"; - scale:1; - mouse_events: 1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - align: 0 0.5; - min: 79 79; - max: 79 79; - rel1 { relative: 0.0 0.0;to: "button"; offset: 4 0;} - rel2 { relative: 1.0 1.0;to: "button";} - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color: 255 255 255 51; - } - } - part{ - name: "over"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "button";} - rel2 { relative: 1.0 1.0;to: "button";} - color: 0 0 0 0; - } - } - } - programs{ - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - } - } -} diff --git a/services/SimpleUI/edc/WebTitleBar.edc b/services/SimpleUI/edc/WebTitleBar.edc deleted file mode 100644 index d6346aa..0000000 --- a/services/SimpleUI/edc/WebTitleBar.edc +++ /dev/null @@ -1,116 +0,0 @@ -#define WEB_TITLE_BAR_WIDTH 1920 -#define WEB_TITLE_BAR_HEIGHT 87 -#define WEB_TITLE_BAR_TEXT_WIDTH 1691 -#define WEB_TITLE_BAR_TEXT_OFFSET 12 -#define WEB_TITLE_BAR_TEXT_SIZE 30 -#define WEB_TITLE_BAR_FAVICON_W_H 37 -#define WEB_TITLE_BAR_FAVICON_OFFSET 90 - -collections{ - group{ name: "web_title_bar"; - styles { - style { name: "text_style"; - base: "font=Sans font_size="WEB_TITLE_BAR_TEXT_SIZE" color=#D3D3D3 align=left"; - } - } - parts{ - part{ name: "web_title_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - ///\todo No given color in guidlines - color: 10 10 10 150; - min: WEB_TITLE_BAR_WIDTH 0; - max: WEB_TITLE_BAR_WIDTH 0; - fixed: 1 1; - align: 0 1; - rel1 { relative: 0.0 1.0; } - rel2 { relative: 1.0 1.0; } - } - description { state: "visible" 0.0; - inherit: "default"; - min: WEB_TITLE_BAR_WIDTH WEB_TITLE_BAR_HEIGHT; - max: WEB_TITLE_BAR_WIDTH WEB_TITLE_BAR_HEIGHT; - } - } - part{ name: "favicon_spacer"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: WEB_TITLE_BAR_FAVICON_OFFSET WEB_TITLE_BAR_HEIGHT; - max: WEB_TITLE_BAR_FAVICON_OFFSET WEB_TITLE_BAR_HEIGHT; - fixed: 1 1; - align: 0 0; - rel1{ relative: 0.0 0.0; to: "web_title_bg"; } - rel2{ relative: 1.0 1.0; to: "web_title_bg"; } - } - } - part{ name: "title_spacer"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: WEB_TITLE_BAR_TEXT_OFFSET WEB_TITLE_BAR_HEIGHT; - max: WEB_TITLE_BAR_TEXT_OFFSET WEB_TITLE_BAR_HEIGHT; - fixed: 1 1; - align: 0.0 0.0; - rel1{ relative: 1.0 0.0; to_x: "favicon"; } - rel2{ relative: 1.0 1.0; to: "web_title_bg"; } - } - } - - part{ name: "favicon"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - min: WEB_TITLE_BAR_FAVICON_W_H WEB_TITLE_BAR_FAVICON_W_H; - max: WEB_TITLE_BAR_FAVICON_W_H WEB_TITLE_BAR_FAVICON_W_H; - fixed: 1 1; - align: 0.0 0.5; - rel1 { to: "favicon_spacer"; relative: 1 0; } - rel2 { to: "favicon_spacer"; } - } - } - part{ name: "text"; - type: TEXTBLOCK; - scale: 1; - description { state: "default" 0.0; - color: 211 211 211 255; - min: WEB_TITLE_BAR_TEXT_WIDTH WEB_TITLE_BAR_HEIGHT; - max: WEB_TITLE_BAR_TEXT_WIDTH WEB_TITLE_BAR_HEIGHT; - visible: 1; - fixed: 1 1; - text { - text: ""; - style: "text_style"; - } - rel1 { relative: 1.0 0.0; to: "title_spacer"; offset: 0 WEB_TITLE_BAR_HEIGHT;} - rel2 { relative: 1.0 1.0; to: "web_title_bg"; } - align: 0.0 0.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1 { relative: 1.0 0.0; to: "title_spacer"; offset: 0 0;} - } - } - } - programs{ - program{ - name: "show_bar"; - signal: "show_webtitle_bar"; - source: "web"; - action: STATE_SET "visible" 0.0; - target: "web_title_bg"; - target: "text"; - transition: LINEAR 0.5; - } - program{ - name: "hide_bar"; - signal: "hide_webtitle_bar"; - source: "web"; - action: STATE_SET "default" 0.0; - target: "web_title_bg"; - target: "text"; - transition: LINEAR 0.5; - } - } -} diff --git a/services/SimpleUI/edc/ZoomItem.edc b/services/SimpleUI/edc/ZoomItem.edc deleted file mode 100644 index eec3ff8..0000000 --- a/services/SimpleUI/edc/ZoomItem.edc +++ /dev/null @@ -1,221 +0,0 @@ -#define SPACER_ITEM_BR(spacer_name, W, H) \ - part { name: spacer_name; \ - type: RECT; \ - scale:1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - align: 1 1; \ - min: W H; \ - max: W H; \ - fixed: 1 1; \ - color: 255 255 255 10; \ - rel1 { relative: 0.0 1.0; to: "bg";} \ - rel2 { relative: 1.0 1.0; to: "bg";} \ - } \ - } - -#define WIDTH 374 -#define HEIGHT 82 - -data { item: "width" WIDTH; item: "height" HEIGHT; } - -collections { - group { - name: "elm/list/item/zoom_list"; - alias: "elm/list/item_odd/zoom_list"; - alias: "elm/list/item_compress/zoom_list"; - alias: "elm/list/item_compress_odd/zoom_list"; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - images { - image: "check_nor.png" COMP; - image: "check_foc.png" COMP; - } - parts { - part { - name: "bg_clipper"; - scale:1; - mouse_events: 0; - type: RECT; - description { - state: "default" 0.0; - min: WIDTH HEIGHT; - color: 0 0 0 0; - } - } - part { - name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - color: 18 22 34 255; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - } - description { state: "highlight focus" 0.0; - inherit: "focus" 0.0; - } - } - SPACER_ITEM_BR("content_br", 374, 2) - part { - name: "elm.swallow.icon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.0 0.0; - min: 38 38; - max: 38 38; - rel1 { relative: 1.0 0.0; to: "elm.text"; offset: 15 21;} - rel2 { relative: 1.0 1.0; to: "elm.text";} - color: 255 255 255 255; - image.normal: "check_foc.png"; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "highlight focus" 0.0; - inherit: "highlight" 0.0; - image.normal: "check_nor.png"; - } - } - part { - name: "elm.text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: 281 80; - max: 281 80; - rel1 { relative: 0.0 0.0; to: "bg"; offset: 25 0;} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 255 255 255 255; - text { - text: ""; - font: "font_name"; - size: 30; - align: 0 0.5; - } - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "highlight focus" 0.0; - inherit: "focus" 0.0; - } - } - part { - name: "over2"; - scale:1; - type: RECT; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { to: "bg_clipper"; relative: 0 0; } - rel2 { to: "bg_clipper"; relative: 1 1; } - } - } - } - programs{ - program { - name: "mouse_in"; - signal: "mouse,in"; - source: "over2"; - script { - new st[31]; - new Float:vl; - get_state(PART:"bg", st, 30, vl); - if(!strcmp(st, "highlight")) { - set_state(PART:"bg", "highlight focus", 0.0); - set_state(PART:"elm.text", "highlight focus", 0.0); - set_state(PART:"elm.swallow.icon", "highlight focus", 0.0); - } - else { - set_state(PART:"bg", "focus", 0.0); - set_state(PART:"elm.text", "focus", 0.0); - set_state(PART:"elm.swallow.icon", "focus", 0.0); - } - } - } - program { - name: "mouse_out"; - signal: "mouse,out"; - source: "over2"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.swallow.icon"; - script { - new st[31]; - new Float:vl; - get_state(PART:"bg", st, 30, vl); - if(!strcmp(st, "highlight focus")) { - set_state(PART:"bg", "highlight", 0.0); - set_state(PART:"elm.text", "highlight", 0.0); - set_state(PART:"elm.swallow.icon", "highlight", 0.0); - } - else if(!strcmp(st, "highlight")) { - set_state(PART:"bg", "highlight", 0.0); - set_state(PART:"elm.text", "highlight", 0.0); - set_state(PART:"elm.swallow.icon", "highlight", 0.0); - } - else { - set_state(PART:"bg", "default", 0.0); - set_state(PART:"elm.text", "default", 0.0); - set_state(PART:"elm.swallow.icon", "default", 0.0); - } - } - } - program { - name: "checked"; - signal: "checked"; - source: ""; - action: STATE_SET "highlight focus" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.swallow.icon"; - } - program { - name: "unchecked"; - signal: "unchecked"; - source: ""; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.swallow.icon"; - } - program { - name: "default_checked"; - signal: "default_checked"; - source: ""; - action: STATE_SET "highlight" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.swallow.icon"; - } - } - } -} -- 2.7.4 From b674d0b9776f018cfc3adb051ae8ca883454a72f Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Fri, 11 Sep 2015 14:04:37 +0200 Subject: [PATCH 05/16] Make AbstractUIComponent doing anything. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class needs AbstractUIComponent to have some view managing functions. [Cause:] N/A [Solution:] Added needed methods to interface: void init(Evas_Object* parent) Evas_Object* getContent() void showUI() void hideUI() [Verify:] Change builds. Browser is not crashing on loading services. Merge it after all UI components implement these methods. Change-Id: I7c67cad62a5b68a713395ecc1487fa9e90c72bc7 --- core/AbstractInterfaces/AbstractUIComponent.h | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/core/AbstractInterfaces/AbstractUIComponent.h b/core/AbstractInterfaces/AbstractUIComponent.h index 19d2984..daf9f76 100644 --- a/core/AbstractInterfaces/AbstractUIComponent.h +++ b/core/AbstractInterfaces/AbstractUIComponent.h @@ -27,9 +27,33 @@ namespace interfaces */ class AbstractUIComponent { +public: +/** + * @brief Sets the parent which will be used when getContent is used. + */ + virtual void init(Evas_Object* parent) = 0; + +/** + * @brief If UI content is not created creates it. + * Call init betore calling this function. + * @return UI content. + */ + virtual Evas_Object* getContent() = 0; + +/** + * @brief This makes element visible and clickable. + * Recreates genlists and gengrids (due to elm_genlist_clear and elm_gengrid_clear isue) + */ + virtual void showUI() = 0; + +/** + * @brief This makes UI element invisible and unclickable. + * Deletes genlists and gengrids (due to elm_genlist_clear and elm_gengrid_clear isue) + */ + virtual void hideUI() = 0; }; -} -} +}//namespace interfaces +}//namespace tizen_browser #endif /* __ABSTRACT_UI_COMPONENT_H__ */ -- 2.7.4 From 7af05447d9444e15afb26a3a481492e0a6c2a7b5 Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Fri, 11 Sep 2015 15:37:24 +0200 Subject: [PATCH 06/16] ViewManager class added. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class is needed. [Cause:] N/A [Solution:] Implemented new class with following public methods: popStackTo popTheStack pushViewToStack getContent [Verify:] Class is not used. Changes builds and doesn't crash. Merge this after merging this patch: https://review.tizen.org/gerrit/#/c/48052/ Change-Id: I4b8ca2866fa1cecbf858b4aed41e42112620a9f7 --- services/SimpleUI/CMakeLists.txt | 2 + services/SimpleUI/ViewManager.cpp | 122 ++++++++++++++++++++++++++++++++++++++ services/SimpleUI/ViewManager.h | 92 ++++++++++++++++++++++++++++ 3 files changed, 216 insertions(+) create mode 100644 services/SimpleUI/ViewManager.cpp create mode 100644 services/SimpleUI/ViewManager.h diff --git a/services/SimpleUI/CMakeLists.txt b/services/SimpleUI/CMakeLists.txt index af5a134..4c77390 100644 --- a/services/SimpleUI/CMakeLists.txt +++ b/services/SimpleUI/CMakeLists.txt @@ -5,6 +5,7 @@ set(SimpleUI_SRCS ButtonBar.cpp SimplePopup.cpp BookmarksManager.cpp + ViewManager.cpp ) set(SimpleUI_HEADERS @@ -12,6 +13,7 @@ set(SimpleUI_HEADERS ButtonBar.h SimplePopup.h BookmarksManager.h + ViewManager.h ) include(Coreheaders) diff --git a/services/SimpleUI/ViewManager.cpp b/services/SimpleUI/ViewManager.cpp new file mode 100644 index 0000000..eab2bbc --- /dev/null +++ b/services/SimpleUI/ViewManager.cpp @@ -0,0 +1,122 @@ +/* + * Copyrm_previousTopight (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +/* + * ViewManager.cpp + * + * Created on: Sep 11, 2015 + * Author: m.lapinski@samsung.com + */ + +#include + +#include "ViewManager.h" +#include "core/BrowserLogger.h" +#include "core/ServiceManager/Debug/BrowserAssert.h" + +namespace tizen_browser{ +namespace base_ui{ + +ViewManager::ViewManager(Evas_Object* parentWindow) + :m_mainLayout(nullptr) + ,m_previousTop(nullptr) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parentWindow); + m_mainLayout = elm_layout_add(parentWindow); + evas_object_size_hint_weight_set(m_mainLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set (m_mainLayout, EVAS_HINT_FILL, EVAS_HINT_FILL); + if(!elm_object_style_set (m_mainLayout,"content-back")) + BROWSER_LOGD("[%s:%d] elm_object_style_set falied.",__PRETTY_FUNCTION__, __LINE__); + elm_win_resize_object_add(parentWindow, m_mainLayout); + evas_object_show(m_mainLayout); +} + +void ViewManager::popStackTo(interfaces::AbstractUIComponent* view) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(view); + + if(!m_viewStack.empty()) + m_previousTop = m_viewStack.top(); + + while(!m_viewStack.empty()) + { + if (m_viewStack.top() == view) + break; + m_viewStack.pop(); + } + updateLayout(); +} + +void ViewManager::popTheStack() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if(!m_viewStack.empty()) + { + m_previousTop = m_viewStack.top(); + m_viewStack.pop(); + updateLayout(); + } +} + +void ViewManager::pushViewToStack(interfaces::AbstractUIComponent* view) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(view); + m_viewStack.push(view); + updateLayout(); +} + + +void ViewManager::updateLayout() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + Evas_Object* swallowed = elm_layout_content_get(m_mainLayout, "elm.swallow.content"); + + if (!m_viewStack.empty()) + { + if (m_viewStack.top()->getContent() == swallowed) + { + BROWSER_LOGD("[%s:%d] Top of stack is already visible!!!", + __PRETTY_FUNCTION__, __LINE__); + return; + } + if(m_previousTop) + m_previousTop->hideUI(); + elm_layout_content_unset(m_mainLayout, "elm.swallow.content"); + elm_layout_content_set(m_mainLayout, "elm.swallow.content", m_viewStack.top()->getContent()); + m_viewStack.top()->showUI(); + } + else + { + BROWSER_LOGD("[%s:%d] Stack is empty!!!",__PRETTY_FUNCTION__, __LINE__); + if(m_previousTop) + m_previousTop->hideUI(); + + elm_layout_content_unset(m_mainLayout, "elm.swallow.content"); + elm_layout_content_set(m_mainLayout, "elm.swallow.content", nullptr); + } +} + +Evas_Object* ViewManager::getContent() +{ + M_ASSERT(m_mainLayout); + return m_mainLayout; +} + +}//namespace base_ui +}//names1pace tizen_browser diff --git a/services/SimpleUI/ViewManager.h b/services/SimpleUI/ViewManager.h new file mode 100644 index 0000000..06d385d --- /dev/null +++ b/services/SimpleUI/ViewManager.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +/* + * ViewManager.h + * + * Created on: Sep 11, 2015 + * Author: m.lapinski@samsung.com + */ + +#ifndef VIEWMANAGER_H_ +#define VIEWMANAGER_H_ + +#include + +#include + +#include "core/AbstractInterfaces/AbstractUIComponent.h" + +namespace tizen_browser{ +namespace base_ui{ + + +/** + * @brief This class simplifies UI component management. It is a views stack. + * It handles all widget framework issues related to changing active view. + */ +class ViewManager +{ +public: +/** + * @brief constructor. + * + * @param A window which will contatin ViewManager's main layout. + */ + ViewManager(Evas_Object* parentWindow); + +/** + * @brief Pops stack to specified view. Hides actual view (if there is any) and + * make specified view visible. Does nothing if stack is empty. If view + * is not in the stack, it pops whole stack. + * + * @param A view which stack should be popped to. Do not use nullptr. + */ + void popStackTo(interfaces::AbstractUIComponent* view); + +/** + * @brief Pops actual view from the stack, hides it and if there is any view + * under it makes it visible. + */ + void popTheStack(); + +/** + * @brief Pushes view to the stack, hides if any wiew was visible hides it and + * new one visible visible. + * + * @param View pushed to stack. Do not use nullptr. + */ + void pushViewToStack(interfaces::AbstractUIComponent* view); + +/** + * @brief Function returns elm layout used in view management. It's parent is + * specified in constructor. + * + * @return ViewManager's main layout. + */ + Evas_Object* getContent(); + +private: + void updateLayout(); +private: + Evas_Object* m_mainLayout; + std::stack m_viewStack; + interfaces::AbstractUIComponent* m_previousTop; +}; + +}//namespace base_ui +}//namespace tizen_browser +#endif //VIEWMANAGER_H_ -- 2.7.4 From 3f1454d3372211caa24570e24d5c6cb71167dc24 Mon Sep 17 00:00:00 2001 From: Dariusz Frankiewicz Date: Fri, 18 Sep 2015 12:18:53 +0200 Subject: [PATCH 07/16] fixup! ViewManager class added. Change-Id: I9a52869f215df69a9e82c18ab2b3e4c547ea1c1d --- services/SimpleUI/ViewManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/SimpleUI/ViewManager.cpp b/services/SimpleUI/ViewManager.cpp index eab2bbc..ca45d1a 100644 --- a/services/SimpleUI/ViewManager.cpp +++ b/services/SimpleUI/ViewManager.cpp @@ -1,5 +1,5 @@ /* - * Copyrm_previousTopight (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. -- 2.7.4 From 5059e93c83493911ad58c4c26162f2792c99ded6 Mon Sep 17 00:00:00 2001 From: Albert Malewski Date: Fri, 18 Sep 2015 15:02:56 +0200 Subject: [PATCH 08/16] Changed database path [Issue] N/A [Problem] There was wrong database path which resulted in fails while launching the browser. [Cause] Wrong Tizen platform variable was used. [Solution] Used TZ_USER_APP instead of TZ_USER_DB. [Verify] Launch browser > Observe logs There shouldn't be fails in logs while loading database. Change-Id: I2641314543647e15cdfc70b5b8decc201fdcc57b --- core/Config/Config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Config/Config.cpp b/core/Config/Config.cpp index 2665734..d9f5490 100644 --- a/core/Config/Config.cpp +++ b/core/Config/Config.cpp @@ -26,7 +26,7 @@ namespace config void DefaultConfig::load(const std::string &) { const char *db_path = NULL; - db_path = tzplatform_getenv(TZ_USER_DB); + db_path = tzplatform_getenv(TZ_USER_APP); m_data["main_service_name"] = std::string("org.tizen.browser.base_UI"); //m_data["favorite_service_name"] = std::string("org.tizen.browser.service.favorite.browserProvider"); -- 2.7.4 From 3ef233bc3596ecebb4dde179f0eb667c7c721c84 Mon Sep 17 00:00:00 2001 From: Dariusz Frankiewicz Date: Fri, 18 Sep 2015 07:53:18 -0700 Subject: [PATCH 09/16] Revert "Changed database path" This reverts commit 5059e93c83493911ad58c4c26162f2792c99ded6. Change-Id: I8cdfa7391739693de3813eed6d2179a90f94f76f --- core/Config/Config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Config/Config.cpp b/core/Config/Config.cpp index d9f5490..2665734 100644 --- a/core/Config/Config.cpp +++ b/core/Config/Config.cpp @@ -26,7 +26,7 @@ namespace config void DefaultConfig::load(const std::string &) { const char *db_path = NULL; - db_path = tzplatform_getenv(TZ_USER_APP); + db_path = tzplatform_getenv(TZ_USER_DB); m_data["main_service_name"] = std::string("org.tizen.browser.base_UI"); //m_data["favorite_service_name"] = std::string("org.tizen.browser.service.favorite.browserProvider"); -- 2.7.4 From d822c546ff9f515c2ac73d560fad2b7158666330 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Mon, 21 Sep 2015 11:24:46 +0200 Subject: [PATCH 10/16] Moved code responsible for web page ui to separate service. [Issue] https://bugs.tizen.org/jira/browse/TT-167 [Problem] Functionality of SimpleUI was confusing. [Cause] N/A [Solution] Created new class WebPageUI, moved all classes connected to web page ui to new service. Change-Id: I633b5c5abad0040b9b7d51e5fb532de2c0d25689 Signed-off-by: Maciej Skrzypkowski --- services/CMakeLists.txt | 2 +- services/MainUI/MainUI.cpp | 41 +- services/MainUI/MainUI.h | 24 +- services/SimpleUI/CMakeLists.txt | 13 +- services/SimpleUI/SimpleUI.cpp | 388 ++++------------ services/SimpleUI/SimpleUI.h | 39 +- services/SimpleUI/edc/ErrorMessage.edc | 169 ------- services/SimpleUI/edc/LeftButtonBar.edc | 100 ---- services/SimpleUI/edc/MainLayout.edc | 291 ------------ services/SimpleUI/edc/RightButtonBar.edc | 83 ---- services/SimpleUI/edc/ScrollerDefault.edc | 502 --------------------- services/SimpleUI/edc/webview.edc | 91 ---- services/SimpleURI/CMakeLists.txt | 27 -- services/SimpleURI/edc/URIEntry.edc | 273 ----------- services/SimpleURI/images/ico_search.png | Bin 18426 -> 0 bytes services/SimpleURI/images/ico_url.png | Bin 3000 -> 0 bytes .../SimpleURI/images/search_searchbar_bg_foc.png | Bin 17789 -> 0 bytes .../SimpleURI/images/search_searchbar_bg_nor.png | Bin 17740 -> 0 bytes services/{SimpleUI => WebPageUI}/ButtonBar.cpp | 99 ++-- services/{SimpleUI => WebPageUI}/ButtonBar.h | 47 +- services/WebPageUI/CMakeLists.txt | 68 +++ .../SimpleURI.cpp => WebPageUI/URIEntry.cpp} | 171 +++---- .../SimpleURI.h => WebPageUI/URIEntry.h} | 70 ++- services/WebPageUI/WebPageUI.cpp | 307 +++++++++++++ services/WebPageUI/WebPageUI.h | 108 +++++ services/WebPageUI/edc/ErrorMessage.edc | 179 ++++++++ .../{SimpleUI => WebPageUI}/edc/ImageButton.edc | 0 services/WebPageUI/edc/LeftButtonBar.edc | 103 +++++ services/WebPageUI/edc/RightButtonBar.edc | 86 ++++ services/{SimpleUI => WebPageUI}/edc/Spacer.edc | 0 services/WebPageUI/edc/URIEntry.edc | 296 ++++++++++++ services/WebPageUI/edc/WebPageUI.edc | 318 +++++++++++++ .../images/btn_bar_back_nor.png | Bin .../images/btn_bar_forward_nor.png | Bin .../images/btn_bar_manager_nor.png | Bin .../images/btn_bar_more_nor.png | Bin .../images/btn_bar_reload_nor.png | Bin .../images/btn_bar_stop_nor.png | Bin .../images/btn_bar_vertical_settings.png | Bin .../images/round_rectangle_4X4.png | Bin .../images/web_browsing_icon_error.png | Bin .../{SimpleUI => WebPageUI}/images/web_shadow.png | Bin unit_tests/CMakeLists.txt | 4 +- 43 files changed, 1792 insertions(+), 2107 deletions(-) delete mode 100644 services/SimpleUI/edc/ErrorMessage.edc delete mode 100644 services/SimpleUI/edc/LeftButtonBar.edc delete mode 100644 services/SimpleUI/edc/MainLayout.edc delete mode 100644 services/SimpleUI/edc/RightButtonBar.edc delete mode 100644 services/SimpleUI/edc/ScrollerDefault.edc delete mode 100644 services/SimpleUI/edc/webview.edc delete mode 100644 services/SimpleURI/CMakeLists.txt delete mode 100644 services/SimpleURI/edc/URIEntry.edc delete mode 100644 services/SimpleURI/images/ico_search.png delete mode 100755 services/SimpleURI/images/ico_url.png delete mode 100644 services/SimpleURI/images/search_searchbar_bg_foc.png delete mode 100644 services/SimpleURI/images/search_searchbar_bg_nor.png rename services/{SimpleUI => WebPageUI}/ButtonBar.cpp (69%) rename services/{SimpleUI => WebPageUI}/ButtonBar.h (59%) create mode 100644 services/WebPageUI/CMakeLists.txt rename services/{SimpleURI/SimpleURI.cpp => WebPageUI/URIEntry.cpp} (59%) rename services/{SimpleURI/SimpleURI.h => WebPageUI/URIEntry.h} (54%) create mode 100644 services/WebPageUI/WebPageUI.cpp create mode 100644 services/WebPageUI/WebPageUI.h create mode 100644 services/WebPageUI/edc/ErrorMessage.edc rename services/{SimpleUI => WebPageUI}/edc/ImageButton.edc (100%) create mode 100644 services/WebPageUI/edc/LeftButtonBar.edc create mode 100644 services/WebPageUI/edc/RightButtonBar.edc rename services/{SimpleUI => WebPageUI}/edc/Spacer.edc (100%) create mode 100644 services/WebPageUI/edc/URIEntry.edc create mode 100644 services/WebPageUI/edc/WebPageUI.edc rename services/{SimpleUI => WebPageUI}/images/btn_bar_back_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_forward_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_manager_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_more_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_reload_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_stop_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_vertical_settings.png (100%) rename services/{SimpleUI => WebPageUI}/images/round_rectangle_4X4.png (100%) rename services/{SimpleUI => WebPageUI}/images/web_browsing_icon_error.png (100%) rename services/{SimpleUI => WebPageUI}/images/web_shadow.png (100%) diff --git a/services/CMakeLists.txt b/services/CMakeLists.txt index b4944bf..975dd93 100644 --- a/services/CMakeLists.txt +++ b/services/CMakeLists.txt @@ -7,7 +7,7 @@ add_subdirectory(HistoryUI) add_subdirectory(TabUI) add_subdirectory(SimpleUI) add_subdirectory(SettingsUI) -add_subdirectory(SimpleURI) +add_subdirectory(WebPageUI) add_subdirectory(BookmarkManagerUI) add_subdirectory(StorageService) add_subdirectory(HistoryService) diff --git a/services/MainUI/MainUI.cpp b/services/MainUI/MainUI.cpp index d5bec80..11df7f9 100644 --- a/services/MainUI/MainUI.cpp +++ b/services/MainUI/MainUI.cpp @@ -81,6 +81,34 @@ MainUI::~MainUI() elm_gengrid_item_class_free(m_bookmark_item_class); } +void MainUI::init(Evas_Object* parent) +{ + M_ASSERT(parent); + m_parent = parent; +} + + +Evas_Object* MainUI::getContent() +{ + M_ASSERT(m_parent); + if (!m_layout) { + m_layout = createQuickAccessLayout(m_parent); + } + return m_layout; +} + +void MainUI::showMostVisited(std::shared_ptr< services::HistoryItemVector > vec) +{ + addHistoryItems(vec); + showHistory(); +} + +void MainUI::showBookmarks(std::vector< std::shared_ptr< tizen_browser::services::BookmarkItem > > vec) +{ + addBookmarkItems(vec); + showBookmarks(); +} + void MainUI::createItemClasses() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); @@ -94,14 +122,6 @@ void MainUI::createItemClasses() } } -void MainUI::show(Evas_Object* parent) -{ - //FIXME: this may be source of memory leak this object is not deleted anywhere - m_layout = createQuickAccessLayout(parent); - evas_object_show(m_layout); - - m_parent = parent; -} Evas_Object* MainUI::createQuickAccessLayout(Evas_Object* parent) { @@ -304,6 +324,7 @@ void MainUI::addBookmarkItem(std::shared_ptr > items) { + clearBookmarkGengrid(); BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); for (auto it = items.begin(); it != items.end(); ++it) { addBookmarkItem(*it); @@ -393,6 +414,7 @@ void MainUI::showHistory() return; } setEmptyView(false); + evas_object_show(m_layout); } void MainUI::clearBookmarkGengrid() @@ -417,13 +439,12 @@ void MainUI::showBookmarks() evas_object_show(m_bookmarksView); elm_object_focus_set(m_bookmarksButton, true); + evas_object_show(m_layout); } void MainUI::hide() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - - //TODO: remove these "evas_object_hide" after cleaning up the mess in whole app window. evas_object_hide(m_layout); evas_object_hide(m_mostVisitedView); evas_object_hide(m_bookmarksView); diff --git a/services/MainUI/MainUI.h b/services/MainUI/MainUI.h index 0ebc78d..0b5b52b 100644 --- a/services/MainUI/MainUI.h +++ b/services/MainUI/MainUI.h @@ -39,24 +39,17 @@ class BROWSER_EXPORT MainUI public: MainUI(); ~MainUI(); - void show(Evas_Object *main_layout); + void init(Evas_Object *main_layout); + Evas_Object* getContent(); + void showMostVisited(std::shared_ptr vec); + void showBookmarks(std::vector > vec); void hide(); virtual std::string getName(); - void clearHistoryGenlist(); - void clearBookmarkGengrid(); - void showHistory(); - void showBookmarks(); - void clearItems(); void openDetailPopup(std::shared_ptr currItem, std::shared_ptr prevItems); bool isDesktopMode() const; void setDesktopMode(bool mode); DetailPopup & getDetailPopup(); - void addHistoryItem(std::shared_ptr); - void addHistoryItems(std::shared_ptr); - void addBookmarkItem(std::shared_ptr); - void addBookmarkItems(std::vector >); - boost::signals2::signal, int)> mostVisitedTileClicked; boost::signals2::signal, bool)> openURLInNewTab; boost::signals2::signal mostVisitedClicked; @@ -68,6 +61,15 @@ public: private: void createItemClasses(); + void addHistoryItem(std::shared_ptr); + void addHistoryItems(std::shared_ptr); + void addBookmarkItem(std::shared_ptr); + void addBookmarkItems(std::vector >); + void clearHistoryGenlist(); + void clearBookmarkGengrid(); + void showHistory(); + void showBookmarks(); + void clearItems(); Evas_Object* createQuickAccessLayout(Evas_Object *parent); Evas_Object* createMostVisitedView(Evas_Object *parent); diff --git a/services/SimpleUI/CMakeLists.txt b/services/SimpleUI/CMakeLists.txt index 4c77390..9771495 100644 --- a/services/SimpleUI/CMakeLists.txt +++ b/services/SimpleUI/CMakeLists.txt @@ -2,7 +2,6 @@ project(SimpleUI) set(SimpleUI_SRCS SimpleUI.cpp - ButtonBar.cpp SimplePopup.cpp BookmarksManager.cpp ViewManager.cpp @@ -10,7 +9,6 @@ set(SimpleUI_SRCS set(SimpleUI_HEADERS SimpleUI.h - ButtonBar.h SimplePopup.h BookmarksManager.h ViewManager.h @@ -23,7 +21,7 @@ include(EWebKitHelpers) include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/services) -include_directories(${CMAKE_SOURCE_DIR}/services/SimpleURI) +include_directories(${CMAKE_SOURCE_DIR}/services/WebPageUI) include_directories(${CMAKE_SOURCE_DIR}/services/WebEngineService) include_directories(${CMAKE_SOURCE_DIR}/services/WebEngineService/src) include_directories(${CMAKE_SOURCE_DIR}/services/StorageService) @@ -45,7 +43,7 @@ pkg_check_modules(capi_net QUIET capi-network-connection) add_library(${PROJECT_NAME} SHARED ${SimpleUI_SRCS}) -add_dependencies(${PROJECT_NAME} SimpleURI) +add_dependencies(${PROJECT_NAME} WebPageUI) add_dependencies(${PROJECT_NAME} StorageService) add_dependencies(${PROJECT_NAME} HistoryService) add_dependencies(${PROJECT_NAME} MoreMenuUI) @@ -56,7 +54,7 @@ add_dependencies(${PROJECT_NAME} TabUI) add_dependencies(${PROJECT_NAME} SettingsUI) add_dependencies(${PROJECT_NAME} PlatformInputManager) add_dependencies(${PROJECT_NAME} SessionStorage) -target_link_libraries(${PROJECT_NAME} SimpleURI) +target_link_libraries(${PROJECT_NAME} WebPageUI) target_link_libraries(${PROJECT_NAME} StorageService) target_link_libraries(${PROJECT_NAME} HistoryService) target_link_libraries(${PROJECT_NAME} MoreMenuUI) @@ -81,13 +79,8 @@ include(EDCCompile) #please do not add edc/ directory set(edcFiles - MainLayout.edc - LeftButtonBar.edc - RightButtonBar.edc AuthenticationPopup.edc BookmarksManager.edc - ScrollerDefault.edc - ErrorMessage.edc Tooltip.edc ) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 9ee8eae..dee412f 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -20,7 +20,6 @@ #include #endif -#include #include #include #include @@ -37,7 +36,6 @@ #include "TabId.h" #include "Tools/EflTools.h" #include "BrowserImage.h" -#include "SimpleURI.h" #include "SimpleUI.h" #include "BookmarkItem.h" #include "Tools/EflTools.h" @@ -60,15 +58,12 @@ const int ROOT_FOLDER = 0; SimpleUI::SimpleUI() : AbstractMainWindow() - , m_mainLayout(nullptr) - , m_progressBar(nullptr) , m_popup(nullptr) , m_moreMenuUI() , m_tabUI() , m_bookmarkManagerUI() , m_mainUI() , m_initialised(false) - , m_isHomePageActive(false) , items_vector() , m_networkErrorPopup(0) , m_wvIMEStatus(false) @@ -147,29 +142,23 @@ int SimpleUI::exec(const std::string& _url) //set global show tooltip timeout elm_config_tooltip_delay_set( boost::any_cast (config.get("TOOLTIP_DELAY"))); - loadThemes(); - loadUIServices(); loadModelServices(); createActions(); - // create view layouts - m_mainLayout = createWebLayout(m_window.get()); - elm_win_resize_object_add(m_window.get(), m_mainLayout); - - m_errorLayout = createErrorLayout(m_window.get()); - - //this needs to be called after UI is estabilished + // initModelServices() needs to be called after initUIServices() + initUIServices(); initModelServices(); + // create view layouts + elm_win_resize_object_add(m_window.get(), m_webPageUI->getContent()); + connectModelSignals(); connectUISignals(); connectActions(); - elm_layout_signal_callback_add(m_simpleURI->getContent(), "slide_websearch", "elm", SimpleUI::favicon_clicked, this); - // show main layout and window - evas_object_show(m_mainLayout); + evas_object_show(m_webPageUI->getContent()); evas_object_show(m_window.get()); } m_initialised = true; @@ -180,63 +169,17 @@ int SimpleUI::exec(const std::string& _url) if (url.empty()) { BROWSER_LOGD("[%s]: changing to homeUrl", __func__); - switchViewToHomePage(); + switchViewToQuickAccess(); restoreLastSession(); + } else { + openNewTab(url); } - else - openNewTab(url); - m_simpleURI->setFocus(); + m_webPageUI->getURIEntry().setFocus(); BROWSER_LOGD("[%s]:%d url=%s", __func__, __LINE__, url.c_str()); return 0; } -Evas_Object* SimpleUI::createWebLayout(Evas_Object* parent) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - // create web layout - Evas_Object* web_layout = elm_layout_add(parent); - evas_object_size_hint_weight_set(web_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_layout_file_set(web_layout, edjePath("SimpleUI/MainLayout.edj").c_str(), "main_layout"); - - // left buttons - leftButtonBar = std::make_shared(web_layout, "SimpleUI/LeftButtonBar.edj", "left_button_bar"); - leftButtonBar->addAction(m_back, "prev_button"); - leftButtonBar->addAction(m_forward, "next_button"); - leftButtonBar->addAction(m_reload, "refresh_stop_button"); - - //register action that will be used later by buttons" - leftButtonBar->registerEnabledChangedCallback(m_stopLoading, "refresh_stop_button"); - - // right buttons - rightButtonBar = std::make_shared(web_layout, "SimpleUI/RightButtonBar.edj", "right_button_bar"); - rightButtonBar->addAction(m_tab, "tab_button"); - rightButtonBar->addAction(m_showMoreMenu, "setting_button"); - - // progress bar - m_progressBar = elm_progressbar_add(web_layout); - elm_object_style_set(m_progressBar,"play_buffer"); - - //URL bar (Evas Object is shipped by SimpleURI object) - elm_object_part_content_set(web_layout, "uri_entry", m_simpleURI->getContent(web_layout)); - elm_object_part_content_set(web_layout, "uri_bar_buttons_left", leftButtonBar->getContent()); - elm_object_part_content_set(web_layout, "uri_bar_buttons_right", rightButtonBar->getContent()); - - return web_layout; -} - -Evas_Object* SimpleUI::createErrorLayout(Evas_Object* parent) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Evas_Object* errorLayout = elm_layout_add(parent); - evas_object_size_hint_weight_set(errorLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_layout_file_set(errorLayout, edjePath("SimpleUI/ErrorMessage.edj").c_str(), "error_message"); - - return errorLayout; -} - void SimpleUI::restoreLastSession() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -258,10 +201,10 @@ void SimpleUI::loadUIServices() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_simpleURI = + m_webPageUI = std::dynamic_pointer_cast - - (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.simpleuri")); + + (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.webpageui")); m_mainUI = std::dynamic_pointer_cast @@ -273,8 +216,8 @@ void SimpleUI::connectUISignals() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - M_ASSERT(m_simpleURI.get()); - m_simpleURI->uriChanged.connect(boost::bind(&SimpleUI::filterURL, this, _1)); + M_ASSERT(m_webPageUI.get()); + m_webPageUI->getURIEntry().uriChanged.connect(boost::bind(&SimpleUI::filterURL, this, _1)); M_ASSERT(m_mainUI.get()); m_mainUI->getDetailPopup().openURLInNewTab.connect(boost::bind(&SimpleUI::onOpenURLInNewTab, this, _1, _2)); @@ -314,13 +257,19 @@ void SimpleUI::loadModelServices() (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.sessionStorageService")); } +void SimpleUI::initUIServices() +{ + m_webPageUI->init(m_window.get()); + m_mainUI->init(m_webPageUI->getContent()); +} + void SimpleUI::initModelServices() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); M_ASSERT(m_webEngine); - M_ASSERT(m_mainLayout); - m_webEngine->init(m_mainLayout); + M_ASSERT(m_webPageUI->getContent()); + m_webEngine->init(m_webPageUI->getContent()); M_ASSERT(m_favoriteService); m_favoriteService->synchronizeBookmarks(); @@ -335,9 +284,9 @@ void SimpleUI::connectModelSignals() BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_webEngine->uriChanged.connect(boost::bind(&SimpleUI::webEngineURLChanged, this, _1)); - m_webEngine->uriChanged.connect(boost::bind(&SimpleURI::changeUri, m_simpleURI.get(), _1)); + m_webEngine->uriChanged.connect(boost::bind(&URIEntry::changeUri, &m_webPageUI->getURIEntry(), _1)); m_webEngine->uriOnTabChanged.connect(boost::bind(&SimpleUI::checkTabId,this,_1)); - m_webEngine->webViewClicked.connect(boost::bind(&SimpleURI::clearFocus, m_simpleURI.get())); + m_webEngine->webViewClicked.connect(boost::bind(&URIEntry::clearFocus, &m_webPageUI->getURIEntry())); m_webEngine->backwardEnableChanged.connect(boost::bind(&SimpleUI::backEnable, this, _1)); m_webEngine->forwardEnableChanged.connect(boost::bind(&SimpleUI::forwardEnable, this, _1)); m_webEngine->loadStarted.connect(boost::bind(&SimpleUI::loadStarted, this)); @@ -353,56 +302,19 @@ void SimpleUI::connectModelSignals() m_favoriteService->bookmarkAdded.connect(boost::bind(&SimpleUI::onBookmarkAdded, this,_1)); m_favoriteService->bookmarkDeleted.connect(boost::bind(&SimpleUI::onBookmarkRemoved, this, _1)); - //m_historyService->historyEmpty.connect(boost::bind(&SimpleUI::disableHistoryButton, this, _1)); m_historyService->historyAdded.connect(boost::bind(&SimpleUI::onHistoryAdded, this,_1)); m_historyService->historyDeleted.connect(boost::bind(&SimpleUI::onHistoryRemoved, this,_1)); - //TODO "clearHistoryGenlist" should be renamed to "onHistoryDeleteFinished" - //and "historyAllDeleted"should be renamed to historyDeleteFinished" - m_historyService->historyAllDeleted.connect(boost::bind(&MainUI::clearHistoryGenlist, m_mainUI.get())); m_platformInputManager->returnPressed.connect(boost::bind(&elm_exit)); m_platformInputManager->backPressed.connect(boost::bind(&SimpleUI::onBackPressed, this)); } -//TODO: move it to WebUI -void SimpleUI::loadThemes() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - elm_theme_extension_add(nullptr, edjePath("SimpleUI/ErrorMessage.edj").c_str()); - - elm_theme_overlay_add(0, edjePath("SimpleUI/ScrollerDefault.edj").c_str()); - elm_theme_overlay_add(0, edjePath("SimpleUI/Tooltip.edj").c_str()); -} - void SimpleUI::createActions() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); ///\todo Add MulitStateAction. and convert m_stopLoading and m_reload actons to it? - m_back = sharedAction(new Action("Back")); - m_back->setToolTip("Previous"); - m_back->setIcon("browser/toolbar_prev"); - - m_forward = sharedAction(new Action("Next")); - m_forward->setToolTip("Next"); - m_forward->setIcon("browser/toolbar_next"); - - m_stopLoading = sharedAction(new Action("Stop")); - m_stopLoading->setToolTip("Stop"); - m_stopLoading->setIcon("browser/toolbar_stop"); - - m_reload = sharedAction(new Action("Reload")); - m_reload->setToolTip("Reload"); - m_reload->setIcon("browser/toolbar_reload"); - m_tab = sharedAction(new Action("Tabs")); - m_tab->setToolTip("Tab page"); - m_tab->setIcon("browser/toolbar_tab"); - - m_showMoreMenu = sharedAction(new Action("Settings")); - m_showMoreMenu->setToolTip("Settings"); - m_showMoreMenu->setIcon("browser/toolbar_setting"); - m_settingPrivateBrowsing = sharedAction(new Action("Private browsing")); m_settingPrivateBrowsing->setToolTip("On exit from private mode all cookies, history, and stored data will be deleted"); m_settingPrivateBrowsing->setCheckable(true); @@ -436,48 +348,30 @@ void SimpleUI::createActions() void SimpleUI::connectActions() { - //left bar - m_back->triggered.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::back, m_webEngine.get())); - m_back->triggered.connect(boost::bind(&SimpleUI::updateBrowserView, this)); - m_forward->triggered.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::forward, m_webEngine.get())); - m_stopLoading->triggered.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::stopLoading, m_webEngine.get())); - m_reload->triggered.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::reload, m_webEngine.get())); - m_reload->triggered.connect(boost::bind(&SimpleUI::updateBrowserView, this)); - - //right bar - m_tab->triggered.connect(boost::bind(&SimpleUI::showTabUI, this)); - m_showMoreMenu->triggered.connect(boost::bind(&SimpleUI::showMoreMenu, this)); - + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_settingPrivateBrowsing->toggled.connect(boost::bind(&SimpleUI::settingsPrivateModeSwitch, this, _1)); -} -void SimpleUI::updateURIBarView() -{ - m_simpleURI->changeUri(m_webEngine->getURI()); - leftButtonBar->setActionForButton("refresh_stop_button", m_reload); - stopEnable(true); - reloadEnable(true); - hideProgressBar(); -} + //left bar + m_webPageUI->backPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::back, m_webEngine.get())); + m_webPageUI->backPage.connect(boost::bind(&SimpleUI::switchViewToWebPage, this)); + m_webPageUI->forwardPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::forward, m_webEngine.get())); + m_webPageUI->stopLoadingPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::stopLoading, m_webEngine.get())); + m_webPageUI->reloadPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::reload, m_webEngine.get())); + m_webPageUI->reloadPage.connect(boost::bind(&SimpleUI::switchViewToWebPage, this)); -void SimpleUI::updateWebView() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - evas_object_hide(elm_object_part_content_get(m_mainLayout, "web_view")); - elm_object_part_content_unset(m_mainLayout, "web_view"); - elm_object_part_content_set(m_mainLayout, "web_view", m_webEngine->getLayout()); - evas_object_show(m_webEngine->getLayout()); + //right bar + m_webPageUI->showTabUI.connect(boost::bind(&SimpleUI::showTabUI, this)); + m_webPageUI->showMoreMenu.connect(boost::bind(&SimpleUI::showMoreMenu, this)); } -void SimpleUI::updateBrowserView() +void SimpleUI::switchViewToWebPage() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if(isHomePageActive()) - hideMainUI(); - - updateWebView(); - - updateURIBarView(); + M_ASSERT(m_webPageUI); + M_ASSERT(m_mainUI); + if(m_webPageUI->isHomePageActive()) + m_mainUI->hide(); + m_webPageUI->switchViewToWebPage(m_webEngine->getLayout(), m_webEngine->getURI()); } void SimpleUI::switchToTab(const tizen_browser::basic_webengine::TabId& tabId) @@ -493,42 +387,23 @@ void SimpleUI::switchToTab(const tizen_browser::basic_webengine::TabId& tabId) return; } BROWSER_LOGD("[%s:%d] swiching to web_view ", __PRETTY_FUNCTION__, __LINE__); - updateBrowserView(); -} - -bool SimpleUI::isHomePageActive() -{ - return m_isHomePageActive; + switchViewToWebPage(); } bool SimpleUI::isErrorPageActive() { - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - return elm_object_part_content_get(m_mainLayout, "web_view") == m_errorLayout; + return m_webPageUI->isErrorPageActive(); } -void SimpleUI::switchViewToHomePage() +void SimpleUI::switchViewToQuickAccess() { - BROWSER_LOGD("[%s:%d] isHomePageActive : %d", __PRETTY_FUNCTION__, __LINE__, m_isHomePageActive); - if(isHomePageActive()) - return; - - showMainUI(); - filterURL(HomePageURL); + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if(m_webPageUI->isHomePageActive()) + return; + m_webPageUI->switchViewToQuickAccess(m_mainUI->getContent()); m_webEngine->disconnectCurrentWebViewSignals(); - - leftButtonBar->setActionForButton("refresh_stop_button", m_reload); - - stopEnable(false); - reloadEnable(false); - forwardEnable(false); - backEnable(false); - evas_object_hide(leftButtonBar->getContent()); - elm_object_signal_emit(m_mainLayout, "shiftback_uri", "ui"); - elm_object_signal_emit(m_simpleURI->getContent(), "shiftback_uribg", "ui"); - - hideProgressBar(); + m_mainUI->showMostVisited(getMostVisitedItems()); } void SimpleUI::checkTabId(const tizen_browser::basic_webengine::TabId& id){ @@ -560,7 +435,7 @@ void SimpleUI::closeTab(const tizen_browser::basic_webengine::TabId& id) void SimpleUI::bookmarkCheck() { - if (isHomePageActive()) + if (m_webPageUI->isHomePageActive()) return; if(m_favoriteService->bookmarkExists(m_webEngine->getURI())){ @@ -616,28 +491,19 @@ void SimpleUI::onClearHistoryClicked(const std::string&) void SimpleUI::onMostVisitedClicked(const std::string&) { BROWSER_LOGD("[%s]", __func__); - m_mainUI->clearHistoryGenlist(); - m_mainUI->clearBookmarkGengrid(); - m_mainUI->addHistoryItems(getMostVisitedItems()); - m_mainUI->showHistory(); + m_mainUI->showMostVisited(getMostVisitedItems()); } void SimpleUI::onBookmarkButtonClicked(const std::string&) { BROWSER_LOGD("[%s]", __func__); - m_mainUI->clearBookmarkGengrid(); - m_mainUI->clearHistoryGenlist(); - m_mainUI->addBookmarkItems(getBookmarks()); - m_mainUI->showBookmarks(); + m_mainUI->showBookmarks(getBookmarks()); } void SimpleUI::onBookmarkManagerButtonClicked(const std::string&) { BROWSER_LOGD("[%s]", __func__); - if(m_mainUI) { // TODO: remove this section when naviframes will be available - m_mainUI->clearBookmarkGengrid(); - m_mainUI->clearHistoryGenlist(); - } + m_mainUI->hide(); if(m_moreMenuUI) { // TODO: remove this section when naviframes will be available m_moreMenuUI->clearItems(); @@ -696,28 +562,28 @@ void SimpleUI::setwvIMEStatus(bool status) void SimpleUI::onBackPressed() { BROWSER_LOGD("[%s]", __func__); - if (!m_simpleURI->hasFocus() && !m_wvIMEStatus && !isHomePageActive() && m_back->isEnabled()) + if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus && !m_webPageUI->isHomePageActive() && m_webPageUI->isBackButtonEnabled()) m_webEngine->backButtonClicked(); } void SimpleUI::backEnable(bool enable) { - m_back->setEnabled(enable); + m_webPageUI->setBackButtonEnabled(enable); } void SimpleUI::forwardEnable(bool enable) { - m_forward->setEnabled(enable); + m_webPageUI->setForwardButtonEnabled(enable); } void SimpleUI::reloadEnable(bool enable) { - m_reload->setEnabled(enable); + m_webPageUI->setReloadButtonEnabled(enable); } void SimpleUI::stopEnable(bool enable) { - m_stopLoading->setEnabled(enable); + m_webPageUI->setStopButtonEnabled(enable); } void SimpleUI::addBookmarkEnable(bool enable) @@ -734,69 +600,42 @@ void SimpleUI::zoomEnable(bool enable) void SimpleUI::settingsButtonEnable(bool enable) { - m_showMoreMenu->setEnabled(enable); + m_webPageUI->setMoreMenuButtonEnabled(enable); } void SimpleUI::loadStarted() { - BROWSER_LOGD("Switching \"reload\" to \"stopLoading\"."); - showProgressBar(); - elm_object_signal_emit(m_simpleURI->getContent(), "shiftright_uribg", "ui"); - elm_object_signal_emit(m_mainLayout, "shiftright_uri", "ui"); - evas_object_show(leftButtonBar->getContent()); - leftButtonBar->setActionForButton("refresh_stop_button", m_stopLoading); + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); addBookmarkEnable(false); if(!m_webEngine->isPrivateMode()){ m_currentSession.updateItem(m_webEngine->currentTabId().toString(), m_webEngine->getURI()); } + m_webPageUI->loadStarted(); } void SimpleUI::progressChanged(double progress) { - if(progress == 1.0){ - hideProgressBar(); - } else { - elm_progressbar_value_set(m_progressBar,progress); - } + m_webPageUI->progressChanged(progress); } void SimpleUI::loadFinished() { - elm_object_signal_emit(m_mainLayout, "hide_progressbar_bg", "ui"); - BROWSER_LOGD("Switching \"stopLoading\" to \"reload\"."); - - leftButtonBar->setActionForButton("refresh_stop_button", m_reload); + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); addBookmarkEnable(m_favoriteService->countBookmarksAndSubFolders() < m_favoritesLimit); - if(m_webEngine->isLoadError()){ - loadError(); - } - if(!m_webEngine->isPrivateMode()){ m_historyService->addHistoryItem(std::make_shared (m_webEngine->getURI(), m_webEngine->getTitle(), m_webEngine->getFavicon()), m_webEngine->getSnapshotData(MainUI::MAX_THUMBNAIL_WIDTH, MainUI::MAX_THUMBNAIL_HEIGHT)); } + m_webPageUI->loadFinished(); } void SimpleUI::loadError() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - hideWebView(); - elm_object_part_content_set(m_mainLayout, "web_view",m_errorLayout); - //evas_object_show(m_errorLayout); -} - -void SimpleUI::setErrorButtons() -{ -// leftButtonBar->setActionForButton("bookmark_button", m_bookmark); - leftButtonBar->setActionForButton("refresh_stop_button", m_reload); -// addBookmarkEnable(false); - stopEnable(false); - reloadEnable(true); - forwardEnable(false); - evas_object_hide(m_progressBar); + m_webPageUI->switchViewToErrorPage(); } void SimpleUI::filterURL(const std::string& url) @@ -807,7 +646,7 @@ void SimpleUI::filterURL(const std::string& url) //create some kind of std::man //and then just map[url]() ? m_webEngine->setURI(url) : /*do nothing*/;; if(/*url.empty() ||*/ url == HomePageURL){ - m_simpleURI->changeUri(""); + m_webPageUI->getURIEntry().changeUri(""); } else if (!url.empty()){ //check if url is in favorites @@ -815,19 +654,19 @@ void SimpleUI::filterURL(const std::string& url) //check if url is in blocked //no filtering - if (isHomePageActive()) + if (m_webPageUI->isHomePageActive()) openNewTab(url); else m_webEngine->setURI(url); } - m_simpleURI->clearFocus(); + m_webPageUI->getURIEntry().clearFocus(); //addBookmarkEnable(false); } void SimpleUI::webEngineURLChanged(const std::string url) { BROWSER_LOGD("webEngineURLChanged:%s", url.c_str()); - m_simpleURI->clearFocus(); + m_webPageUI->getURIEntry().clearFocus(); bookmarkCheck(); } @@ -856,7 +695,7 @@ void SimpleUI::closeTabUI(const std::string& str) void SimpleUI::newTabClicked(const std::string& str) { BROWSER_LOGD("%s", __func__); - switchViewToHomePage(); + switchViewToQuickAccess(); } void SimpleUI::tabClicked(const tizen_browser::basic_webengine::TabId& tabId) @@ -885,7 +724,7 @@ void SimpleUI::handleConfirmationRequest(basic_webengine::WebConfirmationPtr web { basic_webengine::AuthenticationConfirmationPtr auth = std::dynamic_pointer_cast(webConfirmation); - Evas_Object *popup_content = elm_layout_add(m_mainLayout); + Evas_Object *popup_content = elm_layout_add(m_webPageUI->getContent()); std::string edjFilePath = EDJE_DIR; edjFilePath.append("SimpleUI/AuthenticationPopup.edj"); Eina_Bool layoutSetResult = elm_layout_file_set(popup_content, edjFilePath.c_str(), "authentication_popup"); @@ -961,36 +800,6 @@ void SimpleUI::authPopupButtonClicked(PopupButtons button, std::shared_ptrhide(); - m_mainUI = nullptr; - m_isHomePageActive = false; -} - -void SimpleUI::showMainUI() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_mainUI = std::dynamic_pointer_cast - - (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.mainui")); - M_ASSERT(m_mainUI); - hideWebView(); - m_mainUI->show(m_window.get()); - m_mainUI->addHistoryItems(getMostVisitedItems()); - m_mainUI->addBookmarkItems(getBookmarks()); - m_isHomePageActive = true; -} - void SimpleUI::showHistoryUI(const std::string& str) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -1048,7 +857,7 @@ void SimpleUI::closeSettingsUI(const std::string& str) void SimpleUI::showMoreMenu() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - bool desktopMode = isHomePageActive() ? m_mainUI->isDesktopMode() : m_webEngine->isDesktopMode(); + bool desktopMode = m_webPageUI->isHomePageActive() ? m_mainUI->isDesktopMode() : m_webEngine->isDesktopMode(); if(!m_moreMenuUI){ m_moreMenuUI = std::dynamic_pointer_cast @@ -1098,7 +907,7 @@ void SimpleUI::closeMoreMenu(const std::string& str) void SimpleUI::switchToMobileMode() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (!isHomePageActive()) { + if (!m_webPageUI->isHomePageActive()) { m_webEngine->switchToMobileMode(); m_webEngine->reload(); } else { @@ -1109,7 +918,7 @@ void SimpleUI::switchToMobileMode() void SimpleUI::switchToDesktopMode() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (!isHomePageActive()) { + if (!m_webPageUI->isHomePageActive()) { m_webEngine->switchToDesktopMode(); m_webEngine->reload(); } else { @@ -1162,18 +971,10 @@ void SimpleUI::closeBookmarkManagerMenu(const std::string& str) } if(m_mainUI) { - m_mainUI->addHistoryItems(getMostVisitedItems()); - m_mainUI->showHistory(); + m_mainUI->showBookmarks(getBookmarks()); } } -void SimpleUI::openLinkFromPopup(const std::string &uri) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - filterURL(uri); - hidePopup(); -} - void SimpleUI::hideHistory() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -1284,21 +1085,18 @@ void SimpleUI::tabCreated() popup->buttonClicked.connect(boost::bind(&SimpleUI::tabLimitPopupButtonClicked, this, _1, _2)); popup->show(); } - elm_object_part_text_set(rightButtonBar->getContent(), "tabs_number", (boost::format("%1%") % tabs).str().c_str()); + m_webPageUI->setTabsNumber(tabs); } void SimpleUI::updateView() { int tabs = m_webEngine->tabsCount(); BROWSER_LOGD("[%s] Opened tabs: %d", __func__, tabs); if (tabs == 0) { - switchViewToHomePage(); - elm_object_part_text_set(rightButtonBar->getContent(), "tabs_number", ""); - } else { - if (!isHomePageActive()) { - updateBrowserView(); - } - elm_object_part_text_set(rightButtonBar->getContent(), "tabs_number", (boost::format("%1%") % tabs).str().c_str()); + switchViewToQuickAccess(); + } else if (!m_webPageUI->isHomePageActive()) { + switchViewToWebPage(); } + m_webPageUI->setTabsNumber(tabs); } void SimpleUI::tabClosed(const tizen_browser::basic_webengine::TabId& id) { @@ -1332,35 +1130,11 @@ void SimpleUI::onNetworkConnected() } } -void SimpleUI::showProgressBar() -{ - elm_object_signal_emit(m_mainLayout, "show_progressbar_bg", "ui"); - elm_object_part_content_set(m_mainLayout,"progress_bar",m_progressBar); -} - -void SimpleUI::hideProgressBar() -{ - elm_object_signal_emit(m_mainLayout, "hide_progressbar_bg", "ui"); - elm_progressbar_value_set(m_progressBar,0.0); - elm_object_part_content_unset(m_mainLayout,"progress_bar"); - evas_object_hide(m_progressBar); -} - void SimpleUI::searchWebPage(std::string &text, int flags) { m_webEngine->searchOnWebsite(text, flags); } -void SimpleUI::favicon_clicked(void *data, Evas_Object *, const char *, const char *) -{ - BROWSER_LOGD("[%s],", __func__); - SimpleUI *self = reinterpret_cast(data); - if (!self->isHomePageActive() && !self->isErrorPageActive()) - { - self->m_simpleURI->clearFocus(); - } -} - void SimpleUI::addToBookmarks(int folder_id) { BROWSER_LOGD("[%s,%d],", __func__, __LINE__); diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index 9a8b7db..5a9ff1f 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -33,16 +33,15 @@ #include "service_macros.h" // components +#include "WebPageUI.h" #include "AbstractWebEngine.h" #include "MoreMenuUI.h" #include "HistoryUI.h" #include "SettingsUI.h" #include "MainUI.h" #include "TabUI.h" -#include "ButtonBar.h" #include "HistoryService.h" #include "BookmarkManagerUI.h" -#include "SimpleURI.h" #include "PlatformInputManager.h" #include "SessionStorage.h" #include "SqlStorage.h" @@ -74,13 +73,13 @@ public: void destroyUI(); private: // setup functions - void loadThemes(); void createActions(); void connectActions(); void loadUIServices(); void connectUISignals(); void loadModelServices(); void initModelServices(); + void initUIServices(); void connectModelSignals(); void restoreLastSession(); Evas_Object* createWebLayout(Evas_Object* parent); @@ -108,11 +107,8 @@ private: void bookmarkAdded(); void bookmarkDeleted(); - bool isHomePageActive(); - void switchViewToHomePage(); - void updateBrowserView(); - void updateWebView(); - void updateURIBarView(); + void switchViewToQuickAccess(); + void switchViewToWebPage(); void updateView(); void openNewTab(const std::string &uri, bool desktopMode = true); @@ -150,20 +146,10 @@ private: void authPopupButtonClicked(PopupButtons button, std::shared_ptr popupData); void onActionTriggered(const Action& action); - - void setwvIMEStatus(bool status); - sharedAction m_back; - sharedAction m_forward; - sharedAction m_stopLoading; - sharedAction m_reload; - sharedAction m_bookmark; - sharedAction m_unbookmark; - sharedAction m_tab; sharedAction m_share; sharedAction m_zoom_in; - sharedAction m_showMoreMenu; sharedAction m_showBookmarkManagerUI; sharedAction m_settingPointerMode; sharedAction m_settingPrivateBrowsing; @@ -229,18 +215,12 @@ private: void switchToDesktopMode(); void showHistoryUI(const std::string& str); void closeHistoryUI(const std::string&); - void showMainUI(); - void hideMainUI(); void showURIBar(); void hideURIBar(); - void hideWebView(); void hideSettingsMenu(); void showSettingsUI(const std::string&); void closeSettingsUI(const std::string&); - void showProgressBar(); - void hideProgressBar(); - void closeBookmarkManagerMenu(const std::string& str); void updateBookmarkManagerGenGrid(int folder_id); void showBookmarkManagerMenu(); @@ -263,7 +243,6 @@ private: void onDeleteDataButton(PopupButtons button, std::shared_ptr popupData); void onDeleteFavoriteButton(PopupButtons button, std::shared_ptr popupData); void tabLimitPopupButtonClicked(PopupButtons button, std::shared_ptr< PopupData > /*popupData*/); - void openLinkFromPopup(const std::string &); void disableHistoryButton(bool flag); int tabsCount(); @@ -278,16 +257,13 @@ private: std::string edjePath(const std::string &); - Evas_Object *m_mainLayout; - Evas_Object *m_progressBar; Evas_Object *m_popup; Evas_Object *m_entry; Evas_Object *m_errorLayout; + std::shared_ptr m_webPageUI; std::shared_ptr> m_webEngine; - std::shared_ptr m_simpleURI; - std::shared_ptr leftButtonBar; - std::shared_ptr rightButtonBar; +// std::shared_ptr m_simpleURI; std::shared_ptr m_favoriteService; std::shared_ptr m_historyService; std::shared_ptr m_moreMenuUI; @@ -301,7 +277,6 @@ private: tizen_browser::Session::Session m_currentSession; std::shared_ptr m_bookmarks_manager; bool m_initialised; - bool m_isHomePageActive; int m_tabLimit; int m_favoritesLimit; bool m_wvIMEStatus; @@ -315,8 +290,6 @@ private: SimplePopup* m_networkErrorPopup; void searchWebPage(std::string &text, int flags); - static void favicon_clicked(void *data, Evas_Object *obj, const char *emission, const char *source); - }; } diff --git a/services/SimpleUI/edc/ErrorMessage.edc b/services/SimpleUI/edc/ErrorMessage.edc deleted file mode 100644 index d644951..0000000 --- a/services/SimpleUI/edc/ErrorMessage.edc +++ /dev/null @@ -1,169 +0,0 @@ - -collections{ - images { - image: "web_browsing_icon_error.png" COMP; - } - styles { - style { name: "mssage_style"; - base: "font=Sans font_size=35 color=#d3d3d3 wrap=word align=0.5"; - } - style { name: "mssage_hint_style"; - base: "font=Sans font_size=24 color=#868686 wrap=word align=0.5"; - } - } - group{ name: "error_message"; - parts{ - part{ name: "message_background"; - type: RECT; - mouse_events: 1; - description{ - state: "default" 0.0; - visible: 1; - rel1.relative: 0 0; - rel2.relative: 1 1; - color: 42 50 64 255; - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "error_message_background"; - type:RECT; - description{ - state: "default" 0.0; - visible: 1; - min: 1582 730; - max: 1582 730; - fixed: 1 1; - align: 0.5 0.5; - color: 30 38 50 153; - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "err_ico"; - type: IMAGE; - description{ - state: "default" 0.0; - visible: 1; - min: 140 140; - max:140 140; - fixed: 1 1; - align: 0.5 0; - rel1{ - relative: 0 0; - offset:0 163; - to: "error_message_background"; - } - rel2{ - relative: 1 1; - to: "error_message_background"; - } - image{ - normal: "web_browsing_icon_error.png"; - } - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "error_text"; - type: TEXTBLOCK; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 1502 96; - max: 1502 96; - //color: 211 211 211 255; - align: 0.5 0; - rel1{ - relative: 0 1; - to_x: "error_message_background"; - to_y: "err_ico"; - } - rel2{ - relative: 1 1; - to: "error_message_background"; - } - text{ - style: "mssage_style"; - text: "Server not found.
Please check the followings:"; - //min: 0 0; - //max: 1 1; - //align: 1 0; - //size: 35; - } - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "error_hint"; - type: TEXTBLOCK; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 1502 117; - max: 1502 117; - color: 134 134 134 255; - align: 0.5 0; - rel1{ - relative: 0 1; - to_x: "error_message_background"; - to_y: "error_text"; - } - rel2{ - relative: 1 1; - to: "error_message_background"; - } - text{ - max: 0 1; - style: "mssage_hint_style"; - text: "Check for any typing error in URL.
" - "Check your network settings.
" - "Try again later.
" - "Click refresh to reload."; - } - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - }//parts - programs{ - program{ name: "show_error"; - signal: "show_error"; - source: "model"; - action: STATE_SET "visibleError" 0.0; - target: "message_background"; - target: "error_message_background"; - target: "err_ico"; - target: "error_text"; - target: "error_hint"; - } - program{ name: "hide_error"; - signal: "hide_error"; - source: "model"; - action: STATE_SET "default" 0.0; - target: "message_background"; - target: "error_message_background"; - target: "err_ico"; - target: "error_text"; - target: "error_hint"; - } - }//programs - } -} diff --git a/services/SimpleUI/edc/LeftButtonBar.edc b/services/SimpleUI/edc/LeftButtonBar.edc deleted file mode 100644 index 5de8ab2..0000000 --- a/services/SimpleUI/edc/LeftButtonBar.edc +++ /dev/null @@ -1,100 +0,0 @@ -#include "ImageButton.edc" -#include "Spacer.edc" - -collections { - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_prev", 82, 102, "btn_bar_back_nor.png") - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_next", 82, 102, "btn_bar_forward_nor.png") - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_reload", 82, 102, "btn_bar_reload_nor.png") - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_stop", 82, 102, "btn_bar_stop_nor.png") - - group { - name: "left_button_bar"; - - parts { - - part { name: "prev_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 1 1; - min: 70 70; - max: 70 70; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - - ADD_SPACER("spacer_1", "prev_button", 10, 70) - - part { name: "next_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 1 1; - min: 70 70; - max: 70 70; - rel1 { relative: 1.0 0.0; to: "spacer_1"; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - - ADD_SPACER("spacer_2", "next_button", 10, 70) - - part { name: "refresh_stop_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 1 1; - min: 70 70; - max: 70 70; - rel1 { relative: 1.0 0.0; to: "spacer_2"; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - - } - } -} diff --git a/services/SimpleUI/edc/MainLayout.edc b/services/SimpleUI/edc/MainLayout.edc deleted file mode 100644 index aedfdbd..0000000 --- a/services/SimpleUI/edc/MainLayout.edc +++ /dev/null @@ -1,291 +0,0 @@ -#define URI_LENGTH 1720 -#define URI_LENGTH_SHORT 1460 -#define URI_WIDTH 82 -#include "Spacer.edc" -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 255; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } -collections { - group { - name: "main_layout"; - images { - image: "web_shadow.png" COMP; - } - parts { - part { name: "uri_bar_bg"; - type : RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0 0; - min: 1920 104; - max: 1920 104; - color: 255 255 255 255; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 0.0; } - } - } - ADD_SPACER_OVER("left_spacer", "uri_bar_bg", 7, 104) - part { name: "uri_bar_buttons_left"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0 0.5; - min: 246 102; - max: 246 102; - fixed: 1 1; - rel1 { relative: 1.0 1.0; to: "left_spacer"; } - rel2 { relative: 0.0 0.0; to: "left_spacer"; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - ADD_SPACER("left_buttons_spacer", "uri_bar_buttons_left", 0.5, 102) - part { name: "uri_entry"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.5; - min: URI_LENGTH URI_WIDTH; - max: URI_LENGTH URI_WIDTH; - fixed: 1 1; - rel1 { relative: 1.0 0.5; to: "left_spacer"; } - rel2 { relative: 1.0 0.5; to: "left_spacer"; } - } - description { - state: "moveright" 0.0; - inherit: "default" 0.0; - visible: 1; - min: URI_LENGTH_SHORT URI_WIDTH; - max: URI_LENGTH_SHORT URI_WIDTH; - rel1 { relative: 1.0 0.5; to: "left_buttons_spacer"; } - rel2 { relative: 1.0 0.5; to: "left_buttons_spacer"; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - ADD_SPACER("right_buttons_spacer", "uri_entry", 26, 102) - part { name: "uri_bar_buttons_right"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.5; - min: 164 102; - max: 164 102; - fixed: 1 1; - rel1 { relative: 1.0 0.5; to: "right_buttons_spacer"; } - rel2 { relative: 1.0 0.5; to: "right_buttons_spacer"; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - ADD_SPACER("right_spacer", "uri_bar_buttons_right", 74, 102) - part { name: "web_view"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 0; - rel1 { relative: 0.0 1.0; to: "uri_bar_bg"; } - rel2 { relative: 1.0 1.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "shadow"; - type: IMAGE; - scale: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 0; - min: 1920 14; - max: 1920 14; - image.normal: "web_shadow.png"; - rel1 { relative: 0.0 0.0; to: "web_view"; } - rel2 { relative: 1.0 1.0; } - } - } - part { name: "progress_bar"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 0; - min: 1920 2; - max: 1920 2; - rel1 { - relative: 0.0 0.0; - offset: -12 -10; - to: "web_view"; - } - rel2 { relative: 1.0 1.0; } - } - } - part { name: "progress_bar_light_bg"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - fixed: 1 1; - min: 0 8; - max: 1920 8; - align: 0 0; - visible: 0; - rel1.to: "web_view"; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 0.0; - color: 69 143 255 55; - } - description {state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "web_title_bar"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - min: 1920 87; - max: 1920 87; - fixed: 1 1; - align: 0 1; - rel1 { to: "web_view"; relative: 0.0 1.0; } - rel2 { to: "web_view"; relative: 1.0 1.0; } - } - } - - - part {name: "popup_bg"; - type: RECT; - scale: 1; - mouse_events: 1; - description {state: "default" 0.0; - visible: 0; - min: 1920 1080; - fixed: 1 1; - color: 100 100 100 128; - rel1 {relative: 0.0 0.0; } - rel2 {relative: 1.0 1.0; } - } - description {state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - part { name: "popup"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - visible: 0; - min: 0 0; - max: 700 800; - align: 0.5 0.5; - rel1 { relative: 0.0 0.0; to: "web_view";} - rel2 { relative: 1.0 1.0; to: "web_view";} - fixed: 1 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - max: 1920 1080; - } - } - } -} - programs { - program { name: "shiftright_uribar"; - signal: "shiftright_uri"; - source: "ui"; - action: STATE_SET "moveright" 0.0; - target: "uri_entry"; - } - program { name: "shiftback_uribar"; - signal: "shiftback_uri"; - source: "ui"; - action: STATE_SET "default" 0.0; - target: "uri_entry"; - } - program { name: "hide_progress"; - signal: "hide_progressbar_bg"; - source: "ui"; - action: STATE_SET "default" 0.0; - target: "progress_bar_light_bg"; - } - program { name: "show_progress"; - signal: "show_progressbar_bg"; - source: "ui"; - action: STATE_SET "visible" 0.0; - target: "progress_bar_light_bg"; - } - program {name: "show_popup"; - signal: "elm,state,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - transition: LINEAR 0.0; - target: "popup"; - target: "popup_bg"; - } - program {name: "hide_popup"; - signal: "elm,state,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.0; - target: "popup"; - target: "popup_bg"; - } - } -} -} diff --git a/services/SimpleUI/edc/RightButtonBar.edc b/services/SimpleUI/edc/RightButtonBar.edc deleted file mode 100644 index 164289e..0000000 --- a/services/SimpleUI/edc/RightButtonBar.edc +++ /dev/null @@ -1,83 +0,0 @@ -#include "ImageButton.edc" -#include "Spacer.edc" -collections { -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_tab", 82, 102, "btn_bar_manager_nor.png") -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_setting", 82, 102, "btn_bar_more_nor.png") - group { - name: "right_button_bar"; - parts { - part { name: "tab_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: 70 70; - max: 70 70; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "tabs_number"; - type: TEXT; - scale: 1; - repeat_events: 1; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: 70 70; - max: 70 70; - color: 86 86 86 255; - rel1 { relative: 0.0 0.0; to: "tab_button"; offset: 5 13; } - rel2 { relative: 1.0 1.0; to: "tab_button"; } - text { - text: ""; - font: "Tizen:style=Bold"; - size: 19; - align: 0.5 0.5; - } - } - } - ADD_SPACER("spacer_1", "tab_button", 10, 70) - part { name: "setting_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: 70 70; - max: 70 70; - fixed: 1 1; - rel1 { relative: 1.0 0.0; to: "spacer_1"; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - } -} diff --git a/services/SimpleUI/edc/ScrollerDefault.edc b/services/SimpleUI/edc/ScrollerDefault.edc deleted file mode 100644 index 472b8fb..0000000 --- a/services/SimpleUI/edc/ScrollerDefault.edc +++ /dev/null @@ -1,502 +0,0 @@ -collections { -group { name: "elm/scroller/base/default"; - - alias: "elm/list/base/default"; - alias: "elm/genlist/base/default"; - alias: "elm/gengrid/base/default"; - alias: "elm/scroller/base/map_bubble"; - alias: "elm/genscroller/base/default"; - - data { - item: "focus_highlight" "on"; - } - - script { - public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; - public timer0(val) { - new v; - v = get_int(sbvis_v); - if (v) { - v = get_int(sbalways_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - v = get_int(sbvis_h); - if (v) { - v = get_int(sbalways_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - set_int(sbvis_timer, 0); - return 0; - } - } - images { - image: "bt_sm_base2.png" COMP; - image: "scrollbar_vertical.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "web_shadow.png" COMP; - image: "web_shadow_from_bottom.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "shadow_top"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - align: 0.0 0.0; - fixed: 1 1; - min: 0 63; - max: -1 63; - image.normal: "web_shadow.png"; - rel1 { relative: 0.0 0.0; to: "elm.swallow.content"; } - rel2 { relative: 1.0 0.0; to: "elm.swallow.content"; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "shadow_bottom"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - align: 0.0 0.0; - fixed: 1 1; - min: 0 63; - max: -1 63; - image.normal: "web_shadow_from_bottom.png"; - rel1 { relative: 0.0 1.0; to: "elm.swallow.content"; offset: 0 -63; } - rel2 { relative: 1.0 1.0; to: "elm.swallow.content"; offset: 0 -63; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 10 17; - align: 1.0 0.0; - rel1 { - relative: 1.0 0.0; - offset: -70 2; - to_y: "elm.swallow.content"; - to_x: "elm.swallow.content"; - } - rel2 { - relative: 1.0 0.0; - offset: -70 -1; - to_y: "sb_hbar"; - to_x: "elm.swallow.content"; - } - } - } - part { name: "elm.dragable.vbar"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 8 45; - max: 10 99999; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - image { - normal: "scrollbar_vertical.png"; - //border: 6 6 6 6; - border: 0 0 4 4; - middle: SOLID; - } - image.border_scale: 1; - color: 0 0 0 191; - } - } - part { name: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar_clip"; - clip_to: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 17 10; - align: 0.0 1.0; - rel1 { - relative: 0.0 1.0; - offset: 2 0; - to_x: "elm.swallow.content"; - to_y: "elm.swallow.content"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to_x: "sb_vbar"; - to_y: "elm.swallow.content"; - } - } - } - part { name: "elm.dragable.hbar"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "sb_hbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 17 10; - max: 99999 10; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 4 4 4 4; - middle: SOLID; - } - } - } - part { name: "sb_hbar_over1"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "sb_hbar_over2"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_shine.png"; - border: 4 4 4 0; - } - } - } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 128 128 128 128; - } - } - } - programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - set_state(PART:"sb_hbar_clip", "hidden", 0.0); - set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_h, 0); - set_int(sbvis_v, 0); - set_int(sbalways_v, 0); - set_int(sbalways_h, 0); - set_int(sbvis_timer, 0); - } - } - - program { name: "vbar_show"; - signal: "elm,action,show,vbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_hide"; - signal: "elm,action,hide,vbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_show_always"; - signal: "elm,action,show_always,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - set_int(sbalways_v, 1); - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - } - } - program { name: "vbar_show_notalways"; - signal: "elm,action,show_notalways,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_v); - if (v) { - set_int(sbalways_v, 0); - v = get_int(sbvis_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - } - } - program { name: "sb_vbar_show"; - signal: "do-show-vbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - program { name: "sb_vbar_hide"; - signal: "do-hide-vbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - - program { name: "hbar_show"; - signal: "elm,action,show,hbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_hide"; - signal: "elm,action,hide,hbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_show_always"; - signal: "elm,action,show_always,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - set_int(sbalways_h, 1); - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - } - } - program { name: "hbar_show_notalways"; - signal: "elm,action,show_notalways,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_h); - if (v) { - set_int(sbalways_h, 0); - v = get_int(sbvis_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - } - } - program { name: "sb_hbar_show"; - signal: "do-show-hbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - program { name: "sb_hbar_hide"; - signal: "do-hide-hbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - - program { name: "scroll"; - signal: "elm,action,scroll"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - v = get_int(sbvis_timer); - if (v > 0) cancel_timer(v); - v = timer(4.5, "timer0", 0); - set_int(sbvis_timer, v); - } - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disabler"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disabler"; - } - program { name: "show_top_shadow"; - signal: "show,top,shadow"; - source: ""; - transition: LINEAR 0.1; - action: STATE_SET "visible" 0.0; - target: "shadow_top"; - } - program { name: "hide_top_shadow"; - signal: "hide,top,shadow"; - source: ""; - transition: LINEAR 0.1; - action: STATE_SET "hidden" 0.0; - target: "shadow_top"; - } - program { name: "show_bottom_shadow"; - signal: "show,bottom,shadow"; - source: ""; - transition: LINEAR 0.1; - action: STATE_SET "visible" 0.0; - target: "shadow_bottom"; - } - program { name: "hide_bottom_shadow"; - signal: "hide,bottom,shadow"; - source: ""; - transition: LINEAR 0.1; - action: STATE_SET "hidden" 0.0; - target: "shadow_bottom"; - } - } -} -} diff --git a/services/SimpleUI/edc/webview.edc b/services/SimpleUI/edc/webview.edc deleted file mode 100644 index 0602899..0000000 --- a/services/SimpleUI/edc/webview.edc +++ /dev/null @@ -1,91 +0,0 @@ -#include "ImageButton.edc" -#include "Spacer.edc" -collections { - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_history", 70, 70, "web_ico_history.png") -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_bookmark", 70, 70, "web_ico_favorite_on.png") - - group { - name: "web_view_bar"; - parts { - part { name: "most_visited_button"; - type :RECT; - scale: 1; - description { - - state: "default" 0.0; - visible: 1; - fixed :1 1; - align: 0.5 0.5; - min: 70 70; - max: 70 70; - - - - rel1 { - - relative: 1.0 1.0; - - offset: 150 150; - - } - - rel2 { - - relative: 0.9 0.8; - - offset: 150 150; - - } -} - -} - - - -part { name: "visited_bookmarks"; - type :RECT; - scale: 1; - description { - - state: "default" 0.0; - visible: 1; - - align: 0.5 0.5; - min: 70 70; - max: 70 70; - - fixed :1 1; - - - rel1 { - - relative: 1.0 1.0; - - offset: 150 150; - - } - - rel2 { - - relative: 0.9 0.8; - - offset: 150 150; - - } -} - -} - - - - - - - - - - - } - } - } diff --git a/services/SimpleURI/CMakeLists.txt b/services/SimpleURI/CMakeLists.txt deleted file mode 100644 index 82200f8..0000000 --- a/services/SimpleURI/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -project(SimpleURI) - -set(SimpleURI_SRCS - SimpleURI.cpp - ) - -set(SimpleURI_HEADERS - SimpleURI.h - ) - -include(Coreheaders) -include(EFLHelpers) - -add_library(${PROJECT_NAME} SHARED ${SimpleURI_SRCS}) - -if(TIZEN_BUILD) - target_link_libraries(${PROJECT_NAME} ${pkgs_LDFLAGS}) - target_link_libraries(${PROJECT_NAME} boost_regex) -endif(TIZEN_BUILD) - -install(TARGETS ${PROJECT_NAME} - LIBRARY DESTINATION services - ARCHIVE DESTINATION services/static) - -EDJ_TARGET(URIEntry.edj - ${CMAKE_CURRENT_SOURCE_DIR}/edc/URIEntry.edc - ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/services/SimpleURI/edc/URIEntry.edc b/services/SimpleURI/edc/URIEntry.edc deleted file mode 100644 index 1ec64f6..0000000 --- a/services/SimpleURI/edc/URIEntry.edc +++ /dev/null @@ -1,273 +0,0 @@ -#define URI_INPUTBOX_LENGTH 1720 -#define URI_INPUTBOX_LENGTH_SMALL 1460 -#define URI_INPUTBOX_WIDTH 82 -collections { -group { name: "elm/entry/selection/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - } -} -group { name: "elm/entry/cursor/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 22 120 237 255; - min: 2 36; - max: 2 36; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "focused" 0.0; - target: "bg"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - } -} -group { - name: "elm/entry/base-single/uri_entry"; - styles { - style { - name: "browser-entry-uri-style-unselected"; - base: "font=Sans:style=SVD_Medium font_size="42" wrap=none color=#969696"; - } - style { - name: "browser-entry-uri-style-selected"; - base: "font=Sans:style=SVD_Medium font_size="42" wrap=none color=#4088d3"; - } - } - data { - item: focus_highlight "off"; - } - parts { - - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - - part { - name: "elm.guide"; - scale:1; - type: TEXTBLOCK; - mouse_events: 0; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-unselected"; - min: 0 1; - } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "label.text.clip"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - } - } - part { - name: "elm.text"; - scale:1; - multiline: 0; - entry_mode: EDITABLE; - select_mode: DEFAULT; - cursor_mode: BEFORE; - type: TEXTBLOCK; - clip_to: "label.text.clip"; - source: "elm/entry/selection/browser_entry"; - source4: "elm/entry/cursor/browser_entry"; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-selected"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "gdisabled"; - signal: "elm,guide,disabled"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "elm.guide"; - } - program { name: "genabled"; - signal: "elm,guide,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.guide"; - } - } -}//group - -group { - name: "elm/button/base/entry_btn"; - parts { - part { - name: "bg"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 1; - } - } - } - programs { - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "bg"; - script { - emit("elm,action,click", ""); - } - } - } - } - - - group { - name: "uri_entry_layout"; - parts { - part { - name: "spacer_1"; - type: SPACER; - scale: 1; - description { - state: "default" 0.0; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 0.0 0.0; offset: 15 0; } - align: 0.0 0.0; - fixed: 1 1; - min: 1 102; - max: 1 102; - } - } - part { name: "uri_entry_swallow"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - color: 255 255 255 255; - align: 0.0 0.0; - min: URI_INPUTBOX_LENGTH URI_INPUTBOX_WIDTH; - max: URI_INPUTBOX_LENGTH URI_INPUTBOX_WIDTH; - fixed: 1 1; - rel1 { relative: 1 0; to: "spacer_1"; } - rel2 { relative: 1 1; to: "spacer_1"; } - } - description { - state: "moveright" 0.0; - inherit: "default" 0.0; - visible: 1; - min: URI_INPUTBOX_LENGTH_SMALL URI_INPUTBOX_WIDTH; - max: URI_INPUTBOX_LENGTH_SMALL URI_INPUTBOX_WIDTH; - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "over"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { relative: 0 0; to: "spacer_1"; } - rel2 { relative: 1 1; to: "spacer_1"; } - } - } - part { name: "uri_entry_btn"; - type: SWALLOW; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - rel1.to: "uri_entry_swallow"; - rel2.to: "uri_entry_swallow"; - } - } - } - programs { - program { name: "shiftright_uribarbg"; - signal: "shiftright_uribg"; - source: "ui"; - action: STATE_SET "moveright" 0.0; - target: "uri_entry_swallow"; - } - program { name: "shiftback_uribarbg"; - signal: "shiftback_uribg"; - source: "ui"; - action: STATE_SET "default" 0.0; - target: "uri_entry_swallow"; - } - program { - name: "mouse_in_entry"; - source: "over"; - signal: "mouse,in"; - action: STATE_SET "focused" 0.0; - target: "spacer_1"; - } - program { - name: "mouse_out_entry"; - source: "over"; - signal: "mouse,out"; - action: STATE_SET "default" 0.0; - target: "spacer_1"; - } - } - } -} diff --git a/services/SimpleURI/images/ico_search.png b/services/SimpleURI/images/ico_search.png deleted file mode 100644 index 4ff60425fc94c1e4798581ed7a6cf85857c2f70b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18426 zcmeI3cU05Kx4^#?=}ke3iqe!KsWcNp4OOHEDKwg=06^T<#=?blN3lLuLISM+M=hsYSvO&-jb{h|h)U0Ycz~=^@&F*>NJ68Xoct(s zN{AnYs$`2sD^Y0_Us50e0K#78xDqk0qq0WRJ#WqJ5@U|rQCwCFDY=*@$H=5^(ozI9ngp3bV(B(I&U!Iom(16%?2D_rU;AnhY#J+~Mg^pVZs3(eW>tBB_t7ZS zW)-Gj6~GhrOjHP9+GjJN>k{T9Uz?xY$rE#che=P}VkZWNvZ= z^7sMo2At0T-~s3|5fCDE18LLTm)L)y6rAD+^ zq)uK(m8l^tV|NIFf(6~(!Rs{|ZRIx0=wo@YS*GBc@RJJgSY64!smB12m%5rY+Ns&F zMv3CaM*Slt5_>?e?+VPR`1lNb9%?G2ngYNpdUVTYZODx^F@^#$L7&fT9Ow7jEt(fP zo$PyE()1RPH~P|jiaO86^7PTNj*g+h!S=29&39lQxkr5_*6d-r&jx;oMtz!o*H_iA z77O1MYt8?@ujcXFZRgiD9TPs_(>0u8{i#%R?vvs(mHW0nWgc2G1J0|0k62_Ko`RoO zNisjC`C#MIIedSw_6(nKuO4vK- zH8JKUOlGa~HUcrew#R}2V7G-D81v|cNu3Y?SmecOT{T<#wpw1BDX^}3MOU@xCvW`& z=4$tA%%#jl@GJs$o3<-~TDT!Wwow_PVptbFo|KvWo_54p^NLZN}4KSt+u4+0C?@Ym5%-pB`y0 z^pkvWNq!vUp{l<*&07NziHBy-|2T&cAr@9kkRb^v|-fx_l)29 z-ZI3*<5$PkB@#6hvgHNki3$w)E1BCaC_GD6sKY=FU~e)RXT4$?{`wf?=1DV0^PthHOM>O&?rlJq^$V_PVYp%VZyR8gH*cnie zo{{cRXjAB1X#J*Azj!P^=R&1rx#vu*gjwBI^_}Y0#FWMrIU}weuHE?}`Lgy#$alry zf`IdDPnTOT?vnGzGjpqU$K-CKTIjkuU3+WNwqr%)CPiTgKE!i64<1?$4V~X<7t&?QFo$#oi!2^Pw0>+RP<7e4!KE_L2gI(WHp`|H;H=iHhmOA z^k|Z5YS$Skk#5kuPs(x4er8RSBbJ54O(iBL+3jxtXBdOC*VcB|R}OBazYE^=D&pz8 zoa`IfHDeb$uZ-)Dlg1OeetWF@n`W-3PDt~;dUT)jP>YG^ZzrGuy+zTEXvbLMtr1lS z4wCAAx$SD{c}BrBc0$hhZ)4hT1I7a=gC2N~=bpy~%+mVO2FH7p+&u?-(fd^A@N*G! zEkJ(EMjj$xQmk3*4&Isf5x*$kJz|3FB>a87W6bPuUYXfyvy}ap_YYNHR`#p^5i4TRn0-Yy<7qA;4P2`sBc>-cMsw3H>?!q63j~ znUMNj)bP`dHE$2*%U%Mn(nhA6ZcB97a{Ny-DXojLhc`}2Gd3O(39nJCA*w)H^ji|! z(L1%)J51VW*+(4vBeg;=TIMKJeW*k$sMWD>%srzxx^h#5eL(E)>PP#lZ}9}Y5p@$8IvDk)t8HwTqX)#Z_ZIeJ ze9l_q)k%knWjf_DR_|-q=n5NJn?QMV_hi@co0kgjm*JaypZbmt_kePDNTe5J3};A? z#XDZ!6z|=BbL`#UmYtA{CmNmQaV6-ovv*OqD+u`y8=n}OV9sIQVm@N@$DelJ!nVC9 zw~ViitoU2^kJio|71OiE534%ec--t;eOn1Lwlg=TO^TBWM&GB;1ns))5EMLC$M=+P zR!~)NZq;&Y56<#P!A9emzy&uS&HD9~_+)?wwvQj(oZI zaAeUd!Dk!xDiReT{^nVeSytJuSu;C)cHD7%Y~1qVbx*`6>&^|5r*u)C;ajIL4@oaa z_diP`PBtCRIgt|;4gS#O-Fc=Yas=1d>n}-}xFbb>_0)1MdBm{7uyN<)ZTjT(&LL^{ z+wNIckb8n&(_f=Lr#*A5D?e49Ra~|+plm#%@>Znp^yu1LgU0T+mEnKM&b?^OMHqEg zPDN0rA56dNmF zEpRZd>2vD46iM`ol#?k9@#67sa<>>G5d9{!+0jq==q7yArd+wtXFfL+%gI8b-?zSL zYi!AEIh`??k#;xem-Dl)nQs)Xbk^3?uCIC+rUTpkcKgg&HKU86IB~XD(sA$?rF|N6 zejl#Ab8XI_NmEEmo8#xpoce^*0d)cZQksPEpnKSFL*ghwU@V^ELjZ>bQCS;N*51@4 zjEcnt5a>!i1R{xSq%u){S4D}0H&SuevxnMK(F8w|O$3eL8sUJ!MFijwcoh?45mXqG z0fgunG2ow&1!$GVXppbAf9UBHBho~+(`Rd1l5Q3wTsB{vAtTgWz z>q7~p8>y(wH}viLGOi%%w}!|eU)ZrILc*|A2n-B`{DYCbJ!i9^pr2ZX&@K0}dh%st zKW#7s6HX;STnHhQP#TV4xtBnutNyGLc-%KX)KFUB0v|jMLI@-Tu}nf(ornFj3)HXQ zK)#uO*Nt!Le;hrXDF~in<`EE(pE_1Jgr7p-4TQ%}@mE zVVRS~nruGoSz(XI(y{->%Xf9z{ZQ~E-|&CsWvS-(KJ4w0w&V~xmW(6VS{Sp&4knTC z$Srs%!T<(?fv`RZ9LNB!y9KmG2Y~?T!SPT%T{xbA*U?=V)%j2phPp&V29x zr%n9C%@0l4kV06Y6TU2@Sb?>WW?Tuu-1d`P$|I~{00rVr_U>*B8^}YIajk&Zf)N?50bWZe$YOn3aSV zI?7hO%xeB+y9m{lwJ#(XvxdfA#9rHp6h;X2upqJC2_f^DPMa0;KV*+@`Sm~fur#9oq*pdy+(y`da2C0^IP+oC za&fT%;Vg1-apuFO<>F!k!dc|v;>?Fl%f-b8gtN%S#hDMAmWzuG2xpOti!&cKEf*IX z5Y8eO7iT_fS}ra&Ae==mF3x<|v|Ls*Ma&d9y!=~lp zVgtfiw&#Hr0PqReT9{$NUjC8o=qPO_!`!zqQAm8q@r;Yi zQ@>eWU6_~S8rxUeb#UIu8AWlU?SU<+Th(8(TRFqKVuXAKq ziD5(WP$gbM$IwvcZdECzr@~gc)&E4Cn&LXBv-gVaKl}+GXX#bpZ}uK7li)D~%k7&O z&!NUf*_a&ViH|kQ%YW6u$m1{K+YtL}yMLG@Tjsm|R#dd$dfwzvoS$9^3 zDxN7KdPgTu!O_e6E&y54eql&lQ1Fmu+8Fz?Jp%4UIb0!A{9cSMRnFk8-B8_d`DuRaq&~zTmUFd42hc39|3~Zw~bXr+BRnmz2rs z2Fz6LQ3z7)msefUDE}^06O3P>5%IWmf;qf>vie#p$n#98P3+9CcitRrzL{QqF*cI* z2wxOP(_RpGUnM3R`5-n1m0o^!I7cJ}STb;{<;V$!;fE3&$I#-Afx}zRUAI zT&NuHLU1b^-lK4dN4W{1G+R_0@+JUl6<$!c-qzIUu6gHuI`x z{o}~nIWg0`QN`Ucm3e7nLS15anv0pCw@H7E8$K@%9rjYtIK6Mu>4yMhg(P|32R)!6 X>h#VTp{BO^BhKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0002vNklEYJU> zbas?aGZ|S?D(}54r6*$n3>YwAz<>b*2AnE&m(9!7+C_Yplce*zMZ4{$m zOPX4Hhes*Vb>#asU#@pA(2{g4xx$wKdR8)cA3zT!%}WK}o}dRY(YXz+YwAz<>b*1`HT5V8DO@8wSVz#N((iV8DM( u#sAWP0RsjM7%*VKfC2xM761VM{{sLf-yP1%${*+e0000|jhTDh>;A5_KI>lVSu@x5 zh+XS!D=)K11^@tgdpj#P=v{W=B_#p<&B_%lhu)+)cHTUwZ2rVc3`jn)5CCLcSY-0r zwZ3dVo9D~sAneIx1c%FJu>3&)2yRVvXHwkzRZK^ozOi(O2|wb%c2kx@xLNKGUl6}s zPg7cHO^oKL7G>9pxz^Tm)N9jY#19?}KcMWYFSk$TiDZxF>4SUD#O%BCp=;+EzelAb z&+EsoJSO$!4yP70N|sB>9kVlVH42x@vRpFv_dPXL)m=R(^9Y%x96(8`fUe0K)fNNZ zg%OD>waO*017gAVWu<^}r<8Kc;^=Y3mzKvjiiPhLE9b|ra*zsN0GNj!v^)!#+lYmy zCM|ad(&qqM>u5gRz*;1*Rp*!I_kr-#cgJ^%0UM5JDvPDZ1Bm%xj1}O!8pv&2x6c~z z!T<{x4pn&I2@=5Adot{Ri$y?rgOY4MASDN2Tw@|v0CRQ%TWhtogMq!rfdw{0p2R;_ z<|*~*L8Ol76N{JPts^!_A%i46JyA<^8|+nAE-{yuyc0Mg@? zq0tVH1~(|=H8dC>EL7Nne0f7+T+7F&d#txHhhq)^UHq`7F@1EwqVUxc;Q?c(mkrMG z-7K5FePll)U(x&uklx?wIn0@0V}0sSaZ5{YPtTJzRhAp5cRY8EF)O!}dye}59Y*{( z^7i-Z&z45uHbvOZdG~we-8YUIiyIG1@AYYa9%uWpNOt_A#(k|Sd!J%2y#?K_^MVdq zB_9~ZWoX4(9$s;4S@SskS*QL7aZ;xdaB&++Y-c?3+$Ng%Uk*A-Ui|WBBLFZ|!mfCr zDD@>bW0@|0vn zCBd9|5!U6>#&ZOg21#il7dIcRv@?cWWwLZ$EE%U$eCP-JOTST?=QZ0j2fAtZ>u04H+AY#fxZO(k z%a_C-(MPPTjqFM7x!GgTqu!%Av_U4-$2{n_cka)0-R^8#qt>g`YuGCRCgChR&Lq2a zoI6FCYZSNM^8Benw+pV(=jI!3PsZ2pQL%T(IDh)+{YAd2z9Xy)FZkEyb{t*eoOsW( zxvt;#MdAzbHv&2NDCIphF-%>xl!cNDnQDTC7m^&$s@>nORzty%7jz@Ot+E?!C z?#!&!=c2Qj=hzgp-@?2{V}(#EN~k>!Z4HUP6~Q=g6}Ndr<<8L9JcT2g4Zjatx!K} z=va&eH~M8COFZV4W0&KaWBaPiIBy^`^=z4SiT8&H1&f+BIvaItnQ;w2ruMnFxOZgA zWU4rs65i&avi&mDPnB2+ZUklyCZ%299G>RL&U_kD*7tt#F7zm6G~j*aTU$9Vi2}K$ z5^Zt~3yHUkg4je2bWPizuH;QO&B+adx%iYR8)TyY;8*A00PJF~vT{^`-QsJWlB>+PXe?y?)`j z!mFTte$V=|-h+jufsyO+-WgsV>o*nHoKHQ!>`}@2lFYf8#m))NIcblWH!uEKc)KvG zNbO?p6N$FG!hphERHlzAv*=dd&B27Sgk9Hm{W@wYDIeXUkfX6)BaC;MyMVBc@HDyM z#Gu)(TW^l_qnTcfN{vqpx(nymt*Bz9x~JT?WvViZd3%Oq_QyKxu0th~P$}xw9kpdW zYxr-2Hg$zIzfDakNU0n+*LGphc#t(1-G1_};mH+g-UhsTH*3kiyY@Dj$(}rl@$1YD zb0ND#Ft7A!qiN`P&-0Hj7G(&sN2sq=Nq>>JC%Z}AM3bkur`}ucnv@sS7S*}jWT$P3 z>?Hr9Jx(7F9d80M!>Qh4x|@bC|ktsKEJ!S z;=HDB?H`BEYmW3KHN-ct6e8D#y?As_lKPyw|7Mt+PGoeXXO!7NPK?*0CTyaSpsAhA z>$G}rbSgcmuo#ch%QFu2zux(A zU^x0&>NDByovKOb+D)90Qw^1GA~RL8Q1kQ&$IKmLoL3$BmxYqvIh6y;hUN>F9h3>F z)Tm@?p_`1GVxEvU>Md~|veR=4J^V*}sZq$%TLu~Wy~TTVvJRCx$~$(X5YkkVcOU|A zri3!=p2P8nf-JK&oe~O}FPYC7JL+=5$o#Qef%}WlOO8t3_A5A)`=d8frqJ^23(9)k z$9j_aOwf~YqdxWy{#Z`h%KCx31$WvGnVfiia(rN3<-D%Lg&9!}o=6R^=ViIu@cG1` zkT#ia5bg=s{Qf6 zCKoTXcjp!A`>0fPl5*_6yajEliORn`(QOazRgY%hxpBPx$mOh@s$zO0qnXkF{3$YR zgTk@w#OH|$f$}Y_m*qRxT^@M*mvtLDv0k^WWKSWv_{JYGsRE7ZsD0-FZacb5KT_{YPx4W%Qaq}$iqJj6Vl9x@(+AM8IAjF{!cX7|54_90-? zdFOzjfg15<@li=_g~G?h4<2eXn^N539<6+3t5EaP^|92~0;IgLyvMI6s-J0dtU`MF zN2EJPmdF!YcO2N6+a-DbryUwh4fHn4sz_9tNX*qYZT>Edrgv^QA7OTi%!tShSEkq92-V7;As> zy8V}J<%0C#rgqyAiO4;TWASg}6v;ov9gnMvl8<_owu*$uKQrTw_J7PIH_{uIr>Tye z9;?e!RY8Znd-&>cLsL@Isl=hggc|`rXNInXEult=AvrW*?6ePRbuL^Hl>`TPxJI{b@nOuN53dOnLWGdW+xPI$f>1_raf6E@+Q3Y$!YsTm?d`9~mgK`Nik zrLfulq^T^M`ThibebV)01=869-U=cbUVCP$XM{j2Djy_4sc4AA7$UJo6s$1;XGk!> zuf*U97|bk@shThiCn)XdR6g~esC-cuuEVCY7$N^iWv1qr8ct3G`#>I_8b|}}tw_+= zQ7jgnu!`YhfM;N#B?jUcNUVvWF%pk40+9?n-2j7S7=bi8I625K!@rWYV$-%yF+my{7#bp1(N{tGCO-64IOA157$5p)=~>}lNxN`a&?ZFnpH*j~ z_y5->z9I8fQ+6yKlsX}^QVL3}$!*3R4EnP4v%{Y?xm|FmTpl>F3Qe^>FT?5mWqSLV zh?!i?1S)M}qao2IautLqd{H{nt?9^5VXUtw@Sjnh(w`On{Wb)?V4$#spOTua^?eZ@ zo52@Qxu69T%8CDF8BPg)839)&q9^ubf7X9s4tUfZ|GyddXG`e6eFkQ7m*z_iWP)@O z`g7WTF8F7YHZ_%BuBXr2z}M@KNT(4PY;FLRPhtg7nIM`I$Rwg?3TN6RPTz$HWVSz> z>%^vmBm*M)TgBguf__|EJN4TdiRWf(iLkdO8)Nat#z-6rJ6mQ}y;(XF_b~#r$3Xc` zom|^c%vWXb`d$-zh5z=+`X)FGbU_Cm==u~o+YJx(79Kj=4G*1(^ay0}Nw`m~!HQ=^ zP26m!pt?inLXZRv4PFGVy_OXW`g>WipnC#uVyDA?j)6PA8R-4Jz*&w@fm7);>-09c zMNE}KXG7>%ik?1~ezki{@2~&P4>KeBcdEj)M2*0J2scHzg!6%UMYv!-F(As1q>+ia92HU7q+3)ba<=BAI!)_l-RKWeMK zmT?Dsl7i~EUbfPt`%)=*{Zix+ngY-KB=?O@A4xw|+34(pqze){4;+}g6ajO&C53|A S+B&FHfW5V|Ri5S6-Twnc%6EqV diff --git a/services/SimpleURI/images/search_searchbar_bg_nor.png b/services/SimpleURI/images/search_searchbar_bg_nor.png deleted file mode 100644 index ad1a285d66c3bf941d9f0c7e8f16102e3846dc35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17740 zcmeI3c{r5o|HmJZeJiAr&R9Y+tF4*FSjL(yjEuAxGh3or2zntbFjB|2R~(|UXtSAdtM=52mFxY*n4xqHl?YT2#|haDF8^jGKs_u z8v@uoHaCFHfjJO~Fit4jpBY34fUx#V4+hDje~H=Xvk@!Dgy^G=Y%&uZnO-}f}s)j#h+Sj0$ca{xujQkn*LTuTIa zABD%S(X5uZ28e{+myrajoinOYE8-^=UR$MY7Kz>~Qq4nItm3|K@QvN{V`*os7F zrs{YA*E7b$@z!ABfI;pB5F3) zCVR)|0sj&Oi%URuf4kQ(XNrx@$;0JOp7i$gJYHXCd$&c#yHR~Mw%E|i5-ENCR4q2xk z9LAi{+-G%U_03gnle8CI24kXxE@R;Qc7jM`5AbqWFY-4Fb)#yxfVgCiJfha~io6*|;R8i7 zt46OfMoP@`mZTCzqdh^yZ$DYfSe|RTe6Q^(nR_%IIz4eocE-KXi_6Up znw;#rR}i4ko=6}zpsHUjl`yOeLLusJSY23aAeBsQyr5YqTTs9J{Ki7jihb{>Ef@G= zi(_o6rA);5Rxrv+OM9{t+2yf)E^LLi(V})KQz_BCZne6a$+?afb*?V@yKbo;1|3hf zH_&>xI8h0y7@0tr?RIZfuXl7W2wYa#xnlWbE!^em)$?Gtbv3wMZZbyOH)W=dy@6b^nX-I zx+8sT{V|W`;XM{3Z`rV3ceAb?Be8j5W}n9skEc1(IZK?) zaPNu{`GIHDPF7g+ud{LnQ?ssZjm~mn=R6Cq>ie)_7jm359{eHaot-RMyi`_OyhFBm zDgLH$2pg}CZ0PvYjkx881@R2!7$xQT-lXzY{OJd_KieuCWY%x)*6t3j53WD0Bd(*N zT?0oNI z@s8rM;Ids5hMy|q^3CEKgUMCNyRPo~dE87wF8+ypf%+!(DDK5jW!y&Gv-IW@gXX(# zjvVhtGRQ58EsqVm%aj^d*D*6aGVa?kR2k*mJ;MnH_BrluM5GW98EW-UZ&mfI=e-Nr z@;svLU1mmUM(sdu$GJh1LFQn5=P!4Sep#L6ZOFZM;}-FEx87EBnO}~f0=o*MT#2qR zj7xo5NGdYPtLV}B%V+rcqm;L*gue)(zjPD2@utr(&%C$YHLbpU>vE&(4R+SH*e>Ev zT9dTNh{;wUCwi3#Lv&w^WsJ{)vG)-_YFs~Lj_aWRRq|xO@?dtkrHWq%qo;+MLwPl#ksI_3Gh03Cc^#fg4e>y0P)GUUBA!I0@wCt>_eEerqR@+hzU1 z`ndJ83Ey=rvTydL52efI%5lk5=WxB`pNFE(KXUF-TdFdY9P z^My=zq-rYi))r3q$>!RT*qkMKh{XoD;}%W{E^Cke%TiH4cgew3LrVNrhor-6)oU4= z$X1iqgvZ3q`YTcQzK%V@oD(vJPBEt~@4jJFxU{;X-e?beYxJSENmPkMt!< z7<4cH>rMOaV2>AMt!Wy#TY9JCu<41nzf2A+u3h~6NZFY&zxQ*h4_$&L%^n)L`77Tc$6h~F*L^ub=Y^}MoyXKNe;2RlF>E75~Z#o|hY;h$c zy}K?^KE!3J5mff=FIMhQO;P#jv0i6buUb6&&h@m;qZjiE>dI*?{%!vKFQ37)eB_Vk zr@Ty&XURQjzbMzW@#4U{zic{?DNTAE6?@8v<)^RXuT;`=ZZ|irGbjB@8Xwd@4uB3Ae9xc#3#BKk$D*A9ENh9W^iBm*4;X_*n3kBA4Kh zfdrb;_*~-t4?EQv>d5U@=|kzZ86N3lK7Kw|UGEZFAHIGT@zJj12Za+xc<=D_ z!=&5H_Ws@XlNm!T2Q!al?utVE-RawLsw}dP+T68Wf&KQXBJX*d&E$c;b(QOyHxFIm z4V85CDtTS;N}l0-1bg)6=)0~ZPoqM0$D11~p73=Ciz;0!w~bf~SUw>>jelV7Gtv3@ZRbzh ztNGc(t(|tG;<0;LCX(JIDi9YYrX@DU$;G|NT1&uUUzmrE_kYYGw$NI1vQ#HdO*9s( zEJ9a8!0MfI|~jA4*q5&muIsR zJd;l|`{saLQaFc>bfMpzKEUjd^e09#{5p$lxHSvIu&MC2oL5Tju=X(@Ytaw zHamzglVx+ipTM6_dR|Nxjm_t-#v`G<=aza-h;B{c(FtHG8o^OUaI`TAZGyuX;S8~B zP*@xaHBV%wCq%;;OnVxINBJizU-X6QuxU*H@PDK-*YisaXJ?!Pi_4?1sB{Nw0yuXB zlS#vwniv}!8Jp1HXcP(qr(%qZ;A`n<8k|Noq+saaPNbpMPEYd7@UNt;+0-3VIrK@I z21--?*ZP@KOpM_EXsij`A8Uk$`(gc2a6e;{wbZqyesqj6{j>DE@UNs@Lz!R^q6E$B zGj;a=*CDeQFn)X@1^@v-M@R zd`!hm?`9l@I#p;0)Tvyh)9}bITIWt{Hu6&#^XmotXOw63=Y@ZN41NHeB`D!%q^5g) zUxdr{=kY0_bV~-96aULLoDuvo0;-HhPSxZf=6_%fxRjm$zZLjrTj;-i1?F;>8bDz& z=rjWIbJ~7x_-BhYvy@-%r_W{J>-~qPQE~q4&|nIWzzn7^=tvHWfk)0Y&W(wmy$a!o z>>zfiGn+;y7~+xNYW`*v_~+V&ng7-ZTz5Mwn1c<`1gu;pa0~)HUuIsvc{)?qF&tQ9 zzHz|+A-bV6oUc}@P-FGK84PALqojCm5JppI__dVeo)p5s&COghcG zdz&s1Gp*pgA$VJgoV_pos(Q@U*MH}ixf%UCRUul!K_EZ`n?hWI`9QovTo53FO(8D9 zd>~#SE(j38rVy84J`k@E7X*l4Q;172ABb0o3j##2Da0k155z0P1py-16yg%h2jUgt zf&dY03ULYM1Mv!RL4XK0g}4Osfp~?uAV370LR^CRK)ga+5Fmn0AuhpuAYLIZ2oS-h z5SL&+5U&sy1c+c$h)XaZh*yXU0z|MW#3h&y#4E%F0V3EG;u6dU;uYe801<2oaS7%F z@d|N4fCx5)xCHZoc!jtiKm?mYT!Q&Pyh2i<34Znizz!4uy!Hhj zA58@SRrZl>H*LYbWCv?YQds-ZqzfX^Fj=u5bk0*EDPrP&l6S=!L}?l0&0{IblMBR@ zvlk@mDy{WGs7iFnW(Vv#xIu~IfE!6%1uVSX?(0*Q9q8?@aA#Kq!#n^fW3ugED*?5I Wk9+DCd6j@;01h@T*2Px7yZ;9iK2@Ut diff --git a/services/SimpleUI/ButtonBar.cpp b/services/WebPageUI/ButtonBar.cpp similarity index 69% rename from services/SimpleUI/ButtonBar.cpp rename to services/WebPageUI/ButtonBar.cpp index 6bf795b..925202f 100644 --- a/services/SimpleUI/ButtonBar.cpp +++ b/services/WebPageUI/ButtonBar.cpp @@ -21,17 +21,15 @@ #include "Config.h" #include "ButtonBar.h" -namespace tizen_browser -{ -namespace base_ui -{ +namespace tizen_browser { +namespace base_ui { double ButtonBar::tooltipHideTimeout = 0.; double ButtonBar::tooltipShowDelay = 0.; -Ecore_Timer * ButtonBar::m_tooltipHideTimer = NULL; -Ecore_Timer * ButtonBar::m_tooltipShowTimer = NULL; +Ecore_Timer* ButtonBar::m_tooltipHideTimer = NULL; +Ecore_Timer* ButtonBar::m_tooltipShowTimer = NULL; -ButtonBar::ButtonBar(Evas_Object *parent, const std::string &edjFile, const std::string &groupName) +ButtonBar::ButtonBar(Evas_Object* parent, const std::string& edjFile, const std::string& groupName) { config::DefaultConfig config; config.load(""); @@ -42,7 +40,7 @@ ButtonBar::ButtonBar(Evas_Object *parent, const std::string &edjFile, const std: elm_theme_extension_add(NULL, edjFilePath.c_str()); m_layout = elm_layout_add(parent); Eina_Bool layoutSetResult = elm_layout_file_set(m_layout, edjFilePath.c_str(), groupName.c_str()); - if(!layoutSetResult) + if (!layoutSetResult) throw std::runtime_error("Layout file not found: " + edjFilePath); evas_object_size_hint_weight_set(m_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(m_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -51,22 +49,22 @@ ButtonBar::ButtonBar(Evas_Object *parent, const std::string &edjFile, const std: ButtonBar::~ButtonBar() { - if(ButtonBar::m_tooltipShowTimer) { + if (ButtonBar::m_tooltipShowTimer) { ecore_timer_del(ButtonBar::m_tooltipShowTimer); ButtonBar::m_tooltipShowTimer = NULL; } - if(ButtonBar::m_tooltipHideTimer) { + if (ButtonBar::m_tooltipHideTimer) { ecore_timer_del(ButtonBar::m_tooltipHideTimer); ButtonBar::m_tooltipHideTimer = NULL; } } -void ButtonBar::addAction(sharedAction action, const std::string &buttonName) +void ButtonBar::addAction(sharedAction action, const std::string& buttonName) { ActionButton actionButton; std::shared_ptr eAction = std::make_shared(action); actionButton.eAction = eAction; - Evas_Object *button = elm_button_add(m_layout); + Evas_Object* button = elm_button_add(m_layout); evas_object_event_callback_add(button, EVAS_CALLBACK_MOUSE_IN, __cb_mouse_in, NULL); evas_object_event_callback_add(button, EVAS_CALLBACK_MOUSE_OUT, __cb_mouse_out, NULL); @@ -78,7 +76,7 @@ void ButtonBar::addAction(sharedAction action, const std::string &buttonName) elm_object_disabled_set(button, action->isEnabled() ? EINA_FALSE : EINA_TRUE); evas_object_smart_callback_add(button, "clicked", EAction::callbackFunction, eAction.get()); evas_object_show(button); - if(action->isEnabled()){ + if (action->isEnabled()) { elm_object_tooltip_text_set(button, eAction->getAction()->getToolTip().c_str()); elm_object_tooltip_orient_set(button, ELM_TOOLTIP_ORIENT_BOTTOM); elm_object_tooltip_style_set(button, "browserTip"); @@ -92,12 +90,12 @@ void ButtonBar::addAction(sharedAction action, const std::string &buttonName) registerEnabledChangedCallback(action, buttonName); } -void ButtonBar::registerEnabledChangedCallback(sharedAction action, const std::string &buttonName) +void ButtonBar::registerEnabledChangedCallback(sharedAction action, const std::string& buttonName) { action->enabledChanged.connect(boost::bind(&ButtonBar::onEnabledChanged, this, buttonName, action)); } -void ButtonBar::onEnabledChanged(const std::string &buttonName, sharedAction action) +void ButtonBar::onEnabledChanged(const std::string& buttonName, sharedAction action) { // if action match action assigned to button, refresh button if (m_actionsMap[buttonName] == action) { @@ -106,41 +104,38 @@ void ButtonBar::onEnabledChanged(const std::string &buttonName, sharedAction act } -void ButtonBar::setActionForButton(const std::string &buttonName, sharedAction newAction) +void ButtonBar::setActionForButton(const std::string& buttonName, sharedAction newAction) { - ActionButton actionButton; - Evas_Object *button = m_buttonsMap[buttonName].button; - std::shared_ptr eAction = std::make_shared(newAction); + ActionButton actionButton; + Evas_Object* button = m_buttonsMap[buttonName].button; + std::shared_ptr eAction = std::make_shared(newAction); - elm_object_style_set(button, newAction->getIcon().c_str()); + elm_object_style_set(button, newAction->getIcon().c_str()); - evas_object_smart_callback_del(button, "clicked", EAction::callbackFunction); - evas_object_smart_callback_add(button, "clicked", EAction::callbackFunction, eAction.get()); + evas_object_smart_callback_del(button, "clicked", EAction::callbackFunction); + evas_object_smart_callback_add(button, "clicked", EAction::callbackFunction, eAction.get()); - if(elm_object_focus_get(button)) { - elm_object_signal_emit(button, "elm,action,focus", "elm"); - } + if (elm_object_focus_get(button)) { + elm_object_signal_emit(button, "elm,action,focus", "elm"); + } - m_buttonsMap[buttonName].eAction = eAction; - m_actionsMap[buttonName] = newAction; + m_buttonsMap[buttonName].eAction = eAction; + m_actionsMap[buttonName] = newAction; - refreshButton(buttonName); + refreshButton(buttonName); } -void ButtonBar::refreshButton(const std::string &buttonName) +void ButtonBar::refreshButton(const std::string& buttonName) { - Evas_Object * button = m_buttonsMap[buttonName].button; - if(m_actionsMap[buttonName]->isEnabled()) - { + Evas_Object* button = m_buttonsMap[buttonName].button; + if (m_actionsMap[buttonName]->isEnabled()) { elm_object_disabled_set(button, EINA_FALSE); elm_object_tooltip_text_set(button, m_actionsMap[buttonName]->getToolTip().c_str()); elm_object_tooltip_orient_set(button, ELM_TOOLTIP_ORIENT_BOTTOM); elm_object_tooltip_style_set(button, "browserTip"); - } - else - { + } else { elm_object_disabled_set(button, EINA_TRUE); elm_object_tooltip_unset(button); } @@ -151,14 +146,14 @@ Evas_Object* ButtonBar::getContent() return m_layout; } -Evas_Object* ButtonBar::getButton(const std::string &buttonName) +Evas_Object* ButtonBar::getButton(const std::string& buttonName) { return m_buttonsMap[buttonName].button; } void ButtonBar::clearFocus() { - for ( auto it = m_buttonsMap.begin(); it != m_buttonsMap.end(); it++) { + for (auto it = m_buttonsMap.begin(); it != m_buttonsMap.end(); it++) { elm_object_focus_set((*it).second.button, EINA_FALSE); } } @@ -171,14 +166,14 @@ void ButtonBar::setDisabled(bool disabled) elm_object_disabled_set(getContent(), disabled ? EINA_TRUE : EINA_FALSE); } -void ButtonBar::__cb_focus_in(void *data, Evas_Object *obj, void *event_info) +void ButtonBar::__cb_focus_in(void*, Evas_Object* obj, void*) { //BROWSER_LOGD("[%s:%d] %d", __PRETTY_FUNCTION__, __LINE__, reinterpret_cast(obj)); - if(ButtonBar::m_tooltipHideTimer) { + if (ButtonBar::m_tooltipHideTimer) { ecore_timer_del(ButtonBar::m_tooltipHideTimer); ButtonBar::m_tooltipHideTimer = NULL; } - if(ButtonBar::m_tooltipShowTimer) { + if (ButtonBar::m_tooltipShowTimer) { ecore_timer_del(ButtonBar::m_tooltipShowTimer); ButtonBar::m_tooltipShowTimer = NULL; } @@ -188,36 +183,36 @@ void ButtonBar::__cb_focus_in(void *data, Evas_Object *obj, void *event_info) ButtonBar::m_tooltipShowTimer = ecore_timer_add(elm_config_tooltip_delay_get(), ButtonBar::__cb_tooltip_show_delay, obj); } -void ButtonBar::__cb_focus_out(void *data, Evas_Object *obj, void *event_info) +void ButtonBar::__cb_focus_out(void*, Evas_Object* obj, void*) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if(ButtonBar::m_tooltipHideTimer) { + if (ButtonBar::m_tooltipHideTimer) { ecore_timer_del(ButtonBar::m_tooltipHideTimer); ButtonBar::m_tooltipHideTimer = NULL; } - if(ButtonBar::m_tooltipShowTimer) { + if (ButtonBar::m_tooltipShowTimer) { ecore_timer_del(ButtonBar::m_tooltipShowTimer); ButtonBar::m_tooltipShowTimer = NULL; } - elm_object_tooltip_hide(obj); + elm_object_tooltip_hide(obj); } -void ButtonBar::__cb_mouse_in(void * /*data*/, Evas */*e*/, Evas_Object *obj, void */*event_info*/) +void ButtonBar::__cb_mouse_in(void* /*data*/, Evas* /*e*/, Evas_Object* obj, void* /*event_info*/) { //BROWSER_LOGD("[%s:%d] %d", __PRETTY_FUNCTION__, __LINE__, reinterpret_cast(obj)); elm_object_focus_set(obj, EINA_TRUE); } -void ButtonBar::__cb_mouse_out(void */*data*/, Evas */*e*/, Evas_Object *obj, void */*event_info*/) +void ButtonBar::__cb_mouse_out(void* /*data*/, Evas* /*e*/, Evas_Object* obj, void* /*event_info*/) { elm_object_focus_set(obj, EINA_FALSE); } -Eina_Bool ButtonBar::__cb_tooltip_hide_timeout(void * data) +Eina_Bool ButtonBar::__cb_tooltip_hide_timeout(void* data) { - Evas_Object * button = static_cast (data); + Evas_Object* button = static_cast(data); - if(ButtonBar::m_tooltipHideTimer) { + if (ButtonBar::m_tooltipHideTimer) { ecore_timer_del(ButtonBar::m_tooltipHideTimer); ButtonBar::m_tooltipHideTimer = NULL; } @@ -226,11 +221,11 @@ Eina_Bool ButtonBar::__cb_tooltip_hide_timeout(void * data) return ECORE_CALLBACK_CANCEL; } -Eina_Bool ButtonBar::__cb_tooltip_show_delay(void * data) +Eina_Bool ButtonBar::__cb_tooltip_show_delay(void* data) { - Evas_Object * button = static_cast (data); + Evas_Object* button = static_cast(data); - if(ButtonBar::m_tooltipShowTimer) { + if (ButtonBar::m_tooltipShowTimer) { ecore_timer_del(ButtonBar::m_tooltipShowTimer); ButtonBar::m_tooltipShowTimer = NULL; } diff --git a/services/SimpleUI/ButtonBar.h b/services/WebPageUI/ButtonBar.h similarity index 59% rename from services/SimpleUI/ButtonBar.h rename to services/WebPageUI/ButtonBar.h index 9362647..08c96d1 100644 --- a/services/SimpleUI/ButtonBar.h +++ b/services/WebPageUI/ButtonBar.h @@ -19,39 +19,36 @@ #include #include +#include #include "Action.h" #include "EAction.h" -namespace tizen_browser -{ -namespace base_ui -{ +namespace tizen_browser { +namespace base_ui { -class ButtonBar -{ +class ButtonBar { public: - struct ActionButton - { - Evas_Object *button; + struct ActionButton { + Evas_Object* button; std::shared_ptr eAction; }; - ButtonBar(Evas_Object *parent, const std::string &edjFile, const std::string &groupName); + ButtonBar(Evas_Object* parent, const std::string& edjFile, const std::string& groupName); ~ButtonBar(); - void addAction(sharedAction action, const std::string &buttonName); - void setActionForButton(const std::string &buttonName, sharedAction newAction); + void addAction(sharedAction action, const std::string& buttonName); + void setActionForButton(const std::string& buttonName, sharedAction newAction); /** * @brief register callback, used internally by addAction, * should be called externally for all actions that will be assigned to button * @param action - action that will be used with buttonName * @param buttonName - name of button used in ButtonBar */ - void registerEnabledChangedCallback(sharedAction action, const std::string &buttonName); + void registerEnabledChangedCallback(sharedAction action, const std::string& buttonName); Evas_Object* getContent(); - Evas_Object* getButton(const std::string &buttonName); + Evas_Object* getButton(const std::string& buttonName); void clearFocus(); void setDisabled(bool disabled); @@ -60,21 +57,21 @@ private: std::map m_actionsMap; //map button name to struct ActionButton which contains Evas_Object of button std::map m_buttonsMap; - Evas_Object *m_layout; - void refreshButton(const std::string &buttonName); - void onEnabledChanged(const std::string &buttonName, sharedAction action); - static Ecore_Timer *m_tooltipHideTimer; - static Ecore_Timer *m_tooltipShowTimer; + Evas_Object* m_layout; + void refreshButton(const std::string& buttonName); + void onEnabledChanged(const std::string& buttonName, sharedAction action); + static Ecore_Timer* m_tooltipHideTimer; + static Ecore_Timer* m_tooltipShowTimer; static double tooltipHideTimeout; static double tooltipShowDelay; - static void __cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void __cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void __cb_focus_in(void *data, Evas_Object *obj, void *event_info); - static void __cb_focus_out(void *data, Evas_Object *obj, void *event_info); - static Eina_Bool __cb_tooltip_hide_timeout(void * data); - static Eina_Bool __cb_tooltip_show_delay(void * data); + static void __cb_mouse_in(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void __cb_mouse_out(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void __cb_focus_in(void* data, Evas_Object* obj, void* event_info); + static void __cb_focus_out(void* data, Evas_Object* obj, void* event_info); + static Eina_Bool __cb_tooltip_hide_timeout(void* data); + static Eina_Bool __cb_tooltip_show_delay(void* data); }; diff --git a/services/WebPageUI/CMakeLists.txt b/services/WebPageUI/CMakeLists.txt new file mode 100644 index 0000000..b9ac365 --- /dev/null +++ b/services/WebPageUI/CMakeLists.txt @@ -0,0 +1,68 @@ +project(WebPageUI) + +set(WebPageUI_SRCS + WebPageUI.cpp + ButtonBar.cpp + URIEntry.cpp + ) + +set(WebPageUI_HEADERS + WebPageUI.h + ButtonBar.h + URIEntry.h + ) + +include(Coreheaders) +include(EFLHelpers) +include(EWebKitHelpers) + +include_directories(${CMAKE_BINARY_DIR}) +include_directories(${CMAKE_SOURCE_DIR}) +include_directories(${CMAKE_SOURCE_DIR}/services) +include_directories(${CMAKE_SOURCE_DIR}/services/WebEngineService) +include_directories(${CMAKE_SOURCE_DIR}/services/WebEngineService/src) +include_directories(${CMAKE_SOURCE_DIR}/services/MoreMenuUI) +include_directories(${CMAKE_SOURCE_DIR}/services/MainUI) +include_directories(${CMAKE_SOURCE_DIR}/services/SettingsUI) +include_directories(${CMAKE_SOURCE_DIR}/services/TabUI) + + +include(FindPkgConfig) + +pkg_check_modules(capi_net QUIET capi-network-connection) + +add_library(${PROJECT_NAME} SHARED ${WebPageUI_SRCS}) + +add_dependencies(${PROJECT_NAME} MoreMenuUI) +add_dependencies(${PROJECT_NAME} MainUI) +add_dependencies(${PROJECT_NAME} TabUI) +target_link_libraries(${PROJECT_NAME} MoreMenuUI) +target_link_libraries(${PROJECT_NAME} MainUI) +target_link_libraries(${PROJECT_NAME} TabUI) +target_link_libraries(${PROJECT_NAME} ${EFL_LDFLAGS}) + +IF (${capi_net_FOUND}) + target_link_libraries(${PROJECT_NAME} ${capi_net_LDFLAGS}) +ENDIF (${capi_net_FOUND}) + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION services + ARCHIVE DESTINATION services/static) + +include(EDCCompile) + +#please do not add edc/ directory +set(edcFiles + WebPageUI.edc + ErrorMessage.edc + LeftButtonBar.edc + RightButtonBar.edc + URIEntry.edc + ) + +foreach(edec ${edcFiles}) + string(REPLACE ".edc" ".edj" target_name ${edec}) + EDJ_TARGET(${target_name} + ${CMAKE_CURRENT_SOURCE_DIR}/edc/${edec} + ${CMAKE_CURRENT_BINARY_DIR}) +endforeach(edec) diff --git a/services/SimpleURI/SimpleURI.cpp b/services/WebPageUI/URIEntry.cpp similarity index 59% rename from services/SimpleURI/SimpleURI.cpp rename to services/WebPageUI/URIEntry.cpp index 2c5b9ba..cc3fadb 100644 --- a/services/SimpleURI/SimpleURI.cpp +++ b/services/WebPageUI/URIEntry.cpp @@ -16,17 +16,15 @@ #include #include -#include "SimpleURI.h" -#include "ServiceManager.h" +#include "URIEntry.h" #include "BrowserLogger.h" #include "MenuButton.h" #include #include +#include "BrowserAssert.h" -namespace tizen_browser{ -namespace base_ui{ - -EXPORT_SERVICE(SimpleURI, "org.tizen.browser.simpleuri") +namespace tizen_browser { +namespace base_ui { const std::string keynameSelect = "Select"; const std::string keynameClear = "Clear"; @@ -34,28 +32,37 @@ const std::string keynameKP_Enter = "KP_Enter"; const std::string keynameReturn = "Return"; const std::string keynameEsc = "XF86Back"; -SimpleURI::SimpleURI() - : m_entry(NULL) +URIEntry::URIEntry() + : m_parent(nullptr) + , m_entry(NULL) , m_favicon(0) , m_entry_layout(NULL) , m_entrySelectedAllFirst(false) { std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleURI/URIEntry.edj"); + edjFilePath.append("WebPageUI/URIEntry.edj"); elm_theme_extension_add(NULL, edjFilePath.c_str()); } -SimpleURI::~SimpleURI() +URIEntry::~URIEntry() {} -Evas_Object * SimpleURI::getContent(Evas_Object *main_layout) +void URIEntry::init(Evas_Object* parent) +{ + m_parent = parent; +} + +Evas_Object* URIEntry::getContent() { - if(!m_entry_layout) { - m_entry_layout = elm_layout_add(main_layout); + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + + if (!m_entry_layout) { + m_entry_layout = elm_layout_add(m_parent); std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleURI/URIEntry.edj"); + edjFilePath.append("WebPageUI/URIEntry.edj"); Eina_Bool layoutSetResult = elm_layout_file_set(m_entry_layout, edjFilePath.c_str(), "uri_entry_layout"); - if(!layoutSetResult) + if (!layoutSetResult) throw std::runtime_error("Layout file not found: " + edjFilePath); m_entry = elm_entry_add(m_entry_layout); @@ -71,22 +78,22 @@ Evas_Object * SimpleURI::getContent(Evas_Object *main_layout) elm_object_part_text_set(m_entry, "elm.guide", "Search words, web address"); #endif - evas_object_smart_callback_add(m_entry, "activated", SimpleURI::activated, this); - evas_object_smart_callback_add(m_entry, "aborted", SimpleURI::aborted, this); - evas_object_smart_callback_add(m_entry, "preedit,changed", SimpleURI::preeditChange, this); - evas_object_smart_callback_add(m_entry, "changed,user", SimpleURI::changedUser, this); - evas_object_smart_callback_add(m_entry, "focused", SimpleURI::focused, this); - evas_object_smart_callback_add(m_entry, "unfocused", SimpleURI::unfocused, this); + evas_object_smart_callback_add(m_entry, "activated", URIEntry::activated, this); + evas_object_smart_callback_add(m_entry, "aborted", URIEntry::aborted, this); + evas_object_smart_callback_add(m_entry, "preedit,changed", URIEntry::preeditChange, this); + evas_object_smart_callback_add(m_entry, "changed,user", URIEntry::changedUser, this); + evas_object_smart_callback_add(m_entry, "focused", URIEntry::focused, this); + evas_object_smart_callback_add(m_entry, "unfocused", URIEntry::unfocused, this); evas_object_smart_callback_add(m_entry, "clicked", _uriEntryClicked, this); - evas_object_event_callback_priority_add(m_entry, EVAS_CALLBACK_KEY_DOWN, 2*EVAS_CALLBACK_PRIORITY_BEFORE, SimpleURI::fixed_entry_key_down_handler, this); + evas_object_event_callback_priority_add(m_entry, EVAS_CALLBACK_KEY_DOWN, 2 * EVAS_CALLBACK_PRIORITY_BEFORE, URIEntry::fixed_entry_key_down_handler, this); elm_object_part_content_set(m_entry_layout, "uri_entry_swallow", m_entry); m_entryBtn = elm_button_add(m_entry_layout); evas_object_event_callback_add(m_entryBtn, EVAS_CALLBACK_MOUSE_IN, __cb_mouse_in, this); - evas_object_smart_callback_add(m_entryBtn, "focused", SimpleURI::focusedBtn, this); - evas_object_smart_callback_add(m_entryBtn, "unfocused", SimpleURI::unfocusedBtn, this); + evas_object_smart_callback_add(m_entryBtn, "focused", URIEntry::focusedBtn, this); + evas_object_smart_callback_add(m_entryBtn, "unfocused", URIEntry::unfocusedBtn, this); elm_object_style_set(m_entryBtn, "entry_btn"); evas_object_smart_callback_add(m_entryBtn, "clicked", _uriEntryBtnClicked, this); @@ -96,16 +103,16 @@ Evas_Object * SimpleURI::getContent(Evas_Object *main_layout) return m_entry_layout; } -void SimpleURI::changeUri(const std::string newUri) +void URIEntry::changeUri(const std::string newUri) { BROWSER_LOGD("%s: newUri=%s", __func__, newUri.c_str()); elm_entry_entry_set(m_entry, elm_entry_utf8_to_markup(newUri.c_str())); } -void SimpleURI::setFavIcon(std::shared_ptr< tizen_browser::tools::BrowserImage > favicon) +void URIEntry::setFavIcon(std::shared_ptr< tizen_browser::tools::BrowserImage > favicon) { BROWSER_LOGD("[%s:%d] faviconType:%d ", __PRETTY_FUNCTION__, __LINE__, favicon->imageType); - if(favicon->imageType != tools::BrowserImage::ImageTypeNoImage){ + if (favicon->imageType != tools::BrowserImage::ImageTypeNoImage) { m_favicon = tizen_browser::tools::EflTools::getEvasImage(favicon, m_entry_layout); evas_object_image_fill_set(m_favicon, 0, 0, 36, 36); evas_object_resize(m_favicon, 36, 36); @@ -116,30 +123,30 @@ void SimpleURI::setFavIcon(std::shared_ptr< tizen_browser::tools::BrowserImage > } } -void SimpleURI::setCurrentFavIcon() +void URIEntry::setCurrentFavIcon() { m_currentIconType = IconTypeFav; elm_object_signal_emit(m_entry_layout, "show_favicon", "model"); } -void SimpleURI::setSearchIcon() +void URIEntry::setSearchIcon() { m_currentIconType = IconTypeSearch; elm_object_signal_emit(m_entry_layout, "set_search_icon", "model"); } -void SimpleURI::setDocIcon() +void URIEntry::setDocIcon() { m_currentIconType = IconTypeDoc; elm_object_signal_emit(m_entry_layout, "set_doc_icon", "model"); } -SimpleURI::IconType SimpleURI::getCurrentIconTyep() +URIEntry::IconType URIEntry::getCurrentIconTyep() { return m_currentIconType; } -void SimpleURI::selectWholeText() +void URIEntry::selectWholeText() { m_oryginalEntryText = elm_entry_markup_to_utf8(elm_entry_entry_get(m_entry)); if (!m_entrySelectedAllFirst && !m_oryginalEntryText.empty()) { @@ -149,99 +156,99 @@ void SimpleURI::selectWholeText() } } -void SimpleURI::_uriEntryClicked(void *data, Evas_Object * /* obj */, void * /* event_info */) +void URIEntry::_uriEntryClicked(void* data, Evas_Object* /* obj */, void* /* event_info */) { BROWSER_LOGD("%s", __func__); - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); self->selectWholeText(); } -void SimpleURI::_uriEntryBtnClicked(void *data, Evas_Object */*obj*/, void */*event_info*/) +void URIEntry::_uriEntryBtnClicked(void* data, Evas_Object* /*obj*/, void* /*event_info*/) { - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); elm_object_focus_set(self->m_entry, EINA_TRUE); self->selectWholeText(); elm_object_signal_emit(self->m_entry_layout, "mouse,in", "over"); } -void SimpleURI::activated(void * /* data */, Evas_Object * /* obj */, void */*event_info*/) +void URIEntry::activated(void* /* data */, Evas_Object* /* obj */, void* /*event_info*/) { BROWSER_LOGD("%s", __func__); } -void SimpleURI::aborted(void *data, Evas_Object * /* obj */, void */*event_info*/) +void URIEntry::aborted(void* data, Evas_Object* /* obj */, void* /*event_info*/) { BROWSER_LOGD("%s", __func__); - SimpleURI *self = reinterpret_cast(data); + URIEntry* self = reinterpret_cast(data); self->editingCanceled(); } -void SimpleURI::preeditChange(void * /* data */, Evas_Object * /* obj */, void */*event_info*/) +void URIEntry::preeditChange(void* /* data */, Evas_Object* /* obj */, void* /*event_info*/) { BROWSER_LOGD("%s", __func__); } -void SimpleURI::changedUser(void *data, Evas_Object * /* obj */, void */*event_info*/) +void URIEntry::changedUser(void* data, Evas_Object* /* obj */, void* /*event_info*/) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - SimpleURI *self = reinterpret_cast(data); + URIEntry* self = reinterpret_cast(data); std::string entry(elm_entry_markup_to_utf8(elm_entry_entry_get(self->m_entry))); - if( (entry.find("http://")==0 ) - || (entry.find("https://")==0) - || (entry.find(".") != std::string::npos)){ + if ((entry.find("http://") == 0) + || (entry.find("https://") == 0) + || (entry.find(".") != std::string::npos)) { self->setDocIcon(); - }else {//if(entry.find(" ") != std::string::npos){ + } else {//if(entry.find(" ") != std::string::npos){ self->setSearchIcon(); } } -void SimpleURI::unfocused(void * data, Evas_Object *, void *) +void URIEntry::unfocused(void* data, Evas_Object*, void*) { BROWSER_LOGD("%s", __func__); - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); self->m_entrySelectedAllFirst = false; elm_object_signal_emit(self->m_entry_layout, "mouse,out", "over"); } -void SimpleURI::focused(void* data, Evas_Object* /* obj */, void* /* event_info */) +void URIEntry::focused(void* data, Evas_Object* /* obj */, void* /* event_info */) { - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); elm_object_signal_emit(self->m_entry_layout, "mouse,in", "over"); BROWSER_LOGD("%s", __func__); } -void SimpleURI::fixed_entry_key_down_handler(void* data, Evas* /*e*/, Evas_Object* /*obj*/, void* event_info) +void URIEntry::fixed_entry_key_down_handler(void* data, Evas* /*e*/, Evas_Object* /*obj*/, void* event_info) { BROWSER_LOGD("%s", __func__); - Evas_Event_Key_Down *ev = static_cast(event_info); + Evas_Event_Key_Down* ev = static_cast(event_info); if (!data || !ev || !ev->keyname) return; - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); if (keynameClear == ev->keyname) { elm_entry_entry_set(self->m_entry, ""); return; } - if ( keynameSelect == ev->keyname - || keynameReturn == ev->keyname - || keynameKP_Enter == ev->keyname) { + if (keynameSelect == ev->keyname + || keynameReturn == ev->keyname + || keynameKP_Enter == ev->keyname) { self->editingCompleted(); return; } - if( keynameEsc == ev->keyname){ + if (keynameEsc == ev->keyname) { self->editingCanceled(); elm_object_focus_set(self->m_entryBtn, EINA_TRUE); return; } } -void SimpleURI::editingCompleted() +void URIEntry::editingCompleted() { BROWSER_LOGD("%s", __func__); - char * text = elm_entry_markup_to_utf8(elm_entry_entry_get(m_entry)); + char* text = elm_entry_markup_to_utf8(elm_entry_entry_get(m_entry)); std::string userString(text); free(text); @@ -249,88 +256,88 @@ void SimpleURI::editingCompleted() uriChanged(rewriteURI(userString)); } -std::string SimpleURI::rewriteURI(const std::string& url) +std::string URIEntry::rewriteURI(const std::string& url) { BROWSER_LOGD("%s: %s", __PRETTY_FUNCTION__, url.c_str()); boost::regex urlRegex(R"(^(https?|ftp)://[^\s/$.?#].[^\s]*$)"); - if(!url.empty() && url != "about:blank" && url != "about:home") - if(boost::regex_match(url, urlRegex)) + if (!url.empty() && url != "about:blank" && url != "about:home") { + if (boost::regex_match(url, urlRegex)) return url; - else if(boost::regex_match( std::string("http://") + url, urlRegex) && url.find(".") != std::string::npos) + else if (boost::regex_match(std::string("http://") + url, urlRegex) && url.find(".") != std::string::npos) return std::string("http://") + url; - else - { + else { std::string searchString("http://www.google.com/search?q="); searchString += url; - std::replace( searchString.begin(), searchString.end(), ' ', '+'); + std::replace(searchString.begin(), searchString.end(), ' ', '+'); BROWSER_LOGD("[%s:%d] Search string: %s", __PRETTY_FUNCTION__, __LINE__, searchString.c_str()); return searchString; } + } return url; } -void SimpleURI::editingCanceled() +void URIEntry::editingCanceled() { BROWSER_LOGD("[%s:%d] oryinal URL: %s ", __PRETTY_FUNCTION__, __LINE__, m_oryginalEntryText.c_str()); - if(!m_oryginalEntryText.empty()){ + if (!m_oryginalEntryText.empty()) { elm_entry_entry_set(m_entry, elm_entry_utf8_to_markup(m_oryginalEntryText.c_str())); - m_oryginalEntryText=""; + m_oryginalEntryText = ""; } elm_entry_input_panel_hide(m_entry); setCurrentFavIcon(); } -void SimpleURI::AddAction(sharedAction action) +void URIEntry::AddAction(sharedAction action) { m_actions.push_back(action); } -std::list SimpleURI::actions() const +std::list URIEntry::actions() const { return m_actions; } -void SimpleURI::clearFocus() +void URIEntry::clearFocus() { elm_object_focus_set(m_entry, EINA_FALSE); } -void SimpleURI::setFocus() +void URIEntry::setFocus() { elm_object_focus_set(m_entryBtn, EINA_TRUE); } -bool SimpleURI::hasFocus() const +bool URIEntry::hasFocus() const { - return elm_object_focus_get(m_entry)==EINA_TRUE ? true : false; + return elm_object_focus_get(m_entry) == EINA_TRUE ? true : false; } -void SimpleURI::__cb_mouse_in(void */*data*/, Evas */*e*/, Evas_Object *obj, void */*event_info*/) +void URIEntry::__cb_mouse_in(void* /*data*/, Evas* /*e*/, Evas_Object* obj, void* /*event_info*/) { elm_object_focus_set(obj, EINA_TRUE); } -void SimpleURI::__cb_mouse_out(void */*data*/, Evas */*e*/, Evas_Object *obj, void */*event_info*/) +void URIEntry::__cb_mouse_out(void* /*data*/, Evas* /*e*/, Evas_Object* obj, void* /*event_info*/) { elm_object_focus_set(obj, EINA_FALSE); } -void SimpleURI::focusedBtn(void* data, Evas_Object* /*obj*/, void* /*event_info*/) +void URIEntry::focusedBtn(void* data, Evas_Object* /*obj*/, void* /*event_info*/) { - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); elm_object_signal_emit(self->m_entry_layout, "mouse,in", "over"); } -void SimpleURI::unfocusedBtn(void* data, Evas_Object* /*obj*/, void* /*event_info*/) +void URIEntry::unfocusedBtn(void* data, Evas_Object* /*obj*/, void* /*event_info*/) { - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); elm_object_signal_emit(self->m_entry_layout, "mouse,out", "over"); } -void SimpleURI::setDisabled(bool disabled) +void URIEntry::setDisabled(bool disabled) { if (disabled) { clearFocus(); diff --git a/services/SimpleURI/SimpleURI.h b/services/WebPageUI/URIEntry.h similarity index 54% rename from services/SimpleURI/SimpleURI.h rename to services/WebPageUI/URIEntry.h index e28abed..691701e 100644 --- a/services/SimpleURI/SimpleURI.h +++ b/services/WebPageUI/URIEntry.h @@ -14,43 +14,36 @@ * limitations under the License. */ -#ifndef SIMPLEURI_H -#define SIMPLEURI_H +#ifndef URIENTRY_H +#define URIENTRY_H #include #include #include "memory.h" -#include "AbstractUIComponent.h" -#include "AbstractService.h" -#include "ServiceFactory.h" -#include "service_macros.h" #include "BasicUI/Action.h" #include "BrowserImage.h" #include "EflTools.h" -namespace tizen_browser{ -namespace base_ui{ +namespace tizen_browser { +namespace base_ui { -class BROWSER_EXPORT SimpleURI - : public tizen_browser::core::AbstractService -{ +class URIEntry { public: - enum IconType{ + enum IconType { IconTypeSearch - ,IconTypeDoc - ,IconTypeFav + , IconTypeDoc + , IconTypeFav }; - SimpleURI(); - ~SimpleURI(); - Evas_Object *getContent(Evas_Object *main_layout); - virtual std::string getName(); + URIEntry(); + ~URIEntry(); + void init(Evas_Object* parent); + Evas_Object* getContent(); - Evas_Object * getContent() { return m_entry_layout;}; void changeUri(const std::string); - boost::signals2::signal uriChanged; + boost::signals2::signal uriChanged; void setFavIcon(std::shared_ptr favicon); void setCurrentFavIcon(); @@ -87,14 +80,14 @@ public: void setDisabled(bool disabled); private: - static void activated(void *data, Evas_Object *obj, void *event_info); - static void aborted(void *data, Evas_Object *obj, void *event_info); - static void preeditChange(void *data, Evas_Object *obj, void *event_info); - static void changedUser(void *data, Evas_Object *obj, void *event_info); - static void focused(void *data, Evas_Object *obj, void *event_info); - static void unfocused(void *data, Evas_Object *obj, void *event_info); - static void fixed_entry_key_down_handler(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void _uriEntryBtnClicked(void *data, Evas_Object *obj, void *event_info); + static void activated(void* data, Evas_Object* obj, void* event_info); + static void aborted(void* data, Evas_Object* obj, void* event_info); + static void preeditChange(void* data, Evas_Object* obj, void* event_info); + static void changedUser(void* data, Evas_Object* obj, void* event_info); + static void focused(void* data, Evas_Object* obj, void* event_info); + static void unfocused(void* data, Evas_Object* obj, void* event_info); + static void fixed_entry_key_down_handler(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void _uriEntryBtnClicked(void* data, Evas_Object* obj, void* event_info); void editingCompleted(); void editingCanceled(); @@ -106,20 +99,21 @@ private: */ std::string rewriteURI(const std::string& url); - static void _uriEntryClicked(void *data, Evas_Object *obj, void *event_info); + static void _uriEntryClicked(void* data, Evas_Object* obj, void* event_info); - static void __cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void __cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void focusedBtn(void *data, Evas_Object *obj, void *event_info); - static void unfocusedBtn(void *data, Evas_Object *obj, void *event_info); + static void __cb_mouse_in(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void __cb_mouse_out(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void focusedBtn(void* data, Evas_Object* obj, void* event_info); + static void unfocusedBtn(void* data, Evas_Object* obj, void* event_info); private: + Evas_Object* m_parent; IconType m_currentIconType; std::list m_actions; - Evas_Object *m_entry; - Evas_Object *m_favicon; - Evas_Object *m_entry_layout; - Evas_Object *m_entryBtn; + Evas_Object* m_entry; + Evas_Object* m_favicon; + Evas_Object* m_entry_layout; + Evas_Object* m_entryBtn; bool m_entrySelectedAllFirst; std::string m_oryginalEntryText; bool m_searchTextEntered; @@ -129,4 +123,4 @@ private: } } -#endif // SIMPLEURI_H +#endif // URIENTRY_H diff --git a/services/WebPageUI/WebPageUI.cpp b/services/WebPageUI/WebPageUI.cpp new file mode 100644 index 0000000..0982bf3 --- /dev/null +++ b/services/WebPageUI/WebPageUI.cpp @@ -0,0 +1,307 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#include +#include +#include +#include "WebPageUI.h" +#include "BrowserLogger.h" +#include "ServiceManager.h" +#include "BrowserAssert.h" + +namespace tizen_browser { +namespace base_ui { + +EXPORT_SERVICE(WebPageUI, "org.tizen.browser.webpageui") + +WebPageUI::WebPageUI() + : m_parent(nullptr) + , m_mainLayout(nullptr) + , m_errorLayout(nullptr) + , m_progressBar(nullptr) + , m_URIEntry(new URIEntry()) + , m_homePageActive(false) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); +} + +WebPageUI::~WebPageUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); +} + +void WebPageUI::init(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parent); + m_parent = parent; +} + +Evas_Object* WebPageUI::getContent() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + if (!m_mainLayout) { + createLayout(); + } + return m_mainLayout; +} + +void WebPageUI::showUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); +} + +void WebPageUI::hideUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); +} + +void WebPageUI::loadStarted() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + showProgressBar(); + elm_object_signal_emit(m_URIEntry->getContent(), "shiftright_uribg", "ui"); + elm_object_signal_emit(m_mainLayout, "shiftright_uri", "ui"); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_stopLoading); +} + +void WebPageUI::progressChanged(double progress) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (progress == 1.0) { + hideProgressBar(); + } else { + elm_progressbar_value_set(m_progressBar, progress); + } +} + +void WebPageUI::loadFinished() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + elm_object_signal_emit(m_mainLayout, "hide_progressbar_bg", "ui"); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_reload); +} + +bool WebPageUI::isErrorPageActive() +{ + return elm_object_part_content_get(m_mainLayout, "web_view") == m_errorLayout; +} + +void WebPageUI::setMainContent(Evas_Object* content) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(content); + hideWebView(); + elm_object_part_content_set(m_mainLayout, "web_view", content); + evas_object_show(content); +} + +void WebPageUI::switchViewToErrorPage() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_homePageActive = false; + setMainContent(m_errorLayout); + evas_object_show(m_leftButtonBar->getContent()); + setErrorButtons(); +} + +void WebPageUI::switchViewToWebPage(Evas_Object* content, const std::string uri) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_homePageActive = false; + setMainContent(content); + evas_object_show(m_leftButtonBar->getContent()); + updateURIBar(uri); +} + +void WebPageUI::switchViewToQuickAccess(Evas_Object* content) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_homePageActive = true; + setMainContent(content); + + m_URIEntry->changeUri(""); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_reload); + evas_object_hide(m_leftButtonBar->getContent()); + elm_object_signal_emit(m_mainLayout, "shiftback_uri", "ui"); + elm_object_signal_emit(m_URIEntry->getContent(), "shiftback_uribg", "ui"); + hideProgressBar(); +} + +void WebPageUI::faviconClicked(void* data, Evas_Object*, const char*, const char*) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + WebPageUI* self = reinterpret_cast(data); + if (!self->isHomePageActive() && !self->isErrorPageActive()) { + self->getURIEntry().clearFocus(); + } +} + +void WebPageUI::setTabsNumber(int tabs) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (tabs == 0) { + elm_object_part_text_set(m_rightButtonBar->getContent(), "tabs_number", ""); + } else { + elm_object_part_text_set(m_rightButtonBar->getContent(), "tabs_number", (boost::format("%1%") % tabs).str().c_str()); + } +} + +void WebPageUI::createLayout() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + // create web layout + m_mainLayout = elm_layout_add(m_parent); + evas_object_size_hint_weight_set(m_mainLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_layout_file_set(m_mainLayout, edjePath("WebPageUI/WebPageUI.edj").c_str(), "main_layout"); + + createErrorLayout(); + createActions(); + + // left buttons + m_leftButtonBar = std::unique_ptr(new ButtonBar(m_mainLayout, "WebPageUI/LeftButtonBar.edj", "left_button_bar")); + m_leftButtonBar->addAction(m_back, "prev_button"); + m_leftButtonBar->addAction(m_forward, "next_button"); + m_leftButtonBar->addAction(m_reload, "refresh_stop_button"); + + //register action that will be used later by buttons" + m_leftButtonBar->registerEnabledChangedCallback(m_stopLoading, "refresh_stop_button"); + + // right buttons + m_rightButtonBar = std::unique_ptr(new ButtonBar(m_mainLayout, "WebPageUI/RightButtonBar.edj", "right_button_bar")); + m_rightButtonBar->addAction(m_tab, "tab_button"); + m_rightButtonBar->addAction(m_showMoreMenu, "setting_button"); + + // progress bar + m_progressBar = elm_progressbar_add(m_mainLayout); + elm_object_style_set(m_progressBar, "play_buffer"); + + //URL bar (Evas Object is shipped by URIEntry object) + m_URIEntry->init(m_mainLayout); + elm_object_part_content_set(m_mainLayout, "uri_entry", m_URIEntry->getContent()); + elm_object_part_content_set(m_mainLayout, "uri_bar_buttons_left", m_leftButtonBar->getContent()); + elm_object_part_content_set(m_mainLayout, "uri_bar_buttons_right", m_rightButtonBar->getContent()); + + elm_layout_signal_callback_add(m_URIEntry->getContent(), "slide_websearch", "elm", faviconClicked, this); + + connectActions(); +} + +void WebPageUI::createErrorLayout() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_errorLayout = elm_layout_add(m_mainLayout); + evas_object_size_hint_weight_set(m_errorLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_errorLayout, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_layout_file_set(m_errorLayout, edjePath("WebPageUI/ErrorMessage.edj").c_str(), "error_message"); +} + +void WebPageUI::createActions() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_back = sharedAction(new Action("Back")); + m_back->setToolTip("Previous"); + m_back->setIcon("browser/toolbar_prev"); + + m_forward = sharedAction(new Action("Next")); + m_forward->setToolTip("Next"); + m_forward->setIcon("browser/toolbar_next"); + + m_stopLoading = sharedAction(new Action("Stop")); + m_stopLoading->setToolTip("Stop"); + m_stopLoading->setIcon("browser/toolbar_stop"); + + m_reload = sharedAction(new Action("Reload")); + m_reload->setToolTip("Reload"); + m_reload->setIcon("browser/toolbar_reload"); + m_tab = sharedAction(new Action("Tabs")); + m_tab->setToolTip("Tab page"); + m_tab->setIcon("browser/toolbar_tab"); + + m_showMoreMenu = sharedAction(new Action("Settings")); + m_showMoreMenu->setToolTip("Settings"); + m_showMoreMenu->setIcon("browser/toolbar_setting"); +} + +void WebPageUI::connectActions() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + //left bar + m_back->triggered.connect(boost::bind(&WebPageUI::backPageConnect, this)); + m_forward->triggered.connect(boost::bind(&WebPageUI::forwardPageConnect, this)); + m_stopLoading->triggered.connect(boost::bind(&WebPageUI::stopLoadingPageConnect, this)); + m_reload->triggered.connect(boost::bind(&WebPageUI::reloadPageConnect, this)); + + //right bar + m_tab->triggered.connect(boost::bind(&WebPageUI::showTabUIConnect, this)); + m_showMoreMenu->triggered.connect(boost::bind(&WebPageUI::showMoreMenuConnect, this)); +} + +void WebPageUI::showProgressBar() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + elm_object_signal_emit(m_mainLayout, "show_progressbar_bg", "ui"); + elm_object_part_content_set(m_mainLayout, "progress_bar", m_progressBar); +} + +void WebPageUI::hideProgressBar() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + elm_object_signal_emit(m_mainLayout, "hide_progressbar_bg", "ui"); + elm_progressbar_value_set(m_progressBar, 0.0); + elm_object_part_content_unset(m_mainLayout, "progress_bar"); + evas_object_hide(m_progressBar); +} + +void WebPageUI::hideWebView() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + evas_object_hide(elm_object_part_content_get(m_mainLayout, "web_view")); + elm_object_part_content_unset(m_mainLayout, "web_view"); +} + +void WebPageUI::setErrorButtons() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_reload); + m_stopLoading->setEnabled(false); + m_reload->setEnabled(true); + m_forward->setEnabled(false); + evas_object_hide(m_progressBar); +} + +void WebPageUI::updateURIBar(const std::string& uri) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_URIEntry->changeUri(uri); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_reload); + + m_stopLoading->setEnabled(true); + m_reload->setEnabled(true); + hideProgressBar(); +} + +std::string WebPageUI::edjePath(const std::string& file) +{ + return std::string(EDJE_DIR) + file; +} + + + +} // namespace tizen_browser +} // namespace base_ui \ No newline at end of file diff --git a/services/WebPageUI/WebPageUI.h b/services/WebPageUI/WebPageUI.h new file mode 100644 index 0000000..0e77b6c --- /dev/null +++ b/services/WebPageUI/WebPageUI.h @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +#ifndef WEBPAGEUI_H +#define WEBPAGEUI_H + +#include +#include +#include "AbstractService.h" +#include "AbstractUIComponent.h" +#include "ServiceFactory.h" +#include "service_macros.h" +#include "ButtonBar.h" +#include "URIEntry.h" + +namespace tizen_browser { +namespace base_ui { + +class BROWSER_EXPORT WebPageUI : public tizen_browser::core::AbstractService, public tizen_browser::interfaces::AbstractUIComponent { +public: + WebPageUI(); + virtual ~WebPageUI(); + virtual std::string getName(); + virtual void init(Evas_Object* parent); + virtual Evas_Object* getContent(); + virtual void showUI(); + virtual void hideUI(); + void loadStarted(); + void progressChanged(double progress); + void loadFinished(); + bool isErrorPageActive(); + bool isHomePageActive() { return m_homePageActive; } + void switchViewToErrorPage(); + void switchViewToWebPage(Evas_Object* content, const std::string uri); + void switchViewToQuickAccess(Evas_Object* content); + URIEntry& getURIEntry() const { return *m_URIEntry.get(); } + bool isBackButtonEnabled() { return m_back->isEnabled(); } + void setTabsNumber(int tabs); + void setBackButtonEnabled(bool enabled) { m_back->setEnabled(enabled); } + void setForwardButtonEnabled(bool enabled) { m_forward->setEnabled(enabled); } + void setReloadButtonEnabled(bool enabled) { m_reload->setEnabled(enabled); } + void setStopButtonEnabled(bool enabled) { m_stopLoading->setEnabled(enabled); } + void setMoreMenuButtonEnabled(bool enabled) { m_showMoreMenu->setEnabled(enabled); } + + boost::signals2::signal backPage; + boost::signals2::signal forwardPage; + boost::signals2::signal stopLoadingPage; + boost::signals2::signal reloadPage; + boost::signals2::signal showTabUI; + boost::signals2::signal showMoreMenu; + + static void faviconClicked(void* data, Evas_Object* obj, const char* emission, const char* source); +private: + void createLayout(); + void createErrorLayout(); + void createActions(); + void connectActions(); + void showProgressBar(); + void hideProgressBar(); + void hideWebView(); + void setErrorButtons(); + void setMainContent(Evas_Object* content); + void updateURIBar(const std::string& uri); + std::string edjePath(const std::string& file); + + // wrappers to call singal as a reaction to other signal + void backPageConnect() { backPage(); } + void forwardPageConnect() { forwardPage(); } + void stopLoadingPageConnect() { stopLoadingPage(); } + void reloadPageConnect() { reloadPage(); } + void showTabUIConnect() { showTabUI(); } + void showMoreMenuConnect() { showMoreMenu(); } + + Evas_Object* m_parent; + Evas_Object* m_mainLayout; + Evas_Object* m_errorLayout; + Evas_Object* m_progressBar; + std::unique_ptr m_leftButtonBar; + std::unique_ptr m_rightButtonBar; + std::unique_ptr m_URIEntry; + bool m_homePageActive; + + sharedAction m_back; + sharedAction m_forward; + sharedAction m_stopLoading; + sharedAction m_reload; + sharedAction m_tab; + sharedAction m_showMoreMenu; +}; + + +} // namespace tizen_browser +} // namespace base_ui + +#endif // WEBPAGEUI_H diff --git a/services/WebPageUI/edc/ErrorMessage.edc b/services/WebPageUI/edc/ErrorMessage.edc new file mode 100644 index 0000000..04cf932 --- /dev/null +++ b/services/WebPageUI/edc/ErrorMessage.edc @@ -0,0 +1,179 @@ + +collections { + images { + image: "web_browsing_icon_error.png" COMP; + } + styles { + style { + name: "mssage_style"; + base: "font=Sans font_size=35 color=#d3d3d3 wrap=word align=0.5"; + } + style { + name: "mssage_hint_style"; + base: "font=Sans font_size=24 color=#868686 wrap=word align=0.5"; + } + } + group{ + name: "error_message"; + parts{ + part{ + name: "message_background"; + type: RECT; + mouse_events: 1; + description{ + state: "default" 0.0; + visible: 1; + rel1.relative: 0 0; + rel2.relative: 1 1; + color: 42 50 64 255; + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "error_message_background"; + type:RECT; + description{ + state: "default" 0.0; + visible: 1; + min: 1582 730; + max: 1582 730; + fixed: 1 1; + align: 0.5 0.5; + color: 30 38 50 153; + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "err_ico"; + type: IMAGE; + description{ + state: "default" 0.0; + visible: 1; + min: 140 140; + max:140 140; + fixed: 1 1; + align: 0.5 0; + rel1{ + relative: 0 0; + offset:0 163; + to: "error_message_background"; + } + rel2{ + relative: 1 1; + to: "error_message_background"; + } + image{ + normal: "web_browsing_icon_error.png"; + } + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "error_text"; + type: TEXTBLOCK; + description{ + state: "default" 0.0; + visible: 1; + fixed: 1 1; + min: 1502 96; + max: 1502 96; + //color: 211 211 211 255; + align: 0.5 0; + rel1{ + relative: 0 1; + to_x: "error_message_background"; + to_y: "err_ico"; + } + rel2{ + relative: 1 1; + to: "error_message_background"; + } + text{ + style: "mssage_style"; + text: "Server not found.
Please check the followings:"; + //min: 0 0; + //max: 1 1; + //align: 1 0; + //size: 35; + } + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "error_hint"; + type: TEXTBLOCK; + description{ + state: "default" 0.0; + visible: 1; + fixed: 1 1; + min: 1502 117; + max: 1502 117; + color: 134 134 134 255; + align: 0.5 0; + rel1{ + relative: 0 1; + to_x: "error_message_background"; + to_y: "error_text"; + } + rel2{ + relative: 1 1; + to: "error_message_background"; + } + text{ + max: 0 1; + style: "mssage_hint_style"; + text: "Check for any typing error in URL.
" + "Check your network settings.
" + "Try again later.
" + "Click refresh to reload."; + } + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + }//parts + programs{ + program{ + name: "show_error"; + signal: "show_error"; + source: "model"; + action: STATE_SET "visibleError" 0.0; + target: "message_background"; + target: "error_message_background"; + target: "err_ico"; + target: "error_text"; + target: "error_hint"; + } + program{ + name: "hide_error"; + signal: "hide_error"; + source: "model"; + action: STATE_SET "default" 0.0; + target: "message_background"; + target: "error_message_background"; + target: "err_ico"; + target: "error_text"; + target: "error_hint"; + } + }//programs +} +} diff --git a/services/SimpleUI/edc/ImageButton.edc b/services/WebPageUI/edc/ImageButton.edc similarity index 100% rename from services/SimpleUI/edc/ImageButton.edc rename to services/WebPageUI/edc/ImageButton.edc diff --git a/services/WebPageUI/edc/LeftButtonBar.edc b/services/WebPageUI/edc/LeftButtonBar.edc new file mode 100644 index 0000000..08c714a --- /dev/null +++ b/services/WebPageUI/edc/LeftButtonBar.edc @@ -0,0 +1,103 @@ +#include "ImageButton.edc" +#include "Spacer.edc" + +collections { + + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_prev", 82, 102, "btn_bar_back_nor.png") + + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_next", 82, 102, "btn_bar_forward_nor.png") + + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_reload", 82, 102, "btn_bar_reload_nor.png") + + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_stop", 82, 102, "btn_bar_stop_nor.png") + + group { + name: "left_button_bar"; + + parts { + + part { + name: "prev_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 1 1; + min: 70 70; + max: 70 70; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + ADD_SPACER("spacer_1", "prev_button", 10, 70) + + part { + name: "next_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 1 1; + min: 70 70; + max: 70 70; + rel1 { relative: 1.0 0.0; to: "spacer_1"; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + ADD_SPACER("spacer_2", "next_button", 10, 70) + + part { + name: "refresh_stop_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 1 1; + min: 70 70; + max: 70 70; + rel1 { relative: 1.0 0.0; to: "spacer_2"; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + } +} +} diff --git a/services/WebPageUI/edc/RightButtonBar.edc b/services/WebPageUI/edc/RightButtonBar.edc new file mode 100644 index 0000000..242bd94 --- /dev/null +++ b/services/WebPageUI/edc/RightButtonBar.edc @@ -0,0 +1,86 @@ +#include "ImageButton.edc" +#include "Spacer.edc" +collections { + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_tab", 82, 102, "btn_bar_manager_nor.png") + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_setting", 82, 102, "btn_bar_more_nor.png") + group { + name: "right_button_bar"; + parts { + part { + name: "tab_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + min: 70 70; + max: 70 70; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "tabs_number"; + type: TEXT; + scale: 1; + repeat_events: 1; + description{ + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + min: 70 70; + max: 70 70; + color: 86 86 86 255; + rel1 { relative: 0.0 0.0; to: "tab_button"; offset: 5 13; } + rel2 { relative: 1.0 1.0; to: "tab_button"; } + text { + text: ""; + font: "Tizen:style=Bold"; + size: 19; + align: 0.5 0.5; + } + } + } + ADD_SPACER("spacer_1", "tab_button", 10, 70) + part { + name: "setting_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + min: 70 70; + max: 70 70; + fixed: 1 1; + rel1 { relative: 1.0 0.0; to: "spacer_1"; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } +} +} diff --git a/services/SimpleUI/edc/Spacer.edc b/services/WebPageUI/edc/Spacer.edc similarity index 100% rename from services/SimpleUI/edc/Spacer.edc rename to services/WebPageUI/edc/Spacer.edc diff --git a/services/WebPageUI/edc/URIEntry.edc b/services/WebPageUI/edc/URIEntry.edc new file mode 100644 index 0000000..f3f1da0 --- /dev/null +++ b/services/WebPageUI/edc/URIEntry.edc @@ -0,0 +1,296 @@ +#define URI_INPUTBOX_LENGTH 1720 +#define URI_INPUTBOX_LENGTH_SMALL 1460 +#define URI_INPUTBOX_WIDTH 82 +collections { + group { + name: "elm/entry/selection/browser_entry"; + parts { + part { + name: "bg"; + scale:1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + } + } + } + group { + name: "elm/entry/cursor/browser_entry"; + parts { + part { + name: "bg"; + scale:1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 22 120 237 255; + min: 2 36; + max: 2 36; + visible: 0; + } + description { + state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + action: STATE_SET "focused" 0.0; + target: "bg"; + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + } + } + } + group { + name: "elm/entry/base-single/uri_entry"; + styles { + style { + name: "browser-entry-uri-style-unselected"; + base: "font=Sans:style=SVD_Medium font_size="42" wrap=none color=#969696"; + } + style { + name: "browser-entry-uri-style-selected"; + base: "font=Sans:style=SVD_Medium font_size="42" wrap=none color=#4088d3"; + } + } + data { + item: focus_highlight "off"; + } + parts { + + part { + name: "bg"; + scale:1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + } + + part { + name: "elm.guide"; + scale:1; + type: TEXTBLOCK; + mouse_events: 0; + description { + state: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + align: 0.0 0.0; + text { + style: "browser-entry-uri-style-unselected"; + min: 0 1; + } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "label.text.clip"; + scale:1; + type: RECT; + description { + state: "default" 0.0; + } + } + part { + name: "elm.text"; + scale:1; + multiline: 0; + entry_mode: EDITABLE; + select_mode: DEFAULT; + cursor_mode: BEFORE; + type: TEXTBLOCK; + clip_to: "label.text.clip"; + source: "elm/entry/selection/browser_entry"; + source4: "elm/entry/cursor/browser_entry"; + description { + state: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + align: 0.0 0.0; + text { + style: "browser-entry-uri-style-selected"; + min: 0 1; + } + } + } + } + programs { + program { + name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { + name: "gdisabled"; + signal: "elm,guide,disabled"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.guide"; + } + program { + name: "genabled"; + signal: "elm,guide,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.guide"; + } + } + }//group + + group { + name: "elm/button/base/entry_btn"; + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + color: 0 0 0 0; + visible: 1; + } + } + } + programs { + program { + name: "mouse_click"; + signal: "mouse,clicked,1"; + source: "bg"; + script { + emit("elm,action,click", ""); + } + } + } + } + + + group { + name: "uri_entry_layout"; + parts { + part { + name: "spacer_1"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 0.0 0.0; offset: 15 0; } + align: 0.0 0.0; + fixed: 1 1; + min: 1 102; + max: 1 102; + } + } + part { + name: "uri_entry_swallow"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + color: 255 255 255 255; + align: 0.0 0.0; + min: URI_INPUTBOX_LENGTH URI_INPUTBOX_WIDTH; + max: URI_INPUTBOX_LENGTH URI_INPUTBOX_WIDTH; + fixed: 1 1; + rel1 { relative: 1 0; to: "spacer_1"; } + rel2 { relative: 1 1; to: "spacer_1"; } + } + description { + state: "moveright" 0.0; + inherit: "default" 0.0; + visible: 1; + min: URI_INPUTBOX_LENGTH_SMALL URI_INPUTBOX_WIDTH; + max: URI_INPUTBOX_LENGTH_SMALL URI_INPUTBOX_WIDTH; + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "over"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + rel1 { relative: 0 0; to: "spacer_1"; } + rel2 { relative: 1 1; to: "spacer_1"; } + } + } + part { + name: "uri_entry_btn"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + rel1.to: "uri_entry_swallow"; + rel2.to: "uri_entry_swallow"; + } + } + } + programs { + program { + name: "shiftright_uribarbg"; + signal: "shiftright_uribg"; + source: "ui"; + action: STATE_SET "moveright" 0.0; + target: "uri_entry_swallow"; + } + program { + name: "shiftback_uribarbg"; + signal: "shiftback_uribg"; + source: "ui"; + action: STATE_SET "default" 0.0; + target: "uri_entry_swallow"; + } + program { + name: "mouse_in_entry"; + source: "over"; + signal: "mouse,in"; + action: STATE_SET "focused" 0.0; + target: "spacer_1"; + } + program { + name: "mouse_out_entry"; + source: "over"; + signal: "mouse,out"; + action: STATE_SET "default" 0.0; + target: "spacer_1"; + } + } +} +} diff --git a/services/WebPageUI/edc/WebPageUI.edc b/services/WebPageUI/edc/WebPageUI.edc new file mode 100644 index 0000000..a2de43b --- /dev/null +++ b/services/WebPageUI/edc/WebPageUI.edc @@ -0,0 +1,318 @@ +#define URI_LENGTH 1720 +#define URI_LENGTH_SHORT 1460 +#define URI_WIDTH 82 +#include "Spacer.edc" +#define DEBUG_RECT_OVER(over_part, r, g, b) \ + part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ + \ +scale:1; \ + type : RECT; \ + repeat_events: 1; \ + description { \ + state: "default" 0.0; \ + visible: 1; \ + color: r g b 255; \ + rel1 { to: over_part; relative: 0 0; } \ + rel2 { to: over_part; relative: 1 1; } \ + } \ + } +collections { + group { + name: "main_layout"; + images { + image: "web_shadow.png" COMP; + } + parts { + part { + name: "uri_bar_bg"; + type : RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0 0; + min: 1920 104; + max: 1920 104; + color: 255 255 255 255; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 0.0; } + } + } + ADD_SPACER_OVER("left_spacer", "uri_bar_bg", 7, 104) + part { + name: "uri_bar_buttons_left"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0 0.5; + min: 246 102; + max: 246 102; + fixed: 1 1; + rel1 { relative: 1.0 1.0; to: "left_spacer"; } + rel2 { relative: 0.0 0.0; to: "left_spacer"; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + ADD_SPACER("left_buttons_spacer", "uri_bar_buttons_left", 0.5, 102) + part { + name: "uri_entry"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + min: URI_LENGTH URI_WIDTH; + max: URI_LENGTH URI_WIDTH; + fixed: 1 1; + rel1 { relative: 1.0 0.5; to: "left_spacer"; } + rel2 { relative: 1.0 0.5; to: "left_spacer"; } + } + description { + state: "moveright" 0.0; + inherit: "default" 0.0; + visible: 1; + min: URI_LENGTH_SHORT URI_WIDTH; + max: URI_LENGTH_SHORT URI_WIDTH; + rel1 { relative: 1.0 0.5; to: "left_buttons_spacer"; } + rel2 { relative: 1.0 0.5; to: "left_buttons_spacer"; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + ADD_SPACER("right_buttons_spacer", "uri_entry", 26, 102) + part { + name: "uri_bar_buttons_right"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + min: 164 102; + max: 164 102; + fixed: 1 1; + rel1 { relative: 1.0 0.5; to: "right_buttons_spacer"; } + rel2 { relative: 1.0 0.5; to: "right_buttons_spacer"; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + ADD_SPACER("right_spacer", "uri_bar_buttons_right", 74, 102) + part { + name: "web_view"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 0 0; + rel1 { relative: 0.0 1.0; to: "uri_bar_bg"; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "shadow"; + type: IMAGE; + scale: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 0 0; + min: 1920 14; + max: 1920 14; + image.normal: "web_shadow.png"; + rel1 { relative: 0.0 0.0; to: "web_view"; } + rel2 { relative: 1.0 1.0; } + } + } + part { + name: "progress_bar"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 0 0; + min: 1920 2; + max: 1920 2; + rel1 { + relative: 0.0 0.0; + offset: -12 -10; + to: "web_view"; + } + rel2 { relative: 1.0 1.0; } + } + } + part { + name: "progress_bar_light_bg"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + fixed: 1 1; + min: 0 8; + max: 1920 8; + align: 0 0; + visible: 0; + rel1.to: "web_view"; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + color: 69 143 255 55; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "web_title_bar"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + min: 1920 87; + max: 1920 87; + fixed: 1 1; + align: 0 1; + rel1 { to: "web_view"; relative: 0.0 1.0; } + rel2 { to: "web_view"; relative: 1.0 1.0; } + } + } + + + part { + name: "popup_bg"; + type: RECT; + scale: 1; + mouse_events: 1; + description { + state: "default" 0.0; + visible: 0; + min: 1920 1080; + fixed: 1 1; + color: 100 100 100 128; + rel1 {relative: 0.0 0.0; } + rel2 {relative: 1.0 1.0; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + part { + name: "popup"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 0; + max: 700 800; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "web_view";} + rel2 { relative: 1.0 1.0; to: "web_view";} + fixed: 1 1; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + max: 1920 1080; + } + } + } + } + programs { + program { + name: "shiftright_uribar"; + signal: "shiftright_uri"; + source: "ui"; + action: STATE_SET "moveright" 0.0; + target: "uri_entry"; + } + program { + name: "shiftback_uribar"; + signal: "shiftback_uri"; + source: "ui"; + action: STATE_SET "default" 0.0; + target: "uri_entry"; + } + program { + name: "hide_progress"; + signal: "hide_progressbar_bg"; + source: "ui"; + action: STATE_SET "default" 0.0; + target: "progress_bar_light_bg"; + } + program { + name: "show_progress"; + signal: "show_progressbar_bg"; + source: "ui"; + action: STATE_SET "visible" 0.0; + target: "progress_bar_light_bg"; + } + program { + name: "show_popup"; + signal: "elm,state,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: LINEAR 0.0; + target: "popup"; + target: "popup_bg"; + } + program { + name: "hide_popup"; + signal: "elm,state,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.0; + target: "popup"; + target: "popup_bg"; + } + } +} +} diff --git a/services/SimpleUI/images/btn_bar_back_nor.png b/services/WebPageUI/images/btn_bar_back_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_back_nor.png rename to services/WebPageUI/images/btn_bar_back_nor.png diff --git a/services/SimpleUI/images/btn_bar_forward_nor.png b/services/WebPageUI/images/btn_bar_forward_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_forward_nor.png rename to services/WebPageUI/images/btn_bar_forward_nor.png diff --git a/services/SimpleUI/images/btn_bar_manager_nor.png b/services/WebPageUI/images/btn_bar_manager_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_manager_nor.png rename to services/WebPageUI/images/btn_bar_manager_nor.png diff --git a/services/SimpleUI/images/btn_bar_more_nor.png b/services/WebPageUI/images/btn_bar_more_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_more_nor.png rename to services/WebPageUI/images/btn_bar_more_nor.png diff --git a/services/SimpleUI/images/btn_bar_reload_nor.png b/services/WebPageUI/images/btn_bar_reload_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_reload_nor.png rename to services/WebPageUI/images/btn_bar_reload_nor.png diff --git a/services/SimpleUI/images/btn_bar_stop_nor.png b/services/WebPageUI/images/btn_bar_stop_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_stop_nor.png rename to services/WebPageUI/images/btn_bar_stop_nor.png diff --git a/services/SimpleUI/images/btn_bar_vertical_settings.png b/services/WebPageUI/images/btn_bar_vertical_settings.png similarity index 100% rename from services/SimpleUI/images/btn_bar_vertical_settings.png rename to services/WebPageUI/images/btn_bar_vertical_settings.png diff --git a/services/SimpleUI/images/round_rectangle_4X4.png b/services/WebPageUI/images/round_rectangle_4X4.png similarity index 100% rename from services/SimpleUI/images/round_rectangle_4X4.png rename to services/WebPageUI/images/round_rectangle_4X4.png diff --git a/services/SimpleUI/images/web_browsing_icon_error.png b/services/WebPageUI/images/web_browsing_icon_error.png similarity index 100% rename from services/SimpleUI/images/web_browsing_icon_error.png rename to services/WebPageUI/images/web_browsing_icon_error.png diff --git a/services/SimpleUI/images/web_shadow.png b/services/WebPageUI/images/web_shadow.png similarity index 100% rename from services/SimpleUI/images/web_shadow.png rename to services/WebPageUI/images/web_shadow.png diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index 98689db..7900886 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -10,7 +10,7 @@ include(EWebKitHelpers) include_directories( ${CMAKE_SOURCE_DIR}) include_directories( ${CMAKE_SOURCE_DIR}/services/FavoriteService) include_directories( ${CMAKE_SOURCE_DIR}/services/SimpleUI) -include_directories( ${CMAKE_SOURCE_DIR}/services/SimpleURI) +include_directories( ${CMAKE_SOURCE_DIR}/services/WebPageUI) include_directories( ${CMAKE_SOURCE_DIR}/services/WebKitEngineService) include_directories( ${CMAKE_SOURCE_DIR}/services/StorageService) include_directories( ${CMAKE_SOURCE_DIR}/services/StorageService/Storage/include) @@ -52,7 +52,7 @@ if(TIZEN_BUILD) HistoryService PlatformInputManager SimpleUI - SimpleURI + WebPageUI StorageService WebKitEngineService SessionStorage -- 2.7.4 From 41dcdbaf1a141f9a6b250435612276ba93b7abc4 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Mon, 21 Sep 2015 10:48:29 +0200 Subject: [PATCH 11/16] Closing app when pressing back key on Web Page view. [Issue#] https://bugs.tizen.org/jira/browse/TT-170 [Problem] Browser didn't close when pressing back key. [Cause] There was a check if back button is enabled which prevent from closing app when there was no previous web page. [Solution] Removed unneeded check. [Verify] Run browser, visit some web page, press back button, check if browser will close. Change-Id: I46c29149a1d311679f9b6ef141f6dd71dc335363 Signed-off-by: Maciej Skrzypkowski --- services/SimpleUI/SimpleUI.cpp | 2 +- services/WebPageUI/WebPageUI.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index dee412f..486ec7e 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -562,7 +562,7 @@ void SimpleUI::setwvIMEStatus(bool status) void SimpleUI::onBackPressed() { BROWSER_LOGD("[%s]", __func__); - if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus && !m_webPageUI->isHomePageActive() && m_webPageUI->isBackButtonEnabled()) + if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus && !m_webPageUI->isHomePageActive()) m_webEngine->backButtonClicked(); } diff --git a/services/WebPageUI/WebPageUI.h b/services/WebPageUI/WebPageUI.h index 0e77b6c..e2010c8 100644 --- a/services/WebPageUI/WebPageUI.h +++ b/services/WebPageUI/WebPageUI.h @@ -47,7 +47,6 @@ public: void switchViewToWebPage(Evas_Object* content, const std::string uri); void switchViewToQuickAccess(Evas_Object* content); URIEntry& getURIEntry() const { return *m_URIEntry.get(); } - bool isBackButtonEnabled() { return m_back->isEnabled(); } void setTabsNumber(int tabs); void setBackButtonEnabled(bool enabled) { m_back->setEnabled(enabled); } void setForwardButtonEnabled(bool enabled) { m_forward->setEnabled(enabled); } -- 2.7.4 From 0007889da722acfe517595de0ea46d8caeee32dd Mon Sep 17 00:00:00 2001 From: Albert Malewski Date: Mon, 21 Sep 2015 10:45:52 +0200 Subject: [PATCH 12/16] Changed database path [Issue] N/A [Problem] There was wrong database path which resulted in fails while launching the browser. [Cause] Wrong Tizen platform variable was used. [Solution] Used TZ_USER_APP instead of TZ_USER_DB and added /data directory. [Verify] Launch browser > Observe logs There shouldn't be fails in logs while loading database. Change-Id: Ibb2a6934f25b4974d2c6990cc78b1d97b8137bce --- core/Config/Config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Config/Config.cpp b/core/Config/Config.cpp index 2665734..dae7cd3 100644 --- a/core/Config/Config.cpp +++ b/core/Config/Config.cpp @@ -26,7 +26,7 @@ namespace config void DefaultConfig::load(const std::string &) { const char *db_path = NULL; - db_path = tzplatform_getenv(TZ_USER_DB); + db_path = tzplatform_getenv(TZ_USER_APP); m_data["main_service_name"] = std::string("org.tizen.browser.base_UI"); //m_data["favorite_service_name"] = std::string("org.tizen.browser.service.favorite.browserProvider"); @@ -43,7 +43,7 @@ void DefaultConfig::load(const std::string &) # include "ConfigValues.h" - m_data["resourcedb/dir"] = std::string(db_path)+"/"; + m_data["resourcedb/dir"] = std::string(db_path)+"/"+std::string("org.tizen.browser/data/"); } void DefaultConfig::store(const std::string & ) -- 2.7.4 From 818824efef48ec6c181c678ec9f50f3d18085a48 Mon Sep 17 00:00:00 2001 From: "t.dakowicz" Date: Tue, 15 Sep 2015 16:40:23 +0200 Subject: [PATCH 13/16] TT-163 'Add to bookmarks' UI change [Issue#] https://bugs.tizen.org/jira/browse/TT-163 [Problem] N/A [Cause] 1.02 UI guideline [Solution] Added checkbox that defines current bookmark status and toast popup for info purpose Choosing folder for a new bookmark is still there. Checkbox's style 'favorite' is not available. Change-Id: I78eaf6ca94d6c0ca6605b6822ea5e5c087260d90 --- services/MoreMenuUI/AddBookmarkPopup.cpp | 2 +- services/MoreMenuUI/MoreMenuUI.cpp | 85 +++++++++++++++++---- services/MoreMenuUI/MoreMenuUI.h | 13 +++- services/MoreMenuUI/edc/MoreMenu.edc | 79 +++++++++++++++---- services/MoreMenuUI/images/ic_add_bookmark_new.png | Bin 0 -> 1188 bytes services/SimpleUI/SimpleUI.cpp | 43 ++++++----- services/SimpleUI/SimpleUI.h | 9 ++- 7 files changed, 177 insertions(+), 54 deletions(-) create mode 100644 services/MoreMenuUI/images/ic_add_bookmark_new.png diff --git a/services/MoreMenuUI/AddBookmarkPopup.cpp b/services/MoreMenuUI/AddBookmarkPopup.cpp index a455589..13d4e8f 100644 --- a/services/MoreMenuUI/AddBookmarkPopup.cpp +++ b/services/MoreMenuUI/AddBookmarkPopup.cpp @@ -159,7 +159,7 @@ void AddBookmarkPopup::addBookmarkFolderItems(std::vector favicon) @@ -219,19 +222,75 @@ void MoreMenuUI::setWebTitle(const std::string& title) void MoreMenuUI::setURL(const std::string& url) { BROWSER_LOGD("[%s:%d] %s", __PRETTY_FUNCTION__, __LINE__, url.c_str()); - if(!url.empty()) + char* part_name = "add_to_bookmark_text"; + + if(!url.empty()) { elm_object_part_text_set(m_current_tab_bar, "webpage_url", url.c_str()); - else + + if(true == isBookmark()) { + m_isBookmark = EINA_TRUE; + changeBookmarkStatus(true); + } + else { + m_isBookmark = EINA_FALSE; + changeBookmarkStatus(false); + } + } + else { elm_object_part_text_set(m_current_tab_bar, "webpage_url", ""); + m_isBookmark = EINA_FALSE; + changeBookmarkStatus(false); + } +} + +void MoreMenuUI::changeBookmarkStatus(bool data) +{ + if(data) { + m_isBookmark = EINA_TRUE; + elm_object_part_text_set(m_current_tab_bar, "add_to_bookmark_text", "Remove Bookmark"); + elm_image_file_set(m_bookmarkIcon, m_edjFilePath.c_str(), "ic_add_bookmark.png"); + } + else { + m_isBookmark = EINA_FALSE; + elm_object_part_text_set(m_current_tab_bar, "add_to_bookmark_text", "Add to Bookmark"); + elm_image_file_set(m_bookmarkIcon, m_edjFilePath.c_str(), "ic_add_bookmark_new.png"); + } +} + +void MoreMenuUI::createToastPopup(const char* text) +{ + m_toastPopup = elm_popup_add(m_mm_layout); + elm_object_style_set(m_toastPopup, "toast"); + evas_object_size_hint_weight_set(m_toastPopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_toastPopup, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(m_current_tab_bar, "toast_popup", m_toastPopup); + elm_object_part_text_set(m_current_tab_bar, "toast_text", text); + evas_object_smart_callback_add(m_toastPopup, "timeout", _timeout, this); + elm_popup_timeout_set(m_toastPopup, 3.0); +} + +void MoreMenuUI::_timeout(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + MoreMenuUI *moreMenuUI = static_cast(data); + elm_object_part_text_set(moreMenuUI->m_current_tab_bar, "toast_text", ""); + evas_object_del(moreMenuUI->m_toastPopup); } void MoreMenuUI::_star_clicked(void* data, Evas_Object*, void*) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (data) { + if(data) { MoreMenuUI *moreMenuUI = static_cast(data); - moreMenuUI->addToBookmarkClicked(); - moreMenuUI->AddBookmarkPopupCalled(); + + if (EINA_FALSE == moreMenuUI->m_isBookmark) { + moreMenuUI->addToBookmarkClicked(); + moreMenuUI->AddBookmarkPopupCalled(); + } + else { + moreMenuUI->m_isBookmark = EINA_FALSE; + moreMenuUI->deleteBookmark(); + } } } diff --git a/services/MoreMenuUI/MoreMenuUI.h b/services/MoreMenuUI/MoreMenuUI.h index 4b0fccb..7624b0a 100644 --- a/services/MoreMenuUI/MoreMenuUI.h +++ b/services/MoreMenuUI/MoreMenuUI.h @@ -18,6 +18,7 @@ #define MOREMENUUI_H #include +#include #include #include @@ -82,6 +83,8 @@ public: void setFavIcon(std::shared_ptr favicon); void setWebTitle(const std::string& title); void setURL(const std::string& url); + void changeBookmarkStatus(bool data); + void createToastPopup(const char* text); boost::signals2::signal addToBookmarkClicked; boost::signals2::signal AddBookmarkInput; @@ -95,8 +98,10 @@ public: boost::signals2::signal closeMoreMenuClicked; boost::signals2::signal switchToMobileMode; boost::signals2::signal switchToDesktopMode; + boost::signals2::signal isBookmark; + boost::signals2::signal deleteBookmark; private: - Elm_Gengrid_Item_Class* crateItemClass(); + Elm_Gengrid_Item_Class* createItemClass(); Evas_Object* createMoreMenuLayout(Evas_Object* parent); Evas_Object* createGengrid(Evas_Object* parent); static char* _grid_text_get(void *data, Evas_Object *obj, const char *part); @@ -114,6 +119,7 @@ private: static void _star_clicked(void *data, Evas_Object *obj, void *event_info); static void _close_clicked(void *data, Evas_Object *obj, void *event_info); + static void _timeout(void *data, Evas_Object *obj, void *event_info); static void __cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); static void __cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); @@ -124,14 +130,17 @@ private: std::shared_ptr m_add_bookmark_popup; Evas_Object *m_gengrid; Evas_Object *m_parent; + Evas_Object *m_toastPopup; + Evas_Object *m_icon; + Evas_Object *m_bookmarkIcon; Elm_Gengrid_Item_Class * m_item_class; std::map m_map_menu_views; std::vector > m_map_bookmark_folder_list; std::string m_edjFilePath; std::string m_folderName; bool m_gengridSetup; - Evas_Object *m_icon; bool m_desktopMode; + Eina_Bool m_isBookmark; }; } diff --git a/services/MoreMenuUI/edc/MoreMenu.edc b/services/MoreMenuUI/edc/MoreMenu.edc index fcfd99a..5347fd3 100644 --- a/services/MoreMenuUI/edc/MoreMenu.edc +++ b/services/MoreMenuUI/edc/MoreMenu.edc @@ -43,6 +43,7 @@ RESOURCE_IMAGE_LOSSY("ic_more_share_nor.png") RESOURCE_IMAGE_LOSSY("ic_more_setting_nor.png") RESOURCE_IMAGE_LOSSY("ic_more_exit_nor.png") RESOURCE_IMAGE_LOSSY("ic_add_bookmark.png") +RESOURCE_IMAGE_LOSSY("ic_add_bookmark_new.png") RESOURCE_IMAGE_LOSSY("ic_more_readermode_foc.png") RESOURCE_IMAGE_LOSSY("ic_more_bookmark_foc.png") RESOURCE_IMAGE_LOSSY("ic_more_history_foc.png") @@ -116,6 +117,40 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") } parts { part { + name: "toast_popup"; + scale:1; + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0 0; + fixed: 1 1; + min: 200 120; + max: 338 120; + rel1 { relative: 0.0 0.0; offset: 63 700;} + rel2 { relative: 1.0 1.0;} + } + } + part { + name: "toast_text"; + scale: 1; + type: TEXT; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "toast_popup";} + rel2 { relative: 1.0 1.0; to: "toast_popup";} + color_class: titleTextColor; + text { + font: "Sans"; + size: 28; + align: 0.5 0.5; + } + } + } + part { name: "bg_rect"; scale:1; mouse_events: 1; @@ -371,7 +406,6 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") rel2 { relative: 1.0 1.0; to: "item_background";} color_class: urlTextColor; text { - text: "http:/onet.pl"; font: "font_name"; size: 28; align: 0 0.5; @@ -415,6 +449,21 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") visible: 1; } } + part { + name: "bookmark_ico"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + description { + state: "default" 0.0; + visible: 1; + min: 58 58; + max: 58 58; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "star_bg";} + } + } part{ name: "add_to_bookmark_text"; type: TEXT; @@ -422,14 +471,14 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") description { state: "default" 0.0; visible: 1; fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "star_bg";} + align: 0 0; + rel1 { relative: 0.0 0.0;to: "star_bg"; offset: 56 0;} rel2 { relative: 1.0 1.0;to: "star_bg";} color: 0 0 0 255; text { - text: "Add to bookmark"; font: "Sans"; size: 28; - align: 0.5 0.5; + align: 0 0.5; } } } @@ -591,7 +640,7 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") program { name: "mouse_click"; signal: "mouse,clicked,1"; - source: "over"; + source: "*"; script { emit("elm,action,click", ""); } @@ -671,17 +720,17 @@ group { } } } - part { name: "current_tab_bar"; + part { name: "elm.swallow.grid"; type : SWALLOW; scale: 1; description { state: "default" 0.0; visible: 1; - min: 1920 366; - max: 1920 366; + min: 1920 714; + max: 1920 714; align: 0.0 0.0; fixed: 0 0; - rel1 { relative: 0.0 0.0; to: "current_tab_bar_bg";} + rel1 { relative: 0.0 0.0; to: "gengrid_bg"; offset: 63 0;} rel2 { relative: 1.0 1.0; } } description { @@ -694,18 +743,18 @@ group { inherit: "default" 0.0; visible: 1; } - } - part { name: "elm.swallow.grid"; + } + part { name: "current_tab_bar"; type : SWALLOW; scale: 1; description { state: "default" 0.0; visible: 1; - min: 1920 714; - max: 1920 714; + min: 1920 366; + max: 1920 366; align: 0.0 0.0; fixed: 0 0; - rel1 { relative: 0.0 0.0; to: "gengrid_bg"; offset: 63 0;} + rel1 { relative: 0.0 0.0; to: "current_tab_bar_bg";} rel2 { relative: 1.0 1.0; } } description { @@ -718,7 +767,7 @@ group { inherit: "default" 0.0; visible: 1; } - } + } part { name: "elm.swallow.empty"; type: SWALLOW; description { state: "default" 0.0; diff --git a/services/MoreMenuUI/images/ic_add_bookmark_new.png b/services/MoreMenuUI/images/ic_add_bookmark_new.png new file mode 100644 index 0000000000000000000000000000000000000000..dabcfd7300f34d29cc38057ecd60d22ad55ad2ae GIT binary patch literal 1188 zcmV;V1Y7%wP)^TU8v#f4zOWErkx!N;}Q)Ayc!k2Qri_?d>h)Va4rLQ8Q4XEKA%wO;D5l z1)6NUG@#L8H%;a+U<}YsM{95EGDdk^MImk$9T8$jpu9GO-pCB2Qht*+8n+ev`sNLZo%C zty;GR3Rq6uDI}z_ZdHZ0Za@gi0_~Jx*P%ADZdE3OS_uGe>^c<7p<1(%+^|iog)$s< zfiFBe#0&WFb_Sk2azJag_hekuOz;ef{5-d`t&3PLn{rwUixmI>T2lUQa*4lj{6)R_ z$?{%FZh8~lL!6~SmrdWlemn!izs$|#XyorawvTo*Ouk-KJpN$e)@WztuEvzHu1Xl2 zO!VdED2~}0nZCzSVXgdEsrPSxW?ja+puW$kW&c&`(w5Q1aXxfet&&@MTP?p&{ZRA2 z?9LyzYrxxPjj5Cb?KmI$Fssu?H3SC>4P^1;RI(#-(;+F)U`GW^#FCwPI>j-nA=sZW z>20P!J9WYLiDe=6=o?X1af$o*)~A+apq+YqtKLAbdze5`yH{jLD#O9>`VZ@1(d3^eR07oRu6Z&7!*h#*}PjHju#c_?)Cr zIO>w6IduA&YTu@{lSxlkdx7Op)yqDH#;Uqq>b^%0Ktq;BB+cFQ)jWnu|Z3NTr2FZ<{so_nq2Iaps&PP&n$6rCH>B z&bi*YU%RVeVC1*K+#E$oc~j^M006t2xvn9J6GPG2f${IE*7bk(v=5e9Vad^ z*vq5(qJvrh0C?no1;!>4(>kr9q4Gl5pJ~kN&HVxZTw**nUvI1B%i_a%PaUfCg4swy zYV_~e#5wckX*KGeSwrl3L$roGMp0000isHomePageActive()) - return; + return false; - if(m_favoriteService->bookmarkExists(m_webEngine->getURI())){ + if(m_favoriteService->bookmarkExists(m_webEngine->getURI())) { BROWSER_LOGD("[%s] There is bookmark for this site [%s], set indicator on!", __func__, m_webEngine->getURI().c_str()); - // MERGE_ME - //leftButtonBar->setActionForButton("bookmark_button", m_unbookmark); + return true; } - else{ + else { BROWSER_LOGD("[%s] There is no bookmark for this site [%s], set indicator off", __func__, m_webEngine->getURI().c_str()); - // MERGE_ME - //leftButtonBar->setActionForButton("bookmark_button", m_bookmark); - //addBookmarkEnable(m_favoriteService->countBookmarksAndSubFolders() < m_favoritesLimit); + return false; } } // Consider removing these functions void SimpleUI::onBookmarkAdded(std::shared_ptr bookmarkItem) { + if (m_moreMenuUI) { + m_moreMenuUI->changeBookmarkStatus(true); + m_moreMenuUI->createToastPopup( (std::string(m_webEngine->getTitle()) + std::string(" added to bookmark")).c_str() ); + } +} + +void SimpleUI::onBookmarkRemoved(const std::string& uri) +{ + BROWSER_LOGD("[%s] deleted %s", __func__, uri.c_str()); + if (m_moreMenuUI) { + m_moreMenuUI->changeBookmarkStatus(false); + m_moreMenuUI->createToastPopup( (std::string(m_webEngine->getTitle()) + std::string(" removed from bookmark")).c_str() ); + } } void SimpleUI::onHistoryAdded(std::shared_ptr historyItem) @@ -527,17 +537,7 @@ void SimpleUI::onBookmarkClicked(std::shared_ptr bookmarkItem) -{ - BROWSER_LOGD("[%s] delete %s", __func__, bookmarkItem->getAddress().c_str()); - m_favoriteService->deleteBookmark(bookmarkItem->getAddress()); -} - // Consider removing these functions -void SimpleUI::onBookmarkRemoved(const std::string& uri) -{ - BROWSER_LOGD("[%s] deleted %s", __func__, uri.c_str()); -} void SimpleUI::onHistoryRemoved(const std::string& uri) { @@ -667,7 +667,6 @@ void SimpleUI::webEngineURLChanged(const std::string url) { BROWSER_LOGD("webEngineURLChanged:%s", url.c_str()); m_webPageUI->getURIEntry().clearFocus(); - bookmarkCheck(); } void SimpleUI::showTabUI() @@ -876,6 +875,8 @@ void SimpleUI::showMoreMenu() m_moreMenuUI->addToBookmarkClicked.connect(boost::bind(&SimpleUI::addBookmarkFolders, this)); m_moreMenuUI->AddBookmarkInput.connect(boost::bind(&SimpleUI::addToBookmarks, this,_1)); m_moreMenuUI->BookmarkFolderCreated.connect(boost::bind(&SimpleUI::newFolderMoreMenu, this,_1,_2)); + m_moreMenuUI->isBookmark.connect(boost::bind(&SimpleUI::checkBookmark, this)); + m_moreMenuUI->deleteBookmark.connect(boost::bind(&SimpleUI::deleteBookmark, this)); m_moreMenuUI->show(m_window.get(), desktopMode); m_moreMenuUI->showCurrentTab(); @@ -901,6 +902,8 @@ void SimpleUI::closeMoreMenu(const std::string& str) m_moreMenuUI->addToBookmarkClicked.disconnect(boost::bind(&SimpleUI::addBookmarkFolders, this)); m_moreMenuUI->AddBookmarkInput.disconnect(boost::bind(&SimpleUI::addToBookmarks, this,_1)); m_moreMenuUI->BookmarkFolderCreated.disconnect(boost::bind(&SimpleUI::newFolderMoreMenu, this,_1,_2)); + m_moreMenuUI->isBookmark.disconnect(boost::bind(&SimpleUI::checkBookmark, this)); + m_moreMenuUI->deleteBookmark.disconnect(boost::bind(&SimpleUI::deleteBookmark, this)); m_moreMenuUI.reset(); } diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index 5a9ff1f..b2600c3 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -119,7 +119,6 @@ private: void tabCreated(); void tabClosed(const tizen_browser::basic_webengine::TabId& id); - void bookmarkCheck(); std::vector > getBookmarks(int folder_id = -1); std::vector > getBookmarkFolders(int folder_id); std::shared_ptr getHistory(); @@ -129,7 +128,6 @@ private: void onBookmarkAdded(std::shared_ptr bookmarkItem); void onBookmarkClicked(std::shared_ptr bookmarkItem); - void onBookmarkDeleteClicked(std::shared_ptr bookmarkItem); void onBookmarkRemoved(const std::string& uri); void onHistoryAdded(std::shared_ptr historyItem); @@ -188,7 +186,12 @@ private: void webEngineURLChanged(const std::string url); void onmostHistoryvisitedClicked(); void onBookmarkvisitedClicked(); - /** + /** + * @brief Check if the current page exists as a bookmark. + * + */ + bool checkBookmark(); + /** * @brief Adds current page to bookmarks. * */ -- 2.7.4 From a061fed006c8a0122e7838751ea40c9b2b5b8d53 Mon Sep 17 00:00:00 2001 From: "t.dakowicz" Date: Mon, 21 Sep 2015 13:47:00 +0200 Subject: [PATCH 14/16] TT-171 Removing bookmark folders from browser [Issue#] https://bugs.tizen.org/jira/browse/TT-171 [Problem] N/A [Cause] Newest guide doesn't contain folders anymore [Solution] Removed bookmark folders [Verify] Check if bookmarks are added/removed/displayed properly Change-Id: Ife3cd8859ef4e1ceb1c4fae0412f40314e89fe02 --- core/AbstractInterfaces/AbstractFavoriteService.h | 25 +- services/BookmarkManagerUI/AddNewFolderPopup.cpp | 145 ---- services/BookmarkManagerUI/AddNewFolderPopup.h | 63 -- services/BookmarkManagerUI/BookmarkManagerUI.cpp | 197 +---- services/BookmarkManagerUI/BookmarkManagerUI.h | 25 +- services/BookmarkManagerUI/CMakeLists.txt | 3 - .../BookmarkManagerUI/edc/AddNewFolderPopup.edc | 198 ----- .../BookmarkManagerUI/edc/BookmarkManagerUI.edc | 156 +--- .../BookmarkManagerUI/images/btn_bar_new_foc.png | Bin 2963 -> 0 bytes .../BookmarkManagerUI/images/btn_bar_new_nor.png | Bin 2977 -> 0 bytes .../images/ic_thumbnail_folder.png | Bin 1522 -> 0 bytes .../images/ic_thumbnail_folder_all.png | Bin 1378 -> 0 bytes .../images/ic_thumbnail_folder_mark.png | Bin 1831 -> 0 bytes services/BookmarkService/BookmarkService.cpp | 966 +-------------------- services/BookmarkService/BookmarkService.h | 56 +- services/MoreMenuUI/AddBookmarkPopup.cpp | 348 -------- services/MoreMenuUI/AddBookmarkPopup.h | 70 -- services/MoreMenuUI/CMakeLists.txt | 6 - services/MoreMenuUI/MoreMenuUI.cpp | 63 +- services/MoreMenuUI/MoreMenuUI.h | 19 +- services/MoreMenuUI/NewFolderPopup.cpp | 179 ---- services/MoreMenuUI/NewFolderPopup.h | 55 -- services/MoreMenuUI/edc/AddBookmarkPopup.edc | 370 -------- services/MoreMenuUI/edc/NewFolderPopup.edc | 463 ---------- services/SimpleUI/SimpleUI.cpp | 80 +- services/SimpleUI/SimpleUI.h | 10 - 26 files changed, 31 insertions(+), 3466 deletions(-) delete mode 100644 services/BookmarkManagerUI/AddNewFolderPopup.cpp delete mode 100644 services/BookmarkManagerUI/AddNewFolderPopup.h delete mode 100644 services/BookmarkManagerUI/edc/AddNewFolderPopup.edc delete mode 100644 services/BookmarkManagerUI/images/btn_bar_new_foc.png delete mode 100644 services/BookmarkManagerUI/images/btn_bar_new_nor.png delete mode 100644 services/BookmarkManagerUI/images/ic_thumbnail_folder.png delete mode 100644 services/BookmarkManagerUI/images/ic_thumbnail_folder_all.png delete mode 100644 services/BookmarkManagerUI/images/ic_thumbnail_folder_mark.png delete mode 100644 services/MoreMenuUI/AddBookmarkPopup.cpp delete mode 100644 services/MoreMenuUI/AddBookmarkPopup.h delete mode 100644 services/MoreMenuUI/NewFolderPopup.cpp delete mode 100644 services/MoreMenuUI/NewFolderPopup.h delete mode 100644 services/MoreMenuUI/edc/AddBookmarkPopup.edc delete mode 100644 services/MoreMenuUI/edc/NewFolderPopup.edc diff --git a/core/AbstractInterfaces/AbstractFavoriteService.h b/core/AbstractInterfaces/AbstractFavoriteService.h index d7a9d75..e2b97c3 100644 --- a/core/AbstractInterfaces/AbstractFavoriteService.h +++ b/core/AbstractInterfaces/AbstractFavoriteService.h @@ -59,22 +59,10 @@ public: std::shared_ptr favicon = std::shared_ptr(), unsigned int dirId = 0) = 0; /** - * @brief Creates a new folder with name "title" in a folder with id and order - * @return folder_id of created folder + * @brief Counts bookmarks + * @return Number of bookmarks */ - virtual int save_folder(const char *title, int *saved_bookmark_id, int by_operator = 0) = 0; - - /** - * @brief get folder id of a folder with name "title" in folder with id, parent_id - * @return true if found, false otherwise - */ - virtual bool get_folder_id(const char *title, int parent_id, int *folder_id) = 0 ; - - /** - * @brief Count bookmarks and subfolders - * @return Number of bookmarks and subfolders - */ - virtual int countBookmarksAndSubFolders() = 0; + virtual int countBookmarks() = 0; /** \todo Need to change this callback function for finding stored bookmark, check getBookmarkId function * @brief Check if bookmark exists @@ -92,13 +80,6 @@ public: virtual std::vector > getBookmarks(int folder_id = -1)= 0; /** - * @brief Get bookmark folders from platform service and store it in private m_bookmarkFoldersList - * - * @return list of bookmark folders - */ - virtual std::vector > getBookmarkFolders(int folder_id) = 0; - - /** * @brief Delete all bookmarks * * @return true if success, false on error diff --git a/services/BookmarkManagerUI/AddNewFolderPopup.cpp b/services/BookmarkManagerUI/AddNewFolderPopup.cpp deleted file mode 100644 index 941e16a..0000000 --- a/services/BookmarkManagerUI/AddNewFolderPopup.cpp +++ /dev/null @@ -1,145 +0,0 @@ - - -#include -#include -#include - -#include "Tools/EflTools.h" -#include "BrowserLogger.h" - -#include "AddNewFolderPopup.h" -#include "BrowserLogger.h" -#include "ServiceManager.h" -#include "AbstractMainWindow.h" - - -namespace tizen_browser{ -namespace base_ui{ - -AddNewFolderPopup::AddNewFolderPopup(Evas_Object* main_layout) : - m_popup(nullptr), - m_cancel_button(nullptr), - m_editfield_entry(nullptr), - m_ok_button(nullptr), - m_mainLayout(main_layout) -{ -} - -AddNewFolderPopup::AddNewFolderPopup(Evas_Object *main_layout - , Evas_Object *content - , const std::string& message - , const std::string& title - , const std::string& okButtonText - , const std::string& cancelButtonText) : - m_popup(nullptr), - m_cancel_button(nullptr), - m_editfield_entry(nullptr), - m_ok_button(nullptr), - m_content(content), - m_message(message), - m_title(title), - m_okButtonText(okButtonText), - m_cancelButtonText(cancelButtonText), - m_mainLayout(main_layout) -{ - -} - -void AddNewFolderPopup::setTitle(const std::string& title) -{ - m_title = title; -} - -void AddNewFolderPopup::setMessage(const std::string& message) -{ - m_message = message; -} - -void AddNewFolderPopup::setContent(Evas_Object* content) -{ - m_content = content; -} - -void AddNewFolderPopup::setOkButtonText(const std::string& okButtonText) -{ - m_okButtonText = okButtonText; -} - -void AddNewFolderPopup::setCancelButtonText(const std::string& cancelButtonText) -{ - m_cancelButtonText = cancelButtonText; -} - -void AddNewFolderPopup::show() -{ - std::string edjePath = std::string(EDJE_DIR); - edjePath.append("BookmarkManagerUI/AddNewFolderPopup.edj"); - elm_theme_extension_add(0, edjePath.c_str()); - m_popup = elm_popup_add(m_mainLayout); - evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - /* for margins */ - Evas_Object *layout = elm_layout_add(m_popup); - elm_layout_file_set(layout, edjePath.c_str() , "popup_input_text"); - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_content_set(m_popup, layout); - elm_object_part_text_set(m_popup, "title,text", m_title.c_str()); - - m_editfield_entry = elm_entry_add(layout); - elm_object_style_set(m_editfield_entry, "uri_entry_popup"); - evas_object_size_hint_weight_set(m_editfield_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_editfield_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_entry_editable_set(m_editfield_entry, EINA_TRUE); - elm_entry_cnp_mode_set(m_editfield_entry, ELM_CNP_MODE_PLAINTEXT); - elm_entry_scrollable_set(m_editfield_entry, EINA_TRUE); - elm_entry_autocapital_type_set(m_editfield_entry, ELM_AUTOCAPITAL_TYPE_NONE); - elm_entry_prediction_allow_set(m_editfield_entry, EINA_FALSE); - elm_entry_single_line_set(m_editfield_entry, EINA_TRUE); - - elm_entry_input_panel_layout_set(m_editfield_entry, ELM_INPUT_PANEL_LAYOUT_URL); - elm_entry_input_panel_return_key_type_set(m_editfield_entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); - elm_object_part_content_set(layout, "elm.swallow.content" , m_editfield_entry); - elm_entry_cursor_end_set(m_editfield_entry); - - m_cancel_button = elm_button_add(m_popup); - elm_object_style_set(m_cancel_button, "popup"); - elm_object_part_content_set(m_popup, "button1",m_cancel_button); - elm_object_part_text_set(m_cancel_button, "elm.text", m_cancelButtonText.c_str()); - evas_object_smart_callback_add(m_cancel_button, "clicked", popup_cancel_cb, this); - - m_ok_button = elm_button_add(m_popup); - elm_object_style_set(m_ok_button, "popup"); - elm_object_part_content_set(m_popup, "button2", m_ok_button); - elm_object_part_text_set(m_ok_button, "elm.text", m_okButtonText.c_str()); - evas_object_smart_callback_add(m_ok_button, "clicked", popup_ok_cb, this); - - evas_object_show(m_popup); -} - -void AddNewFolderPopup::hide() -{ - evas_object_hide(m_popup); - elm_object_signal_emit(m_mainLayout, "elm,state,hide", "elm"); -} - -void AddNewFolderPopup::popup_ok_cb(void *data, Evas_Object *, void*) -{ - BROWSER_LOGD("[%s],", __func__); - if (data != nullptr) - { - AddNewFolderPopup *ownPopup = static_cast(data); - ownPopup->on_ok(ownPopup->m_editfield_entry); - } -} -void AddNewFolderPopup::popup_cancel_cb(void *data, Evas_Object *, void*) -{ - BROWSER_LOGD("[%s],", __func__); - if (data != nullptr) - { - AddNewFolderPopup *ownPopup = static_cast(data); - ownPopup->on_cancel(ownPopup->m_editfield_entry); - } -} - -} -} diff --git a/services/BookmarkManagerUI/AddNewFolderPopup.h b/services/BookmarkManagerUI/AddNewFolderPopup.h deleted file mode 100644 index 5923be4..0000000 --- a/services/BookmarkManagerUI/AddNewFolderPopup.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef ADDNEWFOLDERPOPUP_H -#define ADDNEWFOLDERPOPUP_H - -#include -#include - -#include "AbstractUIComponent.h" -#include "AbstractService.h" -#include "ServiceFactory.h" -#include "service_macros.h" -#include "BookmarkItem.h" - - - -namespace tizen_browser{ -namespace base_ui{ - -class AddNewFolderPopup{ - -public: - AddNewFolderPopup(Evas_Object *main_layout); - AddNewFolderPopup(Evas_Object *main_layout - , Evas_Object *content - , const std::string& message - , const std::string& title - , const std::string& okButtonText - , const std::string& cancelButtonText); - - /* - * These setters should be called before showing popup. - */ - void setContent(Evas_Object *content); - void setMessage(const std::string &message); - void setTitle(const std::string &title); - void setOkButtonText(const std::string &okButtonText); - void setCancelButtonText(const std::string &cancelButtonText); - - void show(); - void hide(); - boost::signals2::signal on_ok; - boost::signals2::signal on_cancel; - - -private: - static void popup_ok_cb(void *data, Evas_Object *, void*); - static void popup_cancel_cb(void *data, Evas_Object *, void*); - Evas_Object *m_popup; - Evas_Object *m_cancel_button; - Evas_Object *m_editfield_entry; - Evas_Object *m_ok_button; - Evas_Object *m_content; - std::string m_message; - std::string m_title; - std::string m_okButtonText; - std::string m_cancelButtonText; - -protected: - Evas_Object *m_mainLayout; -}; - -} -} -#endif diff --git a/services/BookmarkManagerUI/BookmarkManagerUI.cpp b/services/BookmarkManagerUI/BookmarkManagerUI.cpp index 5d08bf0..ae5e9fa 100644 --- a/services/BookmarkManagerUI/BookmarkManagerUI.cpp +++ b/services/BookmarkManagerUI/BookmarkManagerUI.cpp @@ -19,7 +19,6 @@ #include #include -#include "AddNewFolderPopup.h" #include "BookmarkManagerUI.h" #include "ServiceManager.h" #include "BrowserLogger.h" @@ -42,16 +41,14 @@ typedef struct { std::shared_ptr item; std::shared_ptr bookmarkManagerUI; -} BookmarkItemData, BookmarkFolderItemData; +} BookmarkItemData; BookmarkManagerUI::BookmarkManagerUI() : m_genList(nullptr) - , popup_content(nullptr) , b_mm_layout(nullptr) , m_itemClass(nullptr) , m_gengrid(nullptr) , m_parent(nullptr) - , m_folder_item_class(nullptr) , m_bookmark_item_class(nullptr) , m_gengridSetup(false) { @@ -64,8 +61,6 @@ BookmarkManagerUI::BookmarkManagerUI() BookmarkManagerUI::~BookmarkManagerUI() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if(m_folder_item_class) - elm_gengrid_item_class_free(m_folder_item_class); if(m_bookmark_item_class) elm_gengrid_item_class_free(m_bookmark_item_class); } @@ -73,13 +68,6 @@ BookmarkManagerUI::~BookmarkManagerUI() void BookmarkManagerUI::createGengridItemClasses() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_folder_item_class = elm_gengrid_item_class_new(); - m_folder_item_class->item_style = "grid_bm_item"; - m_folder_item_class->func.text_get = _grid_folder_text_get; - m_folder_item_class->func.content_get = _grid_folder_content_get; - m_folder_item_class->func.state_get = nullptr; - m_folder_item_class->func.del = nullptr; - m_bookmark_item_class = elm_gengrid_item_class_new(); m_bookmark_item_class->item_style = "grid_ds_item"; m_bookmark_item_class->func.text_get = _grid_bookmark_text_get; @@ -130,7 +118,6 @@ Evas_Object* BookmarkManagerUI::getContent() Evas_Object* BookmarkManagerUI::createBookmarksLayout(Evas_Object* parent) { - m_folder.clear(); elm_theme_extension_add(nullptr, edjFilePath.c_str()); b_mm_layout = elm_layout_add(parent); elm_layout_file_set(b_mm_layout, edjFilePath.c_str(), "bookmarkmanager-layout"); @@ -208,19 +195,11 @@ Evas_Object* BookmarkManagerUI::listItemContentGet(void* data, Evas_Object* obj, BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); if ((data != nullptr) && (obj != nullptr) && (part != nullptr)) { - const char *part_name1 = "new_folder_click"; - const char *part_name2 = "close_click"; - static const int part_name1_len = strlen(part_name1); - static const int part_name2_len = strlen(part_name2); + const char *part_name = "close_click"; + static const int part_name_len = strlen(part_name); ItemData * id = static_cast(data); - if(!strncmp(part_name1, part, part_name1_len)) - { - Evas_Object *new_folder_click = elm_button_add(obj); - elm_object_style_set(new_folder_click, "hidden_button"); - evas_object_smart_callback_add(new_folder_click, "clicked", BookmarkManagerUI::new_folder_clicked_cb, id); - return new_folder_click; - } - if(!strncmp(part_name2, part, part_name2_len)) + + if(!strncmp(part_name, part, part_name_len)) { Evas_Object *close_click = elm_button_add(obj); elm_object_style_set(close_click, "hidden_button"); @@ -247,64 +226,9 @@ void BookmarkManagerUI::close_clicked_cb(void* data, Evas_Object*, void*) } } -void BookmarkManagerUI::new_folder_clicked_cb(void* data, Evas_Object*, void*) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (data != nullptr) - { - ItemData * id = static_cast(data); - id->m_bookmarkManager->newFolderPopup(); - } -} - -void BookmarkManagerUI::newFolderPopup() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_popup.reset(new AddNewFolderPopup(m_parent, nullptr,"Add New Folder?","New Folder","Ok","Cancel")); - m_popup->on_ok.disconnect_all_slots(); - m_popup->on_ok.connect(boost::bind(&BookmarkManagerUI::newFolderCreate, this, _1)); - m_popup->on_cancel.disconnect_all_slots(); - m_popup->on_cancel.connect(boost::bind(&BookmarkManagerUI::CancelClicked, this, _1)); - m_popup->show(); -} - -void BookmarkManagerUI::newFolderCreate(Evas_Object * popup_content) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (popup_content != nullptr) - { - m_folderName = elm_entry_entry_get(popup_content); - saveFolderClicked(m_folderName.c_str(), 0); - m_popup->hide(); - } -} - -void BookmarkManagerUI::CancelClicked(Evas_Object * popup) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (popup != nullptr) - { - m_popup->hide(); - } -} - char* BookmarkManagerUI::listItemTextGet(void* data, Evas_Object*, const char* part) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if ((data != nullptr) && (part != nullptr)) - { - const char *part_name = "folder_text"; - static const int part_name_len = strlen(part_name); - ItemData * id = static_cast(data); - if(!strncmp(part_name, part, part_name_len)) - { - if(!id->m_bookmarkManager->m_folder.empty()) - { - std::string s = std::string("Bookmark > ") + id->m_bookmarkManager->m_folder; - return strdup(s.c_str()); - } - } - } return strdup("Bookmark"); } @@ -347,30 +271,6 @@ Evas_Object* BookmarkManagerUI::createNoHistoryLabel() return label; } -void BookmarkManagerUI::addBookmarkFolderItem(std::shared_ptr hi) -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - BookmarkFolderItemData *itemData = new BookmarkFolderItemData(); - itemData->item = hi; - itemData->bookmarkManagerUI.reset(this); - Elm_Object_Item* BookmarkFolderView = elm_gengrid_item_append(m_gengrid, m_folder_item_class, itemData, _folderItemClicked, itemData); - m_map_bookmark_folder_views.insert(std::pair(hi->getAddress(),BookmarkFolderView)); - elm_gengrid_item_selected_set(BookmarkFolderView, EINA_FALSE); - setEmptyGengrid(false); -} - -void BookmarkManagerUI::addBookmarkFolderItems(std::vector > items) -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - for (auto it = items.begin(); it != items.end(); ++it) - { - addBookmarkFolderItem(*it); - } - elm_object_part_content_set(b_mm_layout, "elm.swallow.grid",getGenGrid()); - evas_object_show(getGenGrid()); -} - - void BookmarkManagerUI::addBookmarkItem(std::shared_ptr hi) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); @@ -378,7 +278,7 @@ void BookmarkManagerUI::addBookmarkItem(std::shared_ptritem = hi; itemData->bookmarkManagerUI.reset(this); Elm_Object_Item* BookmarkView = elm_gengrid_item_append(m_gengrid, m_bookmark_item_class, itemData, _bookmarkItemClicked, itemData); - m_map_bookmark_folder_views.insert(std::pair(hi->getAddress(),BookmarkView)); + m_map_bookmark.insert(std::pair(hi->getAddress(),BookmarkView)); elm_gengrid_item_selected_set(BookmarkView, EINA_FALSE); setEmptyGengrid(false); } @@ -394,61 +294,6 @@ void BookmarkManagerUI::addBookmarkItems(std::vector(data); - const char *part_name1 = "page_title"; - const char *part_name2 = "page_url"; - static const int part_name1_len = strlen(part_name1); - static const int part_name2_len = strlen(part_name2); - if (!strncmp(part_name1, part, part_name1_len) && !itemData->item->getTittle().empty()) - { - return strdup(itemData->item->getTittle().c_str()); - } - if (!strncmp(part_name2, part, part_name2_len) && !itemData->item->getAddress().empty()) - { - return strdup(itemData->item->getAddress().c_str()); - } - } - return strdup(""); -} - -Evas_Object * BookmarkManagerUI::_grid_folder_content_get(void *data, Evas_Object *obj, const char *part) -{ - if ((data != nullptr) && (obj != nullptr) && (part != nullptr)) - { - BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part); - BookmarkFolderItemData *itemData = static_cast(data); - const char *part_name1 = "elm.thumbnail"; - const char *part_name2 = "elm.thumbButton"; - static const int part_name1_len = strlen(part_name1); - static const int part_name2_len = strlen(part_name2); - if (!strncmp(part_name1, part, part_name1_len)) - { - Evas_Object * thumb = nullptr; - std::shared_ptr image = itemData->item->getThumbnail(); - if (image) - { - thumb = tools::EflTools::getEvasImage(image, itemData->bookmarkManagerUI->m_parent); - } - return thumb; - } - else if (!strncmp(part_name2, part, part_name2_len)) - { - Evas_Object *thumbButton = elm_button_add(obj); - if (thumbButton != nullptr) - { - elm_object_style_set(thumbButton, "thumbButton"); - } - return thumbButton; - } - } - return nullptr; -} - char* BookmarkManagerUI::_grid_bookmark_text_get(void *data, Evas_Object *, const char *part) { if ((data != nullptr) && (part != nullptr)) @@ -511,43 +356,19 @@ void BookmarkManagerUI::_bookmarkItemClicked(void * data, Evas_Object *, void * BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); if (data != nullptr) { - BookmarkFolderItemData * itemData = static_cast(data); + BookmarkItemData * itemData = static_cast(data); BROWSER_LOGD("Bookmark URL: %s" , itemData->item->getAddress().c_str()); itemData->bookmarkManagerUI->bookmarkItemClicked(itemData->item); } } -void BookmarkManagerUI::_folderItemClicked(void * data, Evas_Object *, void *) -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - if (data != nullptr) - { - BookmarkFolderItemData * itemData = static_cast(data); - BROWSER_LOGD("Folder ID: %d" , itemData->item->getId()); - itemData->bookmarkManagerUI->set_folder(itemData->item->getTittle().c_str()); - itemData->bookmarkManagerUI->folderItemClicked(itemData->item->getId()); - } -} - -void BookmarkManagerUI::_bookmark_thumbSelected(void * data, Evas_Object *, void *) -{ - (void)data; -#if 0 - if (data != nullptr) - { - HistoryItemData * itemData = static_cast(data); - itemData->bookmarkManagerUI->bookmarkClicked(itemData->item); - } -#endif -} - void BookmarkManagerUI::clearItems() { hide(); BROWSER_LOGD("Deleting all items from gengrid"); elm_gengrid_clear(m_gengrid); elm_genlist_clear(m_genList); - m_map_bookmark_folder_views.clear(); + m_map_bookmark.clear(); elm_theme_extension_del(nullptr, edjFilePath.c_str()); elm_theme_full_flush(); elm_cache_all_flush(); @@ -559,7 +380,7 @@ void BookmarkManagerUI::updateGengrid() //elm_gengrid_clear(m_gengrid); //remove 'createGenGrid' if the elm_gengrid_clear() will be valid again createGenGrid(); - m_map_bookmark_folder_views.clear(); + m_map_bookmark.clear(); } } } diff --git a/services/BookmarkManagerUI/BookmarkManagerUI.h b/services/BookmarkManagerUI/BookmarkManagerUI.h index 8d5bd14..22c1095 100644 --- a/services/BookmarkManagerUI/BookmarkManagerUI.h +++ b/services/BookmarkManagerUI/BookmarkManagerUI.h @@ -26,7 +26,6 @@ #include "service_macros.h" #include "services/HistoryService/HistoryItem.h" #include "BookmarkItem.h" -#include "AddNewFolderPopup.h" namespace tizen_browser{ namespace base_ui{ @@ -50,23 +49,16 @@ public: //TODO: make it private; void showTopContent(); virtual std::string getName(); - void addBookmarkFolderItem(std::shared_ptr); - void addBookmarkFolderItems(std::vector >); void addBookmarkItem(std::shared_ptr); void addBookmarkItems(std::vector >); void hide(); void clearItems(); - void set_folder(const std::string &name) {m_folder = name;}; void updateGengrid(); - void newFolderPopup(); Evas_Object* createNoHistoryLabel(); void setEmptyGengrid(bool setEmpty); boost::signals2::signal closeBookmarkManagerClicked; - boost::signals2::signal addNewFolderClicked; - boost::signals2::signal saveFolderClicked; boost::signals2::signal)> bookmarkItemClicked; - boost::signals2::signal folderItemClicked; private: Evas_Object* createBookmarksLayout(Evas_Object* parent); @@ -74,39 +66,28 @@ private: void createGengridItemClasses(); Evas_Object *getGenList(); Evas_Object *getGenGrid(); - static char* _grid_folder_text_get(void *data, Evas_Object *obj, const char *part); - static Evas_Object * _grid_folder_content_get(void *data, Evas_Object *obj, const char *part); - static char* _grid_bookmark_text_get(void *data, Evas_Object *obj, const char *part); + + static char* _grid_bookmark_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object * _grid_bookmark_content_get(void *data, Evas_Object *obj, const char *part); static void _bookmarkItemClicked(void * data, Evas_Object * obj, void * event_info); - static void _folderItemClicked(void * data, Evas_Object * obj, void * event_info); static void _bookmark_thumbSelected(void * data, Evas_Object *, void *); - void newFolderCreate(Evas_Object * popup_content); - void CancelClicked(Evas_Object * popup_content); - static Evas_Object* listItemContentGet(void *data, Evas_Object *obj, const char *part); static char* listItemTextGet(void *data, Evas_Object *, const char *part); static void item_clicked_cb(void *, Evas_Object *, void *); static void close_clicked_cb(void *data, Evas_Object *, void *); - static void new_folder_clicked_cb(void *data, Evas_Object *, void *); private: - std::string m_folderName; Evas_Object *m_genList; - Evas_Object *popup_content; - std::shared_ptr m_popup; Evas_Object *b_mm_layout; Elm_Genlist_Item_Class *m_itemClass; Evas_Object *m_gengrid; Evas_Object *m_parent; Elm_Gengrid_Item_Class * m_bookmark_item_class; - Elm_Gengrid_Item_Class * m_folder_item_class; - std::map m_map_bookmark_folder_views; + std::map m_map_bookmark; std::string edjFilePath; - std::string m_folder; bool m_gengridSetup; }; diff --git a/services/BookmarkManagerUI/CMakeLists.txt b/services/BookmarkManagerUI/CMakeLists.txt index 7ff57b7..d0cbdb5 100644 --- a/services/BookmarkManagerUI/CMakeLists.txt +++ b/services/BookmarkManagerUI/CMakeLists.txt @@ -2,12 +2,10 @@ project(BookmarkManagerUI) set(BookmarkManagerUI_SRCS BookmarkManagerUI.cpp - AddNewFolderPopup.cpp ) set(BookmarkManagerUI_HEADERS BookmarkManagerUI.h - AddNewFolderPopup.h ) include(Coreheaders) @@ -28,7 +26,6 @@ install(TARGETS ${PROJECT_NAME} #please do not add edc/ directory set(edcFiles BookmarkManagerUI.edc - AddNewFolderPopup.edc ) foreach(edec ${edcFiles}) diff --git a/services/BookmarkManagerUI/edc/AddNewFolderPopup.edc b/services/BookmarkManagerUI/edc/AddNewFolderPopup.edc deleted file mode 100644 index 3ae44b9..0000000 --- a/services/BookmarkManagerUI/edc/AddNewFolderPopup.edc +++ /dev/null @@ -1,198 +0,0 @@ -#define POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC 40 -#define POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 65 -#define POPUP_CONTENT_DEFAULT_PADDING_RIGHT_MIN_INC 65 - -collections { - -group { name: "elm/entry/selection/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - } -} -group { name: "elm/entry/cursor/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 22 120 237 255; - min: 2 36; - max: 2 36; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "focused" 0.0; - target: "bg"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - } -} -group { - name: "popup_input_text"; - parts { - part { - name: "elm.text.message"; - type: TEXT; - scale: 1; - description { - state: "default" 0.0; - min: 0 0 ; - max: 670 80 ; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; offset: 65 0; - } - rel2 { - relative: 1.0 1.0; - } - color: 0 0 0 255; - text - { text: "Add a New Folder?"; - font: "Sans,Edje-Vera"; - size: 34; - min: 0 1; - align: 0.0 0.5; - } - } - } - part { - name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - min: 0 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; - max: -1 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; - align: 0.0 0.5; - min: 0 0 ; - max: 540 100 ; - rel1 { - relative: 0.0 1.0 ; - to: "elm.text.message"; - } - rel2 { - relative: 1.0 1.0; - } - } - } - } - } - group { - name: "elm/entry/base-single/uri_entry_popup"; - styles { - style { - name: "browser-entry-uri-style-unselected"; - base: "font=Sans:style=SVD_Medium font_size="34" wrap=none color=#515151"; - } - style { - name: "browser-entry-uri-style-selected"; - base: "font=Sans:style=SVD_Medium font_size="34" wrap=none color=#dddddd"; - } - } - data { - item: focus_highlight "off"; - } - parts { - - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - - part { - name: "elm.guide"; - scale:1; - type: TEXTBLOCK; - mouse_events: 0; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-unselected"; - min: 0 1; - } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "label.text.clip"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - } - } - part { - name: "elm.text"; - scale:1; - multiline: 0; - entry_mode: EDITABLE; - select_mode: DEFAULT; - cursor_mode: BEFORE; - type: TEXTBLOCK; - clip_to: "label.text.clip"; - source: "elm/entry/selection/browser_entry"; - source4: "elm/entry/cursor/browser_entry"; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-unselected"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "gdisabled"; - signal: "elm,guide,disabled"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "elm.guide"; - } - program { name: "genabled"; - signal: "elm,guide,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.guide"; - } - } -}//group -} diff --git a/services/BookmarkManagerUI/edc/BookmarkManagerUI.edc b/services/BookmarkManagerUI/edc/BookmarkManagerUI.edc index 6b29ccb..96f6c64 100644 --- a/services/BookmarkManagerUI/edc/BookmarkManagerUI.edc +++ b/services/BookmarkManagerUI/edc/BookmarkManagerUI.edc @@ -17,16 +17,12 @@ collections { RESOURCE_IMAGE_LOSSY("ic_more_exit_nor.png") -RESOURCE_IMAGE_LOSSY("btn_bar_new_nor.png") -RESOURCE_IMAGE_LOSSY("btn_bar_new_foc.png") -RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder.png") -RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder_all.png") -RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder_mark.png") #define WIDTH 1920 #define HEIGHT 181 #define ITEM_WIDTH 1200 + group { name: "elm/genlist/item/topContent/default"; min: WIDTH HEIGHT; @@ -37,8 +33,8 @@ RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder_mark.png") image: "thumbnail.png" COMP; image: "btn_bar_stop_nor.png" COMP; } - data.item: "texts" "webpage_title webpage_url folder_text"; - data.item: "contents" "favicon star_click close_click new_folder_click"; + data.item: "texts" "webpage_title webpage_url bookmark_group_text"; + data.item: "contents" "favicon star_click close_click"; color_classes{ color_class{ name: "defaultBgColor"; @@ -127,92 +123,6 @@ RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder_mark.png") rel2 { relative: 1.0 1.0; } } } - part { - name: "new_folder_bg"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0 0; - min: 82 102; - max: 82 102; - rel1 { relative: 0.0 0.0; to: "action_bar_bg"; offset: 10 0;} - rel2 { relative: 1.0 1.0; to: "action_bar_bg";} - color_class: transparent; - } - description { - state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: focusBgColor; - visible: 1; - } - description { - state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusDelBgColor; - visible: 1; - } - } - part { - name: "new_folder_icon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0 0; - min: 82 102; - max: 82 102; - rel1 { relative: 0.0 0.0; to: "new_folder_bg";} - rel2 { relative: 1.0 1.0; to: "new_folder_bg";} - image.normal: "btn_bar_new_nor.png"; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "focus" 0.0; - inherit: "highlight" 0.0; - image.normal: btn_bar_new_foc.png; - } - } - part { - name: "new_folder_over"; - scale:1; - type: RECT; - mouse_events :1; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: 82 102; - max: 82 102; - rel1 { relative: 0.0 0.0; to: "new_folder_bg";} - rel2 { relative: 1.0 1.0; to: "new_folder_bg";} - color_class: transparent; - } - } - part { - name: "new_folder_click"; - scale:1; - type: SWALLOW; - mouse_events :1; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: 82 102; - max: 82 102; - rel1 { relative: 0.0 0.0; to: "new_folder_over";} - rel2 { relative: 1.0 1.0; to: "new_folder_over";} - color_class: transparent; - } - } part { name: "title_text"; scale: 1; @@ -318,7 +228,7 @@ RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder_mark.png") } part { - name: "folder_bg"; + name: "bookmark_group_bg"; scale:1; mouse_events: 1; type: RECT; @@ -347,14 +257,14 @@ RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder_mark.png") } } part { - name: "folder_text"; + name: "bookmark_group_text"; scale: 1; type: TEXT; description { state: "default" 0.0; visible: 1; fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "folder_bg"; offset : 62 104; } - rel2 { relative: 1.0 1.0;to: "folder_bg";} + rel1 { relative: 0.0 0.0;to: "bookmark_group_bg"; offset : 62 104; } + rel2 { relative: 1.0 1.0;to: "bookmark_group_bg";} color: 116 116 116 255; text { text: "Bookmark"; @@ -382,22 +292,6 @@ RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder_mark.png") emit("mouse_out_close_click", ""); } } - program { - name: "mouse_in_new_folder_click"; - signal: "mouse,in"; - source: "new_folder_*"; - script { - emit("mouse_in_new_folder_click", ""); - } - } - program { - name: "mouse_out_new_folder_click"; - signal: "mouse,out"; - source: "new_folder_*"; - script { - emit("mouse_out_new_folder_click", ""); - } - } program { name: "mouse_in_close"; signal: "mouse_in_close_click"; @@ -416,25 +310,6 @@ RESOURCE_IMAGE_LOSSY("ic_thumbnail_folder_mark.png") target: "close_bg"; target: "close_icon"; } - program { - name: "mouse_in_new_folder"; - signal: "mouse_in_new_folder_click"; - source: ""; - action: STATE_SET "highlight" 0.0; - target: "new_folder_over"; - target: "new_folder_bg"; - target: "new_folder_icon"; - } - program { - name: "mouse_out_new_folder"; - signal: "mouse_out_new_folder_click"; - source: ""; - action: STATE_SET "default" 0.0; - target: "new_folder_over"; - target: "new_folder_bg"; - target: "new_folder_icon"; - } - } } @@ -748,23 +623,6 @@ group { name: "elm/gengrid/item/grid_bm_item/default"; } } - part { name: "folder_image"; - type: IMAGE; - scale: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.5 0.5; - fixed: 0 0; - min: 140 140; - max: 140 140; - image.normal: "ic_thumbnail_folder.png"; - rel1 { relative: 0.0 0.0; to: "bg"; } - rel2 { relative: 1.0 1.0; to: "bg"; } - } - } - part { name: "elm.thumbnail"; type: SWALLOW; description { state: "default" 0.0; diff --git a/services/BookmarkManagerUI/images/btn_bar_new_foc.png b/services/BookmarkManagerUI/images/btn_bar_new_foc.png deleted file mode 100644 index 2a5c00b557e060802cc68807ec9e93e1406b3aa2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2963 zcmai0cRUn+AODK%m2ByE_Q;;u+!<$wle5Z*Gm??AqO(^S$?k-*M@CL(Wrd6rGSA2k z;mL?H?$Pu7_5Ahx@%g-8pY{HXzdrG|O!VleIjI2vboy{@^9%edu9V~#8rjJ8p@iZ(zJI7UMW+KqGDrLM&i88)HWb|mO1l6L>p zn}(EVW}q3I1T6-dx+G{!mY@a5Cj$-x&Q8nVmN;+_db&0S(3s=w5E5Yfl81#PKNUc( zy2NP%Hx*Dhd^dzb1jO(Hom&&eF#qlfYgxgYz`%+k0Nn97k>$BZpR&c!Jn4>At8I;W- z6E4T_ZGRAe{8W~UZTHUt@$}Vryh0L|{;v4uM{**slhg9~>TrdRCIE~6VI${alJ%Tu z6>_xKd7;1#ncE$j{6|NLu5}EW4IqDG#%kZ^?`?DnQgGALt1By02Hj9w$9}8Ob5!Tu zcB`}dzr$2dj}E`JE%ArT*oW(p9e?W_JTNM{HvEDr%4v2jS?{!whIq<7#@ns$ghPrl zFPky>CTZt9+m|WgjfcJv`6Mt(ytlL-kBhO46iBkfSFNu;ZJNlTX15U=2$Pf7($85%Hm?{sKHcvo6 zEaBXHYJQiLV(oOBQdRnZOvGtSi=On$@H#WKue1#?T&W^wlx`u-mwW!wImxW~xnKO= zbE-X4C|Lhe;l?nNtPbmyYX8noA=`alN}{I=T6DRtRj53Ytjy^Ew+Yl?um4kEgrG1{c=UGRg z^im9Rqc3^|v(mL9yTY}?vu8_Dz{4Rk|m>M`6kDFuCxGg zMLyXET2+8Ge`gk3dR6XGj?z#htG;1TRbl!VryHBwk^8&v{!Lfr(yyCjez6)I*wFi) z`JMD2fR-+XC9*dTCCrh_PQi}i2w;DgWmL>DmdMeIkW!T1%39B6$o95Gieg2du%z}= zryHaTrgMo(BFf5(%je5!EcY!35XohCEJCYwEoCj1%c#C)R9Kc{Zf#j`S)j^PN@L4W zrQQgQw_(<2@#NNBMqQ?`w`TdZcb8jwAT-V#^?_nMo^%y4kHY1<1#5?IR4Q&n_072Mb6tjK?mc$P{L5ZFUOjIF$pv`?4UIRAcXG^) zam6CVDn=?sy+eaTg+mkB^0{i#lQQeM>$#J;3ylsofi_~;QtSs8{kj#KV(T4j%Y$ee zCF>%jrHy^PZWX3VV4}IIx#UU-&LqvGB5wlKRr3@38C%xKQL{QlPN>FuVM85JPHd>g zPt{#JX{~9YO`*@v)F|j;r|B!WZMef8zV~BRzO6i;gMYQ75&G#MV?z>!9A+Gzl3m7L z9T4eu$5`Z!>7m$AxQCJZaf$JU5d#vL>JqtJJ#&4nD+d0DzV?g3qlcK>`rOX#Qo_3( zg&p^u*xA>Ea<4`5tYsg5>FR@hGg}?epn07x<+)H9W(qS6M>VYTNjgiWT2)QfG!_Mv zA35%_ssB>6I_1PO>b*G%g1T4XeCEfMXYvI@woNnGHI7K?;BoIk`S#{cyPaM;dFaHb_ugYvmC;fCD~{16I6ijJcuq~ zEt6mpQ_j#diZi+S@?TnvqNS|Q1oo~52qaMlb#iy2cqK;^M&hPmcB0o!_TZw%!7qNK zw#WzZf08W{Tg62Qm8G;8(HYI{*{udD&W=8VfD{j<6A)6s4#`xmdY=9E$H(%BaY@F|<8c-%m(U ze6{N)nZ$7GiXmKg|j2}|bK)gj9ApRf}c1GtK94C(-jO=iQwEU9$F;1{;IXYAS+(xh@ zu{0ic9d|j=KdC>`sE#k+ILCyN8 z({_&84G^bOptF4bs%MGMM>}X`a8(evc__>4Dpr5S7iSaxowYk>)VDF<(M~4fnb76i$XZV5U=>Vafsut6h zy9b)vTGOz(*l`Wp^VzB0*{2@u0r~qQvwBD5(UHUFsfWo7u*=EW$pbNTFW% zH2lssPD^0J_l5=Y*v<>j2dddvCBu%#wqfyC%9+s04jYwE%Ph<6KCkQ~^D;5CAO+BE{yLa8a{k@;Kd;4(dL!n$ge%@{#k6Zx=oJUz8U>4g< zswYcF5W_fRhM~7PBPo|TBoWDwCLqF1Mr#nqT{OpN)4bo6PGY_wi5EjbGq$hbM&%lMs2J55Y;$F(n(60r6*%1hor24aMFE^9O&&| zSr^v`C+G74w4{v>xSw3`5`fb%6_wjOog^KAAaIg`6m%NrcS_!j#nbFSa_tC^Q3Rd- zX?F}skqkg1I2lq3G;|1%s2l+cP)GzEhh3c4z+ExmDEMM?5+G5hxgi9=HiMgypfC+^ z-EfW50`AJ7dhA|;Hh@b41~e|%_&bqygMkD zRXSXj=Ih}I0EKCcS85M00#~@CpUC|_Md8zvM7IVSjV4gIJ#TgB^T!+QqEyV>+{XI)tU)it)@jHp^b*nS z&}nt?=vSD^`N{Fuj#a*JY5QmoYO|0DBh481LAT8X#bM*v( zgI4dZFG8e*NcYHkxJ^$XoXet>k-f9VUreJwt5*ifVT04V@kh2bJ~n(RkiETWyn zH@mJcbWxl;%11%?db=UC5b_7en|_YM)e#V(n9({85l4wH8XU5nX6`ZRKGfpfmLI59 zeQ16=krs3bwS|)rX%3R!aN?eiBXCZD^Cpur=SH7$cj*z)C-QN9ieoV2F-()wlQK_$ zaarnd9H{zTQ;fCKX-QKa1kw@bF>Sh18Q~3Ps$VFZpqO$6wkVxqiq8-HrSejk3iChv zy=PNRk}ul&T;)zPpP~jGknH@%LL$@qNK(AN2U34Wlq}t4xSpq)vZ|l0?p`%vYy7dx zSbYEyeYkcfnLJSdgv*IjQx9$gH<{Hd=eo%!OE*uZKt>p4)-A}BUT*kapoQ*NFN?FZ zR4iOily{mw<%R@pNF20RfsZ~ODlLdfy{2FP7B)dYp)>K=oOfHaB41XIjW_+%`~%Mh z62%NruG@pr>!|gfb(wYcb?yUOa+I@%@7q(0RUz}ChX$-0v>UP;#I8BgnwD?!%oodx zV03aRHjtVkwD~);*zy~)PxBND%$^L9LF}$t& zE&ChcQ2-@X3}fU#972dSpM``4!5YBwF2|^pbuy8404Av*wVSh*OOxwu2^T?&JZDTB zBF{9)6v$*3k$_cHmR2rRQdk~Z4#QF^?puV`>R8HHtW}VG$*QufMBUxBV7EY2D3`}p zBFepC>TkoWFXD-NF!>mAnG`nf1vSQ`UHxjm_>VxES}^$OIF&OLu7(wcL@ z(VD1QSy7}2l`)X9YBWF0a8oB)%ke#ZGD^Y2fag{eyI)CZVBzg4Pt?{jS^?UWd5g-=e7BDp4G2YKJ zH^!6-mns`68x4$(j24eh=gQ@)O3g@bA+ zzA-G^>w&V!pVUP#BQQ@Q591Q!4I_rdv(?1&+4~m<+t&^JkA3Y|f+vnq`HlJAd*!%y z`||r9`>_kJM`T|M7g)^I-F^X^(e-L-aEA1uy;qJ{Ug^%8>j72*UVq z&2ZamXQ#o>xj!bWE8$#!Hq7m5CKX~d88uTPY9cneYPj78zo*u4pKRq|)36@Y(RahX zO@AhF+H^|n38NH@j*Yg8QBU@XgR_lGWy=MOFF>CxYyH;B(pt(#NSP|W6Elz#QL7Yx zs4}n6BHNsaN0sP72LERkP2p)-X`SG|}sGSI>$$_4Taq!FU zX>D>re0?${q8pef!HU#2BPyfCe5C@Wyk}fq(yB`BQjssyQhgzn+{Wo>#13N9?b&d( zYjne9-{Zt)3C>KCPo9mb)z_`X$kC9}Z!jC784;2OgsYX?$Iae%4BiL`4{QksZlhe%Ub3Ee+oxG)UiLL6UcP$+gcF1pB)rt<8O)a{jtNzmdCK(dU0v#d zTOF6E9|2-i@>G_8z3N}(_0bAi-##H*KH;QNntzrQQoTYldFvSmf<2 zRo(Am`@9S~_Fzn)fcdica=4b6Nh0iYYIg=Zo-pNV3cRy#x zr$8C0`$zZA_PPQV0yuuWS*9^vf6nzn2=D%@{@CJk*;zVkdODtnFz4{xMMeyF^>1>y z=$RV>5X=t%G7^Aa_$%B7;He}4JB|P-}=hBQ|&`aggB^%imsLd vKil+Q{{IyIcbe$`nf}abbj%U}fX5Sp=xwUu%I9RmSGs_{wux3P#4+OE&*pDL diff --git a/services/BookmarkManagerUI/images/ic_thumbnail_folder.png b/services/BookmarkManagerUI/images/ic_thumbnail_folder.png deleted file mode 100644 index 57fc200e05738e3d357efca75381578bc6ff706f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1522 zcmeAS@N?(olHy`uVBq!ia0vp^Js`}%1|-)VaI^zbk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+nA0*tB1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxSU1_g&``n5OwZ87 z)XdCKN5ROz&`93^h|F{iO{`4Ktc=VRpg;*|TTx1yRgjAt)Gi>;Rw<*Tq`*pFzr4I$ zuiRKKzbIYb(9+TpWQLKEE>MMTab;dfVufyAu`kBtHuNWFoz#!AFNG#Ad)HBe}%?0@jth%@)C>7xhtg4GcDhpEegHnt0 zON)|$@sXws(+mtd{1$-}0$pR}Uz7=ql*AmD{N&Qy)VvZ;7h5Huj9yA+ij|X#nTe5w zsiUQ(tA(qHp`nGjv6+jDv7@<@xsipdxgpF9Y?vEu5T8 zjNJ@e3=J&Y9L->QJ@bl767!N%VfJPM?S<-f#H-iJxhOTUB)=#mKR*YS0s=DfOY(~| z@(UE4gUu8)!ZY(y^2>`gLD2*8txIZAW?5>ATTyiplsND(Oe&M-(furg9fIW#*m}~0mBdtzDEOGM zf|qvRmU!!F_}NLcztA+`QE=V;c@cIJ7!GiU-IZU-{iwZXPkYkW!E3S z6Io<^CVyU%p7wEfIprIPzaqOTduI9`mp0r!?JnQv*`FfML_Yno;Ni}mgkL*69!?2M zGSl6iP*vG&xl-o+(K8WM-wpO|xt#BF+BD|y^OE>&!k-h{C40WlI6NyZ`lm>>_VurS zr^_z8(zUZca&4wXkh zyZrjlZ99>>R&Nc=uNA*o_iD@G9P@quvwyptnX^@P#q}@DJLf-6IlJfsXXETRh#N?< d<-&9ZW(L`wM7f<)Bb^z5z|+;wWt~$(69D)y450u3 diff --git a/services/BookmarkManagerUI/images/ic_thumbnail_folder_all.png b/services/BookmarkManagerUI/images/ic_thumbnail_folder_all.png deleted file mode 100644 index c23e195c8a3d6587bc0f869c9b94ee4aedd56073..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1378 zcmbVMUu@e%821=V)znUXK!Q$CS*|AjXo-DJ?AUIzE{UBjV(Cg6tr4B3xb`KnTHBd@ zN!-E^1U9s(NN8eJr3s|&r4L9G1MxC6Sg6D_)a_x?3IhQHgg~Ow9tJ|%UO4AZ`J=86 zoNV9k?!NE)efPWXd~$STU(fcP+X;f`N$r<2xS#Xiu5I{x{&H*&?)s3DLt}OU)l>%( zG2NboWXe>FFauS6=IB*8L=amGMmC3X=>w8xn?cpL33_H3dlSUauvb>KDTv5PSTw9C zb?4(xDbmoR)Hs)B(&Yp!8T)4)I5s@ocN!a7yV;pCq%+X9 zD~^WGqcG5M#@cO8Qp-XX@53>Rn6GcT(!T<=7 z5HHK2SR@`{1tkJHF*fq$Ie}**2^quy2Y|u}Ae>MHK?YoiRgyg0@l9DSQY{U3cn!?k z_DyW+DT$AtJ;>@k9gwQNh^@NiG?aMS+RO1Q2K9RNGhoKbp}v8QL$7e-uk+3Rj>H*GnG{ z)-MmV@Qrcs)p&6>{UbqaIh~SYS?}w$Z!h$G#`Nxee(qd%@2b}Ith`KQ8RE&iyXNvc zu0Dd>h5F1v>EsUmYH)VJ9O{XTB?*>igoi>08B#p9q8jAV45sK|H=d05Jd#8{&X$>J~5|o`f%uaD>40 zMW><>2BRbcR!zsEc2asiNm?WzXt�b}kDi@<2!|7P~Px942MKv^p^oaWFA!xCa47 zt$M;_Ax$_2xDk;pcrhuZQ<=Uxg4vRiG6RfRr-`B{109G3gjj6QY<8b(%Gye1ps&-I z)!M3YT2L?pwc^Euo~nm2+~Z7fH+LYnA(f3JjWAI~K?-49Uu;G(G7*;2sV^*p$sm!# z0v<=imx;wnk&*{NA|Y1*!(5qAF64-mLdb(Lo3Dr~7xK9>F(iZd5TxXb*&?A_!4oPJ z3Kb;cDLlT3n3Y5@J?e>TqT){bistl{C@KVU#f0P=kuV&A=4D64Na4xgw!R&Xp^K5F}Po*^5+sl?)b(*m9W&lC$OX zXQ@qfwddKS@noW+E)pIDURKc)lP& z7Fza4MZ%t-H+6opj1$j%qS|(WtzTB`PPp793F-s{(NT*#HMR}umsRkB6@h`wH%1u& z&3>|oz2C`|)f2*B7Pv|u(Ax{o4gBDxd;Am|+t=^JY_`X?w&T6|0T&B58~k^&fh7yQ zF70H~khhond6&+k#EcGDGN;bZnES9IdtW&m5{O3ZFrMCut&#>_FFF{F<-dQ`5ldum zw7b|xDg%8rUCrI=Hx6#@XgI@=1`gRrTI?sb*4^8by>>9}^S9(>kM@UDWz|G4-*c|w z$KG`crTXv*fXJd>f`QBRjo+{OD>hFtsn!a)9 zWRh={Hq`0gfA{Ep&A5L;UFqbnS8q1`b&?zi>7MW5f<_TD2R}2MrSl>gA^XlTYFivl zV{P*#!56lpcf;COj(}3vYOZ8?`?^mCE?;>Trm9svkh>1==(CzQUF#~7oYIbl+LqPh z5k$k2(HDOGU*M6Qf0j*@6f9Ef+TwHL+gvNR`SpjkAHc^B)+hab{_5%Q!bbeNVQ?k>N~ebPHi~;&9&j~&hA^mxgAWRBjRp#$<2{d zJ|O*_tnU4ep#A`7(=v5h$Ygh9&Zgm83|&>$;X38SE?q?`^V^)hN0S?P!_QOnYkfXy z&j~&nW2`z>n$x#tz{PGEF6uq>6Nx{_S#b|n^oAY@?qM!N&L-E8X!V$Ql-{Z}S;l;k zvuQP{q7rNMg7`!?d(&;@7E`T8={`8CzTNN8h4)PS{o(aku)J99YgKH&vF`i9A1{S6 zYhQY=U>vL8QQi*KU-&fg3DUmRXkm+R*}U5x*r&Zc`EiHiQROE=G(*5cD@KA^RY Qx_@1X%2c>X{_d`S0KGJi(f|Me diff --git a/services/BookmarkService/BookmarkService.cpp b/services/BookmarkService/BookmarkService.cpp index edb3469..3af5cb7 100644 --- a/services/BookmarkService/BookmarkService.cpp +++ b/services/BookmarkService/BookmarkService.cpp @@ -56,7 +56,6 @@ BookmarkService::BookmarkService() BookmarkService::~BookmarkService() { bp_bookmark_adaptor_deinitialize(); - free_path_history(); } /*private*/ std::shared_ptr BookmarkService::getStorageManager() { @@ -154,7 +153,7 @@ bool BookmarkService::deleteBookmark(const std::string & url) return true; } -int BookmarkService::countBookmarksAndSubFolders() +int BookmarkService::countBookmarks() { return m_bookmarks.size(); } @@ -193,7 +192,6 @@ int BookmarkService::getBookmarkId(const std::string & url) std::vector > BookmarkService::getBookmarks(int folder_id) { BROWSER_LOGD("[%s:%d] folder_id = %d", __func__, __LINE__, folder_id); - set_current_folder_id(folder_id); int *ids = nullptr; int ids_count = 0; int ret = bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, -1, 0, folder_id, BOOKMARK_TYPE, -1, -1, BP_BOOKMARK_O_SEQUENCE, 0); @@ -238,54 +236,6 @@ std::vector > BookmarkService::getBookmarks(int fo return m_bookmarks; } -std::vector > BookmarkService::getBookmarkFolders(int folder_id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - set_current_folder_id(folder_id); - int *ids = nullptr; - int ids_count = 0; - int ret = bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, -1, 0, folder_id, FOLDER_TYPE, -1, -1, BP_BOOKMARK_O_SEQUENCE, 0); - if (ret<0){ - BROWSER_LOGE("Error! Could not get ids!"); - return std::vector>(); - } - - m_bookmarks.clear(); - BROWSER_LOGD("Bookmark folders: %d", ids_count); - - for(int i = 0; i bookmark = std::make_shared(std::string(bookmark_info.url ? bookmark_info.url : ""),std::string(bookmark_info.title ? bookmark_info.title : ""), std::string(""),(int) bookmark_info.parent, ids[i]); - std::shared_ptr bi = std::make_shared(); - bi->imageType = tizen_browser::tools::BrowserImage::ImageType::ImageTypePNG; - bi->width = bookmark_info.thumbnail_width; - bi->height = bookmark_info.thumbnail_height; - bi->dataSize = bookmark_info.thumbnail_length; - bi->imageData = (void*)malloc(bookmark_info.thumbnail_length); - memcpy(bi->imageData, (void*)bookmark_info.thumbnail, bookmark_info.thumbnail_length); - bookmark->setThumbnail(bi); - - std::shared_ptr fav = std::make_shared(); - unsigned char *image_bytes; - bp_bookmark_adaptor_get_icon(ids[i], &fav->width, &fav->height, &image_bytes, &fav->dataSize); - fav->imageType = tizen_browser::tools::BrowserImage::ImageType::ImageTypePNG; - - fav->imageData = (void*)malloc(bookmark_info.favicon_length); - memcpy(fav->imageData, (void*)image_bytes, bookmark_info.favicon_length); - bookmark->setFavicon(fav); - if(!bookmark_info.is_operator) - m_bookmarks.push_back(bookmark); - else - m_bookmarks.insert(m_bookmarks.begin(),bookmark); - } - free(ids); - return m_bookmarks; -} - - bool BookmarkService::deleteAllBookmarks() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -295,72 +245,6 @@ bool BookmarkService::deleteAllBookmarks() return true; } -int BookmarkService::get_root_folder_id(void) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - int root_id = 0; - bp_bookmark_adaptor_get_root(&root_id); - return root_id; -} - -int BookmarkService::save_folder(const char *title, int *saved_folder_id, int by_operator) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - bp_bookmark_property_cond_fmt properties; - properties.parent = get_current_folder_id(); - properties.type = 1; - properties.is_operator = -1; - properties.is_editable = -1; - //conditions for querying - bp_bookmark_rows_cond_fmt conds; - conds.limit = 1; - conds.offset = 0; - conds.order_offset = BP_BOOKMARK_O_SEQUENCE; - conds.ordering = 0; - conds.period_offset = BP_BOOKMARK_O_DATE_CREATED; - conds.period_type = BP_BOOKMARK_DATE_ALL; - int id = -1; - int *ids = nullptr; - int ids_count = -1; - int ret = bp_bookmark_adaptor_get_cond_ids_p(&ids, &ids_count, &properties, &conds, BP_BOOKMARK_O_TITLE, title, 0); - free(ids); - - if (ret < 0) - return -1; - - if (ids_count > 0) { - return 0; - } - - bp_bookmark_info_fmt info; - std::memset(&info, 0, sizeof(bp_bookmark_info_fmt)); - - info.type = 1; - info.parent = get_current_folder_id(); - info.sequence = -1; - info.is_operator = by_operator; - info.access_count = -1; - info.editable = 1; - - if (title != nullptr && strlen(title) > 0) - { - info.title = (char *)title; - } - ret = bp_bookmark_adaptor_easy_create(&id, &info); - - if (ret == 0) { - ret = bp_bookmark_adaptor_set_sequence(id, -1); // max sequence - if (ret == 0) { - *saved_folder_id = id; - BROWSER_LOGD("bmsvc_add_bookmark is success(id:%d)", *saved_folder_id); - bp_bookmark_adaptor_publish_notification(); - return id; - } - } - BROWSER_LOGD("bmsvc_add_bookmark is failed"); - return -1; -} - bool BookmarkService::delete_by_id(int id) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -445,13 +329,6 @@ int BookmarkService::update_bookmark(int id, const char *title, const char *uri, if (ret < 0) return -1; } - //This is a bookmark folder so check for any such folder with same title already exists - else if (is_title_exist) { - ret = bp_bookmark_adaptor_get_cond_ids_p(&ids, &ids_count, &properties, &conds, BP_BOOKMARK_O_TITLE, title, 0); - free(ids); - if (ret < 0) - return -1; - } if (ids_count > 0) { BROWSER_LOGD("same bookmark already exist"); @@ -499,32 +376,6 @@ bool BookmarkService::is_in_bookmark(const char *uri) return get_id(uri, &id); } -bool BookmarkService::is_in_folder(int parent_folder, const char *title) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - - bp_bookmark_property_cond_fmt properties; - properties.parent = parent_folder; - properties.type = 1; - properties.is_operator = -1; - properties.is_editable = -1; - //conditions for querying - bp_bookmark_rows_cond_fmt conds; - conds.limit = 1; - conds.offset = 0; - conds.order_offset = BP_BOOKMARK_O_SEQUENCE; - conds.ordering = 0; - conds.period_offset = BP_BOOKMARK_O_DATE_CREATED; - conds.period_type = BP_BOOKMARK_DATE_ALL; - - int *ids = nullptr; - int ids_count = -1; - int ret = bp_bookmark_adaptor_get_cond_ids_p(&ids, &ids_count, &properties, &conds, BP_BOOKMARK_O_TITLE, title, 0); - free(ids); - return ((ret >= 0) && (ids_count > 0)); -} - bool BookmarkService::get_id(const char *uri, int *bookmark_id) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -553,35 +404,6 @@ bool BookmarkService::get_id(const char *uri, int *bookmark_id) return result; } -bool BookmarkService::get_folder_id(const char *title, int parent_id, int *folder_id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - - bp_bookmark_property_cond_fmt properties; - properties.parent = parent_id; - properties.type = 1; - properties.is_operator = -1; - properties.is_editable = -1; - //conditions for querying - bp_bookmark_rows_cond_fmt conds; - conds.limit = 1; - conds.offset = 0; - conds.order_offset = BP_BOOKMARK_O_SEQUENCE; - conds.ordering = 0; - conds.period_offset = BP_BOOKMARK_O_DATE_CREATED; - conds.period_type = BP_BOOKMARK_DATE_ALL; - - int *ids = nullptr; - int ids_count = -1; - int ret = bp_bookmark_adaptor_get_cond_ids_p(&ids, &ids_count, &properties, &conds, BP_BOOKMARK_O_TITLE, title, 0); - free(ids); - bool result = ((ret >= 0) && (ids_count > 0)); - if (result) { - *folder_id = ids[0]; - } - return false; -} - bool BookmarkService::get_item_by_id(int id, BookmarkItem *item) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -591,12 +413,10 @@ bool BookmarkService::get_item_by_id(int id, BookmarkItem *item) return false; } - if (id == get_root_folder_id()) { + if (id == 0) { item->setTittle("Bookmarks"); item->setAddress(""); item->setId(id); - item->set_folder_flag(1); - item->set_editable_flag(1); item->setDir(-1); return true; } @@ -604,9 +424,7 @@ bool BookmarkService::get_item_by_id(int id, BookmarkItem *item) if (bp_bookmark_adaptor_get_info(id, (BP_BOOKMARK_O_TYPE | BP_BOOKMARK_O_PARENT | BP_BOOKMARK_O_SEQUENCE | BP_BOOKMARK_O_IS_EDITABLE | BP_BOOKMARK_O_URL |BP_BOOKMARK_O_TITLE), &info) == 0) { item->setId(id); - item->set_folder_flag(static_cast(info.type)); item->setDir(info.parent); - item->set_editable_flag(static_cast(info.editable)); if (info.url != nullptr && strlen(info.url) > 0) item->setAddress(info.url); @@ -621,785 +439,5 @@ bool BookmarkService::get_item_by_id(int id, BookmarkItem *item) return false; } -std::vector BookmarkService::get_list_by_folder(const int folder_id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - std::vector list; - BROWSER_LOGD("folder ID: %d", folder_id); - int *ids = nullptr; - int ids_count = -1; - - if (bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, -1, 0, folder_id, -1, -1, -1, BP_BOOKMARK_O_SEQUENCE, 1) < 0) { - BROWSER_LOGD("bp_bookmark_adaptor_get_sequence_child_ids_p is failed"); - return list; - } - - if (ids_count <= 0) { - BROWSER_LOGD("bookmark list is empty"); - free(ids); - return list; - } - - bp_bookmark_info_fmt info; - for(int i = 0; i < ids_count; i++) { - if (bp_bookmark_adaptor_get_info(ids[i], (BP_BOOKMARK_O_TYPE | - BP_BOOKMARK_O_SEQUENCE | - BP_BOOKMARK_O_IS_EDITABLE | BP_BOOKMARK_O_URL | - BP_BOOKMARK_O_TITLE | BP_BOOKMARK_O_IS_OPERATOR), &info) == 0) { - BookmarkItem *item = new BookmarkItem(); - item->setId(ids[i]); - - item->set_folder_flag(static_cast(info.type)); - item->setDir(folder_id); - item->set_editable_flag(static_cast(info.editable)); - - if (info.url != nullptr && strlen(info.url) > 0) - item->setAddress(info.url); - - if (info.title != nullptr && strlen(info.title) > 0) - item->setTittle(info.title); - - list.push_back(item); - bp_bookmark_adaptor_easy_free(&info); - } - } - free(ids); - return list; -} - -bool BookmarkService::get_list_users_by_folder(const int folder_id, std::vector &list) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("folder ID: %d", folder_id); - int *ids = nullptr; - int ids_count = -1; - if (bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, -1, 0, folder_id, -1, 0, -1, BP_BOOKMARK_O_SEQUENCE, 1) < 0) { - BROWSER_LOGD("bp_bookmark_adaptor_get_ids_p is failed"); - return false; - } - - if (ids_count <= 0) { - BROWSER_LOGD("bookmark list is empty"); - free(ids); - return false; - } - - bp_bookmark_info_fmt info; - for(int i = 0; i < ids_count; i++) { - if (bp_bookmark_adaptor_get_info(ids[i], (BP_BOOKMARK_O_TYPE | - BP_BOOKMARK_O_SEQUENCE | - BP_BOOKMARK_O_IS_EDITABLE | BP_BOOKMARK_O_URL | - BP_BOOKMARK_O_TITLE | - BP_BOOKMARK_O_IS_OPERATOR), &info) == 0) { - BookmarkItem *item = new BookmarkItem(); - item->setId(ids[i]); - item->set_folder_flag(static_cast(info.type)); - item->setDir(folder_id); - item->set_editable_flag(static_cast(info.editable)); - - if (info.url != nullptr && strlen(info.url) > 0) - item->setAddress(info.url); - - if (info.title != nullptr && strlen(info.title) > 0) - item->setTittle(info.title); - - if (info.is_operator > 0) { - delete item; - } else { - list.push_back(item); - } - bp_bookmark_adaptor_easy_free(&info); - } - } - free(ids); - return (list.empty() == false); -} - -bool BookmarkService::get_list_by_dividing(const int folder_id, std::vector &list, int *list_item_count, int genlist_block_size) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("folder ID: %d", folder_id); - - int *ids = nullptr; - int ids_count = -1; - if (bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, genlist_block_size, *list_item_count, folder_id, -1, -1, -1, - BP_BOOKMARK_O_SEQUENCE, 1) < 0) { - BROWSER_LOGD("bp_bookmark_adaptor_get_ids_p is failed"); - return false; - } - - if (ids_count <= 0) { - BROWSER_LOGD("bookmark list is empty"); - free(ids); - return false; - } - - bp_bookmark_info_fmt info; - for(int i = 0; i < ids_count; i++) { - if (bp_bookmark_adaptor_get_info(ids[i], (BP_BOOKMARK_O_TYPE | - BP_BOOKMARK_O_SEQUENCE | - BP_BOOKMARK_O_IS_EDITABLE | BP_BOOKMARK_O_URL | - BP_BOOKMARK_O_TITLE | BP_BOOKMARK_O_IS_OPERATOR), &info) == 0) { - BookmarkItem *item = new BookmarkItem(); - item->setId(ids[i]); - item->set_folder_flag(static_cast(info.type)); - item->setDir(folder_id); - item->set_editable_flag(static_cast(info.editable)); - - if (info.url != nullptr && strlen(info.url) > 0) - item->setAddress(info.url); - - if (info.title != nullptr && strlen(info.title) > 0) - item->setTittle(info.title); - - list.push_back(item); - bp_bookmark_adaptor_easy_free(&info); - } - } - free(ids); - return true; -} - -bool BookmarkService::get_list_users_by_dividing(const int folder_id, std::vector &list, int *list_item_count, int genlist_block_size) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("folder ID: %d", folder_id); - int *ids = nullptr; - int ids_count = -1; - if (bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, genlist_block_size, *list_item_count, folder_id, -1, 0, 1, - BP_BOOKMARK_O_SEQUENCE, 1) < 0) { - BROWSER_LOGD("bp_bookmark_adaptor_get_ids_p is failed"); - return false; - } - - if (ids_count <= 0) { - BROWSER_LOGD("bookmark list is empty"); - free(ids); - return false; - } - - bp_bookmark_info_fmt info; - BROWSER_LOGD("list.size() before : %d", list.size()); - BROWSER_LOGD("ids_count: %d", ids_count); - for(int i = 0; i < ids_count; i++) { - BROWSER_LOGD("list.size(): %d", list.size()); - BROWSER_LOGD("index : %d", i); - if (bp_bookmark_adaptor_get_info(ids[i], (BP_BOOKMARK_O_TYPE | - BP_BOOKMARK_O_SEQUENCE | - BP_BOOKMARK_O_IS_EDITABLE | BP_BOOKMARK_O_URL | - BP_BOOKMARK_O_TITLE | - BP_BOOKMARK_O_IS_OPERATOR), &info) == 0) { - BookmarkItem *item = new BookmarkItem(); - item->setId(ids[i]); - item->set_folder_flag(static_cast(info.type)); - item->setDir(folder_id); - item->set_editable_flag(static_cast(info.editable)); - - if (info.url != nullptr && strlen(info.url) > 0) - item->setAddress(info.url); - - if (info.title != nullptr && strlen(info.title) > 0) - item->setTittle(info.title); - - if (info.is_operator > 0) { - BROWSER_LOGD("this is operator bookmark"); - delete item; - } else { - BROWSER_LOGD("item is pushed"); - list.push_back(item); - } - bp_bookmark_adaptor_easy_free(&info); - } - } - BROWSER_LOGD("list.size() after: %d", list.size()); - free(ids); - return (list.empty() == false); -} - -int BookmarkService::_get_folder_count(const int folder_id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("folder ID: %d", folder_id); - - int *ids = nullptr; - int ids_count = -1; - bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, -1, 0, folder_id, 1, -1, -1, BP_BOOKMARK_O_SEQUENCE, 0); - free(ids); - return ids_count; -} - - -int BookmarkService::_get_bookmarks_count(const int folder_id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("folder ID: %d", folder_id); - - int *ids = nullptr; - int ids_count = -1; - bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, -1, 0, folder_id, 0, -1, -1, BP_BOOKMARK_O_SEQUENCE, 0); - free(ids); - return ids_count; -} - - -int BookmarkService::_get_total_contents_count(const int folder_id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("folder ID: %d", folder_id); - - int *ids = nullptr; - int ids_count = -1; - bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, -1, 0, folder_id, 0, -1, -1, BP_BOOKMARK_O_SEQUENCE, 0); - free(ids); - return ids_count; -} - -bool BookmarkService::get_list_operators(const int folder_id, std::vector &list) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("folder ID: %d", folder_id); - int *ids = nullptr; - int ids_count = -1; - - if (bp_bookmark_adaptor_get_ids_p(&ids, &ids_count, -1, 0, folder_id, -1, 1, -1, BP_BOOKMARK_O_SEQUENCE, 1) < 0) { - BROWSER_LOGD("bp_bookmark_adaptor_get_ids_p is failed"); - return false; - } - - if (ids_count <= 0) { - BROWSER_LOGD("bookmark list is empty"); - free(ids); - return false; - } - - bp_bookmark_info_fmt info; - for(int i = 0; i < ids_count; i++) { - if (bp_bookmark_adaptor_get_info(ids[i], (BP_BOOKMARK_O_TYPE | - BP_BOOKMARK_O_SEQUENCE | - BP_BOOKMARK_O_IS_EDITABLE | BP_BOOKMARK_O_URL | - BP_BOOKMARK_O_TITLE), &info) == 0) { - BookmarkItem *item = new BookmarkItem(); - item->setId(ids[i]); - item->set_folder_flag(static_cast(info.type)); - item->setDir(folder_id); - item->set_editable_flag(static_cast(info.editable)); - - if (info.url != nullptr && strlen(info.url) > 0) - item->setAddress(info.url); - - if (info.title != nullptr && strlen(info.title) > 0) - item->setTittle(info.title); - - list.push_back(item); - bp_bookmark_adaptor_easy_free(&info); - } - } - free(ids); - return (list.empty() == false); -} - -bool BookmarkService::get_list_by_keyword(const char *keyword, std::vector &list) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - - if (!keyword || (strlen(keyword) == 0)) { - BROWSER_LOGD("keyword is nullptr"); - return false; - } - - std::string buf_str(keyword); - buf_str = "%" + buf_str + "%"; - - bp_bookmark_property_cond_fmt properties; - properties.parent = -1; - properties.type = 0; - properties.is_operator = -1; - properties.is_editable = -1; - //conditions for querying - bp_bookmark_rows_cond_fmt conds; - conds.limit = -1; - conds.offset = 0; - conds.order_offset = BP_BOOKMARK_O_TITLE; - conds.ordering = -1; - conds.period_offset = BP_BOOKMARK_O_DATE_CREATED; - conds.period_type = BP_BOOKMARK_DATE_ALL; - - int *ids = nullptr; - int ids_count = -1; - if (bp_bookmark_adaptor_get_cond_ids_p(&ids, &ids_count, &properties, &conds, - (BP_BOOKMARK_O_TITLE | BP_BOOKMARK_O_URL), buf_str.c_str(), 1) < 0) { - BROWSER_LOGE("bp_bookmark_adaptor_get_cond_ids_p is failed"); - return false; - } - - if (ids_count <= 0) { - BROWSER_LOGD("bookmark list is empty"); - free(ids); - return false; - } - - bp_bookmark_info_fmt info; - for(int i = 0; i < ids_count; i++) { - if (bp_bookmark_adaptor_get_info(ids[i], (BP_BOOKMARK_O_TYPE | - BP_BOOKMARK_O_PARENT | BP_BOOKMARK_O_SEQUENCE | - BP_BOOKMARK_O_IS_EDITABLE | BP_BOOKMARK_O_URL | - BP_BOOKMARK_O_TITLE), &info) == 0) { - BookmarkItem *item = new BookmarkItem(); - item->setId(ids[i]); - item->set_folder_flag(static_cast(info.type)); - item->setDir(info.parent); - item->set_editable_flag(static_cast(info.editable)); - - if (info.url != nullptr && strlen(info.url) > 0) - item->setAddress(info.url); - - if (info.title != nullptr && strlen(info.title) > 0) - item->setTittle(info.title); - - list.push_back(item); - bp_bookmark_adaptor_easy_free(&info); - } - } - free(ids); - return true; -} - -void BookmarkService::destroy_list(std::vector &list) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - - for(unsigned int i = 0 ; i < list.size() ; i++) { - delete list[i]; - } - list.clear(); -} - -bool BookmarkService::get_folder_depth_count(int *depth_count) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("depth_count: %d", *depth_count); - return _get_depth_count_recursive(get_root_folder_id(), 0, depth_count); -} - -bool BookmarkService::_get_depth_count_recursive(int folder_id, int cur_depth, int *depth_count) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("current_depth: %d, depth_count:%d", cur_depth, *depth_count); - - std::vector bookmark_list = get_list_by_folder(folder_id); - if (!bookmark_list.empty()) { - BROWSER_LOGE("get_list_by_folder is failed(folder id:%d)",folder_id); - return false; - } - - for(unsigned int j = 0 ; j < bookmark_list.size() ; j++) { - if (bookmark_list[j]->is_folder()) { - /* Folder item is found. get sub list */ - if ((cur_depth+1) > *depth_count) - *depth_count = cur_depth+1; - - _get_depth_count_recursive(bookmark_list[j]->getId(), cur_depth+1, depth_count); - } - } - destroy_list(bookmark_list); - return true; -} - -bool BookmarkService::set_thumbnail(int id, Evas_Object *thumbnail) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("id : %d", id); - - int w = 0; - int h = 0; - int stride = 0; - int len = 0; - - //platform_Service ps. - //ps.evas_image_size_get(thumbnail, &w, &h, &stride); - len = stride * h; - BROWSER_LOGD("thumbnail w=[%d], h=[%d], stride=[%d], len=[%d]", w, h, stride, len); - - if (len == 0) - return false; - - void *thumbnail_data = evas_object_image_data_get(thumbnail, true); - int ret = bp_bookmark_adaptor_set_snapshot(id, w, h, (const unsigned char *)thumbnail_data, len); - if (ret < 0) { - BROWSER_LOGE("bp_bookmark_adaptor_set_thumbnail is failed"); - return false; - } - return true; -} - -Evas_Object *BookmarkService::get_thumbnail(int id, Evas_Object *parent) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("id : %d", id); - void *thumbnail_data = nullptr; - int w = 0; - int h = 0; - int len = 0; - Evas_Object *icon = nullptr; - - int ret = bp_bookmark_adaptor_get_snapshot(id, &w, &h, (unsigned char **)&thumbnail_data, &len); - BROWSER_LOGE("len: %d, w:%d, h:%d", len, w, h); - if (len > 0){ - /* gengrid event area has scaled with original image if it is evas image. - therefore use elm_image*/ - icon = elm_image_add(parent); - Evas_Object *icon_object = elm_image_object_get(icon); - evas_object_image_colorspace_set(icon_object, EVAS_COLORSPACE_ARGB8888); - evas_object_image_size_set(icon_object, w, h); - evas_object_image_fill_set(icon_object, 0, 0, w, h); - evas_object_image_filled_set(icon_object, true); - evas_object_image_alpha_set(icon_object,true); - - void *target_image_data = evas_object_image_data_get(icon_object, true); - memcpy(target_image_data, thumbnail_data, len); - evas_object_image_data_set(icon_object, target_image_data); - } - - return icon; -} - -bool BookmarkService::set_favicon(int id, Evas_Object *favicon) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("id : %d", id); - - int w = 0; - int h = 0; - int stride = 0; - int len = 0; - - //platform_Service ps. - //ps.evas_image_size_get(favicon, &w, &h, &stride); - len = stride * h; - BROWSER_LOGD("favicon w=[%d], h=[%d], stride=[%d], len=[%d]", w, h, stride, len); - - if (len == 0) - return false; - - void *favicon_data = evas_object_image_data_get(favicon, true); - int ret = bp_bookmark_adaptor_set_icon(id, w, h, (const unsigned char *)favicon_data, len); - if (ret < 0) { - BROWSER_LOGE("bp_bookmark_adaptor_set_favicon is failed"); - return false; - } - return true; -} - -Evas_Object *BookmarkService::get_favicon(int id, Evas_Object *parent) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("id : %d", id); - void *favicon_data = nullptr; - int w = 0; - int h = 0; - int len = 0; - - Evas *e = nullptr; - e = evas_object_evas_get(parent); - if (!e) { - BROWSER_LOGE("canvas is nullptr"); - return nullptr; - } - int ret = bp_bookmark_adaptor_get_icon(id, &w, &h, (unsigned char **)&favicon_data, &len); - if (ret < 0) { - BROWSER_LOGE("bp_bookmark_adaptor_set_favicon is failed"); - return nullptr; - } - - Evas_Object *icon = nullptr; - BROWSER_LOGE("len: %d, w:%d, h:%d", len, w, h); - if (len > 0){ - icon = evas_object_image_filled_add(e); - if (w == 0 || h == 0) { - // Android bookmark. - evas_object_image_memfile_set(icon, favicon_data, len, nullptr, nullptr); - } else { - // Tizen bookmark. - evas_object_image_colorspace_set(icon, EVAS_COLORSPACE_ARGB8888); - evas_object_image_size_set(icon, w, h); - evas_object_image_fill_set(icon, 0, 0, w, h); - evas_object_image_filled_set(icon, true); - evas_object_image_alpha_set(icon,true); - - void *target_image_data = evas_object_image_data_get(icon, true); - memcpy(target_image_data, favicon_data, len); - evas_object_image_data_set(icon, target_image_data); - } - } - return icon; -} - -bool BookmarkService::set_webicon(int id, Evas_Object *webicon) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("id : %d", id); - - int w = 0; - int h = 0; - int stride = 0; - int len = 0; - - //platform_Service ps; - //ps.evas_image_size_get(webicon, &w, &h, &stride); - len = stride * h; - BROWSER_LOGD("webicon w=[%d], h=[%d], stride=[%d], len=[%d]", w, h, stride, len); - - if (len == 0) - return false; - - void *webicon_data = evas_object_image_data_get(webicon, true); - int ret = bp_bookmark_adaptor_set_webicon(id, w, h, (const unsigned char *)webicon_data, len); - if (ret != 0) - BROWSER_LOGE("set webicon is failed"); - return false; -} - -Evas_Object *BookmarkService::get_webicon(int id, Evas_Object *parent) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("id : %d", id); - void *webicon_data = nullptr; - int w = 0; - int h = 0; - int len = 0; - - int ret = bp_bookmark_adaptor_get_webicon(id, &w, &h, (unsigned char **)&webicon_data, &len); - if (ret != 0) { - BROWSER_LOGE("bp_bookmark_adaptor_set_webicon is failed"); - return nullptr; - } - - Evas_Object *icon = nullptr; - BROWSER_LOGE("len: %d, w:%d, h:%d", len, w, h); - if (len > 0){ - Evas *e = evas_object_evas_get(parent); - icon = evas_object_image_filled_add(e); - - evas_object_image_colorspace_set(icon, EVAS_COLORSPACE_ARGB8888); - evas_object_image_size_set(icon, w, h); - evas_object_image_fill_set(icon, 0, 0, w, h); - evas_object_image_filled_set(icon, true); - evas_object_image_alpha_set(icon,true); - - void *target_image_data = evas_object_image_data_get(icon, true); - memcpy(target_image_data, webicon_data, len); - evas_object_image_data_set(icon, target_image_data); - } - - return icon; -} - -bool BookmarkService::set_access_count(int id, int count) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - return !bp_bookmark_adaptor_set_access_count(id, count); -} - -bool BookmarkService::get_access_count(int id, int *count) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - return !bp_bookmark_adaptor_get_access_count(id, count); -} - -bool BookmarkService::increase_access_count(int id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - int count; - if(get_access_count(id, &count) == false) { - BROWSER_LOGD("get_access_count is failed"); - return false; - } - - if(set_access_count(id, count + 1) == false) { - BROWSER_LOGD("set_access_count is failed"); - return false; - } - - return true; -} - -bool BookmarkService::set_last_sequence(int id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - return (bp_bookmark_adaptor_set_sequence(id, -1) == -1); -} - -const char* BookmarkService::get_path_info(void) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("%s", m_path_string.c_str()); - return m_path_string.c_str(); -} - -BookmarkService::folder_info *BookmarkService::get_path_by_index(unsigned int index) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("%s", m_path_history[index]->folder_name); - return m_path_history[index]; -} - -int BookmarkService::get_path_size(void) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("%d", m_path_history.size()); - return m_path_history.size(); -} - -void BookmarkService::push_back_path(folder_info *item) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("path size before push: %d", m_path_history.size()); - m_path_history.push_back(item); -} - -void BookmarkService::pop_back_path(void) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD("path size before pop: %d", m_path_history.size()); - m_path_history.pop_back(); -} - -void BookmarkService::clear_path_history(void) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - free_path_history(); - m_path_history.clear(); -} - -void BookmarkService::free_path_history(void) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - for(unsigned int i = 0 ; i < m_path_history.size() ; i++) { - if (m_path_history[i]) { - if (m_path_history[i]->folder_name) - free(m_path_history[i]->folder_name); - - free(m_path_history[i]); - } - } -} - -void BookmarkService::change_path_lang(void) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - m_path_string.clear(); - - char *old_str = m_path_history[0]->folder_name; - m_path_history[0]->folder_name = strdup("Bookmarks"); - free(old_str); - - for(int i = 0 ; i < get_path_size(); i++) { - if (get_path_by_index(i)) { - if (m_path_string.empty()) { - m_path_string = m_path_history[0]->folder_name; - } else { - m_path_string += "/"; - m_path_string += get_path_by_index(i)->folder_name; - } - } - } - BROWSER_LOGD("str: %s", m_path_string.c_str()); -} - -void BookmarkService::path_into_sub_folder(int folder_id, const char *folder_name) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - - folder_info *item = (folder_info *)calloc(1, sizeof(folder_info)); - - item->folder_id = folder_id; - if (folder_id == get_root_folder_id()) { - item->folder_name = strdup("Bookmarks"); - } else - item->folder_name = strdup(folder_name); - push_back_path(item); - - m_path_string.clear(); - for(int i = 0 ; i < get_path_size() ; i++) { - if (get_path_by_index(i)) { - if (m_path_string.empty()) { - m_path_string = get_path_by_index(i)->folder_name; - } else { - m_path_string += "/"; - m_path_string += get_path_by_index(i)->folder_name; - } - } - } - char *path_string = (elm_entry_utf8_to_markup(m_path_string.c_str())); - m_path_string = path_string; - free(path_string); - BROWSER_LOGD("m_path_string: %s", m_path_string.c_str()); - - set_current_folder_id(folder_id); -} - -bool BookmarkService::path_to_upper_folder(int *curr_folder) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - BROWSER_LOGD(""); - - int current_depth = get_path_size(); - BROWSER_LOGD("current_depth: %d", current_depth); - - if (current_depth <= 0) { - BROWSER_LOGE("[ERROR] top folder is not valid"); - return true; - } - - int curr_depth = current_depth - 1; - if (curr_depth > 0) { - *curr_folder = get_path_by_index(curr_depth - 1)->folder_id; - if (get_path_by_index(curr_depth) && get_path_by_index(curr_depth)->folder_name) { - free(get_path_by_index(curr_depth)->folder_name); - free(get_path_by_index(curr_depth)); - } - pop_back_path(); - } else { - /* Current folder is root folder */ - if (*curr_folder != get_root_folder_id()) { - BROWSER_LOGE("[ERROR] top folder is not root folder"); - return true; - } - if (get_path_by_index(curr_depth) && get_path_by_index(curr_depth)->folder_name) { - free(get_path_by_index(curr_depth)->folder_name); - free(get_path_by_index(curr_depth)); - } - pop_back_path(); - m_path_string.clear(); - return false; - } - - m_path_string.clear(); - for(int i = 0 ; i < get_path_size() ; i++) { - if (get_path_by_index(i)) { - if (m_path_string.empty()) { - m_path_string = get_path_by_index(i)->folder_name; - } else { - m_path_string += "/"; - m_path_string += get_path_by_index(i)->folder_name; - } - } - } - BROWSER_LOGD("m_path_string: %s", m_path_string.c_str()); - - set_current_folder_id(*curr_folder); - return true; -} - } /* end of namespace services*/ } /* end of namespace tizen_browser */ diff --git a/services/BookmarkService/BookmarkService.h b/services/BookmarkService/BookmarkService.h index 3560a46..171d1c5 100644 --- a/services/BookmarkService/BookmarkService.h +++ b/services/BookmarkService/BookmarkService.h @@ -64,11 +64,7 @@ public: std::shared_ptr thumbnail=std::shared_ptr(), std::shared_ptr favicon = std::shared_ptr(), unsigned int dirId = 0); - /** - * @brief Count bookmarks and subfolders - * @return Number of bookmarks and subfolders - */ - int countBookmarksAndSubFolders(); + int countBookmarks(); /** \todo Need to change this callback function for finding stored bookmark, check getBookmarkId function * @brief Check if bookmark exists @@ -84,7 +80,6 @@ public: * @return list of bookmark items, bookmark items in a folder & bookmark folders */ std::vector > getBookmarks(int folder_id = -1); - std::vector > getBookmarkFolders(int folder_id); /** * @brief Delete all bookmarks @@ -101,16 +96,8 @@ public: */ bool deleteBookmark(const std::string & url); - void synchronizeBookmarks(); - typedef struct _folder_info { - int folder_id; - char *folder_name; - } folder_info; - - int get_root_folder_id(void); - int save_folder(const char *title, int *saved_bookmark_id, int by_operator = 0); bool delete_by_id(int id); bool delete_by_id_notify(int id); bool delete_by_uri(const char *uri); @@ -120,60 +107,19 @@ public: bool is_duplicate_check_needed = false, bool is_URI_check_needed = false); bool delete_all(void); bool get_item_by_id(int id, BookmarkItem *item); - std::vector get_list_by_folder(const int folder_id); - bool get_list_users_by_folder(const int folder_id, std::vector &list); - bool get_list_by_dividing(const int folder_id, std::vector &list, int *last_item, int genlist_block_size); - bool get_list_users_by_dividing(const int folder_id, std::vector &list, int *last_item, int genlist_block_size); - int _get_folder_count(const int folder_id); - int _get_bookmarks_count(const int folder_id); - int _get_total_contents_count(const int folder_id); - bool get_list_operators(const int folder_id, std::vector &list); - bool get_list_by_keyword(const char *keyword, std::vector &list); - void destroy_list(std::vector &list); int get_count(void); bool get_id(const char *uri, int *bookmark_id); - bool get_folder_id(const char *title, int parent_id, int *folder_id); bool is_in_bookmark(const char *uri); - bool is_in_folder(int parent_folder, const char *title); - bool get_folder_depth_count(int *depth_count); - bool set_thumbnail(int id, Evas_Object *thumbnail); - Evas_Object *get_thumbnail(int id, Evas_Object *parent); - bool set_favicon(int id, Evas_Object *favicon); - Evas_Object *get_favicon(int id, Evas_Object *parent); - bool set_webicon(int id, Evas_Object *webicon); - Evas_Object *get_webicon(int id, Evas_Object *parent); - bool set_access_count(int id, int count); - bool get_access_count(int id, int *count); - bool increase_access_count(int id); - bool set_last_sequence(int id); - const char* get_path_info(void); - folder_info *get_path_by_index(unsigned int index); - int get_path_size(void); - void push_back_path(folder_info *item); - void pop_back_path(void); - void clear_path_history(void); - void free_path_history(void); - void change_path_lang(void); - void path_into_sub_folder(int folder_id, const char *folder_name); - bool path_to_upper_folder(int *curr_folder); - bool get_memory_full(void) { return m_memory_full; } - int get_current_folder_id(void) { return m_curr_folder; } - void set_current_folder_id(int folder_id) { m_curr_folder = folder_id; } private: enum ItemType{ BOOKMARK_TYPE = 0 - , FOLDER_TYPE = 1 , ALL_TYPE = -1 }; - bool _get_depth_count_recursive(int folder_id, int cur_depth, int *depth_count); std::vector m_bookmark_list; - std::vector m_path_history; - std::string m_path_string; bool m_memory_full; bool m_bookmark_adaptor_initialize; - int m_curr_folder; std::shared_ptr m_storageManager; std::vector > m_bookmarks; /// \todo Need to change getBookmarkId function for finding stored bookmark - check getBookmarkExists function diff --git a/services/MoreMenuUI/AddBookmarkPopup.cpp b/services/MoreMenuUI/AddBookmarkPopup.cpp deleted file mode 100644 index 13d4e8f..0000000 --- a/services/MoreMenuUI/AddBookmarkPopup.cpp +++ /dev/null @@ -1,348 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include -#include -#include - -#include "Tools/EflTools.h" -#include "AddBookmarkPopup.h" -#include "BrowserLogger.h" - -namespace tizen_browser{ -namespace base_ui{ - -typedef struct _BookmarkFolderItemData -{ - int index; - std::shared_ptr item; - std::shared_ptr addBookmarkPopup; -} BookmarkFolderItemData; - - -AddBookmarkPopup::AddBookmarkPopup(Evas_Object* main_layout): - m_mainLayout(main_layout), - m_popup(nullptr), - m_gengrid(nullptr), - m_itemClass(nullptr) -{ -} - -AddBookmarkPopup::~AddBookmarkPopup () -{} - -void AddBookmarkPopup::show() -{ - BROWSER_LOGD("[%s],", __func__); - m_edjFilePath = EDJE_DIR; - m_edjFilePath.append("MoreMenuUI/AddBookmarkPopup.edj"); - elm_theme_extension_add(0, m_edjFilePath.c_str()); - m_popup = elm_layout_add(m_mainLayout); - if (m_popup != nullptr) - { - elm_object_signal_emit(m_mainLayout, "elm,state,show", "elm"); - elm_layout_file_set(m_popup, m_edjFilePath.c_str(), "bookmark_popup"); - BROWSER_LOGI("PATH: %s", m_edjFilePath.c_str()); - - m_gengrid = elm_gengrid_add(m_popup); - - if (m_gengrid != nullptr) - { - evas_object_smart_callback_add(m_gengrid, "item,focused", focusItem, nullptr); - evas_object_smart_callback_add(m_gengrid, "item,unfocused", unFocusItem, nullptr); - // evas_object_smart_callback_add(m_gengrid, "activated", _itemSelected, this); - - if (!m_itemClass) { - m_itemClass = elm_gengrid_item_class_new(); - m_itemClass->item_style = "folder_grid_item"; - m_itemClass->func.text_get = _grid_text_get; - m_itemClass->func.content_get = _grid_content_get; - m_itemClass->func.state_get = nullptr; - m_itemClass->func.del = nullptr; - } - - elm_gengrid_align_set(m_gengrid, 0, 0); - elm_gengrid_select_mode_set(m_gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_gengrid_multi_select_set(m_gengrid, EINA_FALSE); - elm_gengrid_horizontal_set(m_gengrid, EINA_FALSE); - elm_scroller_policy_set(m_gengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); - elm_scroller_page_size_set(m_gengrid, 0, 327); - evas_object_size_hint_weight_set(m_gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); - double efl_scale = elm_config_scale_get() / elm_app_base_scale_get(); - elm_gengrid_item_size_set(m_gengrid, 226 * efl_scale, 226 * efl_scale); - - elm_object_part_content_set(m_popup, "elm.swallow.gengrid", m_gengrid); - elm_object_part_content_set(m_mainLayout, "popup", m_popup); - evas_object_show(m_gengrid); - } - } -} - -void AddBookmarkPopup::hide() -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - elm_object_signal_emit(m_mainLayout, "elm,state,hide", "elm"); - evas_object_hide(elm_layout_content_get(m_popup, "elm.swallow.gengrid")); - evas_object_hide(elm_layout_content_get(m_mainLayout, "popup")); - evas_object_hide(m_gengrid); - evas_object_hide(m_popup); - clearItems(); -} - -Evas_Object * AddBookmarkPopup::getContent() -{ - return m_gengrid; -} - -void AddBookmarkPopup::setEmptyGengrid(bool setEmpty) -{ - if(setEmpty) { - elm_object_part_content_set(m_gengrid, "elm.swallow.empty", createNoHistoryLabel()); - } else { - elm_object_part_content_set(m_gengrid, "elm.swallow.empty", nullptr); - } -} - -Evas_Object* AddBookmarkPopup::createNoHistoryLabel() -{ - Evas_Object *label = elm_label_add(m_popup); - if (label != nullptr) - { - elm_object_text_set(label, "No favorite websites."); - evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL); - } - return label; -} - -void AddBookmarkPopup::addBookmarkFolderItem(std::shared_ptr hi , int ind) -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - BookmarkFolderItemData *itemData = new BookmarkFolderItemData(); - if (itemData != nullptr) - { - itemData->item = hi; - itemData->index = ind; - itemData->addBookmarkPopup = std::shared_ptr(this); - Elm_Object_Item* BookmarkFolderView = elm_gengrid_item_append(m_gengrid, m_itemClass, itemData, nullptr, this); - if (BookmarkFolderView) - { - if(ind == 1) - { - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - m_map_bookmark_folder_views.insert(std::pair("new_folder_button",BookmarkFolderView)); - } - else - m_map_bookmark_folder_views.insert(std::pair(hi->getAddress(),BookmarkFolderView)); - - elm_gengrid_item_selected_set(BookmarkFolderView, EINA_FALSE); - setEmptyGengrid(false); - } - } -} - -void AddBookmarkPopup::addBookmarkFolderItems(std::vector > items) -{ - BROWSER_LOGD("%s:%d %s Bookmark Folder Items: %d", __FILE__, __LINE__, __func__, items.size()); - int i = 1; - addBookmarkFolderItem(nullptr, i++); - for (auto it = items.begin(); it != items.end(); ++it, ++i) { - addBookmarkFolderItem(*it, i); - } - elm_object_part_content_set(m_popup, "elm.swallow.gengrid",getContent()); - evas_object_show(getContent()); -} - -char* AddBookmarkPopup::_grid_text_get(void *data, Evas_Object *, const char *part) -{ - BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part); - if ((data != nullptr) && (part != nullptr)) - { - static const char* part_name = "page_title"; - static const int part_len = strlen(part_name); - - BookmarkFolderItemData *itemData = static_cast(data); - if (!strncmp(part, part_name, part_len)) { - if(itemData->item) - return strdup(itemData->item->getTittle().c_str()); - } - } - return strdup(""); -} - -const char* AddBookmarkPopup::getImageFileNameForType(int index, bool focused) -{ - static const char *file_name = ""; - if (index == 1) { - file_name = focused ? "btn_bar_new_foc.png" : "btn_bar_new_nor.png"; - } - return file_name; -} - -Evas_Object * AddBookmarkPopup::_grid_content_get(void *data, Evas_Object *obj, const char *part) -{ - BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part); - if ((data != nullptr) && (obj != nullptr) && (part != nullptr)) - { - BookmarkFolderItemData *itemData = static_cast(data); - - static const char* part1_name = "elm.thumbnail"; - static const char* part2_name = "elm.thumbButton"; - static const int part1_len = strlen(part1_name); - static const int part2_len = strlen(part2_name); - - if (!strncmp(part, part1_name, part1_len) && (itemData->index == 1)) { - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - Evas_Object* thumb_nail = elm_icon_add(obj); - const char* file_name = getImageFileNameForType(itemData->index, false); - BROWSER_LOGD("%s:%d %s file=%s", __FILE__, __LINE__, __func__, file_name); - if (thumb_nail != nullptr) - { - elm_image_file_set(thumb_nail, itemData->addBookmarkPopup->m_edjFilePath.c_str(), file_name); - } - return thumb_nail; - } - if (!strncmp(part, part2_name, part2_len)) { - Evas_Object *thumbButton = elm_button_add(obj); - if (thumbButton != nullptr) - { - elm_object_style_set(thumbButton, part2_name); - if(itemData->index == 1) - { - evas_object_smart_callback_add(thumbButton, "clicked", tizen_browser::base_ui::AddBookmarkPopup::_newFolderButton, data); - evas_object_event_callback_add(thumbButton, EVAS_CALLBACK_MOUSE_IN, __cb_mouse_in, data); - evas_object_event_callback_add(thumbButton, EVAS_CALLBACK_MOUSE_OUT, __cb_mouse_out, data); - } - else - evas_object_smart_callback_add(thumbButton, "clicked", tizen_browser::base_ui::AddBookmarkPopup::_thumbSelected, data); - } - return thumbButton; - } - - } - return nullptr; -} - -void AddBookmarkPopup::__cb_mouse_in(void * data, Evas *, Evas_Object *obj, void *) -{ - BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__); - if ((data != nullptr) && (obj != nullptr)) - { - elm_object_focus_set(obj, EINA_TRUE); - BookmarkFolderItemData *itemData = static_cast(data); - - const char* file_name = getImageFileNameForType(itemData->index, true); - Elm_Object_Item * selected = itemData->addBookmarkPopup->m_map_bookmark_folder_views["new_folder_button"]; - if (selected != nullptr) - { - Evas_Object *thumb_nail = elm_object_item_part_content_get(selected, "elm.thumbnail"); - if (thumb_nail != nullptr) - { - elm_image_file_set(thumb_nail, itemData->addBookmarkPopup->m_edjFilePath.c_str(), file_name); - } - } - } -} - -void AddBookmarkPopup::__cb_mouse_out(void * data, Evas *, Evas_Object *obj, void* ) -{ - BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__); - if (data && obj){ - BookmarkFolderItemData *itemData = static_cast(data); - elm_object_focus_set(obj, EINA_FALSE); - const char* file_name = getImageFileNameForType(itemData->index, false); - Elm_Object_Item * selected = itemData->addBookmarkPopup->m_map_bookmark_folder_views["new_folder_button"]; - Evas_Object *thumb_nail = elm_object_item_part_content_get(selected, "elm.thumbnail"); - elm_image_file_set(thumb_nail, itemData->addBookmarkPopup->m_edjFilePath.c_str(), file_name); - } -} - -//void AddBookmarkPopup::_itemSelected(void* , Evas_Object* , void*) -//{ -// BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); -// if (data && event_info) { -// Elm_Object_Item * selected = static_cast(event_info); -// HistoryItemData * itemData = static_cast(elm_object_item_data_get(selected)); -// AddBookmarkPopup * self = static_cast(data); -// -// self->bookmarkClicked(itemData->item); -// } -//} - - -void AddBookmarkPopup::_newFolderButton(void* data, Evas_Object*, void*) -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - if (data) { - BookmarkFolderItemData * itemData = static_cast(data); - itemData->addBookmarkPopup->addNewFolderClicked(std::string()); - } -} - -void AddBookmarkPopup::_thumbSelected(void* data, Evas_Object*, void*) -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - if (data) { - BookmarkFolderItemData * itemData = static_cast(data); - itemData->addBookmarkPopup->folderSelected(itemData->item->getId()); - } -} - -void AddBookmarkPopup::clearItems() -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - elm_gengrid_clear(m_gengrid); - m_map_bookmark_folder_views.clear(); - elm_theme_extension_del(nullptr, m_edjFilePath.c_str()); - elm_theme_full_flush(); - elm_cache_all_flush(); -} - - -void AddBookmarkPopup::updateGengrid() -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - elm_gengrid_clear(m_gengrid); - m_map_bookmark_folder_views.clear(); -} - -void AddBookmarkPopup::focusItem(void*, Evas_Object*, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (event_info) { - Elm_Object_Item *item = static_cast(event_info); - elm_object_item_signal_emit(item, "mouse,in", "over2"); - - // selected manually - elm_gengrid_item_selected_set(item, EINA_TRUE); - } -} - -void AddBookmarkPopup::unFocusItem(void*, Evas_Object*, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (event_info) { - Elm_Object_Item *item = static_cast(event_info); - elm_object_item_signal_emit(item, "mouse,out", "over2"); - - // unselected manually - elm_gengrid_item_selected_set(item, EINA_FALSE); - } -} - -} -} diff --git a/services/MoreMenuUI/AddBookmarkPopup.h b/services/MoreMenuUI/AddBookmarkPopup.h deleted file mode 100644 index bce7ada..0000000 --- a/services/MoreMenuUI/AddBookmarkPopup.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef ADDBOOKMARKPOPUP_H -#define ADDBOOKMARKPOPUP_H - -#include -#include - -#include "AbstractUIComponent.h" -#include "AbstractService.h" -#include "ServiceFactory.h" -#include "service_macros.h" -#include "BookmarkItem.h" - -namespace tizen_browser{ -namespace base_ui{ - -class AddBookmarkPopup{ - -public: - AddBookmarkPopup(Evas_Object *main_layout); - ~AddBookmarkPopup(); - - Evas_Object *getContent(); - void addBookmarkFolderItem(std::shared_ptr , int); - void addBookmarkFolderItems(std::vector >); - void clearItems(); - void updateGengrid(); - Evas_Object* createNoHistoryLabel(); - void setEmptyGengrid(bool setEmpty); - - boost::signals2::signal blockClicked; - boost::signals2::signal folderSelected; - boost::signals2::signal addNewFolderClicked; - /** - * Theese setters should be called before showing popup. - */ - void show(); - void hide(); - -private: - static char* _grid_text_get(void *data, Evas_Object *, const char *part); - static Evas_Object * _grid_content_get(void *data, Evas_Object *obj, const char *part); - //static void _itemSelected(void * data, Evas_Object * obj, void * event_info); - static void _thumbSelected(void * data, Evas_Object * obj, void * event_info); - static void _newFolderButton(void *data, Evas_Object *obj, void *event_info); - static Evas_Object* listItemContentGet(void *data, Evas_Object *obj, const char *part); - static char* listItemTextGet(void *data, Evas_Object *obj, const char *part); - - static void item_clicked_cb(void *data, Evas_Object *obj, void *event_info); - static void close_clicked_cb(void *data, Evas_Object *obj, void *event_info); - - static const char* getImageFileNameForType(int index, bool focused); - - Evas_Object *m_mainLayout; - Evas_Object *m_popup; - Evas_Object *m_gengrid; - - Elm_Gengrid_Item_Class * m_itemClass; - std::map m_map_bookmark_folder_views; - std::string m_edjFilePath; - bool m_gengridSetup; - - static void __cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void __cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); - - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); -}; -} -} -#endif diff --git a/services/MoreMenuUI/CMakeLists.txt b/services/MoreMenuUI/CMakeLists.txt index 611598b..6754d80 100644 --- a/services/MoreMenuUI/CMakeLists.txt +++ b/services/MoreMenuUI/CMakeLists.txt @@ -2,14 +2,10 @@ project(MoreMenuUI) set(MoreMenuUI_SRCS MoreMenuUI.cpp - AddBookmarkPopup.cpp - NewFolderPopup.cpp ) set(MoreMenuUI_HEADERS MoreMenuUI.h - AddBookmarkPopup.h - NewFolderPopup.h ) include(Coreheaders) @@ -31,8 +27,6 @@ include(EDCCompile) #please do not add edc/ directory set(edcFiles MoreMenu.edc - AddBookmarkPopup.edc - NewFolderPopup.edc ) foreach(edec ${edcFiles}) diff --git a/services/MoreMenuUI/MoreMenuUI.cpp b/services/MoreMenuUI/MoreMenuUI.cpp index 5e55319..d8050ec 100644 --- a/services/MoreMenuUI/MoreMenuUI.cpp +++ b/services/MoreMenuUI/MoreMenuUI.cpp @@ -284,8 +284,7 @@ void MoreMenuUI::_star_clicked(void* data, Evas_Object*, void*) MoreMenuUI *moreMenuUI = static_cast(data); if (EINA_FALSE == moreMenuUI->m_isBookmark) { - moreMenuUI->addToBookmarkClicked(); - moreMenuUI->AddBookmarkPopupCalled(); + moreMenuUI->addToBookmarkClicked(0); } else { moreMenuUI->m_isBookmark = EINA_FALSE; @@ -304,60 +303,6 @@ void MoreMenuUI::_close_clicked(void* data, Evas_Object*, void*) } } -void MoreMenuUI::AddBookmarkPopupCalled() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_add_bookmark_popup = std::make_shared(m_mm_layout); - m_add_bookmark_popup->show(); - m_add_bookmark_popup->addBookmarkFolderItems(m_map_bookmark_folder_list); - m_add_bookmark_popup->folderSelected.disconnect_all_slots(); - m_add_bookmark_popup->folderSelected.connect(boost::bind(&MoreMenuUI::addToBookmarks, this, _1)); - m_add_bookmark_popup->addNewFolderClicked.disconnect_all_slots(); - m_add_bookmark_popup->addNewFolderClicked.connect(boost::bind(&MoreMenuUI::newFolderPopup, this,_1)); -} - -void MoreMenuUI::newFolderPopup(std::string) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_new_folder_popup = - std::make_shared(m_mm_layout - , nullptr - , "Add New Folder for adding to Bookmark" - , "New Folder" - , "Add to bookmark" - , "Cancel"); - m_new_folder_popup->on_ok.disconnect_all_slots(); - m_new_folder_popup->on_ok.connect(boost::bind(&MoreMenuUI::NewFolderCreate, this, _1)); - m_new_folder_popup->on_cancel.disconnect_all_slots(); - m_new_folder_popup->on_cancel.connect(boost::bind(&MoreMenuUI::CancelClicked, this, _1)); - m_add_bookmark_popup->hide(); - m_new_folder_popup->show(); -} - -void MoreMenuUI::NewFolderCreate(Evas_Object* popup_content) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (popup_content) { - m_folderName = elm_entry_entry_get(popup_content); - BookmarkFolderCreated(m_folderName.c_str(), 0); - m_new_folder_popup->hide(); - } -} - -void MoreMenuUI::CancelClicked(Evas_Object*) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_new_folder_popup->hide(); -} - -void MoreMenuUI::addToBookmarks(int folder_id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - AddBookmarkInput(folder_id); - m_add_bookmark_popup->hide(); - m_add_bookmark_popup.reset(); -} - void MoreMenuUI::hide() { evas_object_hide(elm_layout_content_get(m_mm_layout, "elm.swallow.grid")); @@ -601,18 +546,12 @@ void MoreMenuUI::_thumbSelected(void* data, Evas_Object*, void*) } } -void MoreMenuUI::getBookmarkFolderList(std::vector > folderList) -{ - m_map_bookmark_folder_list = folderList; -} - void MoreMenuUI::clearItems() { hide(); BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); elm_gengrid_clear(m_gengrid); m_map_menu_views.clear(); - m_map_bookmark_folder_list.clear(); evas_object_del(m_current_tab_bar); elm_theme_extension_del(NULL, m_edjFilePath.c_str()); elm_theme_full_flush(); diff --git a/services/MoreMenuUI/MoreMenuUI.h b/services/MoreMenuUI/MoreMenuUI.h index 7624b0a..4b1dac1 100644 --- a/services/MoreMenuUI/MoreMenuUI.h +++ b/services/MoreMenuUI/MoreMenuUI.h @@ -28,9 +28,6 @@ #include "service_macros.h" #include "BookmarkItem.h" -#include "AddBookmarkPopup.h" -#include "NewFolderPopup.h" -#include "../BookmarkManagerUI/AddNewFolderPopup.h" #include "services/HistoryService/HistoryItem.h" namespace tizen_browser{ @@ -79,19 +76,15 @@ public: //TODO: remove this function after new view managment introduction. void hide(); void clearItems(); - void getBookmarkFolderList(std::vector > ); void setFavIcon(std::shared_ptr favicon); void setWebTitle(const std::string& title); void setURL(const std::string& url); void changeBookmarkStatus(bool data); void createToastPopup(const char* text); - boost::signals2::signal addToBookmarkClicked; - boost::signals2::signal AddBookmarkInput; - boost::signals2::signal BookmarkFolderCreated; + boost::signals2::signal addToBookmarkClicked; //TODO: remove redundant argument from this signal. boost::signals2::signal bookmarkManagerClicked; - boost::signals2::signal BookmarkFoldersListImport; boost::signals2::signal historyUIClicked; boost::signals2::signal settingsClicked; //TODO: remove redundant argument from this signal. @@ -110,12 +103,6 @@ private: static void _exitClicked(); void setDocIcon(); - void newFolderPopup(std::string); - void NewFolderCreate(Evas_Object * popup_content); - void CancelClicked(Evas_Object * popup_content); - - void AddBookmarkPopupCalled(); - void addToBookmarks(int folder_id); static void _star_clicked(void *data, Evas_Object *obj, void *event_info); static void _close_clicked(void *data, Evas_Object *obj, void *event_info); @@ -125,9 +112,7 @@ private: static void __cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); Evas_Object *m_current_tab_bar; - std::shared_ptr m_new_folder_popup; Evas_Object *m_mm_layout; - std::shared_ptr m_add_bookmark_popup; Evas_Object *m_gengrid; Evas_Object *m_parent; Evas_Object *m_toastPopup; @@ -135,9 +120,7 @@ private: Evas_Object *m_bookmarkIcon; Elm_Gengrid_Item_Class * m_item_class; std::map m_map_menu_views; - std::vector > m_map_bookmark_folder_list; std::string m_edjFilePath; - std::string m_folderName; bool m_gengridSetup; bool m_desktopMode; Eina_Bool m_isBookmark; diff --git a/services/MoreMenuUI/NewFolderPopup.cpp b/services/MoreMenuUI/NewFolderPopup.cpp deleted file mode 100644 index ca5ef0f..0000000 --- a/services/MoreMenuUI/NewFolderPopup.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - -#include -#include -#include - -#include "Tools/EflTools.h" -#include "NewFolderPopup.h" -#include "BrowserLogger.h" - -#define efl_scale (elm_config_scale_get() / elm_app_base_scale_get()) - -namespace tizen_browser{ -namespace base_ui{ - -NewFolderPopup::NewFolderPopup(Evas_Object* main_layout) : - m_popup(nullptr), - m_content(nullptr), - m_mainLayout(main_layout) -{ - -} - -NewFolderPopup::NewFolderPopup(Evas_Object *main_layout - , Evas_Object *content - , const char *message - , const char *title - , const char *okButtonText - , const char *cancelButtonText) : - m_popup(nullptr), - m_content(content), - m_message(message), - m_title(title), - m_okButtonText(okButtonText), - m_cancelButtonText(cancelButtonText), - m_mainLayout(main_layout) -{ - -} - -void NewFolderPopup::setTitle(const std::string& title) -{ - m_title = title; -} - -void NewFolderPopup::setMessage(const std::string& message) -{ - m_message = message; -} - -void NewFolderPopup::setContent(Evas_Object* content) -{ - m_content = content; -} - -void NewFolderPopup::setOkButtonText(const std::string& okButtonText) -{ - m_okButtonText = okButtonText; -} - -void NewFolderPopup::setCancelButtonText(const std::string& cancelButtonText) -{ - m_cancelButtonText = cancelButtonText; -} - -void NewFolderPopup::show() -{ - BROWSER_LOGD("[%si %d],", __func__, __LINE__); - std::string edjePath = std::string(EDJE_DIR); - edjePath.append("MoreMenuUI/NewFolderPopup.edj"); - elm_theme_extension_add(0, edjePath.c_str()); - m_popup = elm_layout_add(m_mainLayout); - elm_layout_file_set(m_popup, edjePath.c_str(), "new_folder_popup"); - elm_object_part_text_set(m_popup, "title_text", m_title.c_str()); - - Evas_Object *buttonsBox = elm_box_add(m_popup); - elm_box_horizontal_set(buttonsBox, EINA_TRUE); - - /* for margins */ - Evas_Object *layout = elm_layout_add(m_popup); - elm_layout_file_set(layout, edjePath.c_str() , "popup_input_text"); - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_content_set(m_popup, layout); - elm_object_part_text_set(m_popup, "title,text", m_title.c_str()); - - m_editfield_entry = elm_entry_add(layout); - elm_object_style_set(m_editfield_entry, "uri_entry_popup"); - evas_object_size_hint_weight_set(m_editfield_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_editfield_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_entry_editable_set(m_editfield_entry, EINA_TRUE); - elm_entry_cnp_mode_set(m_editfield_entry, ELM_CNP_MODE_PLAINTEXT); - elm_entry_scrollable_set(m_editfield_entry, EINA_TRUE); - elm_entry_autocapital_type_set(m_editfield_entry, ELM_AUTOCAPITAL_TYPE_NONE); - elm_entry_prediction_allow_set(m_editfield_entry, EINA_FALSE); - elm_entry_single_line_set(m_editfield_entry, EINA_TRUE); - - elm_entry_input_panel_layout_set(m_editfield_entry, ELM_INPUT_PANEL_LAYOUT_URL); - elm_entry_input_panel_return_key_type_set(m_editfield_entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); - elm_object_part_content_set(layout, "elm.swallow.content" , m_editfield_entry); - elm_entry_cursor_end_set(m_editfield_entry); - - if (!m_okButtonText.empty()) - { - BROWSER_LOGD("Button1, %s", edjePath.c_str()); - Evas_Object *btn1 = elm_button_add(buttonsBox); - evas_object_size_hint_weight_set(btn1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(btn1, 0.5, 0.5); - elm_object_style_set(btn1, "bookmark_button"); - elm_object_part_text_set(btn1, "elm.text", m_okButtonText.c_str()); - elm_box_pack_end(buttonsBox, btn1); - evas_object_smart_callback_add(btn1, "clicked", popup_ok_cb, (void*)this); - evas_object_show(btn1); - } - - if (!m_cancelButtonText.empty()) - { - BROWSER_LOGD("Button2"); - Evas_Object *btn2 = elm_button_add(buttonsBox); - evas_object_size_hint_weight_set(btn2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(btn2, 0.5, 0.5); - elm_object_style_set(btn2, "bookmark_button"); - elm_object_part_text_set(btn2, "elm.text", m_cancelButtonText.c_str()); - elm_box_pack_end(buttonsBox, btn2); - evas_object_smart_callback_add(btn2, "clicked", popup_cancel_cb, (void*)this); - evas_object_show(btn2); - } - - if(!m_message.empty()) - elm_object_part_text_set(m_popup, "elm.text", m_message.c_str()); - - evas_object_show(m_editfield_entry); - evas_object_show(buttonsBox); - evas_object_show(layout); - elm_object_part_content_set(m_popup, "buttons", buttonsBox); - elm_object_part_content_set(m_popup, "content", layout); - elm_object_part_content_set(m_mainLayout, "popup", m_popup); - - elm_object_signal_emit(m_mainLayout, "elm,state,show", "elm"); -} - -void NewFolderPopup::hide() -{ - evas_object_hide(m_popup); - elm_object_signal_emit(m_mainLayout, "elm,state,hide", "elm"); -} - -void NewFolderPopup::popup_ok_cb(void *data, Evas_Object*, void*) -{ - BROWSER_LOGD("[%s],", __func__); - if (data) { - NewFolderPopup *ownPopup = static_cast(data); - ownPopup->on_ok(ownPopup->m_editfield_entry); - } -} -void NewFolderPopup::popup_cancel_cb(void *data, Evas_Object*, void*) -{ - BROWSER_LOGD("[%s],", __func__); - if (data) { - NewFolderPopup *ownPopup = static_cast(data); - ownPopup->on_cancel(ownPopup->m_editfield_entry); - } -} - -} -} diff --git a/services/MoreMenuUI/NewFolderPopup.h b/services/MoreMenuUI/NewFolderPopup.h deleted file mode 100644 index e0fd051..0000000 --- a/services/MoreMenuUI/NewFolderPopup.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef NEWFOLDERPOPUP_H -#define NEWFOLDERPOPUP_H - -#include -#include - -#include "AbstractUIComponent.h" -#include "AbstractService.h" -#include "ServiceFactory.h" -#include "service_macros.h" -#include "BookmarkItem.h" - -namespace tizen_browser{ -namespace base_ui{ - -class NewFolderPopup{ - -public: - NewFolderPopup(Evas_Object *main_layout); - NewFolderPopup(Evas_Object *main_layout - , Evas_Object *content - , const char *message - , const char *title - , const char *okButtonText - , const char *cancelButtonText); - - /** - * Theese setters should be called before showing popup. - */ - void setContent(Evas_Object *content); - void setMessage(const std::string &message); - void setTitle(const std::string &title); - void setOkButtonText(const std::string &okButtonText); - void setCancelButtonText(const std::string &cancelButtonText); - - void show(); - void hide(); - boost::signals2::signal on_ok; - boost::signals2::signal on_cancel; - -private: - static void popup_ok_cb(void *data, Evas_Object *btn, void*); - static void popup_cancel_cb(void *data, Evas_Object *btn, void*); - Evas_Object *m_popup; - Evas_Object *m_editfield_entry; - Evas_Object *m_content; - std::string m_message, m_title, m_okButtonText, m_cancelButtonText; - -protected: - Evas_Object *m_mainLayout; -}; - -} -} -#endif diff --git a/services/MoreMenuUI/edc/AddBookmarkPopup.edc b/services/MoreMenuUI/edc/AddBookmarkPopup.edc deleted file mode 100644 index ec3c60a..0000000 --- a/services/MoreMenuUI/edc/AddBookmarkPopup.edc +++ /dev/null @@ -1,370 +0,0 @@ -#define CONTENT_HEIGHT 99; -#define CONTENT_BG_HEIGHT (CONTENT_HEIGHT+294); - -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 128; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } - -#define RESOURCE_IMAGE_LOSSY( FILE_NAME ) \ - group { \ - name: FILE_NAME; \ - images.image: FILE_NAME LOSSY 100; \ - parts { \ - part { name: "image"; \ - description { \ - state: "default" 0.0; \ - image.normal: FILE_NAME; \ - min: 134 167; \ - max: 134 167; \ - aspect_preference: BOTH; \ - } \ - } \ - } \ - } - - - -collections{ - RESOURCE_IMAGE_LOSSY("btn_bar_new_foc.png") - RESOURCE_IMAGE_LOSSY("btn_bar_new_nor.png") - - group { name: "bookmark_popup"; - parts{ - part{ name: "content_bg"; - type: RECT; - scale: 1; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - color: 255 255 255 255; - align: 0.5 0.5; - min: 740 658; - max: 740 884; - rel1 {relative: 0.0 0.0;} - rel2 {relative: 1.0 1.0;} - } - } - part{ name: "title_bg"; - type: RECT; - description{ - state: "default" 0.0; - visible: 1; - color: 255 255 255 255; - min: 740 144; - max: 740 144; - align: 0.0 0; - rel1 {relative: 0.0 0.0; to: "content_bg"; offset: 0 0;} - rel2 {relative: 1.0 1.0; to: "content_bg";} - } - } - part{ name: "title_text_bm"; - type: TEXT; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 {relative: 0.0 0.0; to: "title_bg"; offset: 40 46;} - rel2 {relative: 1.0 1.0; to: "title_bg"; offset: -40 0;} - color: 51 51 51 255; - text{ - text: "Add to bookmark"; - font: "Sans"; - size: 42; - align: 0.5 0.0; - } - } - } - part{ name: "sub_title_text_bm"; - type: TEXT; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 {relative: 0.0 0.0; to: "title_bg"; offset: 40 112;} - rel2 {relative: 1.0 1.0; to: "title_bg"; offset: -40 0;} - color: 104 104 104 255; - text{ - text: "Select folder for adding to bookmark"; - font: "Sans"; - size: 32; - align: 0.5 0.0; - } - } - } - part{ name: "gengrid_bg"; - type: RECT; - mouse_events: 0; - description{ - state: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 {relative: 0.0 1.0; to: "title_bg"; offset: 40 40;} - rel2 {relative: 1.0 1.0; } - align: 0 0; - min: 698 452; - max: 698 678; - } - } - part{ name: "elm.swallow.gengrid"; - type: SWALLOW; - scale: 1; - description{ - state: "default" 0.0; - visible: 1; - fixed: 0 0; - rel1 {relative: 0.0 0.0; to: "gengrid_bg";} - rel2 {relative: 1.0 1.0; to: "gengrid_bg";} - align: 0.0 0.0; - min: 698 452; - max: 698 678; - } - } - } - } - - /* group { - name: "own_popup_bm_long"; - inherit: "own_popup_bm"; - parts { - part{ name: "content"; - type: SWALLOW; - scale: 1; - description{ - state: "default" 0.0; - visible: 1; - rel1 {relative: 0.0 0.0;} - rel2 {relative: 1.0 1.0;} - fixed: 1 1; - align: 0.5 0.5; - min: 542 0; - max: 542 450; - } - } - } - } - */ - -group { name: "elm/gengrid/item/folder_grid_item/default"; - data.item: "texts" "page_title"; - data.item: "contents" "elm.thumbnail elm.thumbButton"; - images { - image: "web_frame_selected.png" COMP; - image: "ico_bg_round_shape_37x37.png" COMP; - image: "btn_bar_new_nor.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 1; - min: 226 226; - max: 226 226; - color: 255 255 255 255; - rel1.offset: -18 -18; - } - description { state: "selected"; - inherit: "default" 0.0; - color: 70 143 254 255; - } - } - - part { name: "thumbnail_bg"; - type: RECT; - description { state: "default" 0.0; - visible: 1; - min: 208 208; - max: 208 208; - align: 0.0 0.0; - color : 231 231 231 255; - rel1 { - relative: 0.0 0.0; to: "bg"; - } - rel2 { - relative: 1.0 1.0; to: "bg"; - } - } - description { state: "selected"; - inherit: "default" 0.0; - color: 70 143 254 255; - } - } - part { name: "elm.thumbnail"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - visible: 1; - align: 0.0 0.0; - color : 255 255 255 255; - rel1 { - relative: 0.0 0.0; to: "thumbnail_bg"; - } - rel2 { - relative: 1.0 1.0; to: "thumbnail_bg"; - } - } - description { state: "selected"; - inherit: "default" 0.0; - } - } - part { name: "page_title"; - type: TEXT; - description { state: "default" 0.0; - align: 0.5 0.5; - rel1 { - to: "thumbnail_bg"; - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - to: "thumbnail_bg"; - relative: 1.0 1.0; - } - color: 51 51 51 255; - text { - text: "Web page title"; - font: "Sans"; - size: 32; - align: 0.5 0.5; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - //color: highlightTextColor; - } - } - part { name: "elm.thumbButton"; - type: SWALLOW; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.thumbnail"; - rel2.to: "elm.thumbnail"; - } - } - part { name: "over"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "thumbnail_bg"; - rel2.to: "thumbnail_bg"; - } - } - } - programs{ - program { - name: "mouse_click_newtab"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "mouse_click_thumbbutton"; - signal: "mouse,clicked"; - source: "elm.thumbButton"; - script { - emit("clicked", "elm.thumbButton"); - } - } - program { name: "mouse_in"; - signal: "mouse,in"; - source: "over"; - action: STATE_SET "selected" 0.0; - target: "thumbnail_bg"; - target: "page_title"; - } - program { name: "mouse_out"; - signal: "mouse,out"; - source: "over"; - action: STATE_SET "default" 0.0; - target: "thumbnail_bg"; - target: "page_title"; - } - } -} - - -group{ - name: "elm/button/base/hidden_bm_button"; - parts{ - part{ - name: "button"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - color: 0 0 0 0; - } - } - part{ - name: "over"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "button";} - rel2 { relative: 1.0 1.0;to: "button";} - color: 0 0 0 0; - } - } - } - programs{ - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - } - } -group { name: "elm/button/base/elm.thumbButton"; - images { - image: "ico_delete.png" COMP; - } - parts { - part { name: "elm.swallow.content"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 1; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - } - } - } - - programs { - program { name: "mouse,clicked"; - signal: "mouse,down,1"; - source: "elm.swallow.content"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - } - -} diff --git a/services/MoreMenuUI/edc/NewFolderPopup.edc b/services/MoreMenuUI/edc/NewFolderPopup.edc deleted file mode 100644 index 7be85ae..0000000 --- a/services/MoreMenuUI/edc/NewFolderPopup.edc +++ /dev/null @@ -1,463 +0,0 @@ -#define CONTENT_HEIGHT 99; -#define POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC 40 -#define POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 65 -#define POPUP_CONTENT_DEFAULT_PADDING_RIGHT_MIN_INC 65 -#define CONTENT_BG_HEIGHT (CONTENT_HEIGHT+294); -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 128; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } -#define SPACER_ITEM_BR(spacer_name, W, H, elem) \ - part { name: spacer_name; \ - type: RECT; \ - scale:1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - align: 0 0; \ - min: W H; \ - max: W H; \ - fixed: 1 1; \ - color: 227 227 227 255; \ - rel1 { relative: 0.0 1.0; to: elem;} \ - rel2 { relative: 1.0 1.0; } \ - } \ - description { \ - state: "focus" 0.0; \ - inherit: "default" 0.0; \ - color: 0 119 246 255; \ - } \ - } -#define SPACER_ITEM_HOR(spacer_name, W, H, elem) \ - part { name: spacer_name; \ - type: RECT; \ - scale:1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - align: 0 0; \ - min: W H; \ - max: W H; \ - fixed: 1 1; \ - color: 227 227 227 255; \ - rel1 { relative: 0.0 0.0; to: elem;} \ - rel2 { relative: 1.0 1.0; to: elem;} \ - } \ - description { \ - state: "focus" 0.0; \ - inherit: "default" 0.0; \ - color: 0 119 246 255; \ - } \ - } \ - -collections{ - group { name: "new_folder_popup"; - images{ - image: "modal_dialogs_bg.png" COMP; - image: "modal_dialogs_title_bg.png" COMP; - } - parts{ -part{ name: "content_bg"; - type: RECT; - scale: 1; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - color: 255 255 255 255; - align: 0.5 0.5; - min: 740 378; - max: 740 378; - rel1 {relative: 0.0 0.0;} - rel2 {relative: 1.0 1.0;} - } - } - part{ name: "title_bg"; - type: RECT; - description{ - state: "default" 0.0; - visible: 1; - color: 255 255 255 255; - min: 740 144; - max: 740 144; - align: 0.0 0; - rel1 {relative: 0.0 0.0; to: "content_bg"; offset: 0 0;} - rel2 {relative: 1.0 1.0; to: "content_bg";} - } - } - part{ name: "title_text_bm"; - type: TEXT; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 {relative: 0.0 0.0; to: "title_bg"; offset: 40 46;} - rel2 {relative: 1.0 1.0; to: "title_bg"; offset: -40 0;} - color: 51 51 51 255; - text{ - text: "Add New Folder"; - font: "Sans"; - size: 42; - align: 0.5 0.0; - } - } - } - part{ name: "sub_title_text_bm"; - type: TEXT; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 {relative: 0.0 0.0; to: "title_bg"; offset: 40 112;} - rel2 {relative: 1.0 1.0; to: "title_bg"; offset: -40 0;} - color: 104 104 104 255; - text{ - text: "Add folder for adding to bookmark"; - font: "Sans"; - size: 32; - align: 0.5 0.0; - } - } - } - part{ name: "content"; - type: SWALLOW; - scale: 1; - description{ - state: "default" 0.0; - visible: 1; - rel1 {relative: 0.0 1.0; to: "title_bg"; offset: 100 0;} - rel2 {relative: 1.0 1.0;} - fixed: 1 1; - color: 0 0 0 255; - align: 0.0 0.0; - min: 540 144; - max: 540 144; - } - } - SPACER_ITEM_BR("horizontal_line", 740, 1, "content") - part{ - name: "buttons"; - type: SWALLOW; - scale: 1; - description{ - state: "default" 0.0; - visible: 1; - rel1 {relative: 0.0 1.0; to: "content"; offset: -100 1;} - rel2 {relative: 1.0 1.0;} - align: 0.0 0.0; - min: 740 90; - max: 740 90; - } - } - } - } - /*****************************************************************/ - group { - name: "elm/button/base/bookmark_button"; - parts { - part { - name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - align: 0.5 0.5; - fixed: 1 1; - color: 225 225 225 255; - min: 370 90; - max: 370 90; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color: 0 119 246 255; - } - description { state: "dim" 0.0; - inherit: "default" 0.0; - color: 225 225 225 102; - } - } - SPACER_ITEM_HOR("vertical_line", 1, 90,"bg") - part { - name: "elm.text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.5 0.5; - min: 360 70; - rel1 { relative: 0.0 0.0; to: "bg"; offset: 30 0;} - rel2 { relative: 1.0 1.0; to: "bg"; offset: -30 0;} - color: 87 87 87 255; - text { - text: "dshfj"; - font: "font_name"; - size: 36; - align: 0.5 0.5; - min: 1 1; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - text.font: "Tizen:style=Bold"; - } - description { state: "dim" 0.0; - inherit: "default" 0.0; - color: 89 89 89 102; - } - } - part { - name: "over"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - rel1 { relative: 0.0 0.0; to: "bg";} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 0 0 0 0; - } - } - } - programs{ - program { - name: "mouse_in"; - signal: "mouse,in"; - source: "over"; - action: STATE_SET "focus" 0.0; - target: "elm.text"; - target: "bg"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(!strcmp(st, "default")) { - set_state(PART:"bg", "focus", 0.0); - set_state(PART:"elm.text", "focus", 0.0); - } - } - } - program { - name: "mouse_out"; - signal: "mouse,out"; - source: "over"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - target: "bg"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(!strcmp(st, "focus")) { - set_state(PART:"bg", "visible", 0.0); - set_state(PART:"elm.text", "visible", 0.0); - } - } - } - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "dim" 0.0; - target: "elm.text"; - target: "bg"; - } - program { - name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - target: "bg"; - } - } - } -group { name: "elm/entry/selection/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - } -} -group { name: "elm/entry/cursor/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 22 120 237 255; - min: 2 36; - max: 2 36; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "focused" 0.0; - target: "bg"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - } -} - group { - name: "elm/entry/base-single/uri_entry_popup"; - styles { - style { - name: "browser-entry-uri-style-unselected"; - base: "font=Sans:style=SVD_Medium font_size="34" wrap=none color=#515151"; - } - style { - name: "browser-entry-uri-style-selected"; - base: "font=Sans:style=SVD_Medium font_size="34" wrap=none color=#dddddd"; - } - } - data { - item: focus_highlight "off"; - } - parts { - - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - - part { - name: "elm.guide"; - scale:1; - type: TEXTBLOCK; - mouse_events: 0; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-unselected"; - min: 0 1; - } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "label.text.clip"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - } - } - part { - name: "elm.text"; - scale:1; - multiline: 0; - entry_mode: EDITABLE; - select_mode: DEFAULT; - cursor_mode: BEFORE; - type: TEXTBLOCK; - clip_to: "label.text.clip"; - source: "elm/entry/selection/browser_entry"; - source4: "elm/entry/cursor/browser_entry"; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-unselected"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "gdisabled"; - signal: "elm,guide,disabled"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "elm.guide"; - } - program { name: "genabled"; - signal: "elm,guide,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.guide"; - } - } -}//group - -group { - name: "popup_input_text"; - parts { - part { - name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - min: 0 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; - max: -1 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC; - align: 0.0 0.5; - min: 0 0 ; - max: 540 100 ; - rel1 { - relative: 0.0 0.0 ; - } - rel2 { - relative: 1.0 1.0; - } - } - } - } - } - - -} diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 80d15a4..a2a0145 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -112,11 +112,6 @@ std::shared_ptr SimpleUI::getHistory() return m_historyService->getHistoryToday(); } -std::vector > SimpleUI::getBookmarkFolders(int folder_id) -{ - return m_favoriteService->getBookmarkFolders(folder_id); -} - int SimpleUI::exec(const std::string& _url) { BROWSER_LOGD("[%s] _url=%s, initialised=%d", __func__, _url.c_str(), m_initialised); @@ -330,20 +325,8 @@ void SimpleUI::createActions() m_settingDeleteFavorite = sharedAction(new Action("Delete favorite site")); m_settingDeleteFavorite->setToolTip("Delete favorite site"); - m_bookmarks_manager_Add_NewFolder = sharedAction(new Action("+ New Folder")); - m_bookmarks_manager_Add_NewFolder->setToolTip("Add a new Folder"); - m_bookmarks_manager_BookmarkBar = sharedAction(new Action("Bookmark Bar")); m_bookmarks_manager_BookmarkBar->setToolTip("show Bookmark bar"); - - m_bookmarks_manager_Folder3 = sharedAction(new Action("Folder 3")); - m_bookmarks_manager_Folder3->setToolTip("open Folder 3"); - - m_bookmarks_manager_Folder2 = sharedAction(new Action("Folder 2")); - m_bookmarks_manager_Folder2->setToolTip("open Folder 2"); - - m_bookmarks_manager_Folder1 = sharedAction(new Action("Folder 1")); - m_bookmarks_manager_Folder1->setToolTip("open Folder 1"); } void SimpleUI::connectActions() @@ -622,7 +605,7 @@ void SimpleUI::loadFinished() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - addBookmarkEnable(m_favoriteService->countBookmarksAndSubFolders() < m_favoritesLimit); + addBookmarkEnable(m_favoriteService->countBookmarks() < m_favoritesLimit); if(!m_webEngine->isPrivateMode()){ m_historyService->addHistoryItem(std::make_shared (m_webEngine->getURI(), @@ -872,9 +855,7 @@ void SimpleUI::showMoreMenu() m_moreMenuUI->closeMoreMenuClicked.connect(boost::bind(&SimpleUI::closeMoreMenu, this,_1)); m_moreMenuUI->switchToMobileMode.connect(boost::bind(&SimpleUI::switchToMobileMode, this)); m_moreMenuUI->switchToDesktopMode.connect(boost::bind(&SimpleUI::switchToDesktopMode, this)); - m_moreMenuUI->addToBookmarkClicked.connect(boost::bind(&SimpleUI::addBookmarkFolders, this)); - m_moreMenuUI->AddBookmarkInput.connect(boost::bind(&SimpleUI::addToBookmarks, this,_1)); - m_moreMenuUI->BookmarkFolderCreated.connect(boost::bind(&SimpleUI::newFolderMoreMenu, this,_1,_2)); + m_moreMenuUI->addToBookmarkClicked.connect(boost::bind(&SimpleUI::addToBookmarks, this, _1)); m_moreMenuUI->isBookmark.connect(boost::bind(&SimpleUI::checkBookmark, this)); m_moreMenuUI->deleteBookmark.connect(boost::bind(&SimpleUI::deleteBookmark, this)); @@ -899,9 +880,7 @@ void SimpleUI::closeMoreMenu(const std::string& str) m_moreMenuUI->closeMoreMenuClicked.disconnect(boost::bind(&SimpleUI::closeMoreMenu, this,_1)); m_moreMenuUI->switchToMobileMode.disconnect(boost::bind(&SimpleUI::switchToMobileMode, this)); m_moreMenuUI->switchToDesktopMode.disconnect(boost::bind(&SimpleUI::switchToDesktopMode, this)); - m_moreMenuUI->addToBookmarkClicked.disconnect(boost::bind(&SimpleUI::addBookmarkFolders, this)); - m_moreMenuUI->AddBookmarkInput.disconnect(boost::bind(&SimpleUI::addToBookmarks, this,_1)); - m_moreMenuUI->BookmarkFolderCreated.disconnect(boost::bind(&SimpleUI::newFolderMoreMenu, this,_1,_2)); + m_moreMenuUI->addToBookmarkClicked.disconnect(boost::bind(&SimpleUI::addToBookmarks, this, _1)); m_moreMenuUI->isBookmark.disconnect(boost::bind(&SimpleUI::checkBookmark, this)); m_moreMenuUI->deleteBookmark.disconnect(boost::bind(&SimpleUI::deleteBookmark, this)); m_moreMenuUI.reset(); @@ -939,33 +918,18 @@ void SimpleUI::showBookmarkManagerMenu() (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.bookmarkmanagerui")); M_ASSERT(m_bookmarkManagerUI); m_bookmarkManagerUI->closeBookmarkManagerClicked.connect(boost::bind(&SimpleUI::closeBookmarkManagerMenu, this,_1)); - m_bookmarkManagerUI->saveFolderClicked.connect(boost::bind(&SimpleUI::newFolderBookmarkManager, this,_1,_2)); m_bookmarkManagerUI->bookmarkItemClicked.connect(boost::bind(&SimpleUI::onBookmarkClicked, this, _1)); - m_bookmarkManagerUI->folderItemClicked.connect(boost::bind(&SimpleUI::updateBookmarkManagerGenGrid, this,_1)); m_bookmarkManagerUI->show(m_window.get()); - m_bookmarkManagerUI->addBookmarkFolderItems(getBookmarkFolders(ROOT_FOLDER)); + m_bookmarkManagerUI->addBookmarkItems(getBookmarks(ROOT_FOLDER)); m_bookmarkManagerUI->showTopContent(); - m_curr_folder_id = ROOT_FOLDER; } } -void SimpleUI::updateBookmarkManagerGenGrid(int folder_id) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_bookmarkManagerUI->updateGengrid(); - m_bookmarkManagerUI->addBookmarkFolderItems(getBookmarkFolders(folder_id)); - m_bookmarkManagerUI->addBookmarkItems(getBookmarks(folder_id)); - m_bookmarkManagerUI->showTopContent(); - m_curr_folder_id = folder_id; -} - void SimpleUI::closeBookmarkManagerMenu(const std::string& str) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_bookmarkManagerUI->closeBookmarkManagerClicked.disconnect(boost::bind(&SimpleUI::closeBookmarkManagerMenu, this,_1)); - m_bookmarkManagerUI->saveFolderClicked.disconnect(boost::bind(&SimpleUI::newFolderBookmarkManager, this,_1,_2)); m_bookmarkManagerUI->bookmarkItemClicked.disconnect(boost::bind(&SimpleUI::onBookmarkClicked, this, _1)); - m_bookmarkManagerUI->folderItemClicked.disconnect(boost::bind(&SimpleUI::updateBookmarkManagerGenGrid, this,_1)); m_bookmarkManagerUI.reset(); if(m_moreMenuUI) { @@ -1152,42 +1116,6 @@ void SimpleUI::addToBookmarks(int folder_id) } } -//TODO: This probably should be replaced by direct call of m_moreMenuUI->getBookmarkFolderList -// as it does nothing more. -void SimpleUI::addBookmarkFolders(void) -{ - if(m_moreMenuUI) - m_moreMenuUI->getBookmarkFolderList(getBookmarkFolders(ROOT_FOLDER)); -} - -void SimpleUI::newFolderBookmarkManager(const char* title, int by_operator) -{ - BROWSER_LOGD("[%s,%d],", __func__, __LINE__); - int id = -1; - if (m_favoriteService) - m_favoriteService->save_folder(title, &id, by_operator); - if (id >= 0 ) - { - BROWSER_LOGD("[%s], Added New Folder", __func__); - if(m_bookmarkManagerUI) - { - updateBookmarkManagerGenGrid(m_curr_folder_id); // TODO: correct folder displaying behaviour needs to be implemented - } - } -} - -void SimpleUI::newFolderMoreMenu(const char* title, int by_operator) -{ - int id = -1; - if (m_favoriteService) - m_favoriteService->save_folder(title, &id, by_operator); - if (id >= 0) - { - BROWSER_LOGD("[%s], Added New Folder", __func__); - addToBookmarks(id); - } -} - //TODO: Replace by direct call. void SimpleUI::deleteBookmark() { diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index b2600c3..897d66d 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -120,7 +120,6 @@ private: void tabClosed(const tizen_browser::basic_webengine::TabId& id); std::vector > getBookmarks(int folder_id = -1); - std::vector > getBookmarkFolders(int folder_id); std::shared_ptr getHistory(); std::shared_ptr getMostVisitedItems(); @@ -156,11 +155,7 @@ private: sharedAction m_settingDeleteFavorite; sharedAction m_mostvisited; sharedAction m_bookmarksvisited; - sharedAction m_bookmarks_manager_Add_NewFolder; sharedAction m_bookmarks_manager_BookmarkBar; - sharedAction m_bookmarks_manager_Folder1; - sharedAction m_bookmarks_manager_Folder2; - sharedAction m_bookmarks_manager_Folder3; /** * \brief filters URL before it is passed to WebEngine. @@ -206,10 +201,7 @@ private: void showHistory(); void hideHistory(); - void addBookmarkFolders(); - void newFolderBookmarkManager(const char* title, int by_user); - void newFolderMoreMenu(const char* title, int by_user); void showTabUI(); void closeTabUI(const std::string& str); void showMoreMenu(); @@ -225,7 +217,6 @@ private: void closeSettingsUI(const std::string&); void closeBookmarkManagerMenu(const std::string& str); - void updateBookmarkManagerGenGrid(int folder_id); void showBookmarkManagerMenu(); void showPopup(Evas_Object *content, char* btn1_text, char* btn2_text); @@ -283,7 +274,6 @@ private: int m_tabLimit; int m_favoritesLimit; bool m_wvIMEStatus; - int m_curr_folder_id; // This context object is used to implicitly init internal ewk data used by opengl to create the first and // consecutive webviews in the application, otherwise we would encounter a crash after creating // the first web view -- 2.7.4 From d5438771ead347730484eb124a4d8dfaaaf4919b Mon Sep 17 00:00:00 2001 From: sungwon2han Date: Wed, 23 Sep 2015 13:53:33 +0900 Subject: [PATCH 15/16] Browser exit when load bookmark items [Issue#] NA [Problem] Browser cannot get bookmark info from browser-provider [Cause] browser-provider issue [Solution] add error check routing for browser-provider Change-Id: If91dc072d4c6294d331294b7cde74433d1dc2f2f Signed-off-by: sungwon2han --- services/BookmarkService/BookmarkService.cpp | 60 ++++++++++++++++------------ 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/services/BookmarkService/BookmarkService.cpp b/services/BookmarkService/BookmarkService.cpp index 3af5cb7..68d1586 100644 --- a/services/BookmarkService/BookmarkService.cpp +++ b/services/BookmarkService/BookmarkService.cpp @@ -206,31 +206,41 @@ std::vector > BookmarkService::getBookmarks(int fo for(int i = 0; i bookmark = std::make_shared(url, title, std::string(""),(int) bookmark_info.parent, ids[i]); - - std::shared_ptr bi = std::make_shared(); - bi->imageType = tizen_browser::tools::BrowserImage::ImageType::ImageTypePNG; - bi->width = bookmark_info.thumbnail_width; - bi->height = bookmark_info.thumbnail_height; - bi->dataSize = bookmark_info.thumbnail_length; - bi->imageData = (void*)malloc(bookmark_info.thumbnail_length); - memcpy(bi->imageData, (void*)bookmark_info.thumbnail, bookmark_info.thumbnail_length); - bookmark->setThumbnail(bi); - - std::shared_ptr fav = std::make_shared(); - unsigned char *image_bytes; - bp_bookmark_adaptor_get_icon(ids[i], &fav->width, &fav->height, &image_bytes, &fav->dataSize); - fav->imageType = tizen_browser::tools::BrowserImage::ImageType::ImageTypePNG; - - fav->imageData = (void*)malloc(bookmark_info.favicon_length); - memcpy(fav->imageData, (void*)image_bytes, bookmark_info.favicon_length); - bookmark->setFavicon(fav); - m_bookmarks.push_back(bookmark); - + if (bp_bookmark_adaptor_get_easy_all(ids[i], &bookmark_info) == 0) { + std::string url = (bookmark_info.url ? bookmark_info.url : ""); + std::string title = (bookmark_info.title ? bookmark_info.title : ""); + + std::shared_ptr bookmark = std::make_shared(url, title, std::string(""),(int) bookmark_info.parent, ids[i]); + + if (bookmark_info.thumbnail_length != -1) { + std::shared_ptr bi = std::make_shared(); + bi->imageType = tizen_browser::tools::BrowserImage::ImageType::ImageTypePNG; + bi->width = bookmark_info.thumbnail_width; + bi->height = bookmark_info.thumbnail_height; + bi->dataSize = bookmark_info.thumbnail_length; + bi->imageData = (void*)malloc(bookmark_info.thumbnail_length); + memcpy(bi->imageData, (void*)bookmark_info.thumbnail, bookmark_info.thumbnail_length); + bookmark->setThumbnail(bi); + } else { + BROWSER_LOGD("bookmark thumbnail size is -1"); + } + + if (bookmark_info.favicon_length != -1) { + std::shared_ptr fav = std::make_shared(); + unsigned char *image_bytes; + bp_bookmark_adaptor_get_icon(ids[i], &fav->width, &fav->height, &image_bytes, &fav->dataSize); + fav->imageType = tizen_browser::tools::BrowserImage::ImageType::ImageTypePNG; + + fav->imageData = (void*)malloc(bookmark_info.favicon_length); + memcpy(fav->imageData, (void*)image_bytes, bookmark_info.favicon_length); + bookmark->setFavicon(fav); + } else { + BROWSER_LOGD("bookmark favicon size is -1"); + } + m_bookmarks.push_back(bookmark); + } else { + BROWSER_LOGD("bp_bookmark_adaptor_get_easy_all error"); + } } free(ids); return m_bookmarks; -- 2.7.4 From 4f6d5a3694b2c8b3e5672dbbaeacd785d97fe358 Mon Sep 17 00:00:00 2001 From: sungwon2han Date: Wed, 23 Sep 2015 15:18:59 +0900 Subject: [PATCH 16/16] Browser exit when load history items [Issue#] NA [Problem] Browser cannot get history info from browser-provider [Cause] browser-provider issue [Solution] add error check routine for browser-provider Change-Id: I12368bc9394e8115c4debfa9b72d8aa5a9aa9f5c Signed-off-by: sungwon2han --- services/HistoryService/HistoryService.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/services/HistoryService/HistoryService.cpp b/services/HistoryService/HistoryService.cpp index 1d93507..c60d669 100644 --- a/services/HistoryService/HistoryService.cpp +++ b/services/HistoryService/HistoryService.cpp @@ -214,14 +214,18 @@ std::shared_ptr HistoryService::getMostVisitedHistoryItems() history->setTitle(std::string(history_info.title ? history_info.title : "")); //thumbail - std::shared_ptr hi = std::make_shared(); - hi->imageType = tools::BrowserImage::ImageTypePNG; - hi->width = history_info.thumbnail_width; - hi->height = history_info.thumbnail_height; - hi->dataSize = history_info.thumbnail_length; - hi->imageData = (void*)malloc(history_info.thumbnail_length); - memcpy(hi->imageData, (void*)history_info.thumbnail, history_info.thumbnail_length); - history->setThumbnail(hi); + if (history_info.thumbnail_length != -1) { + std::shared_ptr hi = std::make_shared(); + hi->imageType = tools::BrowserImage::ImageTypePNG; + hi->width = history_info.thumbnail_width; + hi->height = history_info.thumbnail_height; + hi->dataSize = history_info.thumbnail_length; + hi->imageData = (void*)malloc(history_info.thumbnail_length); + memcpy(hi->imageData, (void*)history_info.thumbnail, history_info.thumbnail_length); + history->setThumbnail(hi); + } else { + BROWSER_LOGD("history thumbnail lenght is -1"); + } ret_history_list->push_back(history); } -- 2.7.4