add_subdirectory(WebKitEngineService)
add_subdirectory(MoreMenuUI)
-add_subdirectory(MainUI)
+add_subdirectory(QuickAccess)
add_subdirectory(HistoryUI)
add_subdirectory(TabUI)
add_subdirectory(SimpleUI)
+++ /dev/null
-project(MainUI)
-
-set(MainUI_SRCS
- MainUI.cpp
- DetailPopup.cpp
- )
-
-set(MainUI_HEADERS
- MainUI.h
- DetailPopup.h
- )
-
-include(Coreheaders)
-include(EFLHelpers)
-
-include_directories(${CMAKE_SOURCE_DIR}/services/FavoriteService)
-
-add_library(${PROJECT_NAME} SHARED ${MainUI_SRCS})
-
-if(TIZEN_BUILD)
- target_link_libraries(${PROJECT_NAME} ${pkgs_LDFLAGS})
-endif(TIZEN_BUILD)
-
-install(TARGETS ${PROJECT_NAME}
- LIBRARY DESTINATION services
- ARCHIVE DESTINATION services/static)
-
-#please do not add edc/ directory
-set(edcFiles
- MainUI.edc
- DetailPopup.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)
+++ /dev/null
-/*
- * 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 <Elementary.h>
-#include <vector>
-#include <algorithm>
-#include "BrowserAssert.h"
-#include "DetailPopup.h"
-#include "BrowserLogger.h"
-#include "Tools/GeneralTools.h"
-#include "Tools/EflTools.h"
-#include "MainUI.h"
-
-namespace tizen_browser{
-namespace base_ui{
-
-const char * DetailPopup::URL_SEPARATOR = " - ";
-const int DetailPopup::HISTORY_ITEMS_NO = 5;
-
-DetailPopup::DetailPopup(MainUI *mainUI)
- : m_main_view(nullptr)
- , m_parent(nullptr)
- , m_layout(nullptr)
- , m_historyList(nullptr)
- , m_mainUI(mainUI)
- , m_urlButton(nullptr)
-{
- edjFilePath = EDJE_DIR;
- edjFilePath.append("MainUI/DetailPopup.edj");
- elm_theme_extension_add(nullptr, edjFilePath.c_str());
-
- m_history_item_class = elm_genlist_item_class_new();
- m_history_item_class->item_style = "history_grid_item";
- m_history_item_class->func.text_get = _get_history_link_text;
- m_history_item_class->func.content_get = nullptr;
- m_history_item_class->func.state_get = nullptr;
- m_history_item_class->func.del = nullptr;
-}
-
-DetailPopup::~DetailPopup()
-{
- elm_genlist_item_class_free(m_history_item_class);
-}
-
-void DetailPopup::createLayout()
-{
- m_layout = elm_layout_add(m_parent);
- elm_layout_file_set(m_layout, edjFilePath.c_str(), "popup");
- 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);
- // TODO: add following (or simillar) callback for hardware back button when it will be available
- //evas_object_event_callback_add(m_layout, EVAS_CALLBACK_KEY_DOWN, _back, this);
- edje_object_signal_callback_add(elm_layout_edje_get(m_layout), "mouse,clicked,1", "bg", _bg_click, this);
- m_urlButton = elm_button_add(m_layout); // add button to receive focus
- elm_object_style_set(m_urlButton, "invisible_button");
- evas_object_smart_callback_add(m_urlButton, "clicked", _url_click_button, this);
- evas_object_show(m_urlButton);
- elm_layout_content_set(m_layout, "url_over", m_urlButton);
- elm_object_focus_custom_chain_unset(m_main_view);
- elm_object_focus_custom_chain_append(m_main_view, m_urlButton, NULL);
- elm_object_focus_set(m_urlButton, EINA_TRUE);
-
- edje_object_signal_callback_add(elm_layout_edje_get(m_layout), "mouse,clicked,1", "thumbnail", _url_click, this);
- elm_layout_text_set(m_layout, "history_title", "History");
- elm_layout_text_set(m_layout, "url", tools::clearURL(m_item->getUrl()));
-
- m_historyList = elm_genlist_add(m_layout);
- evas_object_size_hint_weight_set(m_historyList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_historyList, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_genlist_select_mode_set(m_historyList, ELM_OBJECT_SELECT_MODE_ALWAYS);
- elm_object_focus_custom_chain_append(m_main_view, m_historyList, NULL);
- for (auto it = m_prevItems->begin(); it != m_prevItems->end(); ++it) {
- elm_genlist_item_append(m_historyList, m_history_item_class, it->get(), nullptr, ELM_GENLIST_ITEM_NONE, _history_url_click, this);
- }
- evas_object_show(m_historyList);
- elm_object_part_content_set(m_layout, "history_list", m_historyList);
-
- if (m_item->getThumbnail()) {
- Evas_Object * thumb = tools::EflTools::getEvasImage(m_item->getThumbnail(), m_layout);
- elm_object_part_content_set(m_layout, "thumbnail", thumb);
- }
-
- evas_object_show(m_layout);
-}
-
-void DetailPopup::show(Evas_Object *parent, Evas_Object *main_view, std::shared_ptr<services::HistoryItem> currItem, std::shared_ptr<services::HistoryItemVector> prevItems)
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- m_main_view = main_view;
- m_parent = parent;
- m_item = currItem;
- m_prevItems = prevItems;
- createLayout();
-}
-
-void DetailPopup::hide()
-{
- edje_object_signal_callback_del(elm_layout_edje_get(m_layout), "mouse,clicked,1", "bg", _bg_click);
- elm_object_focus_custom_chain_unset(m_main_view);
- evas_object_smart_callback_del(m_urlButton, "clicked", _url_click_button);
- edje_object_signal_callback_del(elm_layout_edje_get(m_layout), "mouse,clicked,1", "thumbnail", _url_click);
- elm_genlist_clear(m_historyList);
- evas_object_hide(m_layout);
- evas_object_del(m_layout);
- m_mainUI->refreshFocusChain();
-}
-
-void DetailPopup::_bg_click(void* data, Evas_Object*, const char*, const char*)
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- DetailPopup *dp = reinterpret_cast<DetailPopup*>(data);
- dp->hide();
-}
-
-void DetailPopup::_url_click(void* data, Evas_Object*, const char*, const char*)
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- DetailPopup *dp = reinterpret_cast<DetailPopup*>(data);
- dp->openURLInNewTab(dp->m_item, dp->m_mainUI->isDesktopMode());
- dp->hide();
-}
-
-void DetailPopup::_url_click_button(void* data, Evas_Object*, void*)
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- DetailPopup *dp = reinterpret_cast<DetailPopup*>(data);
- dp->openURLInNewTab(dp->m_item, dp->m_mainUI->isDesktopMode());
- dp->hide();
-}
-
-void DetailPopup::_history_url_click(void* data, Evas_Object*, void* event_info)
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- Elm_Object_Item *glit = reinterpret_cast<Elm_Object_Item*>(event_info);
- void *itemData = elm_object_item_data_get(glit);
- services::HistoryItem *item = reinterpret_cast<services::HistoryItem*>(itemData);
-
- DetailPopup *dp = reinterpret_cast<DetailPopup*>(data);
- // find shared pointer pointed to HistoryItem object
- auto it = std::find_if(dp->m_prevItems->begin(),
- dp->m_prevItems->end(),
- [item] (const std::shared_ptr<services::HistoryItem> i)
- { return i.get() == item; }
- );
- std::shared_ptr<services::HistoryItem> itemPtr= *it;
- dp->openURLInNewTab(itemPtr, dp->m_mainUI->isDesktopMode());
- dp->hide();
-}
-
-char* DetailPopup::_get_history_link_text(void* data, Evas_Object*, const char* part)
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-
- services::HistoryItem *item = reinterpret_cast<services::HistoryItem*>(data);
- if (!strcmp(part, "page_dsc")) {
- if (item != nullptr) {
- std::string text = item->getTitle() + URL_SEPARATOR + tools::clearURL(item->getUrl());
- return strdup(text.c_str());
- }
- }
- return strdup("");
-}
-
-}
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 __DETAIL_POPUP_H__
-#define __DETAIL_POPUP_H__
-
-#include <Evas.h>
-#include <string>
-#include <memory>
-#include <boost/signals2/signal.hpp>
-#include "services/HistoryService/HistoryItem.h"
-
-namespace tizen_browser{
-namespace base_ui{
-
- class MainUI;
-
- class DetailPopup {
- public:
- DetailPopup(MainUI *mainUI);
- ~DetailPopup();
-
- /**
- * @brief Show popup window
- */
- void show(Evas_Object *parent, Evas_Object *main_view, std::shared_ptr<services::HistoryItem> currItem, std::shared_ptr<services::HistoryItemVector> prevItems);
-
- /**
- * @brief Hide popup
- */
- void hide();
-
- bool isVisible() { return m_layout; }
-
- boost::signals2::signal<void (std::shared_ptr<tizen_browser::services::HistoryItem>, bool)> openURLInNewTab;
-
- static const int HISTORY_ITEMS_NO;
- private:
- /**
- * @brief Mouse background click callback
- */
- static void _bg_click(void *data, Evas_Object *obj, const char *emission, const char *source);
-
- /**
- * @brief URL rectangle click callback
- */
- static void _url_click(void *data, Evas_Object *obj, const char *emission, const char *source);
- static void _url_click_button(void *data, Evas_Object *obj, void *event_info);
-
- /**
- * @brief History genlist item click callback
- */
- static void _history_url_click(void *data, Evas_Object *o, void *event_info);
-
- /**
- * @brief Create main layout and all compnents.
- */
- void createLayout();
-
- /**
- * @brief Provide texts for history genlist
- */
- static char* _get_history_link_text(void *data, Evas_Object *obj, const char *part);
-
- Evas_Object* m_main_view;
- Evas_Object* m_parent;
- Evas_Object *m_layout;
- Evas_Object *m_historyList;
- Evas_Object* m_urlButton;
- Elm_Gengrid_Item_Class * m_history_item_class;
- MainUI *m_mainUI;
- std::string edjFilePath;
- std::shared_ptr<services::HistoryItem> m_item;
- std::shared_ptr<services::HistoryItemVector> m_prevItems;
-
- static const char * URL_SEPARATOR;
- };
-
-}
-}
-
-#endif // __DETAIL_POPUP_H__
+++ /dev/null
-/*
- * 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 <Elementary.h>
-#include <boost/concept_check.hpp>
-#include <vector>
-#include <AbstractMainWindow.h>
-
-#include "MainUI.h"
-#include "ServiceManager.h"
-#include "BrowserLogger.h"
-#include "Tools/EflTools.h"
-#include "../Tools/BrowserImage.h"
-#include "Tools/GeneralTools.h"
-
-#define efl_scale (elm_config_scale_get() / elm_app_base_scale_get())
-
-namespace tizen_browser{
-namespace base_ui{
-
-EXPORT_SERVICE(MainUI, "org.tizen.browser.mainui")
-
-const int MainUI::MAX_TILES_NUMBER = 5;
-const int MainUI::MAX_THUMBNAIL_WIDTH = 840;
-const int MainUI::MAX_THUMBNAIL_HEIGHT = 648;
-const int MainUI::BIG_TILE_INDEX = 0;
-const int MainUI::TOP_RIGHT_TILE_INDEX = 3;
-const int MainUI::BOTTOM_RIGHT_TILE_INDEX = 4;
-
-const std::vector<std::string> MainUI::TILES_NAMES = {
- "elm.swallow.big",
- "elm.swallow.small_first",
- "elm.swallow.small_second",
- "elm.swallow.small_third",
- "elm.swallow.small_fourth"
-};
-
-typedef struct _HistoryItemData
-{
- std::shared_ptr<tizen_browser::services::HistoryItem> item;
- std::shared_ptr<tizen_browser::base_ui::MainUI> mainUI;
-} HistoryItemData;
-
-typedef struct _BookmarkItemData
-{
- std::shared_ptr<tizen_browser::services::BookmarkItem> item;
- std::shared_ptr<tizen_browser::base_ui::MainUI> mainUI;
-} BookmarkItemData;
-
-MainUI::MainUI()
- : m_parent(nullptr)
- , m_layout(nullptr)
- , m_bookmarksView(nullptr)
- , m_mostVisitedView(nullptr)
- , m_bookmarksButton(nullptr)
- , m_mostVisitedButton(nullptr)
- , m_bookmarkGengrid(nullptr)
- , m_bookmarkManagerButton(nullptr)
- , m_parentFocusChain(nullptr)
- , m_bookmark_item_class(nullptr)
- , m_detailPopup(this)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- edjFilePath = EDJE_DIR;
- edjFilePath.append("MainUI/MainUI.edj");
- elm_theme_extension_add(nullptr, edjFilePath.c_str());
- MainUI::createItemClasses();
-}
-
-MainUI::~MainUI()
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- elm_gengrid_item_class_free(m_bookmark_item_class);
- eina_list_free(m_parentFocusChain);
-}
-
-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__);
- if (!m_bookmark_item_class) {
- m_bookmark_item_class = elm_gengrid_item_class_new();
- m_bookmark_item_class->item_style = "grid_item";
- m_bookmark_item_class->func.text_get = _grid_bookmark_text_get;
- m_bookmark_item_class->func.content_get = _grid_bookmark_content_get;
- m_bookmark_item_class->func.state_get = nullptr;
- m_bookmark_item_class->func.del = nullptr;
- }
-}
-
-
-Evas_Object* MainUI::createQuickAccessLayout(Evas_Object* parent)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- m_desktopMode = true;
-
- Evas_Object* layout = elm_layout_add(parent);
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set (layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
- m_mostVisitedView = createMostVisitedView(layout);
- m_bookmarksView = createBookmarksView (layout);
-
- showHistory();
-
- return layout;
-}
-
-Evas_Object* MainUI::createMostVisitedView (Evas_Object * parent)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
-
- Evas_Object* mostVisitedLayout = elm_layout_add(parent);
- elm_layout_file_set(mostVisitedLayout, edjFilePath.c_str(), "mv_bookmarks");
- evas_object_size_hint_weight_set(mostVisitedLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set (mostVisitedLayout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
- Evas_Object* topButtons = createTopButtons(mostVisitedLayout);
- elm_object_part_content_set(mostVisitedLayout, "elm.swallow.layoutTop", topButtons);
-
- return mostVisitedLayout;
-}
-
-Evas_Object* MainUI::createBookmarksView (Evas_Object * parent)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
-
- Evas_Object *bookmarkViewLayout = elm_layout_add(parent);
- elm_layout_file_set(bookmarkViewLayout, edjFilePath.c_str(), "mv_bookmarks");
- evas_object_size_hint_weight_set(bookmarkViewLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bookmarkViewLayout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
- m_bookmarkGengrid = createBookmarkGengrid(bookmarkViewLayout);
- elm_object_part_content_set(bookmarkViewLayout, "elm.swallow.grid", m_bookmarkGengrid);
-
- Evas_Object* topButtons = createTopButtons(bookmarkViewLayout);
- elm_object_part_content_set(bookmarkViewLayout, "elm.swallow.layoutTop", topButtons);
-
- Evas_Object* bottomButton = createBottomButton(bookmarkViewLayout);
- elm_object_part_content_set(bookmarkViewLayout, "elm.swallow.layoutBottom", bottomButton);
-
- return bookmarkViewLayout;
-}
-
-Evas_Object* MainUI::createBookmarkGengrid(Evas_Object *parent)
-{
- Evas_Object *bookmarkGengrid = elm_gengrid_add(parent);
-
- elm_gengrid_align_set(bookmarkGengrid, 0, 0);
- elm_gengrid_select_mode_set(bookmarkGengrid, ELM_OBJECT_SELECT_MODE_ALWAYS);
- elm_gengrid_multi_select_set(bookmarkGengrid, EINA_FALSE);
- elm_gengrid_horizontal_set(bookmarkGengrid, EINA_FALSE);
-
- elm_scroller_policy_set(bookmarkGengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
- elm_scroller_page_size_set(bookmarkGengrid, 0, 327);
- evas_object_size_hint_weight_set(bookmarkGengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bookmarkGengrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_gengrid_item_size_set(bookmarkGengrid, 364 * efl_scale, 320 * efl_scale);
-
- return bookmarkGengrid;
-}
-
-Evas_Object* MainUI::createTopButtons (Evas_Object *parent)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
-
- Evas_Object *layoutTop = elm_layout_add(parent);
- elm_layout_file_set(layoutTop, edjFilePath.c_str(), "top_button_item");
- evas_object_size_hint_weight_set(layoutTop, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(layoutTop, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(layoutTop);
-
- Evas_Object *mostVisitedButton = elm_button_add(layoutTop);
- elm_object_style_set(mostVisitedButton, "invisible_button");
- evas_object_smart_callback_add(mostVisitedButton, "clicked", _mostVisited_clicked, this);
- evas_object_show(mostVisitedButton);
- elm_layout_content_set(layoutTop, "mostvisited_click", mostVisitedButton);
- m_mostVisitedButton = mostVisitedButton;
-
- Evas_Object *bookmarksButton = elm_button_add(layoutTop);
- elm_object_style_set(bookmarksButton, "invisible_button");
- evas_object_smart_callback_add(bookmarksButton, "clicked", _bookmark_clicked, this);
- evas_object_show(bookmarksButton);
- elm_layout_content_set(layoutTop, "bookmark_click", bookmarksButton);
- m_bookmarksButton = bookmarksButton;
-
- return layoutTop;
-}
-
-Evas_Object* MainUI::createBottomButton(Evas_Object *parent)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
-
- Evas_Object *layoutBottom = elm_layout_add(parent);
- elm_layout_file_set(layoutBottom, edjFilePath.c_str(), "bottom_button_item");
-
- evas_object_size_hint_weight_set(layoutBottom, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(layoutBottom, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(layoutBottom);
-
- m_bookmarkManagerButton = elm_button_add(layoutBottom);
- elm_object_style_set(m_bookmarkManagerButton, "invisible_button");
- evas_object_smart_callback_add(m_bookmarkManagerButton, "clicked", _bookmark_manager_clicked, this);
- evas_object_show(m_bookmarkManagerButton);
-
- elm_object_part_content_set(layoutBottom, "bookmarkmanager_click", m_bookmarkManagerButton);
-
- return layoutBottom;
-}
-
-void MainUI::_mostVisited_clicked(void * data, Evas_Object *, void *)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- MainUI* mainUI = reinterpret_cast<MainUI *>(data);
- mainUI->mostVisitedClicked();
-}
-
-void MainUI::_bookmark_clicked(void * data, Evas_Object *, void *)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- MainUI* mainUI = reinterpret_cast<MainUI *>(data);
- mainUI->bookmarkClicked();
-}
-
-void MainUI::_bookmark_manager_clicked(void * data, Evas_Object *, void *)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- MainUI* mainUI = static_cast<MainUI *>(data);
- mainUI->bookmarkManagerClicked();
-}
-
-void MainUI::addHistoryItem(std::shared_ptr<services::HistoryItem> hi)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- M_ASSERT(m_historyItems.size() < MAX_TILES_NUMBER);
-
- int tileNumber = m_historyItems.size();
- HistoryItemData *itemData = new HistoryItemData();
- itemData->item = hi;
- itemData->mainUI = std::shared_ptr<MainUI>(this);
-
- Evas_Object* tile = elm_button_add(m_mostVisitedView);
- if (tileNumber == BIG_TILE_INDEX)
- elm_object_style_set(tile, "big_tile");
- else
- elm_object_style_set(tile, "small_tile");
- evas_object_size_hint_weight_set(tile, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set (tile, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(tile);
- elm_object_part_content_set(m_mostVisitedView, TILES_NAMES[tileNumber].c_str(), tile);
- m_tiles.push_back(tile);
-
- elm_layout_text_set(tile, "page_title", hi->getTitle().c_str());
- elm_layout_text_set(tile, "page_url", hi->getUrl().c_str());
- Evas_Object * thumb = tizen_browser::tools::EflTools::getEvasImage(hi->getThumbnail(), m_parent);
- elm_object_part_content_set(tile, "elm.thumbnail", thumb);
- evas_object_smart_callback_add(tile, "clicked", _thumbClicked, itemData);
-
- m_historyItems.push_back(hi);
-}
-
-void MainUI::addHistoryItems(std::shared_ptr<services::HistoryItemVector> items)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- clearHistoryGenlist();
- int i = 0;
- for (auto it = items->begin(); it != items->end(); ++it) {
- i++;
- if (i > MAX_TILES_NUMBER)
- break;
- addHistoryItem(*it);
- }
- if (i>0)
- setEmptyView(false);
-}
-
-void MainUI::addBookmarkItem(std::shared_ptr<tizen_browser::services::BookmarkItem> bi)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- BookmarkItemData *itemData = new BookmarkItemData();
- itemData->item = bi;
- itemData->mainUI = std::shared_ptr<tizen_browser::base_ui::MainUI>(this);
- elm_gengrid_item_append(m_bookmarkGengrid, m_bookmark_item_class, itemData, _thumbBookmarkClicked, itemData);
-}
-
-void MainUI::addBookmarkItems(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > items)
-{
- clearBookmarkGengrid();
- for (auto it = items.begin(); it != items.end(); ++it) {
- addBookmarkItem(*it);
- }
-}
-
-
-char* MainUI::_grid_bookmark_text_get(void *data, Evas_Object *, const char *part)
-{
- BookmarkItemData *itemData = reinterpret_cast<BookmarkItemData*>(data);
- if (!strcmp(part, "page_title")) {
- return strdup(itemData->item->getTittle().c_str());
- }
- if (!strcmp(part, "page_url")) {
- return strdup(itemData->item->getAddress().c_str());
- }
- return strdup("");
-}
-
-Evas_Object * MainUI::_grid_bookmark_content_get(void *data, Evas_Object*, const char *part)
-{
- BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part);
- BookmarkItemData *itemData = reinterpret_cast<BookmarkItemData*>(data);
-
- if (!strcmp(part, "elm.thumbnail")) {
- if (itemData->item->getThumbnail()) {
- Evas_Object * thumb = tizen_browser::tools::EflTools::getEvasImage(itemData->item->getThumbnail(), itemData->mainUI->m_parent);
- return thumb;
- }
- else {
- return nullptr;
- }
- }
-
- return nullptr;
-}
-
-void MainUI::_thumbBookmarkClicked(void * data, Evas_Object * , void *)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- HistoryItemData * itemData = reinterpret_cast<HistoryItemData *>(data);
- itemData->mainUI->openURLInNewTab(itemData->item, itemData->mainUI->isDesktopMode());
-}
-
-void MainUI::_thumbClicked(void* data, Evas_Object*, void*)
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- HistoryItemData * itemData = reinterpret_cast<HistoryItemData *>(data);
- itemData->mainUI->mostVisitedTileClicked(itemData->item, DetailPopup::HISTORY_ITEMS_NO);
-}
-
-void MainUI::clearHistoryGenlist()
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
-
- for (auto it = m_tiles.begin(); it != m_tiles.end(); ++it) {
- evas_object_smart_callback_del(*it, "clicked", _thumbClicked);
- evas_object_del(*it);
- }
-
- m_tiles.clear();
- m_historyItems.clear();
-}
-
-void MainUI::showHistory()
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
-
- if (elm_layout_content_get(m_layout, "elm.swallow.content") == m_mostVisitedView)
- return;
-
- evas_object_hide(m_bookmarksView);
- elm_layout_content_set(m_layout, "elm.swallow.content", m_mostVisitedView);
- evas_object_show(m_mostVisitedView);
-
-
- if (m_historyItems.empty()) {
- setEmptyView(true);
- return;
- }
- setEmptyView(false);
- evas_object_show(m_layout);
- refreshFocusChain();
- elm_object_focus_set(m_mostVisitedButton, true);
-}
-
-void MainUI::clearBookmarkGengrid()
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- elm_gengrid_clear(m_bookmarkGengrid);
-}
-
-void MainUI::showBookmarks()
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
-
- if (elm_layout_content_get(m_layout, "elm.swallow.content") == m_bookmarksView && m_bookmarksView != nullptr)
- return;
-
- evas_object_hide(m_mostVisitedView);
- elm_layout_content_set(m_layout, "elm.swallow.content", m_bookmarksView);
- evas_object_show(m_bookmarksView);
-
- evas_object_show(m_layout);
- refreshFocusChain();
- elm_object_focus_set(m_bookmarksButton, true);
-}
-
-void MainUI::showUI()
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- evas_object_show(m_layout);
- if (elm_layout_content_get(m_layout, "elm.swallow.content") == m_bookmarksView) {
- evas_object_show(m_bookmarksView);
- } else {
- evas_object_show(m_mostVisitedView);
- }
-}
-
-void MainUI::hideUI()
-{
- BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- evas_object_hide(m_layout);
- evas_object_hide(m_mostVisitedView);
- evas_object_hide(m_bookmarksView);
- clearHistoryGenlist();
- clearBookmarkGengrid();
-}
-
-void MainUI::openDetailPopup(std::shared_ptr<services::HistoryItem> currItem, std::shared_ptr<services::HistoryItemVector> prevItems)
-{
- m_detailPopup.show(m_layout, m_parent, currItem, prevItems);
-}
-
-void MainUI::showNoHistoryLabel()
-{
- elm_layout_text_set(m_mostVisitedView, "elm.text.empty", "No visited site");
- elm_layout_signal_emit(m_mostVisitedView, "empty,view", "mainui");
-}
-
-void MainUI::setEmptyView(bool empty)
-{
- BROWSER_LOGD("%s:%d %s, empty: %d", __FILE__, __LINE__, __func__, empty);
- if(empty) {
- showNoHistoryLabel();
- } else {
- elm_layout_signal_emit(m_mostVisitedView, "not,empty,view", "mainui");
- }
-}
-
-bool MainUI::isDesktopMode() const
-{
- return m_desktopMode;
-}
-
-void MainUI::setDesktopMode(bool mode)
-{
- m_desktopMode = mode;
-}
-
-DetailPopup& MainUI::getDetailPopup()
-{
- return m_detailPopup;
-}
-
-void MainUI::backButtonClicked()
-{
- if (m_detailPopup.isVisible()) {
- m_detailPopup.hide();
- }
-}
-
-bool MainUI::isMostVisitedActive() const
-{
- return evas_object_visible_get(m_mostVisitedView);
-}
-
-void MainUI::refreshFocusChain()
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-
- if (!m_parentFocusChain) {
- m_parentFocusChain = eina_list_clone(elm_object_focus_custom_chain_get(m_parent));
- } else {
- elm_object_focus_custom_chain_unset(m_parent);
- elm_object_focus_custom_chain_set(m_parent, eina_list_clone(m_parentFocusChain));
- }
-
- elm_object_focus_custom_chain_append(m_parent, m_mostVisitedButton, NULL);
- elm_object_focus_custom_chain_append(m_parent, m_bookmarksButton, NULL);
- if (isMostVisitedActive()) {
- for (auto tile = m_tiles.begin(); tile != m_tiles.end(); ++tile) {
- elm_object_focus_custom_chain_append(m_parent, *tile, NULL);
- }
- // prevent from moving outside of screen
- elm_object_focus_next_object_set(m_tiles[BIG_TILE_INDEX], m_tiles[BIG_TILE_INDEX], ELM_FOCUS_LEFT);
- elm_object_focus_next_object_set(m_tiles[TOP_RIGHT_TILE_INDEX], m_tiles[TOP_RIGHT_TILE_INDEX], ELM_FOCUS_RIGHT);
- elm_object_focus_next_object_set(m_tiles[BOTTOM_RIGHT_TILE_INDEX], m_tiles[BOTTOM_RIGHT_TILE_INDEX], ELM_FOCUS_RIGHT);
- } else {
- elm_object_focus_custom_chain_append(m_parent, m_bookmarkGengrid, NULL);
- elm_object_focus_custom_chain_append(m_parent, m_bookmarkManagerButton, NULL);
- // prevent from moving outside of screen
- elm_object_focus_next_object_set(m_bookmarkGengrid, m_bookmarkGengrid, ELM_FOCUS_LEFT);
- elm_object_focus_next_object_set(m_bookmarkGengrid, m_bookmarkGengrid, ELM_FOCUS_RIGHT);
- }
-}
-
-}
-}
+++ /dev/null
-/*
- * 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 MAINUI_H
-#define MAINUI_H
-
-#include <Evas.h>
-#include <boost/signals2/signal.hpp>
-
-#include "AbstractUIComponent.h"
-#include "AbstractService.h"
-#include "ServiceFactory.h"
-#include "service_macros.h"
-#include "services/HistoryService/HistoryItem.h"
-#include "BookmarkItem.h"
-#include "DetailPopup.h"
-
-namespace tizen_browser{
-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::core::AbstractService
-{
-public:
- MainUI();
- ~MainUI();
- void init(Evas_Object *main_layout);
- Evas_Object* getContent();
- void showMostVisited(std::shared_ptr<services::HistoryItemVector> vec);
- void showBookmarks(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > vec);
- void hideUI();
- void showUI();
- virtual std::string getName();
- void openDetailPopup(std::shared_ptr<services::HistoryItem> currItem, std::shared_ptr<services::HistoryItemVector> prevItems);
- bool isDesktopMode() const;
- void setDesktopMode(bool mode);
- DetailPopup & getDetailPopup();
- void backButtonClicked();
- inline bool isMostVisitedActive() const;
- void refreshFocusChain();
-
- boost::signals2::signal<void (std::shared_ptr<tizen_browser::services::HistoryItem>, int)> mostVisitedTileClicked;
- boost::signals2::signal<void (std::shared_ptr<tizen_browser::services::HistoryItem>, bool)> openURLInNewTab;
- boost::signals2::signal<void ()> mostVisitedClicked;
- boost::signals2::signal<void ()> bookmarkClicked;
- boost::signals2::signal<void ()> bookmarkManagerClicked;
-
- static const int MAX_THUMBNAIL_WIDTH;
- static const int MAX_THUMBNAIL_HEIGHT;
-
-private:
- void createItemClasses();
- void addHistoryItem(std::shared_ptr<services::HistoryItem>);
- void addHistoryItems(std::shared_ptr<services::HistoryItemVector>);
- void addBookmarkItem(std::shared_ptr<tizen_browser::services::BookmarkItem>);
- void addBookmarkItems(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> >);
- void clearHistoryGenlist();
- void clearBookmarkGengrid();
- Evas_Object* createBookmarkGengrid(Evas_Object *parent);
- void showHistory();
- void showBookmarks();
-
- Evas_Object* createQuickAccessLayout(Evas_Object *parent);
- Evas_Object* createMostVisitedView(Evas_Object *parent);
- Evas_Object* createBookmarksView(Evas_Object *parent);
- Evas_Object* createBottomButton(Evas_Object *parent);
- Evas_Object* createTopButtons(Evas_Object *parent);
-
- 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 _thumbBookmarkClicked(void * data, Evas_Object * obj, void * event_info);
- static void _thumbClicked(void * data, Evas_Object * obj, void * event_info);
- void setEmptyView(bool empty);
- void showNoHistoryLabel();
-
- static void _mostVisited_clicked(void * data, Evas_Object * obj, void * event_info);
- static void _bookmark_clicked(void * data, Evas_Object * obj, void * event_info);
- static void _bookmark_manager_clicked(void * data, Evas_Object * obj, void * event_info);
-
- Evas_Object *m_parent;
- Evas_Object *m_layout;
- Evas_Object *m_bookmarksView;
- Evas_Object *m_mostVisitedView;
- Evas_Object *m_bookmarksButton;
- Evas_Object *m_mostVisitedButton;
- Evas_Object *m_bookmarkGengrid;
- Evas_Object *m_bookmarkManagerButton;
- std::vector<Evas_Object *> m_tiles;
- Eina_List* m_parentFocusChain;
-
- Elm_Gengrid_Item_Class * m_bookmark_item_class;
- DetailPopup m_detailPopup;
- services::HistoryItemVector m_historyItems;
- bool m_gengridSetup;
- std::string edjFilePath;
- bool m_desktopMode;
-
- static const int MAX_TILES_NUMBER;
- static const int BIG_TILE_INDEX;
- static const int TOP_RIGHT_TILE_INDEX;
- static const int BOTTOM_RIGHT_TILE_INDEX;
- static const std::vector<std::string> TILES_NAMES;
-};
-
-}
-}
-
-#endif // BOOKMARKSUI_H
+++ /dev/null
-collections {
-
- group {
- name: "popup";
- images {
- image: "ic_popup_list_arrow.png" COMP;
- }
- parts {
- part { name: "bg";
- type: RECT;
- mouse_events: 1;
- description { state: "default" 0.0;
- color: 0 0 0 102;
- visible: 1;
- min: 1920 1080;
- max: -1 -1;
- align: 0.0 0.0;
- rel1 {
- relative: 0.0 0.0;
- }
- rel2 {
- relative: 1.0 1.0;
- }
- }
- }
-
- part { name: "main_rect";
- type: RECT;
- mouse_events: 1;
- description { state: "default" 0.0;
- color: 255 255 255 255;
- min: 1336 648;
- max: 1336 648;
- visible: 1;
- align: 0.5 0.0;
- rel1 {
- to: "bg";
- offset: 0 264;
- relative: 0.0 0.0;
- }
- rel2 {
- to: "bg";
- relative: 1.0 1.0;
- }
- }
- }
-
- part { name: "thumbnail";
- type: SWALLOW;
- description {
- min: 840 648;
- max: 840 648;
- visible: 1;
- align: 0.0 0.0;
- rel1 {
- to: "main_rect";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "main_rect";
- relative: 1.0 1.0;
- }
- }
- }
-
- part { name: "url_bg";
- type: RECT;
- description { state: "default" 0.0;
- color: 255 255 255 255;
- min: 496 122;
- max: 496 122;
- visible: 1;
- align: 0.0 0.0;
- rel1 {
- to: "thumbnail";
- relative: 1.0 0.0;
- }
- rel2 {
- to: "main_rect";
- relative: 1.0 1.0;
- }
- }
- description { state: "selected" 0.0;
- inherit: "default" 0.0;
- color: 0 119 246 255;
- }
- }
-
- part { name: "url";
- type: TEXT;
- description {
- visible: 1;
- min: 408 122;
- max: 408 122;
- align: 0.0 0.0;
- fixed: 1 1;
- color: 51 51 51 255;
- rel1 {
- to: "url_bg";
- relative: 0.0 0.0;
- offset: 34 0;
- }
- rel2 {
- to: "url_bg";
- relative: 1.0 1.0;
- }
- text {
- text: "Web page title";
- font: "Sans";
- size: 32;
- align: 0 0.5;
- }
- }
- description { state: "selected" 0.0;
- inherit: "default" 0.0;
- color: 255 255 255 255;
- }
- }
-
- part { name: "url_arrow";
- type: IMAGE;
- scale: 1;
- repeat_events: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- align: 0.0 0.5;
- min: 38 38;
- max: 38 38;
- image.normal: "ic_popup_list_arrow.png";
- rel1 {
- to: "url_bg";
- relative: 0.0 0.0;
- offset: 442 0;
- }
- rel2 {
- to: "url_bg";
- relative: 1.0 1.0;
- }
- }
- }
-
- part { name: "url_over";
- type: SWALLOW;
- mouse_events: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- visible: 1;
- color: 0 0 0 0;
- rel1.to: "url_bg";
- rel2.to: "url_bg";
- }
- }
-
- part { name: "history_title_bg";
- type: RECT;
- description {
- color: 244 244 244 255;
- min: 496 44;
- max: 496 44;
- visible: 1;
- align: 0.0 0.0;
- rel1 {
- to: "url_bg";
- relative: 0.0 1.0;
- }
- rel2 {
- to: "main_rect";
- relative: 1.0 1.0;
- }
- }
- }
-
- part { name: "history_title";
- type: TEXT;
- description {
- visible: 1;
- min: 428 44;
- max: 428 44;
- align: 0.0 0.0;
- fixed: 1 1;
- color: 51 51 51 255;
- rel1 {
- to: "history_title_bg";
- relative: 0.0 0.0;
- offset: 34 0;
- }
- rel2 {
- to: "history_title_bg";
- relative: 1.0 1.0;
- }
- text {
- text: "Web page title";
- font: "Sans";
- size: 22;
- align: 0 0.5;
- }
- }
- }
-
- part { name: "history_list";
- type: SWALLOW;
- description {
- color: 255 255 255 255;
- min: 496 460;
- max: 496 460;
- visible: 1;
- align: 0.0 0.0;
- rel1 {
- to: "history_title_bg";
- relative: 0.0 1.0;
- offset: 0 22;
- }
- rel2 {
- to: "main_rect";
- relative: 1.0 1.0;
- }
- }
- }
- }
-
- programs {
- program {
- name: "mouse_in_url";
- signal: "mouse,in";
- source: "url_over";
- action: STATE_SET "selected" 0.0;
- target: "url_bg";
- target: "url";
- }
- program {
- name: "mouse_out_url";
- signal: "mouse,out";
- source: "url_over";
- action: STATE_SET "default" 0.0;
- target: "url_bg";
- target: "url";
- }
- program {
- name: "mouse_click";
- signal: "mouse,clicked,1";
- source: "url_over";
- script {
- emit("elm,action,click", "");
- }
- }
- }
- }
-
- group { name: "elm/genlist/item/history_grid_item/default";
- data.item: "texts" "page_dsc";
- parts {
- part { name: "bg";
- type: RECT;
- mouse_events: 1;
- description { state: "default" 0.0;
- min: 496 86;
- max: 496 86;
- visible: 1;
- color: 255 255 255 255;
- align: 0.0 0.0;
- }
- description { state: "selected" 0.0;
- inherit: "default" 0.0;
- color: 0 119 246 255;
- }
- }
-
- part { name: "page_dsc";
- type: TEXT;
- description { state: "default" 0.0;
- min: 428 86;
- max: 428 86;
- align: 0.0 0.0;
- color: 0 0 0 255;
- rel1 {
- to: "bg";
- relative: 0.0 0.0;
- offset: 34 0;
- }
- rel2 {
- to: "bg";
- relative: 1.0 1.0;
- }
- text {
- font: "Sans";
- size: 24;
- align: 0 0.5;
- }
- }
- description { state: "selected" 0.0;
- inherit: "default" 0.0;
- color: 255 255 255 255;
- }
- }
-
- part { name: "dsc_over";
- type: RECT;
- mouse_events: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- visible: 1;
- color: 0 0 0 0;
- rel1.to: "bg";
- rel2.to: "bg";
- }
- }
-
- }
- programs {
- program {
- name: "mouse_in_url";
- signal: "mouse,in";
- source: "dsc_over";
- action: STATE_SET "selected" 0.0;
- target: "bg";
- target: "page_dsc";
- }
- program {
- name: "mouse_out_url";
- signal: "mouse,out";
- source: "dsc_over";
- action: STATE_SET "default" 0.0;
- target: "bg";
- target: "page_dsc";
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-#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 {
-
-#define WIDTH 1920
-#define HEIGHT 181
-#define ITEM_WIDTH 374
-#define PARENT_ITEM_HEIGHT 36
-
-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", "");
- }
- }
- }
-}
-
-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: "mv_bookmarks";
- data {
- item: "focus_highlight" "off";
- }
- images {
- image: "web_shadow.png" COMP;
- }
- color_classes{
- color_class{
- name: "defaultBgColor";
- color: 18 22 34 255;
- }
- color_class{
- name: "focusBgColor";
- color: 0 119 246 255;
- }
- color_class{
- name: "imageHighlight";
- color: 255 255 255 102;
- }
- color_class{
- name: "focusbtBgColor";
- color: 22 120 224 255;
- }
- color_class{
- name: "titleTextColor";
- color: 74 74 74 255;
- }
- color_class{
- name: "focusTextColor";
- color: 255 255 255 255;
- }
- color_class{
- name: "highlightTextColor";
- color: 255 255 255 51;
- }
- color_class{
- name: "urlTextColor";
- color: 116 116 116 204;
- }
- color_class{
- name: "transparent";
- color: 0 0 0 0;
- }
- }
-
- parts {
- part { name: "layoutTop_bg";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- color: 255 255 255 255;
- min: 0 181;
- max: -1 181;
- align: 0.0 0.0;
- fixed: 0 0;
- rel1 {
- relative: 0 0; offset: 0 104;
- }
- rel2{
- relative: 1 1;
- }
- }
- }
- part { name: "gengrid_bg";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- color: 255 255 255 255;
- min: 1920 626;
- max: -1 626;
- align: 0.0 0.0;
- fixed: 0 0;
- rel1 {
- to: "layoutTop_bg";
- relative: 0 1;
- }
- rel2{
- relative: 1 1;
- }
- }
- }
- part { name: "layoutBottom_bg";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- color: 255 255 255 255;
- min: 1920 181;
- max: 1920 181;
- align: 0.0 0.0;
- fixed: 0 0;
- rel1 {
- relative: 0 1; to: "gengrid_bg";
- }
- rel2{
- relative: 1 1;
- }
- }
- }
-
- part { name: "elm.swallow.grid";
- type: SWALLOW;
- description { state: "default" 0.0;
- min: 1920 614;
- max: 1920 614;
- align: 0.0 0.0;
- fixed: 0 0;
- rel1 {
- relative: 0 0; to: "gengrid_bg"; offset: 63 0;
- }
- rel2 {
- relative: 1 1;
- offset: 0 0;
- }
- }
- }
-
- part { name: "center_rect";
- type: RECT;
- description { state: "default" 0.0;
- min: 1592 614;
- max: 1592 614;
- visible: 0;
- align: 0.5 0.0;
- rel1 {
- to: "gengrid_bg";
- relative: 0 0;
- }
- rel2 {
- to: "gengrid_bg";
- relative: 1 1;
- }
- }
- description { state: "empty" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- color: 229 229 229 255;
- }
- }
-
- part { name: "elm.swallow.big";
- type: SWALLOW;
- description { state: "default" 0.0;
- min: 784 614;
- max: 784 614;
- align: 0.0 0.0;
- fixed: 1 1;
- visible: 1;
- rel1 {
- relative: 0 0; to: "center_rect";
- }
- rel2 {
- relative: 1 1;
- offset: 0 0;
- }
- }
- description { state: "empty" 0.0;
- inherit: "default" 0.0;
- visible: 0;
- }
- }
-
- part { name: "elm.swallow.small_first";
- type: SWALLOW;
- description { state: "default" 0.0;
- min: 378 294;
- max: 378 294;
- align: 0.0 0.0;
- fixed: 1 1;
- visible: 1;
- rel1 {
- to: "center_rect";
- relative: 0 0;
- offset: 810 0;
- }
- rel2{
- to: "center_rect";
- relative: 1 1;
- offset: 0 0;
- }
- }
- description { state: "empty" 0.0;
- inherit: "default" 0.0;
- visible: 0;
- }
- }
-
- part { name: "elm.swallow.small_second";
- type: SWALLOW;
- description { state: "default" 0.0;
- min: 378 294;
- max: 378 294;
- align: 0.0 0.0;
- fixed: 1 1;
- visible: 1;
- rel1 {
- to: "center_rect";
- relative: 0 0;
- offset: 810 320;
- }
- rel2{
- to: "center_rect";
- relative: 1 1;
- offset: 0 0;
- }
- }
- description { state: "empty" 0.0;
- inherit: "default" 0.0;
- visible: 0;
- }
- }
-
- part { name: "elm.swallow.small_third";
- type: SWALLOW;
- description { state: "default" 0.0;
- min: 378 294;
- max: 378 294;
- align: 0.0 0.0;
- fixed: 1 1;
- visible: 1;
- rel1 {
- to: "center_rect";
- relative: 0 0;
- offset: 1214 0;
- }
- rel2 {
- to: "center_rect";
- relative: 1 1;
- offset: 0 0;
- }
- }
- description { state: "empty" 0.0;
- inherit: "default" 0.0;
- visible: 0;
- }
- }
-
- part { name: "elm.swallow.small_fourth";
- type: SWALLOW;
- description { state: "default" 0.0;
- min: 378 294;
- max: 378 294;
- align: 0.0 0.0;
- fixed: 1 1;
- visible: 1;
- rel1 {
- to: "center_rect";
- relative: 0 0;
- offset: 1214 320;
- }
- rel2 {
- to: "center_rect";
- relative: 1 1;
- offset: 0 0;
- }
- }
- description { state: "empty" 0.0;
- inherit: "default" 0.0;
- visible: 0;
- }
- }
-
- part { name: "elm.swallow.layoutTop";
- type: SWALLOW;
- description { state: "default" 0.0;
- min: 1920 181;
- max: 1920 181;
- align: 0.0 0.0;
- fixed: 0 0;
- rel1 {
- relative: 0 0; to: "layoutTop_bg";
- }
- rel2 {
- relative: 1 1;
- offset: 0 0;
- }
- }
- }
-
- part { name: "uri_bar_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: "elm.swallow.layoutTop"; }
- rel2 { relative: 1.0 1.0; }
- }
- }
-
- part { name: "elm.swallow.layoutBottom";
- type: SWALLOW;
- description { state: "default" 0.0;
- min: 1920 181;
- max: 1920 181;
- align: 0.0 0.0;
- fixed: 0 0;
- rel1 {
- to: "layoutBottom_bg";
- relative: 0 0;
- }
- rel2 {
- relative: 1 1;
- offset: 0 0;
- }
- }
- }
-
- part { name: "elm.text.empty";
- type: TEXT;
- description { state: "default" 0.0;
- visible: 0;
- align: 0.5 0.5;
- color: 0 0 0 179;
- text {
- text: "empty";
- font: "Sans";
- size: 32;
- align: 0.5 0.5;
- }
- rel1 {
- to: "gengrid_bg";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "gengrid_bg";
- relative: 1 1;
- }
- }
- description { state: "empty" 0.0;
- inherit: "default" 0.0;
- visible: 1;
- }
- }
- }
-
- programs {
- program { name: "empty";
- signal: "empty,view";
- source: "mainui";
- action: STATE_SET "empty" 0.0;
- target: "elm.swallow.big";
- target: "elm.swallow.small_first";
- target: "elm.swallow.small_second";
- target: "elm.swallow.small_third";
- target: "elm.swallow.small_fourth";
- target: "elm.text.empty";
- target: "center_rect";
- }
- program { name: "not_empty";
- signal: "not,empty,view";
- source: "mainui";
- action: STATE_SET "default" 0.0;
- target: "elm.text.empty";
- target: "center_rect";
- target: "elm.swallow.big";
- target: "elm.swallow.small_first";
- target: "elm.swallow.small_second";
- target: "elm.swallow.small_third";
- target: "elm.swallow.small_fourth";
- }
- }
-}
-
-group { name: "elm/button/base/big_tile";
- data.item: "texts" "page_title page_url";
- data.item: "contents" "elm.thumbnail";
- min: 600 614;
- max: 600 614;
- images {
- image: "web_frame_selected.png" COMP;
- image: "ico_bg_round_shape_37x37.png" COMP;
- }
- parts {
- part { name: "bg";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- min: 784 614;
- max: 784 614;
- visible: 1;
- color: 231 231 231 255;
- }
- }
-
- part { name: "elm.thumbnail";
- type: SWALLOW;
- description { state: "default" 0.0;
- fixed: 1 0;
- align: 0.0 0.0;
- color : 231 231 231 255;
- min: 784 577; // size adjusted to max thubnail with and height
- max: 784 577;
- rel1 {
- relative: 0.0 0.0; to: "bg";
- }
- rel2 {
- relative: 1.0 1.0; to: "bg";
- }
- }
- description { state: "selected";
- inherit: "default" 0.0;
- }
- }
-
- part { name: "border_top";
- type: RECT;
- description { state: "default" 0.0;
- color_class: focusBgColor;
- min: 0 6;
- max: -1 6;
- align: 0 0;
- rel1 {
- to: "elm.thumbnail";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "elm.thumbnail";
- relative: 1.0 1.0;
- }
- visible: 0;
- }
- description { state: "selected";
- inherit: "default" 0.0;
- visible: 1;
- }
- }
-
- part { name: "border_left";
- type: RECT;
- description { state: "default" 0.0;
- color_class: focusBgColor;
- min: 6 0;
- max: 6 -1;
- align: 0 0;
- rel1 {
- to: "elm.thumbnail";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "elm.thumbnail";
- relative: 1.0 1.0;
- }
- visible: 0;
- }
- description { state: "selected";
- inherit: "default" 0.0;
- visible: 1;
- }
- }
-
- part { name: "border_right";
- type: RECT;
- description { state: "default" 0.0;
- color_class: focusBgColor;
- min: 6 0;
- max: 6 -1;
- align: 1 0;
- rel1 {
- to: "elm.thumbnail";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "elm.thumbnail";
- relative: 1.0 1.0;
- }
- visible: 0;
- }
- description { state: "selected";
- inherit: "default" 0.0;
- visible: 1;
- }
- }
-
- part { name: "background";
- type: RECT;
- description { state: "default" 0.0;
- min: 784 116;
- max: 784 116;
- align: 0.0 0.0;
- color: 113 128 147 255;
- visible: 1;
- rel1 {
- to: "bg";
- relative: 0.0 0.0;
- offset: 0 498; // thumbnail height
- }
- rel2 {
- relative: 1.0 1.0;
- }
- }
- description { state: "selected" 0.0;
- inherit: "default" 0.0;
- color: 0 119 246 255;
- }
- }
-
- part { name: "page_title";
- type: TEXT;
- description { state: "default" 0.0;
- min: 700 36;
- max: 700 36;
- align: 0.0 0.0;
- color: 255 255 255 255;
- rel1 {
- to: "background";
- relative: 0.0 0.0;
- offset: 32 22;
- }
- rel2 {
- to: "background";
- relative: 1.0 1.0;
- }
- text {
- text: "Web page title";
- font: "Sans";
- size: 36;
- align: 0 0.5;
- }
- }
- }
-
- part { name: "page_url";
- type: TEXT;
- description { state: "default" 0.0;
- min: 700 28;
- max: 700 28;
- align: 0 0.0;
- color: 255 255 255 255;
- rel1 {
- to: "page_title";
- relative: 0.0 1.0;
- offset: 0 10;
- }
- rel2 {
- to: "background";
- relative: 1.0 1.0;
- }
- text {
- text: "Web page url";
- font: "Sans";
- size: 28;
- align: 0 0.5;
- }
- }
- }
-
- part { name: "over";
- type: RECT;
- mouse_events: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- color: 0 0 0 0;
- rel1.to: "bg";
- rel2.to: "background";
- }
- }
- }
-
- programs{
- program { name: "mouse_in";
- signal: "mouse,in";
- source: "over";
- action: STATE_SET "selected" 0.0;
- target: "background";
- target: "border_top";
- target: "border_left";
- target: "border_right";
- }
- program { name: "mouse_out";
- signal: "mouse,out";
- source: "over";
- action: STATE_SET "default" 0.0;
- target: "background";
- target: "border_top";
- target: "border_left";
- target: "border_right";
- }
- program {
- name: "mouse_click";
- signal: "mouse,clicked,1";
- source: "over";
- script {
- emit("elm,action,click", "");
- }
- }
- }
-}
-
-group { name: "elm/button/base/small_tile";
- data.item: "texts" "page_title page_url";
- data.item: "contents" "elm.thumbnail";
- images {
- image: "web_frame_selected.png" COMP;
- image: "ico_bg_round_shape_37x37.png" COMP;
- }
- parts {
- part { name: "container";
- type: RECT;
- description { state: "default" 0.0;
- min: 378 320;
- max: 378 320;
- visible: 0;
- }
- }
-
- part { name: "bg";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- min: 378 294;
- max: 378 294;
- visible: 1;
- color: 231 231 231 255;
- align: 0.0 0.0;
- rel1 {
- relative: 0.0 0.0; to: "container";
- }
- rel2 {
- relative: 1.0 1.0; to: "container";
- }
- }
- }
-
- part { name: "elm.thumbnail";
- type: SWALLOW;
- description { state: "default" 0.0;
- fixed: 1 0;
- align: 0.0 0.0;
- color : 231 231 231 255;
- min: 378 292; // size adjusted to max thubnail with and height
- max: 378 292;
- rel1 {
- relative: 0.0 0.0; to: "bg";
- }
- rel2 {
- relative: 1.0 1.0; to: "bg";
- }
- }
- description { state: "selected";
- inherit: "default" 0.0;
- }
- }
- part { name: "border_top";
- type: RECT;
- description { state: "default" 0.0;
- color_class: focusBgColor;
- min: 0 6;
- max: -1 6;
- align: 0 0;
- rel1 {
- to: "elm.thumbnail";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "elm.thumbnail";
- relative: 1.0 1.0;
- }
- visible: 0;
- }
- description { state: "selected";
- inherit: "default" 0.0;
- visible: 1;
- }
- }
-
- part { name: "border_left";
- type: RECT;
- description { state: "default" 0.0;
- color_class: focusBgColor;
- min: 6 0;
- max: 6 -1;
- align: 0 0;
- rel1 {
- to: "elm.thumbnail";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "elm.thumbnail";
- relative: 1.0 1.0;
- }
- visible: 0;
- }
- description { state: "selected";
- inherit: "default" 0.0;
- visible: 1;
- }
- }
-
- part { name: "border_right";
- type: RECT;
- description { state: "default" 0.0;
- color_class: focusBgColor;
- min: 6 0;
- max: 6 -1;
- align: 1 0;
- rel1 {
- to: "elm.thumbnail";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "elm.thumbnail";
- relative: 1.0 1.0;
- }
- visible: 0;
- }
- description { state: "selected";
- inherit: "default" 0.0;
- visible: 1;
- }
- }
-
- part { name: "background";
- type: RECT;
- description { state: "default" 0.0;
- min: 378 96;
- max: 378 96;
- align: 0.0 0.0;
- color: 113 128 147 255;
- visible: 1;
- rel1 {
- to: "bg";
- relative: 0.0 0.0;
- offset: 0 198; // thumbnail height
- }
- rel2 {
- relative: 1.0 1.0;
- }
- }
- description { state: "selected" 0.0;
- inherit: "default" 0.0;
- color: 0 119 246 255;
- }
- }
-
- part { name: "page_title";
- type: TEXT;
- description { state: "default" 0.0;
- min: 314 28;
- max: 314 28;
- align: 0.0 0.0;
- color: 255 255 255 255;
- rel1 {
- to: "background";
- relative: 0.0 0.0;
- offset: 32 18;
- }
- rel2 {
- to: "background";
- relative: 1.0 1.0;
- }
- text {
- text: "Web page title";
- font: "Sans";
- size: 28;
- align: 0 0.0;
- }
- }
- 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";
- type: TEXT;
- description { state: "default" 0.0;
- min: 314 24;
- max: 314 24;
- align: 0 0.0;
- color: 255 255 255 255;
- rel1 {
- to: "page_title";
- relative: 0.0 1.0;
- offset: 0 8;
- }
- rel2 {
- to: "background";
- relative: 1.0 1.0;
- }
- text {
- text: "Web page url";
- font: "Sans";
- size: 24;
- 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: "over";
- type: RECT;
- mouse_events: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- color: 0 0 0 0;
- rel1.to: "bg";
- rel2.to: "background";
- }
- }
- }
-
- programs {
- program { name: "mouse_in";
- signal: "mouse,in";
- source: "over";
- action: STATE_SET "selected" 0.0;
- target: "background";
- target: "border_top";
- target: "border_left";
- target: "border_right";
- }
- program { name: "mouse_out";
- signal: "mouse,out";
- source: "over";
- action: STATE_SET "default" 0.0;
- target: "background";
- target: "border_top";
- target: "border_left";
- target: "border_right";
- }
- program {
- name: "mouse_click";
- signal: "mouse,clicked,1";
- source: "over";
- script {
- emit("elm,action,click", "");
- }
- }
- }
-}
-
-group { name: "elm/gengrid/item/grid_item/default";
- data.item: "texts" "page_title page_url";
- data.item: "contents" "elm.thumbnail elm.thumbButton";
- images {
- image: "web_frame_selected.png" COMP;
- image: "ico_bg_round_shape_37x37.png" COMP;
- image: "ic_thumbnail_favorite_01.png" COMP;
- }
- parts {
- part { name: "bg";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- min: 338 294;
- max: 338 294;
- visible: 1;
- color: 231 231 231 255;
- rel1.offset: -26 -26;
- }
- 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;
- align: 0.0 0.0;
- color : 231 231 231 255;
- min: 338 198;
- max: 338 198;
- rel1 {
- relative: 0.0 0.0; to: "bg";
- }
- rel2 {
- relative: 1.0 1.0; to: "bg";
- }
- }
- description { state: "selected";
- inherit: "default" 0.0;
- }
- }
-
- part {
- name: "bookmark_thumbButton";
- type: IMAGE;
- mouse_events: 1;
- repeat_events: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- rel1.to: "elm.thumbnail";
- rel1.offset: 284 18;
- rel1.relative: 0.0 0.0;
- rel2.to: "elm.thumbnail";
- rel2.offset: 324 58;
- rel2.relative: 0.0 0.0;
- align: 0.0 0.0;
- image.normal: "ic_thumbnail_favorite_01.png";
- }
- }
-
- 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";
- type: RECT;
- description { state: "default" 0.0;
- min: 338 87;
- max: 338 87;
- align: 0.0 0.0;
- color: 231 231 231 255;
- rel1 {
- to: "elm.thumbnail";
- relative: 0.0 1.0;
- }
- rel2 {
- relative: 1.0 1.0;
- }
- }
- description { state: "selected" 0.0;
- inherit: "default" 0.0;
- color: 70 143 254 255;
- }
- }
-
- part { name: "page_title";
- type: TEXT;
- description { state: "default" 0.0;
- min: 300 48;
- max: 300 48;
- align: 0.0 0.5;
- rel1 {
- to: "background";
- relative: 0.0 0.0;
- offset: 17 0;
- }
- rel2 {
- to: "background";
- relative: 1.0 1.0;
- }
- color: 51 51 51 255;
- text {
- text: "Web page title";
- font: "Sans";
- size: 27;
- align: 0 0.5;
- }
- }
- description { state: "focus" 0.0;
- inherit: "default" 0.0;
- //color: focusTextColor;
- }
- description { state: "highlight" 0.0;
- inherit: "default" 0.0;
- //color: highlightTextColor;
- }
- }
-
- part { name: "page_url";
- type: TEXT;
- description { state: "default" 0.0;
- min: 300 48;
- max: 300 48;
- align: 0 0.5;
- rel1 {
- to: "page_title";
- relative: 0.0 1.0;
- }
- rel2 {
- to: "page_title";
- relative: 1.0 1.0;
- }
- color: 153 153 153 255;
- text {
- text: "Web page url";
- font: "Sans";
- size: 24;
- align: 0 0.5;
- }
- }
- description { state: "focus" 0.0;
- inherit: "default" 0.0;
- //color: focusTextColor;
- }
- description { state: "highlight" 0.0;
- inherit: "default" 0.0;
- //color: highlightTextColor;
- }
- }
-
- part { name: "elm.thumbButton";
- type: SWALLOW;
- 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: "bg";
- rel2.to: "background";
- }
- }
- }
-
- programs{
- program { name: "mouse_in";
- signal: "mouse,in";
- source: "over";
- action: STATE_SET "selected" 0.0;
- target: "background";
- target: "focus_highlight";
- target: "bg";
- }
- program { name: "mouse_out";
- signal: "mouse,out";
- source: "over";
- action: STATE_SET "default" 0.0;
- target: "background";
- target: "focus_highlight";
- target: "bg";
- }
- }
-}
-
-group { name: "top_button_item";
- min: 1920 181;
- max: 1920 181;
- data.item: "texts" "mostvisited_text bookmark_text";
- data.item: "contents" "mostvisited_click bookmark_click";
- parts{
- part {
- name: "bg_clipper";
- scale:1;
- mouse_events: 1;
- type: RECT;
- description {
- state: "default" 0.0;
- color: 255 255 255 255;
- align: 0 0;
- min: 1920 181;
- max: 1920 181;
- rel1 { relative: 0.0 0.0;}
- rel2 { relative: 1.0 1.0;}
- }
- }
- part {
- name: "mostvisited_button";
- scale:1;
- mouse_events: 1;
- type: RECT;
- description {
- state: "default" 0.0;
- visible: 1;
- fixed: 1 1;
- color: 192 192 192 255;
- align: 0 0;
- min: 348 64;
- max: 348 64;
- rel1 { relative: 0.0 0.0; to: "bg_clipper"; offset: 611 58;}
- rel2 { relative: 1.0 1.0; to: "bg_clipper"; }
- }
- 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: focusbtBgColor;
- visible: 1;
- }
- }
- part{
- name: "mostvisited_text";
- type: TEXT;
- scale: 1;
- description { state: "default" 0.0;
- visible: 1;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0;to: "mostvisited_button";}
- rel2 { relative: 1.0 1.0;to: "mostvisited_button";}
- color: 0 0 0 255;
- text {
- text: "Most visited";
- font: "Sans";
- size: 27;
- align: 0.5 0.5;
- }
- }
- }
- part {
- name: "mostvisited_over";
- scale:1;
- type: RECT;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- align: 0 0;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0; to: "mostvisited_button";}
- rel2 { relative: 1.0 1.0; to: "mostvisited_button";}
- color_class: transparent;
- }
- }
- part {
- name: "mostvisited_click";
- scale:1;
- type: SWALLOW;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- align: 0 0;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0; to: "mostvisited_button";}
- rel2 { relative: 1.0 1.0; to: "mostvisited_button";}
- }
- }
- part {
- name: "bookmark_button";
- scale:1;
- mouse_events: 1;
- type: RECT;
- description {
- state: "default" 0.0;
- visible: 1;
- fixed: 1 1;
- color: 192 192 192 255;
- align: 0 0;
- min: 348 64;
- max: 348 64;
- rel1 { relative: 0.0 0.0; to: "bg_clipper"; offset: 961 58;}
- rel2 { relative: 1.0 1.0; to: "bg_clipper"; }
- }
- 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: focusbtBgColor;
- visible: 1;
- }
- }
- part{
- name: "bookmark_text";
- type: TEXT;
- scale: 1;
- description { state: "default" 0.0;
- visible: 1;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0;to: "bookmark_button";}
- rel2 { relative: 1.0 1.0;to: "bookmark_button";}
- color: 0 0 0 255;
- text {
- text: "Bookmark";
- font: "Sans";
- size: 27;
- align: 0.5 0.5;
- }
- }
- }
- part {
- name: "bookmark_over";
- scale:1;
- type: RECT;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- align: 0 0;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0; to: "bookmark_button";}
- rel2 { relative: 1.0 1.0; to: "bookmark_button";}
- color_class: transparent;
- }
- }
- part {
- name: "bookmark_click";
- scale:1;
- type: SWALLOW;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- align: 0 0;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0; to: "bookmark_button";}
- rel2 { relative: 1.0 1.0; to: "bookmark_button";}
- color_class: transparent;
- }
- }
-
- programs{
- program {
- name: "mouse_click_mostvisited";
- signal: "mouse,clicked,1";
- source: "mostvisited_over";
- script {
- emit("elm,action,click", "");
- }
- }
- program {
- name: "mouse_in_mostvisited_click";
- signal: "mouse,in";
- source: "mostvisited_*";
- action: STATE_SET "highlight" 0.0;
- target: "mostvisited_button";
- target: "mostvisited_over";
- target: "mostvisited_text";
- }
- program {
- name: "mouse_out_mostvisited_click";
- signal: "mouse,out";
- source: "mostvisited_*";
- action: STATE_SET "default" 0.0;
- target: "mostvisited_button";
- target: "mostvisited_over";
- target: "mostvisited_text";
- }
- program {
- name: "mouse_click_bookmark";
- signal: "mouse,clicked,1";
- source: "bookmark_over";
- script {
- emit("elm,action,click", "");
- }
- }
- program {
- name: "mouse_in_bookmark_click";
- signal: "mouse,in";
- source: "bookmark_*";
- action: STATE_SET "highlight" 0.0;
- target: "bookmark_button";
- target: "bookmark_over";
- target: "bookmark_text";
- }
- program {
- name: "mouse_out_bookmark_click";
- signal: "mouse,out";
- source: "bookmark_*";
- action: STATE_SET "default" 0.0;
- target: "bookmark_button";
- target: "bookmark_over";
- target: "mostvisited_text";
- }
- }
- }
-}
-
-group { name: "bottom_button_item";
- min: 1920 181;
- max: 1920 181;
- data.item: "texts" "bookmarkmanager_text";
- data.item: "contents" "bookmarkmanager_click";
- parts{
- part {
- name: "bg_clipper";
- scale:1;
- mouse_events: 1;
- type: RECT;
- description {
- state: "default" 0.0;
- color: 255 255 255 255;
- align: 0 0;
- min: 1920 181;
- max: 1920 181;
- rel1 { relative: 0.0 0.0;}
- rel2 { relative: 1.0 1.0;}
- }
- }
- part {
- name: "bookmarkmanager_button";
- scale:1;
- mouse_events: 1;
- type: RECT;
- description {
- state: "default" 0.0;
- visible: 1;
- fixed: 1 1;
- align: 0 0;
- min: 348 65;
- max: 348 65;
- color: 192 192 192 255;
- rel1 { relative: 0.0 0.0; to: "bg_clipper"; offset: 786 58;}
- rel2 { relative: 1.0 1.0; to: "bg_clipper"; }
- }
- 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: focusbtBgColor;
- visible: 1;
- }
- }
- part{
- name: "bookmarkmanager_text";
- type: TEXT;
- scale: 1;
- description { state: "default" 0.0;
- visible: 1;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0;to: "bookmarkmanager_button";}
- rel2 { relative: 1.0 1.0;to: "bookmarkmanager_button";}
- color: 0 0 0 255;
- text {
- text: "Bookmark Manager";
- font: "Sans";
- size: 27;
- align: 0.5 0.5;
- }
- }
- }
- part {
- name: "bookmarkmanager_over";
- scale:1;
- type: RECT;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- align: 0 0;
- fixed: 1 1;
- min: 348 65;
- max: 348 65;
- rel1 { relative: 0.0 0.0; to: "bookmarkmanager_button";}
- rel2 { relative: 1.0 1.0; to: "bookmarkmanager_button";}
- color_class: transparent;
- }
- }
- part {
- name: "bookmarkmanager_click";
- scale:1;
- type: SWALLOW;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- visible: 1;
- align: 0 0;
- fixed: 1 1;
- min: 348 65;
- max: 348 65;
- rel1 { relative: 0.0 0.0; to: "bookmarkmanager_over";}
- rel2 { relative: 1.0 1.0; to: "bookmarkmanager_over";}
- }
- }
- }
- programs{
- program {
- name: "mouse_click_bookmarkmanager";
- signal: "mouse,clicked,1";
- source: "bookmarkmanager_over";
- script {
- emit("elm,action,click", "");
- }
- }
- program {
- name: "mouse_in_bookmarkmanager_click";
- signal: "mouse,in";
- source: "bookmarkmanager_*";
- action: STATE_SET "highlight" 0.0;
- target: "bookmarkmanager_button";
- target: "bookmarkmanager_over";
- target: "bookmarkmanager_text";
- }
- program {
- name: "mouse_out_bookmarkmanager_click";
- signal: "mouse,out";
- source: "bookmarkmanager_*";
- action: STATE_SET "default" 0.0;
- target: "bookmarkmanager_button";
- target: "bookmarkmanager_over";
- target: "bookmarkmanager_text";
- }
- }
- }
-}
+++ /dev/null
-collections {
- images {
- image: "web_browsing_icon_error.png" COMP;
- }
- group { name: "error_message";
- 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";
- }
- }
- parts {
- part{
- name: "message_background";
- type: RECT;
- description{
- state: "default" 0.0;
- visible: 1;
- rel1.relative: 0 0;
- rel2.relative: 1 1;
- color: 42 50 64 255;
- }
- }
- 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;
- }
- }
- 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";
- }
- }
- }
-
- 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.<br/>sdf Please check the followings:";
- //min: 0 0;
- //max: 1 1;
- //align: 1 0;
- //size: 35;
- }
- }
- }
-
-
- 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. <br/>"
- "Check your network settings.<br/>"
- "Try again later.<br/>"
- "Click refresh to reload.";
- }
- }
- }
- }
-/*
- programs {
- program { name: "mouse_down";
- signal: "mouse,down,1";
- source: "logo";
- action: STATE_SET "hide" 0.0;
- target: "logo";
- }
- program { name: "mouse_up";
- signal: "mouse,up,1";
- source: "logo";
- action: STATE_SET "default" 0.0;
- target: "logo";
- }
- }
-*/
- }
-}
--- /dev/null
+project(QuickAccess)
+
+set(QuickAccess_SRCS
+ QuickAccess.cpp
+ DetailPopup.cpp
+ )
+
+set(QuickAccess_HEADERS
+ QuickAccess.h
+ DetailPopup.h
+ )
+
+include(Coreheaders)
+include(EFLHelpers)
+
+include_directories(${CMAKE_SOURCE_DIR}/services/FavoriteService)
+
+add_library(${PROJECT_NAME} SHARED ${QuickAccess_SRCS})
+
+if(TIZEN_BUILD)
+ target_link_libraries(${PROJECT_NAME} ${pkgs_LDFLAGS})
+endif(TIZEN_BUILD)
+
+install(TARGETS ${PROJECT_NAME}
+ LIBRARY DESTINATION services
+ ARCHIVE DESTINATION services/static)
+
+#please do not add edc/ directory
+set(edcFiles
+ QuickAccess.edc
+ DetailPopup.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)
--- /dev/null
+/*
+ * 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 <Elementary.h>
+#include <vector>
+#include <algorithm>
+#include "BrowserAssert.h"
+#include "DetailPopup.h"
+#include "BrowserLogger.h"
+#include "Tools/GeneralTools.h"
+#include "Tools/EflTools.h"
+#include "QuickAccess.h"
+
+namespace tizen_browser{
+namespace base_ui{
+
+const char * DetailPopup::URL_SEPARATOR = " - ";
+const int DetailPopup::HISTORY_ITEMS_NO = 5;
+
+DetailPopup::DetailPopup(QuickAccess *quickAccess)
+ : m_main_view(nullptr)
+ , m_parent(nullptr)
+ , m_layout(nullptr)
+ , m_historyList(nullptr)
+ , m_urlButton(nullptr)
+ , m_history_item_class(nullptr)
+ , m_quickAccess(quickAccess)
+{
+ edjFilePath = EDJE_DIR;
+ edjFilePath.append("QuickAccess/DetailPopup.edj");
+ elm_theme_extension_add(nullptr, edjFilePath.c_str());
+
+ m_history_item_class = elm_genlist_item_class_new();
+ m_history_item_class->item_style = "history_grid_item";
+ m_history_item_class->func.text_get = _get_history_link_text;
+ m_history_item_class->func.content_get = nullptr;
+ m_history_item_class->func.state_get = nullptr;
+ m_history_item_class->func.del = nullptr;
+}
+
+DetailPopup::~DetailPopup()
+{
+ elm_genlist_item_class_free(m_history_item_class);
+}
+
+void DetailPopup::createLayout()
+{
+ m_layout = elm_layout_add(m_parent);
+ elm_layout_file_set(m_layout, edjFilePath.c_str(), "popup");
+ 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);
+ // TODO: add following (or simillar) callback for hardware back button when it will be available
+ //evas_object_event_callback_add(m_layout, EVAS_CALLBACK_KEY_DOWN, _back, this);
+ edje_object_signal_callback_add(elm_layout_edje_get(m_layout), "mouse,clicked,1", "bg", _bg_click, this);
+ m_urlButton = elm_button_add(m_layout); // add button to receive focus
+ elm_object_style_set(m_urlButton, "invisible_button");
+ evas_object_smart_callback_add(m_urlButton, "clicked", _url_click_button, this);
+ evas_object_show(m_urlButton);
+ elm_layout_content_set(m_layout, "url_over", m_urlButton);
+ elm_object_focus_custom_chain_unset(m_main_view);
+ elm_object_focus_custom_chain_append(m_main_view, m_urlButton, NULL);
+ elm_object_focus_set(m_urlButton, EINA_TRUE);
+
+ edje_object_signal_callback_add(elm_layout_edje_get(m_layout), "mouse,clicked,1", "thumbnail", _url_click, this);
+ elm_layout_text_set(m_layout, "history_title", "History");
+ elm_layout_text_set(m_layout, "url", tools::clearURL(m_item->getUrl()));
+
+ m_historyList = elm_genlist_add(m_layout);
+ evas_object_size_hint_weight_set(m_historyList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(m_historyList, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_genlist_select_mode_set(m_historyList, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_object_focus_custom_chain_append(m_main_view, m_historyList, NULL);
+ for (auto it = m_prevItems->begin(); it != m_prevItems->end(); ++it) {
+ elm_genlist_item_append(m_historyList, m_history_item_class, it->get(), nullptr, ELM_GENLIST_ITEM_NONE, _history_url_click, this);
+ }
+ evas_object_show(m_historyList);
+ elm_object_part_content_set(m_layout, "history_list", m_historyList);
+
+ if (m_item->getThumbnail()) {
+ Evas_Object * thumb = tools::EflTools::getEvasImage(m_item->getThumbnail(), m_layout);
+ elm_object_part_content_set(m_layout, "thumbnail", thumb);
+ }
+
+ evas_object_show(m_layout);
+}
+
+void DetailPopup::show(Evas_Object *parent, Evas_Object *main_view, std::shared_ptr<services::HistoryItem> currItem, std::shared_ptr<services::HistoryItemVector> prevItems)
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ m_main_view = main_view;
+ m_parent = parent;
+ m_item = currItem;
+ m_prevItems = prevItems;
+ createLayout();
+}
+
+void DetailPopup::hide()
+{
+ edje_object_signal_callback_del(elm_layout_edje_get(m_layout), "mouse,clicked,1", "bg", _bg_click);
+ elm_object_focus_custom_chain_unset(m_main_view);
+ evas_object_smart_callback_del(m_urlButton, "clicked", _url_click_button);
+ edje_object_signal_callback_del(elm_layout_edje_get(m_layout), "mouse,clicked,1", "thumbnail", _url_click);
+ elm_genlist_clear(m_historyList);
+ evas_object_hide(m_layout);
+ evas_object_del(m_layout);
+ m_quickAccess->refreshFocusChain();
+}
+
+void DetailPopup::_bg_click(void* data, Evas_Object*, const char*, const char*)
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ DetailPopup *dp = reinterpret_cast<DetailPopup*>(data);
+ dp->hide();
+}
+
+void DetailPopup::_url_click(void* data, Evas_Object*, const char*, const char*)
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ DetailPopup *dp = reinterpret_cast<DetailPopup*>(data);
+ dp->openURLInNewTab(dp->m_item, dp->m_quickAccess->isDesktopMode());
+ dp->hide();
+}
+
+void DetailPopup::_url_click_button(void* data, Evas_Object*, void*)
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ DetailPopup *dp = reinterpret_cast<DetailPopup*>(data);
+ dp->openURLInNewTab(dp->m_item, dp->m_quickAccess->isDesktopMode());
+ dp->hide();
+}
+
+void DetailPopup::_history_url_click(void* data, Evas_Object*, void* event_info)
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ Elm_Object_Item *glit = reinterpret_cast<Elm_Object_Item*>(event_info);
+ void *itemData = elm_object_item_data_get(glit);
+ services::HistoryItem *item = reinterpret_cast<services::HistoryItem*>(itemData);
+
+ DetailPopup *dp = reinterpret_cast<DetailPopup*>(data);
+ // find shared pointer pointed to HistoryItem object
+ auto it = std::find_if(dp->m_prevItems->begin(),
+ dp->m_prevItems->end(),
+ [item] (const std::shared_ptr<services::HistoryItem> i)
+ { return i.get() == item; }
+ );
+ std::shared_ptr<services::HistoryItem> itemPtr= *it;
+ dp->openURLInNewTab(itemPtr, dp->m_quickAccess->isDesktopMode());
+ dp->hide();
+}
+
+char* DetailPopup::_get_history_link_text(void* data, Evas_Object*, const char* part)
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+
+ services::HistoryItem *item = reinterpret_cast<services::HistoryItem*>(data);
+ if (!strcmp(part, "page_dsc")) {
+ if (item != nullptr) {
+ std::string text = item->getTitle() + URL_SEPARATOR + tools::clearURL(item->getUrl());
+ return strdup(text.c_str());
+ }
+ }
+ return strdup("");
+}
+
+}
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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 __DETAIL_POPUP_H__
+#define __DETAIL_POPUP_H__
+
+#include <Evas.h>
+#include <string>
+#include <memory>
+#include <boost/signals2/signal.hpp>
+#include "services/HistoryService/HistoryItem.h"
+
+namespace tizen_browser{
+namespace base_ui{
+
+ class QuickAccess;
+
+ class DetailPopup {
+ public:
+ DetailPopup(QuickAccess *quickAccess);
+ ~DetailPopup();
+
+ /**
+ * @brief Show popup window
+ */
+ void show(Evas_Object *parent, Evas_Object *main_view, std::shared_ptr<services::HistoryItem> currItem, std::shared_ptr<services::HistoryItemVector> prevItems);
+
+ /**
+ * @brief Hide popup
+ */
+ void hide();
+
+ bool isVisible() { return m_layout; }
+
+ boost::signals2::signal<void (std::shared_ptr<tizen_browser::services::HistoryItem>, bool)> openURLInNewTab;
+
+ static const int HISTORY_ITEMS_NO;
+ private:
+ /**
+ * @brief Mouse background click callback
+ */
+ static void _bg_click(void *data, Evas_Object *obj, const char *emission, const char *source);
+
+ /**
+ * @brief URL rectangle click callback
+ */
+ static void _url_click(void *data, Evas_Object *obj, const char *emission, const char *source);
+ static void _url_click_button(void *data, Evas_Object *obj, void *event_info);
+
+ /**
+ * @brief History genlist item click callback
+ */
+ static void _history_url_click(void *data, Evas_Object *o, void *event_info);
+
+ /**
+ * @brief Create main layout and all compnents.
+ */
+ void createLayout();
+
+ /**
+ * @brief Provide texts for history genlist
+ */
+ static char* _get_history_link_text(void *data, Evas_Object *obj, const char *part);
+
+ Evas_Object* m_main_view;
+ Evas_Object* m_parent;
+ Evas_Object *m_layout;
+ Evas_Object *m_historyList;
+ Evas_Object* m_urlButton;
+ Elm_Gengrid_Item_Class * m_history_item_class;
+ QuickAccess *m_quickAccess;
+ std::string edjFilePath;
+ std::shared_ptr<services::HistoryItem> m_item;
+ std::shared_ptr<services::HistoryItemVector> m_prevItems;
+
+ static const char * URL_SEPARATOR;
+ };
+
+}
+}
+
+#endif // __DETAIL_POPUP_H__
--- /dev/null
+/*
+ * 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 <Elementary.h>
+#include <boost/concept_check.hpp>
+#include <vector>
+#include <AbstractMainWindow.h>
+
+#include "QuickAccess.h"
+#include "ServiceManager.h"
+#include "BrowserLogger.h"
+#include "Tools/EflTools.h"
+#include "../Tools/BrowserImage.h"
+#include "Tools/GeneralTools.h"
+
+#define efl_scale (elm_config_scale_get() / elm_app_base_scale_get())
+
+namespace tizen_browser{
+namespace base_ui{
+
+EXPORT_SERVICE(QuickAccess, "org.tizen.browser.quickaccess")
+
+const int QuickAccess::MAX_TILES_NUMBER = 5;
+const int QuickAccess::MAX_THUMBNAIL_WIDTH = 840;
+const int QuickAccess::MAX_THUMBNAIL_HEIGHT = 648;
+const int QuickAccess::BIG_TILE_INDEX = 0;
+const int QuickAccess::TOP_RIGHT_TILE_INDEX = 3;
+const int QuickAccess::BOTTOM_RIGHT_TILE_INDEX = 4;
+
+const std::vector<std::string> QuickAccess::TILES_NAMES = {
+ "elm.swallow.big",
+ "elm.swallow.small_first",
+ "elm.swallow.small_second",
+ "elm.swallow.small_third",
+ "elm.swallow.small_fourth"
+};
+
+typedef struct _HistoryItemData
+{
+ std::shared_ptr<tizen_browser::services::HistoryItem> item;
+ std::shared_ptr<tizen_browser::base_ui::QuickAccess> quickAccess;
+} HistoryItemData;
+
+typedef struct _BookmarkItemData
+{
+ std::shared_ptr<tizen_browser::services::BookmarkItem> item;
+ std::shared_ptr<tizen_browser::base_ui::QuickAccess> quickAccess;
+} BookmarkItemData;
+
+QuickAccess::QuickAccess()
+ : m_parent(nullptr)
+ , m_layout(nullptr)
+ , m_bookmarksView(nullptr)
+ , m_mostVisitedView(nullptr)
+ , m_bookmarksButton(nullptr)
+ , m_mostVisitedButton(nullptr)
+ , m_bookmarkGengrid(nullptr)
+ , m_bookmarkManagerButton(nullptr)
+ , m_parentFocusChain(nullptr)
+ , m_bookmark_item_class(nullptr)
+ , m_detailPopup(this)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ edjFilePath = EDJE_DIR;
+ edjFilePath.append("QuickAccess/QuickAccess.edj");
+ elm_theme_extension_add(nullptr, edjFilePath.c_str());
+ QuickAccess::createItemClasses();
+}
+
+QuickAccess::~QuickAccess()
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ elm_gengrid_item_class_free(m_bookmark_item_class);
+ eina_list_free(m_parentFocusChain);
+}
+
+void QuickAccess::init(Evas_Object* parent)
+{
+ M_ASSERT(parent);
+ m_parent = parent;
+}
+
+
+Evas_Object* QuickAccess::getContent()
+{
+ M_ASSERT(m_parent);
+ if (!m_layout) {
+ m_layout = createQuickAccessLayout(m_parent);
+ }
+ return m_layout;
+}
+
+void QuickAccess::showMostVisited(std::shared_ptr< services::HistoryItemVector > vec)
+{
+ addHistoryItems(vec);
+ showHistory();
+}
+
+void QuickAccess::showBookmarks(std::vector< std::shared_ptr< tizen_browser::services::BookmarkItem > > vec)
+{
+ addBookmarkItems(vec);
+ showBookmarks();
+}
+
+void QuickAccess::createItemClasses()
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ if (!m_bookmark_item_class) {
+ m_bookmark_item_class = elm_gengrid_item_class_new();
+ m_bookmark_item_class->item_style = "grid_item";
+ m_bookmark_item_class->func.text_get = _grid_bookmark_text_get;
+ m_bookmark_item_class->func.content_get = _grid_bookmark_content_get;
+ m_bookmark_item_class->func.state_get = nullptr;
+ m_bookmark_item_class->func.del = nullptr;
+ }
+}
+
+
+Evas_Object* QuickAccess::createQuickAccessLayout(Evas_Object* parent)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ m_desktopMode = true;
+
+ Evas_Object* layout = elm_layout_add(parent);
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set (layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ m_mostVisitedView = createMostVisitedView(layout);
+ m_bookmarksView = createBookmarksView (layout);
+
+ showHistory();
+
+ return layout;
+}
+
+Evas_Object* QuickAccess::createMostVisitedView (Evas_Object * parent)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+
+ Evas_Object* mostVisitedLayout = elm_layout_add(parent);
+ elm_layout_file_set(mostVisitedLayout, edjFilePath.c_str(), "mv_bookmarks");
+ evas_object_size_hint_weight_set(mostVisitedLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set (mostVisitedLayout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ Evas_Object* topButtons = createTopButtons(mostVisitedLayout);
+ elm_object_part_content_set(mostVisitedLayout, "elm.swallow.layoutTop", topButtons);
+
+ return mostVisitedLayout;
+}
+
+Evas_Object* QuickAccess::createBookmarksView (Evas_Object * parent)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+
+ Evas_Object *bookmarkViewLayout = elm_layout_add(parent);
+ elm_layout_file_set(bookmarkViewLayout, edjFilePath.c_str(), "mv_bookmarks");
+ evas_object_size_hint_weight_set(bookmarkViewLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bookmarkViewLayout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ m_bookmarkGengrid = createBookmarkGengrid(bookmarkViewLayout);
+ elm_object_part_content_set(bookmarkViewLayout, "elm.swallow.grid", m_bookmarkGengrid);
+
+ Evas_Object* topButtons = createTopButtons(bookmarkViewLayout);
+ elm_object_part_content_set(bookmarkViewLayout, "elm.swallow.layoutTop", topButtons);
+
+ Evas_Object* bottomButton = createBottomButton(bookmarkViewLayout);
+ elm_object_part_content_set(bookmarkViewLayout, "elm.swallow.layoutBottom", bottomButton);
+
+ return bookmarkViewLayout;
+}
+
+Evas_Object* QuickAccess::createBookmarkGengrid(Evas_Object *parent)
+{
+ Evas_Object *bookmarkGengrid = elm_gengrid_add(parent);
+
+ elm_gengrid_align_set(bookmarkGengrid, 0, 0);
+ elm_gengrid_select_mode_set(bookmarkGengrid, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_gengrid_multi_select_set(bookmarkGengrid, EINA_FALSE);
+ elm_gengrid_horizontal_set(bookmarkGengrid, EINA_FALSE);
+
+ elm_scroller_policy_set(bookmarkGengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ elm_scroller_page_size_set(bookmarkGengrid, 0, 327);
+ evas_object_size_hint_weight_set(bookmarkGengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bookmarkGengrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_gengrid_item_size_set(bookmarkGengrid, 364 * efl_scale, 320 * efl_scale);
+
+ return bookmarkGengrid;
+}
+
+Evas_Object* QuickAccess::createTopButtons (Evas_Object *parent)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+
+ Evas_Object *layoutTop = elm_layout_add(parent);
+ elm_layout_file_set(layoutTop, edjFilePath.c_str(), "top_button_item");
+ evas_object_size_hint_weight_set(layoutTop, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(layoutTop, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(layoutTop);
+
+ Evas_Object *mostVisitedButton = elm_button_add(layoutTop);
+ elm_object_style_set(mostVisitedButton, "invisible_button");
+ evas_object_smart_callback_add(mostVisitedButton, "clicked", _mostVisited_clicked, this);
+ evas_object_show(mostVisitedButton);
+ elm_layout_content_set(layoutTop, "mostvisited_click", mostVisitedButton);
+ m_mostVisitedButton = mostVisitedButton;
+
+ Evas_Object *bookmarksButton = elm_button_add(layoutTop);
+ elm_object_style_set(bookmarksButton, "invisible_button");
+ evas_object_smart_callback_add(bookmarksButton, "clicked", _bookmark_clicked, this);
+ evas_object_show(bookmarksButton);
+ elm_layout_content_set(layoutTop, "bookmark_click", bookmarksButton);
+ m_bookmarksButton = bookmarksButton;
+
+ return layoutTop;
+}
+
+Evas_Object* QuickAccess::createBottomButton(Evas_Object *parent)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+
+ Evas_Object *layoutBottom = elm_layout_add(parent);
+ elm_layout_file_set(layoutBottom, edjFilePath.c_str(), "bottom_button_item");
+
+ evas_object_size_hint_weight_set(layoutBottom, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(layoutBottom, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(layoutBottom);
+
+ m_bookmarkManagerButton = elm_button_add(layoutBottom);
+ elm_object_style_set(m_bookmarkManagerButton, "invisible_button");
+ evas_object_smart_callback_add(m_bookmarkManagerButton, "clicked", _bookmark_manager_clicked, this);
+ evas_object_show(m_bookmarkManagerButton);
+
+ elm_object_part_content_set(layoutBottom, "bookmarkmanager_click", m_bookmarkManagerButton);
+
+ return layoutBottom;
+}
+
+void QuickAccess::_mostVisited_clicked(void * data, Evas_Object *, void *)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ QuickAccess* quickAccess = reinterpret_cast<QuickAccess *>(data);
+ quickAccess->mostVisitedClicked();
+}
+
+void QuickAccess::_bookmark_clicked(void * data, Evas_Object *, void *)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ QuickAccess* quickAccess = reinterpret_cast<QuickAccess *>(data);
+ quickAccess->bookmarkClicked();
+}
+
+void QuickAccess::_bookmark_manager_clicked(void * data, Evas_Object *, void *)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ QuickAccess* quickAccess = static_cast<QuickAccess *>(data);
+ quickAccess->bookmarkManagerClicked();
+}
+
+void QuickAccess::addHistoryItem(std::shared_ptr<services::HistoryItem> hi)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ M_ASSERT(m_historyItems.size() < MAX_TILES_NUMBER);
+
+ int tileNumber = m_historyItems.size();
+ HistoryItemData *itemData = new HistoryItemData();
+ itemData->item = hi;
+ itemData->quickAccess = std::shared_ptr<QuickAccess>(this);
+
+ Evas_Object* tile = elm_button_add(m_mostVisitedView);
+ if (tileNumber == BIG_TILE_INDEX)
+ elm_object_style_set(tile, "big_tile");
+ else
+ elm_object_style_set(tile, "small_tile");
+ evas_object_size_hint_weight_set(tile, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set (tile, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(tile);
+ elm_object_part_content_set(m_mostVisitedView, TILES_NAMES[tileNumber].c_str(), tile);
+ m_tiles.push_back(tile);
+
+ elm_layout_text_set(tile, "page_title", hi->getTitle().c_str());
+ elm_layout_text_set(tile, "page_url", hi->getUrl().c_str());
+ Evas_Object * thumb = tizen_browser::tools::EflTools::getEvasImage(hi->getThumbnail(), m_parent);
+ elm_object_part_content_set(tile, "elm.thumbnail", thumb);
+ evas_object_smart_callback_add(tile, "clicked", _thumbClicked, itemData);
+
+ m_historyItems.push_back(hi);
+}
+
+void QuickAccess::addHistoryItems(std::shared_ptr<services::HistoryItemVector> items)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ clearHistoryGenlist();
+ int i = 0;
+ for (auto it = items->begin(); it != items->end(); ++it) {
+ i++;
+ if (i > MAX_TILES_NUMBER)
+ break;
+ addHistoryItem(*it);
+ }
+ if (i>0)
+ setEmptyView(false);
+}
+
+void QuickAccess::addBookmarkItem(std::shared_ptr<tizen_browser::services::BookmarkItem> bi)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ BookmarkItemData *itemData = new BookmarkItemData();
+ itemData->item = bi;
+ itemData->quickAccess = std::shared_ptr<tizen_browser::base_ui::QuickAccess>(this);
+ elm_gengrid_item_append(m_bookmarkGengrid, m_bookmark_item_class, itemData, _thumbBookmarkClicked, itemData);
+}
+
+void QuickAccess::addBookmarkItems(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > items)
+{
+ clearBookmarkGengrid();
+ for (auto it = items.begin(); it != items.end(); ++it) {
+ addBookmarkItem(*it);
+ }
+}
+
+
+char* QuickAccess::_grid_bookmark_text_get(void *data, Evas_Object *, const char *part)
+{
+ BookmarkItemData *itemData = reinterpret_cast<BookmarkItemData*>(data);
+ if (!strcmp(part, "page_title")) {
+ return strdup(itemData->item->getTittle().c_str());
+ }
+ if (!strcmp(part, "page_url")) {
+ return strdup(itemData->item->getAddress().c_str());
+ }
+ return strdup("");
+}
+
+Evas_Object * QuickAccess::_grid_bookmark_content_get(void *data, Evas_Object*, const char *part)
+{
+ BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part);
+ BookmarkItemData *itemData = reinterpret_cast<BookmarkItemData*>(data);
+
+ if (!strcmp(part, "elm.thumbnail")) {
+ if (itemData->item->getThumbnail()) {
+ Evas_Object * thumb = tizen_browser::tools::EflTools::getEvasImage(itemData->item->getThumbnail(), itemData->quickAccess->m_parent);
+ return thumb;
+ }
+ else {
+ return nullptr;
+ }
+ }
+
+ return nullptr;
+}
+
+void QuickAccess::_thumbBookmarkClicked(void * data, Evas_Object * , void *)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ HistoryItemData * itemData = reinterpret_cast<HistoryItemData *>(data);
+ itemData->quickAccess->openURLInNewTab(itemData->item, itemData->quickAccess->isDesktopMode());
+}
+
+void QuickAccess::_thumbClicked(void* data, Evas_Object*, void*)
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ HistoryItemData * itemData = reinterpret_cast<HistoryItemData *>(data);
+ itemData->quickAccess->mostVisitedTileClicked(itemData->item, DetailPopup::HISTORY_ITEMS_NO);
+}
+
+void QuickAccess::clearHistoryGenlist()
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+
+ for (auto it = m_tiles.begin(); it != m_tiles.end(); ++it) {
+ evas_object_smart_callback_del(*it, "clicked", _thumbClicked);
+ evas_object_del(*it);
+ }
+
+ m_tiles.clear();
+ m_historyItems.clear();
+}
+
+void QuickAccess::showHistory()
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+
+ if (elm_layout_content_get(m_layout, "elm.swallow.content") == m_mostVisitedView)
+ return;
+
+ evas_object_hide(m_bookmarksView);
+ elm_layout_content_set(m_layout, "elm.swallow.content", m_mostVisitedView);
+ evas_object_show(m_mostVisitedView);
+
+
+ if (m_historyItems.empty()) {
+ setEmptyView(true);
+ return;
+ }
+ setEmptyView(false);
+ evas_object_show(m_layout);
+ refreshFocusChain();
+ elm_object_focus_set(m_mostVisitedButton, true);
+}
+
+void QuickAccess::clearBookmarkGengrid()
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ elm_gengrid_clear(m_bookmarkGengrid);
+}
+
+void QuickAccess::showBookmarks()
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+
+ if (elm_layout_content_get(m_layout, "elm.swallow.content") == m_bookmarksView && m_bookmarksView != nullptr)
+ return;
+
+ evas_object_hide(m_mostVisitedView);
+ elm_layout_content_set(m_layout, "elm.swallow.content", m_bookmarksView);
+ evas_object_show(m_bookmarksView);
+
+ evas_object_show(m_layout);
+ refreshFocusChain();
+ elm_object_focus_set(m_bookmarksButton, true);
+}
+
+void QuickAccess::showUI()
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ evas_object_show(m_layout);
+ if (elm_layout_content_get(m_layout, "elm.swallow.content") == m_bookmarksView) {
+ evas_object_show(m_bookmarksView);
+ } else {
+ evas_object_show(m_mostVisitedView);
+ }
+}
+
+void QuickAccess::hideUI()
+{
+ BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+ evas_object_hide(m_layout);
+ evas_object_hide(m_mostVisitedView);
+ evas_object_hide(m_bookmarksView);
+ clearHistoryGenlist();
+ clearBookmarkGengrid();
+}
+
+void QuickAccess::openDetailPopup(std::shared_ptr<services::HistoryItem> currItem, std::shared_ptr<services::HistoryItemVector> prevItems)
+{
+ m_detailPopup.show(m_layout, m_parent, currItem, prevItems);
+}
+
+void QuickAccess::showNoHistoryLabel()
+{
+ elm_layout_text_set(m_mostVisitedView, "elm.text.empty", "No visited site");
+ elm_layout_signal_emit(m_mostVisitedView, "empty,view", "quickaccess");
+}
+
+void QuickAccess::setEmptyView(bool empty)
+{
+ BROWSER_LOGD("%s:%d %s, empty: %d", __FILE__, __LINE__, __func__, empty);
+ if(empty) {
+ showNoHistoryLabel();
+ } else {
+ elm_layout_signal_emit(m_mostVisitedView, "not,empty,view", "quickaccess");
+ }
+}
+
+bool QuickAccess::isDesktopMode() const
+{
+ return m_desktopMode;
+}
+
+void QuickAccess::setDesktopMode(bool mode)
+{
+ m_desktopMode = mode;
+}
+
+DetailPopup& QuickAccess::getDetailPopup()
+{
+ return m_detailPopup;
+}
+
+void QuickAccess::backButtonClicked()
+{
+ if (m_detailPopup.isVisible()) {
+ m_detailPopup.hide();
+ }
+}
+
+bool QuickAccess::isMostVisitedActive() const
+{
+ return evas_object_visible_get(m_mostVisitedView);
+}
+
+void QuickAccess::refreshFocusChain()
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+
+ if (!m_parentFocusChain) {
+ m_parentFocusChain = eina_list_clone(elm_object_focus_custom_chain_get(m_parent));
+ } else {
+ elm_object_focus_custom_chain_unset(m_parent);
+ elm_object_focus_custom_chain_set(m_parent, eina_list_clone(m_parentFocusChain));
+ }
+
+ elm_object_focus_custom_chain_append(m_parent, m_mostVisitedButton, NULL);
+ elm_object_focus_custom_chain_append(m_parent, m_bookmarksButton, NULL);
+ if (isMostVisitedActive()) {
+ for (auto tile = m_tiles.begin(); tile != m_tiles.end(); ++tile) {
+ elm_object_focus_custom_chain_append(m_parent, *tile, NULL);
+ }
+ // prevent from moving outside of screen
+ elm_object_focus_next_object_set(m_tiles[BIG_TILE_INDEX], m_tiles[BIG_TILE_INDEX], ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(m_tiles[TOP_RIGHT_TILE_INDEX], m_tiles[TOP_RIGHT_TILE_INDEX], ELM_FOCUS_RIGHT);
+ elm_object_focus_next_object_set(m_tiles[BOTTOM_RIGHT_TILE_INDEX], m_tiles[BOTTOM_RIGHT_TILE_INDEX], ELM_FOCUS_RIGHT);
+ } else {
+ elm_object_focus_custom_chain_append(m_parent, m_bookmarkGengrid, NULL);
+ elm_object_focus_custom_chain_append(m_parent, m_bookmarkManagerButton, NULL);
+ // prevent from moving outside of screen
+ elm_object_focus_next_object_set(m_bookmarkGengrid, m_bookmarkGengrid, ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(m_bookmarkGengrid, m_bookmarkGengrid, ELM_FOCUS_RIGHT);
+ }
+}
+
+}
+}
--- /dev/null
+/*
+ * 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 QUICKACCESS_H
+#define QUICKACCESS_H
+
+#include <Evas.h>
+#include <boost/signals2/signal.hpp>
+
+#include "AbstractUIComponent.h"
+#include "AbstractService.h"
+#include "ServiceFactory.h"
+#include "service_macros.h"
+#include "services/HistoryService/HistoryItem.h"
+#include "BookmarkItem.h"
+#include "DetailPopup.h"
+
+namespace tizen_browser{
+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 QuickAccess
+ : public tizen_browser::core::AbstractService
+{
+public:
+ QuickAccess();
+ ~QuickAccess();
+ void init(Evas_Object *main_layout);
+ Evas_Object* getContent();
+ void showMostVisited(std::shared_ptr<services::HistoryItemVector> vec);
+ void showBookmarks(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > vec);
+ void hideUI();
+ void showUI();
+ virtual std::string getName();
+ void openDetailPopup(std::shared_ptr<services::HistoryItem> currItem, std::shared_ptr<services::HistoryItemVector> prevItems);
+ bool isDesktopMode() const;
+ void setDesktopMode(bool mode);
+ DetailPopup & getDetailPopup();
+ void backButtonClicked();
+ inline bool isMostVisitedActive() const;
+ void refreshFocusChain();
+
+ boost::signals2::signal<void (std::shared_ptr<tizen_browser::services::HistoryItem>, int)> mostVisitedTileClicked;
+ boost::signals2::signal<void (std::shared_ptr<tizen_browser::services::HistoryItem>, bool)> openURLInNewTab;
+ boost::signals2::signal<void ()> mostVisitedClicked;
+ boost::signals2::signal<void ()> bookmarkClicked;
+ boost::signals2::signal<void ()> bookmarkManagerClicked;
+
+ static const int MAX_THUMBNAIL_WIDTH;
+ static const int MAX_THUMBNAIL_HEIGHT;
+
+private:
+ void createItemClasses();
+ void addHistoryItem(std::shared_ptr<services::HistoryItem>);
+ void addHistoryItems(std::shared_ptr<services::HistoryItemVector>);
+ void addBookmarkItem(std::shared_ptr<tizen_browser::services::BookmarkItem>);
+ void addBookmarkItems(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> >);
+ void clearHistoryGenlist();
+ void clearBookmarkGengrid();
+ Evas_Object* createBookmarkGengrid(Evas_Object *parent);
+ void showHistory();
+ void showBookmarks();
+
+ Evas_Object* createQuickAccessLayout(Evas_Object *parent);
+ Evas_Object* createMostVisitedView(Evas_Object *parent);
+ Evas_Object* createBookmarksView(Evas_Object *parent);
+ Evas_Object* createBottomButton(Evas_Object *parent);
+ Evas_Object* createTopButtons(Evas_Object *parent);
+
+ 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 _thumbBookmarkClicked(void * data, Evas_Object * obj, void * event_info);
+ static void _thumbClicked(void * data, Evas_Object * obj, void * event_info);
+ void setEmptyView(bool empty);
+ void showNoHistoryLabel();
+
+ static void _mostVisited_clicked(void * data, Evas_Object * obj, void * event_info);
+ static void _bookmark_clicked(void * data, Evas_Object * obj, void * event_info);
+ static void _bookmark_manager_clicked(void * data, Evas_Object * obj, void * event_info);
+
+ Evas_Object *m_parent;
+ Evas_Object *m_layout;
+ Evas_Object *m_bookmarksView;
+ Evas_Object *m_mostVisitedView;
+ Evas_Object *m_bookmarksButton;
+ Evas_Object *m_mostVisitedButton;
+ Evas_Object *m_bookmarkGengrid;
+ Evas_Object *m_bookmarkManagerButton;
+ std::vector<Evas_Object *> m_tiles;
+ Eina_List* m_parentFocusChain;
+
+ Elm_Gengrid_Item_Class * m_bookmark_item_class;
+ DetailPopup m_detailPopup;
+ services::HistoryItemVector m_historyItems;
+ bool m_gengridSetup;
+ std::string edjFilePath;
+ bool m_desktopMode;
+
+ static const int MAX_TILES_NUMBER;
+ static const int BIG_TILE_INDEX;
+ static const int TOP_RIGHT_TILE_INDEX;
+ static const int BOTTOM_RIGHT_TILE_INDEX;
+ static const std::vector<std::string> TILES_NAMES;
+};
+
+}
+}
+
+#endif // QUICKACCESS_H
--- /dev/null
+collections {
+
+ group {
+ name: "popup";
+ images {
+ image: "ic_popup_list_arrow.png" COMP;
+ }
+ parts {
+ part { name: "bg";
+ type: RECT;
+ mouse_events: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 102;
+ visible: 1;
+ min: 1920 1080;
+ max: -1 -1;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ }
+ }
+
+ part { name: "main_rect";
+ type: RECT;
+ mouse_events: 1;
+ description { state: "default" 0.0;
+ color: 255 255 255 255;
+ min: 1336 648;
+ max: 1336 648;
+ visible: 1;
+ align: 0.5 0.0;
+ rel1 {
+ to: "bg";
+ offset: 0 264;
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+
+ part { name: "thumbnail";
+ type: SWALLOW;
+ description {
+ min: 840 648;
+ max: 840 648;
+ visible: 1;
+ align: 0.0 0.0;
+ rel1 {
+ to: "main_rect";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "main_rect";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+
+ part { name: "url_bg";
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 255 255 255 255;
+ min: 496 122;
+ max: 496 122;
+ visible: 1;
+ align: 0.0 0.0;
+ rel1 {
+ to: "thumbnail";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "main_rect";
+ relative: 1.0 1.0;
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 0 119 246 255;
+ }
+ }
+
+ part { name: "url";
+ type: TEXT;
+ description {
+ visible: 1;
+ min: 408 122;
+ max: 408 122;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ color: 51 51 51 255;
+ rel1 {
+ to: "url_bg";
+ relative: 0.0 0.0;
+ offset: 34 0;
+ }
+ rel2 {
+ to: "url_bg";
+ relative: 1.0 1.0;
+ }
+ text {
+ text: "Web page title";
+ font: "Sans";
+ size: 32;
+ align: 0 0.5;
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+
+ part { name: "url_arrow";
+ type: IMAGE;
+ scale: 1;
+ repeat_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0.0 0.5;
+ min: 38 38;
+ max: 38 38;
+ image.normal: "ic_popup_list_arrow.png";
+ rel1 {
+ to: "url_bg";
+ relative: 0.0 0.0;
+ offset: 442 0;
+ }
+ rel2 {
+ to: "url_bg";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+
+ part { name: "url_over";
+ type: SWALLOW;
+ mouse_events: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ visible: 1;
+ color: 0 0 0 0;
+ rel1.to: "url_bg";
+ rel2.to: "url_bg";
+ }
+ }
+
+ part { name: "history_title_bg";
+ type: RECT;
+ description {
+ color: 244 244 244 255;
+ min: 496 44;
+ max: 496 44;
+ visible: 1;
+ align: 0.0 0.0;
+ rel1 {
+ to: "url_bg";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "main_rect";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+
+ part { name: "history_title";
+ type: TEXT;
+ description {
+ visible: 1;
+ min: 428 44;
+ max: 428 44;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ color: 51 51 51 255;
+ rel1 {
+ to: "history_title_bg";
+ relative: 0.0 0.0;
+ offset: 34 0;
+ }
+ rel2 {
+ to: "history_title_bg";
+ relative: 1.0 1.0;
+ }
+ text {
+ text: "Web page title";
+ font: "Sans";
+ size: 22;
+ align: 0 0.5;
+ }
+ }
+ }
+
+ part { name: "history_list";
+ type: SWALLOW;
+ description {
+ color: 255 255 255 255;
+ min: 496 460;
+ max: 496 460;
+ visible: 1;
+ align: 0.0 0.0;
+ rel1 {
+ to: "history_title_bg";
+ relative: 0.0 1.0;
+ offset: 0 22;
+ }
+ rel2 {
+ to: "main_rect";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ }
+
+ programs {
+ program {
+ name: "mouse_in_url";
+ signal: "mouse,in";
+ source: "url_over";
+ action: STATE_SET "selected" 0.0;
+ target: "url_bg";
+ target: "url";
+ }
+ program {
+ name: "mouse_out_url";
+ signal: "mouse,out";
+ source: "url_over";
+ action: STATE_SET "default" 0.0;
+ target: "url_bg";
+ target: "url";
+ }
+ program {
+ name: "mouse_click";
+ signal: "mouse,clicked,1";
+ source: "url_over";
+ script {
+ emit("elm,action,click", "");
+ }
+ }
+ }
+ }
+
+ group { name: "elm/genlist/item/history_grid_item/default";
+ data.item: "texts" "page_dsc";
+ parts {
+ part { name: "bg";
+ type: RECT;
+ mouse_events: 1;
+ description { state: "default" 0.0;
+ min: 496 86;
+ max: 496 86;
+ visible: 1;
+ color: 255 255 255 255;
+ align: 0.0 0.0;
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 0 119 246 255;
+ }
+ }
+
+ part { name: "page_dsc";
+ type: TEXT;
+ description { state: "default" 0.0;
+ min: 428 86;
+ max: 428 86;
+ align: 0.0 0.0;
+ color: 0 0 0 255;
+ rel1 {
+ to: "bg";
+ relative: 0.0 0.0;
+ offset: 34 0;
+ }
+ rel2 {
+ to: "bg";
+ relative: 1.0 1.0;
+ }
+ text {
+ font: "Sans";
+ size: 24;
+ align: 0 0.5;
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+
+ part { name: "dsc_over";
+ type: RECT;
+ mouse_events: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ visible: 1;
+ color: 0 0 0 0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ }
+ }
+
+ }
+ programs {
+ program {
+ name: "mouse_in_url";
+ signal: "mouse,in";
+ source: "dsc_over";
+ action: STATE_SET "selected" 0.0;
+ target: "bg";
+ target: "page_dsc";
+ }
+ program {
+ name: "mouse_out_url";
+ signal: "mouse,out";
+ source: "dsc_over";
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ target: "page_dsc";
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+#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 {
+
+#define WIDTH 1920
+#define HEIGHT 181
+#define ITEM_WIDTH 374
+#define PARENT_ITEM_HEIGHT 36
+
+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", "");
+ }
+ }
+ }
+}
+
+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: "mv_bookmarks";
+ data {
+ item: "focus_highlight" "off";
+ }
+ images {
+ image: "web_shadow.png" COMP;
+ }
+ color_classes{
+ color_class{
+ name: "defaultBgColor";
+ color: 18 22 34 255;
+ }
+ color_class{
+ name: "focusBgColor";
+ color: 0 119 246 255;
+ }
+ color_class{
+ name: "imageHighlight";
+ color: 255 255 255 102;
+ }
+ color_class{
+ name: "focusbtBgColor";
+ color: 22 120 224 255;
+ }
+ color_class{
+ name: "titleTextColor";
+ color: 74 74 74 255;
+ }
+ color_class{
+ name: "focusTextColor";
+ color: 255 255 255 255;
+ }
+ color_class{
+ name: "highlightTextColor";
+ color: 255 255 255 51;
+ }
+ color_class{
+ name: "urlTextColor";
+ color: 116 116 116 204;
+ }
+ color_class{
+ name: "transparent";
+ color: 0 0 0 0;
+ }
+ }
+
+ parts {
+ part { name: "layoutTop_bg";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ color: 255 255 255 255;
+ min: 0 181;
+ max: -1 181;
+ align: 0.0 0.0;
+ fixed: 0 0;
+ rel1 {
+ relative: 0 0; offset: 0 104;
+ }
+ rel2{
+ relative: 1 1;
+ }
+ }
+ }
+ part { name: "gengrid_bg";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ color: 255 255 255 255;
+ min: 1920 626;
+ max: -1 626;
+ align: 0.0 0.0;
+ fixed: 0 0;
+ rel1 {
+ to: "layoutTop_bg";
+ relative: 0 1;
+ }
+ rel2{
+ relative: 1 1;
+ }
+ }
+ }
+ part { name: "layoutBottom_bg";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ color: 255 255 255 255;
+ min: 1920 181;
+ max: 1920 181;
+ align: 0.0 0.0;
+ fixed: 0 0;
+ rel1 {
+ relative: 0 1; to: "gengrid_bg";
+ }
+ rel2{
+ relative: 1 1;
+ }
+ }
+ }
+
+ part { name: "elm.swallow.grid";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 1920 614;
+ max: 1920 614;
+ align: 0.0 0.0;
+ fixed: 0 0;
+ rel1 {
+ relative: 0 0; to: "gengrid_bg"; offset: 63 0;
+ }
+ rel2 {
+ relative: 1 1;
+ offset: 0 0;
+ }
+ }
+ }
+
+ part { name: "center_rect";
+ type: RECT;
+ description { state: "default" 0.0;
+ min: 1592 614;
+ max: 1592 614;
+ visible: 0;
+ align: 0.5 0.0;
+ rel1 {
+ to: "gengrid_bg";
+ relative: 0 0;
+ }
+ rel2 {
+ to: "gengrid_bg";
+ relative: 1 1;
+ }
+ }
+ description { state: "empty" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 229 229 229 255;
+ }
+ }
+
+ part { name: "elm.swallow.big";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 784 614;
+ max: 784 614;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 1;
+ rel1 {
+ relative: 0 0; to: "center_rect";
+ }
+ rel2 {
+ relative: 1 1;
+ offset: 0 0;
+ }
+ }
+ description { state: "empty" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+
+ part { name: "elm.swallow.small_first";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 378 294;
+ max: 378 294;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 1;
+ rel1 {
+ to: "center_rect";
+ relative: 0 0;
+ offset: 810 0;
+ }
+ rel2{
+ to: "center_rect";
+ relative: 1 1;
+ offset: 0 0;
+ }
+ }
+ description { state: "empty" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+
+ part { name: "elm.swallow.small_second";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 378 294;
+ max: 378 294;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 1;
+ rel1 {
+ to: "center_rect";
+ relative: 0 0;
+ offset: 810 320;
+ }
+ rel2{
+ to: "center_rect";
+ relative: 1 1;
+ offset: 0 0;
+ }
+ }
+ description { state: "empty" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+
+ part { name: "elm.swallow.small_third";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 378 294;
+ max: 378 294;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 1;
+ rel1 {
+ to: "center_rect";
+ relative: 0 0;
+ offset: 1214 0;
+ }
+ rel2 {
+ to: "center_rect";
+ relative: 1 1;
+ offset: 0 0;
+ }
+ }
+ description { state: "empty" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+
+ part { name: "elm.swallow.small_fourth";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 378 294;
+ max: 378 294;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ visible: 1;
+ rel1 {
+ to: "center_rect";
+ relative: 0 0;
+ offset: 1214 320;
+ }
+ rel2 {
+ to: "center_rect";
+ relative: 1 1;
+ offset: 0 0;
+ }
+ }
+ description { state: "empty" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+
+ part { name: "elm.swallow.layoutTop";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 1920 181;
+ max: 1920 181;
+ align: 0.0 0.0;
+ fixed: 0 0;
+ rel1 {
+ relative: 0 0; to: "layoutTop_bg";
+ }
+ rel2 {
+ relative: 1 1;
+ offset: 0 0;
+ }
+ }
+ }
+
+ part { name: "uri_bar_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: "elm.swallow.layoutTop"; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+
+ part { name: "elm.swallow.layoutBottom";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: 1920 181;
+ max: 1920 181;
+ align: 0.0 0.0;
+ fixed: 0 0;
+ rel1 {
+ to: "layoutBottom_bg";
+ relative: 0 0;
+ }
+ rel2 {
+ relative: 1 1;
+ offset: 0 0;
+ }
+ }
+ }
+
+ part { name: "elm.text.empty";
+ type: TEXT;
+ description { state: "default" 0.0;
+ visible: 0;
+ align: 0.5 0.5;
+ color: 0 0 0 179;
+ text {
+ text: "empty";
+ font: "Sans";
+ size: 32;
+ align: 0.5 0.5;
+ }
+ rel1 {
+ to: "gengrid_bg";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "gengrid_bg";
+ relative: 1 1;
+ }
+ }
+ description { state: "empty" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+
+ programs {
+ program { name: "empty";
+ signal: "empty,view";
+ source: "quickaccess";
+ action: STATE_SET "empty" 0.0;
+ target: "elm.swallow.big";
+ target: "elm.swallow.small_first";
+ target: "elm.swallow.small_second";
+ target: "elm.swallow.small_third";
+ target: "elm.swallow.small_fourth";
+ target: "elm.text.empty";
+ target: "center_rect";
+ }
+ program { name: "not_empty";
+ signal: "not,empty,view";
+ source: "quickaccess";
+ action: STATE_SET "default" 0.0;
+ target: "elm.text.empty";
+ target: "center_rect";
+ target: "elm.swallow.big";
+ target: "elm.swallow.small_first";
+ target: "elm.swallow.small_second";
+ target: "elm.swallow.small_third";
+ target: "elm.swallow.small_fourth";
+ }
+ }
+}
+
+group { name: "elm/button/base/big_tile";
+ data.item: "texts" "page_title page_url";
+ data.item: "contents" "elm.thumbnail";
+ min: 600 614;
+ max: 600 614;
+ images {
+ image: "web_frame_selected.png" COMP;
+ image: "ico_bg_round_shape_37x37.png" COMP;
+ }
+ parts {
+ part { name: "bg";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ min: 784 614;
+ max: 784 614;
+ visible: 1;
+ color: 231 231 231 255;
+ }
+ }
+
+ part { name: "elm.thumbnail";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ align: 0.0 0.0;
+ color : 231 231 231 255;
+ min: 784 577; // size adjusted to max thubnail with and height
+ max: 784 577;
+ rel1 {
+ relative: 0.0 0.0; to: "bg";
+ }
+ rel2 {
+ relative: 1.0 1.0; to: "bg";
+ }
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ }
+ }
+
+ part { name: "border_top";
+ type: RECT;
+ description { state: "default" 0.0;
+ color_class: focusBgColor;
+ min: 0 6;
+ max: -1 6;
+ align: 0 0;
+ rel1 {
+ to: "elm.thumbnail";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "elm.thumbnail";
+ relative: 1.0 1.0;
+ }
+ visible: 0;
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+
+ part { name: "border_left";
+ type: RECT;
+ description { state: "default" 0.0;
+ color_class: focusBgColor;
+ min: 6 0;
+ max: 6 -1;
+ align: 0 0;
+ rel1 {
+ to: "elm.thumbnail";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "elm.thumbnail";
+ relative: 1.0 1.0;
+ }
+ visible: 0;
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+
+ part { name: "border_right";
+ type: RECT;
+ description { state: "default" 0.0;
+ color_class: focusBgColor;
+ min: 6 0;
+ max: 6 -1;
+ align: 1 0;
+ rel1 {
+ to: "elm.thumbnail";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "elm.thumbnail";
+ relative: 1.0 1.0;
+ }
+ visible: 0;
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+
+ part { name: "background";
+ type: RECT;
+ description { state: "default" 0.0;
+ min: 784 116;
+ max: 784 116;
+ align: 0.0 0.0;
+ color: 113 128 147 255;
+ visible: 1;
+ rel1 {
+ to: "bg";
+ relative: 0.0 0.0;
+ offset: 0 498; // thumbnail height
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 0 119 246 255;
+ }
+ }
+
+ part { name: "page_title";
+ type: TEXT;
+ description { state: "default" 0.0;
+ min: 700 36;
+ max: 700 36;
+ align: 0.0 0.0;
+ color: 255 255 255 255;
+ rel1 {
+ to: "background";
+ relative: 0.0 0.0;
+ offset: 32 22;
+ }
+ rel2 {
+ to: "background";
+ relative: 1.0 1.0;
+ }
+ text {
+ text: "Web page title";
+ font: "Sans";
+ size: 36;
+ align: 0 0.5;
+ }
+ }
+ }
+
+ part { name: "page_url";
+ type: TEXT;
+ description { state: "default" 0.0;
+ min: 700 28;
+ max: 700 28;
+ align: 0 0.0;
+ color: 255 255 255 255;
+ rel1 {
+ to: "page_title";
+ relative: 0.0 1.0;
+ offset: 0 10;
+ }
+ rel2 {
+ to: "background";
+ relative: 1.0 1.0;
+ }
+ text {
+ text: "Web page url";
+ font: "Sans";
+ size: 28;
+ align: 0 0.5;
+ }
+ }
+ }
+
+ part { name: "over";
+ type: RECT;
+ mouse_events: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.to: "bg";
+ rel2.to: "background";
+ }
+ }
+ }
+
+ programs{
+ program { name: "mouse_in";
+ signal: "mouse,in";
+ source: "over";
+ action: STATE_SET "selected" 0.0;
+ target: "background";
+ target: "border_top";
+ target: "border_left";
+ target: "border_right";
+ }
+ program { name: "mouse_out";
+ signal: "mouse,out";
+ source: "over";
+ action: STATE_SET "default" 0.0;
+ target: "background";
+ target: "border_top";
+ target: "border_left";
+ target: "border_right";
+ }
+ program {
+ name: "mouse_click";
+ signal: "mouse,clicked,1";
+ source: "over";
+ script {
+ emit("elm,action,click", "");
+ }
+ }
+ }
+}
+
+group { name: "elm/button/base/small_tile";
+ data.item: "texts" "page_title page_url";
+ data.item: "contents" "elm.thumbnail";
+ images {
+ image: "web_frame_selected.png" COMP;
+ image: "ico_bg_round_shape_37x37.png" COMP;
+ }
+ parts {
+ part { name: "container";
+ type: RECT;
+ description { state: "default" 0.0;
+ min: 378 320;
+ max: 378 320;
+ visible: 0;
+ }
+ }
+
+ part { name: "bg";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ min: 378 294;
+ max: 378 294;
+ visible: 1;
+ color: 231 231 231 255;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 0.0 0.0; to: "container";
+ }
+ rel2 {
+ relative: 1.0 1.0; to: "container";
+ }
+ }
+ }
+
+ part { name: "elm.thumbnail";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ fixed: 1 0;
+ align: 0.0 0.0;
+ color : 231 231 231 255;
+ min: 378 292; // size adjusted to max thubnail with and height
+ max: 378 292;
+ rel1 {
+ relative: 0.0 0.0; to: "bg";
+ }
+ rel2 {
+ relative: 1.0 1.0; to: "bg";
+ }
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ }
+ }
+ part { name: "border_top";
+ type: RECT;
+ description { state: "default" 0.0;
+ color_class: focusBgColor;
+ min: 0 6;
+ max: -1 6;
+ align: 0 0;
+ rel1 {
+ to: "elm.thumbnail";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "elm.thumbnail";
+ relative: 1.0 1.0;
+ }
+ visible: 0;
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+
+ part { name: "border_left";
+ type: RECT;
+ description { state: "default" 0.0;
+ color_class: focusBgColor;
+ min: 6 0;
+ max: 6 -1;
+ align: 0 0;
+ rel1 {
+ to: "elm.thumbnail";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "elm.thumbnail";
+ relative: 1.0 1.0;
+ }
+ visible: 0;
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+
+ part { name: "border_right";
+ type: RECT;
+ description { state: "default" 0.0;
+ color_class: focusBgColor;
+ min: 6 0;
+ max: 6 -1;
+ align: 1 0;
+ rel1 {
+ to: "elm.thumbnail";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "elm.thumbnail";
+ relative: 1.0 1.0;
+ }
+ visible: 0;
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+
+ part { name: "background";
+ type: RECT;
+ description { state: "default" 0.0;
+ min: 378 96;
+ max: 378 96;
+ align: 0.0 0.0;
+ color: 113 128 147 255;
+ visible: 1;
+ rel1 {
+ to: "bg";
+ relative: 0.0 0.0;
+ offset: 0 198; // thumbnail height
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 0 119 246 255;
+ }
+ }
+
+ part { name: "page_title";
+ type: TEXT;
+ description { state: "default" 0.0;
+ min: 314 28;
+ max: 314 28;
+ align: 0.0 0.0;
+ color: 255 255 255 255;
+ rel1 {
+ to: "background";
+ relative: 0.0 0.0;
+ offset: 32 18;
+ }
+ rel2 {
+ to: "background";
+ relative: 1.0 1.0;
+ }
+ text {
+ text: "Web page title";
+ font: "Sans";
+ size: 28;
+ align: 0 0.0;
+ }
+ }
+ 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";
+ type: TEXT;
+ description { state: "default" 0.0;
+ min: 314 24;
+ max: 314 24;
+ align: 0 0.0;
+ color: 255 255 255 255;
+ rel1 {
+ to: "page_title";
+ relative: 0.0 1.0;
+ offset: 0 8;
+ }
+ rel2 {
+ to: "background";
+ relative: 1.0 1.0;
+ }
+ text {
+ text: "Web page url";
+ font: "Sans";
+ size: 24;
+ 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: "over";
+ type: RECT;
+ mouse_events: 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.to: "bg";
+ rel2.to: "background";
+ }
+ }
+ }
+
+ programs {
+ program { name: "mouse_in";
+ signal: "mouse,in";
+ source: "over";
+ action: STATE_SET "selected" 0.0;
+ target: "background";
+ target: "border_top";
+ target: "border_left";
+ target: "border_right";
+ }
+ program { name: "mouse_out";
+ signal: "mouse,out";
+ source: "over";
+ action: STATE_SET "default" 0.0;
+ target: "background";
+ target: "border_top";
+ target: "border_left";
+ target: "border_right";
+ }
+ program {
+ name: "mouse_click";
+ signal: "mouse,clicked,1";
+ source: "over";
+ script {
+ emit("elm,action,click", "");
+ }
+ }
+ }
+}
+
+group { name: "elm/gengrid/item/grid_item/default";
+ data.item: "texts" "page_title page_url";
+ data.item: "contents" "elm.thumbnail elm.thumbButton";
+ images {
+ image: "web_frame_selected.png" COMP;
+ image: "ico_bg_round_shape_37x37.png" COMP;
+ image: "ic_thumbnail_favorite_01.png" COMP;
+ }
+ parts {
+ part { name: "bg";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ min: 338 294;
+ max: 338 294;
+ visible: 1;
+ color: 231 231 231 255;
+ rel1.offset: -26 -26;
+ }
+ 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;
+ align: 0.0 0.0;
+ color : 231 231 231 255;
+ min: 338 198;
+ max: 338 198;
+ rel1 {
+ relative: 0.0 0.0; to: "bg";
+ }
+ rel2 {
+ relative: 1.0 1.0; to: "bg";
+ }
+ }
+ description { state: "selected";
+ inherit: "default" 0.0;
+ }
+ }
+
+ part {
+ name: "bookmark_thumbButton";
+ type: IMAGE;
+ mouse_events: 1;
+ repeat_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1.to: "elm.thumbnail";
+ rel1.offset: 284 18;
+ rel1.relative: 0.0 0.0;
+ rel2.to: "elm.thumbnail";
+ rel2.offset: 324 58;
+ rel2.relative: 0.0 0.0;
+ align: 0.0 0.0;
+ image.normal: "ic_thumbnail_favorite_01.png";
+ }
+ }
+
+ 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";
+ type: RECT;
+ description { state: "default" 0.0;
+ min: 338 87;
+ max: 338 87;
+ align: 0.0 0.0;
+ color: 231 231 231 255;
+ rel1 {
+ to: "elm.thumbnail";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ }
+ description { state: "selected" 0.0;
+ inherit: "default" 0.0;
+ color: 70 143 254 255;
+ }
+ }
+
+ part { name: "page_title";
+ type: TEXT;
+ description { state: "default" 0.0;
+ min: 300 48;
+ max: 300 48;
+ align: 0.0 0.5;
+ rel1 {
+ to: "background";
+ relative: 0.0 0.0;
+ offset: 17 0;
+ }
+ rel2 {
+ to: "background";
+ relative: 1.0 1.0;
+ }
+ color: 51 51 51 255;
+ text {
+ text: "Web page title";
+ font: "Sans";
+ size: 27;
+ align: 0 0.5;
+ }
+ }
+ description { state: "focus" 0.0;
+ inherit: "default" 0.0;
+ //color: focusTextColor;
+ }
+ description { state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ //color: highlightTextColor;
+ }
+ }
+
+ part { name: "page_url";
+ type: TEXT;
+ description { state: "default" 0.0;
+ min: 300 48;
+ max: 300 48;
+ align: 0 0.5;
+ rel1 {
+ to: "page_title";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "page_title";
+ relative: 1.0 1.0;
+ }
+ color: 153 153 153 255;
+ text {
+ text: "Web page url";
+ font: "Sans";
+ size: 24;
+ align: 0 0.5;
+ }
+ }
+ description { state: "focus" 0.0;
+ inherit: "default" 0.0;
+ //color: focusTextColor;
+ }
+ description { state: "highlight" 0.0;
+ inherit: "default" 0.0;
+ //color: highlightTextColor;
+ }
+ }
+
+ part { name: "elm.thumbButton";
+ type: SWALLOW;
+ 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: "bg";
+ rel2.to: "background";
+ }
+ }
+ }
+
+ programs{
+ program { name: "mouse_in";
+ signal: "mouse,in";
+ source: "over";
+ action: STATE_SET "selected" 0.0;
+ target: "background";
+ target: "focus_highlight";
+ target: "bg";
+ }
+ program { name: "mouse_out";
+ signal: "mouse,out";
+ source: "over";
+ action: STATE_SET "default" 0.0;
+ target: "background";
+ target: "focus_highlight";
+ target: "bg";
+ }
+ }
+}
+
+group { name: "top_button_item";
+ min: 1920 181;
+ max: 1920 181;
+ data.item: "texts" "mostvisited_text bookmark_text";
+ data.item: "contents" "mostvisited_click bookmark_click";
+ parts{
+ part {
+ name: "bg_clipper";
+ scale:1;
+ mouse_events: 1;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 255;
+ align: 0 0;
+ min: 1920 181;
+ max: 1920 181;
+ rel1 { relative: 0.0 0.0;}
+ rel2 { relative: 1.0 1.0;}
+ }
+ }
+ part {
+ name: "mostvisited_button";
+ scale:1;
+ mouse_events: 1;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ fixed: 1 1;
+ color: 192 192 192 255;
+ align: 0 0;
+ min: 348 64;
+ max: 348 64;
+ rel1 { relative: 0.0 0.0; to: "bg_clipper"; offset: 611 58;}
+ rel2 { relative: 1.0 1.0; to: "bg_clipper"; }
+ }
+ 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: focusbtBgColor;
+ visible: 1;
+ }
+ }
+ part{
+ name: "mostvisited_text";
+ type: TEXT;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 1;
+ fixed: 1 1;
+ rel1 { relative: 0.0 0.0;to: "mostvisited_button";}
+ rel2 { relative: 1.0 1.0;to: "mostvisited_button";}
+ color: 0 0 0 255;
+ text {
+ text: "Most visited";
+ font: "Sans";
+ size: 27;
+ align: 0.5 0.5;
+ }
+ }
+ }
+ part {
+ name: "mostvisited_over";
+ scale:1;
+ type: RECT;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0 0;
+ fixed: 1 1;
+ rel1 { relative: 0.0 0.0; to: "mostvisited_button";}
+ rel2 { relative: 1.0 1.0; to: "mostvisited_button";}
+ color_class: transparent;
+ }
+ }
+ part {
+ name: "mostvisited_click";
+ scale:1;
+ type: SWALLOW;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0 0;
+ fixed: 1 1;
+ rel1 { relative: 0.0 0.0; to: "mostvisited_button";}
+ rel2 { relative: 1.0 1.0; to: "mostvisited_button";}
+ }
+ }
+ part {
+ name: "bookmark_button";
+ scale:1;
+ mouse_events: 1;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ fixed: 1 1;
+ color: 192 192 192 255;
+ align: 0 0;
+ min: 348 64;
+ max: 348 64;
+ rel1 { relative: 0.0 0.0; to: "bg_clipper"; offset: 961 58;}
+ rel2 { relative: 1.0 1.0; to: "bg_clipper"; }
+ }
+ 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: focusbtBgColor;
+ visible: 1;
+ }
+ }
+ part{
+ name: "bookmark_text";
+ type: TEXT;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 1;
+ fixed: 1 1;
+ rel1 { relative: 0.0 0.0;to: "bookmark_button";}
+ rel2 { relative: 1.0 1.0;to: "bookmark_button";}
+ color: 0 0 0 255;
+ text {
+ text: "Bookmark";
+ font: "Sans";
+ size: 27;
+ align: 0.5 0.5;
+ }
+ }
+ }
+ part {
+ name: "bookmark_over";
+ scale:1;
+ type: RECT;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0 0;
+ fixed: 1 1;
+ rel1 { relative: 0.0 0.0; to: "bookmark_button";}
+ rel2 { relative: 1.0 1.0; to: "bookmark_button";}
+ color_class: transparent;
+ }
+ }
+ part {
+ name: "bookmark_click";
+ scale:1;
+ type: SWALLOW;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0 0;
+ fixed: 1 1;
+ rel1 { relative: 0.0 0.0; to: "bookmark_button";}
+ rel2 { relative: 1.0 1.0; to: "bookmark_button";}
+ color_class: transparent;
+ }
+ }
+
+ programs{
+ program {
+ name: "mouse_click_mostvisited";
+ signal: "mouse,clicked,1";
+ source: "mostvisited_over";
+ script {
+ emit("elm,action,click", "");
+ }
+ }
+ program {
+ name: "mouse_in_mostvisited_click";
+ signal: "mouse,in";
+ source: "mostvisited_*";
+ action: STATE_SET "highlight" 0.0;
+ target: "mostvisited_button";
+ target: "mostvisited_over";
+ target: "mostvisited_text";
+ }
+ program {
+ name: "mouse_out_mostvisited_click";
+ signal: "mouse,out";
+ source: "mostvisited_*";
+ action: STATE_SET "default" 0.0;
+ target: "mostvisited_button";
+ target: "mostvisited_over";
+ target: "mostvisited_text";
+ }
+ program {
+ name: "mouse_click_bookmark";
+ signal: "mouse,clicked,1";
+ source: "bookmark_over";
+ script {
+ emit("elm,action,click", "");
+ }
+ }
+ program {
+ name: "mouse_in_bookmark_click";
+ signal: "mouse,in";
+ source: "bookmark_*";
+ action: STATE_SET "highlight" 0.0;
+ target: "bookmark_button";
+ target: "bookmark_over";
+ target: "bookmark_text";
+ }
+ program {
+ name: "mouse_out_bookmark_click";
+ signal: "mouse,out";
+ source: "bookmark_*";
+ action: STATE_SET "default" 0.0;
+ target: "bookmark_button";
+ target: "bookmark_over";
+ target: "mostvisited_text";
+ }
+ }
+ }
+}
+
+group { name: "bottom_button_item";
+ min: 1920 181;
+ max: 1920 181;
+ data.item: "texts" "bookmarkmanager_text";
+ data.item: "contents" "bookmarkmanager_click";
+ parts{
+ part {
+ name: "bg_clipper";
+ scale:1;
+ mouse_events: 1;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 255;
+ align: 0 0;
+ min: 1920 181;
+ max: 1920 181;
+ rel1 { relative: 0.0 0.0;}
+ rel2 { relative: 1.0 1.0;}
+ }
+ }
+ part {
+ name: "bookmarkmanager_button";
+ scale:1;
+ mouse_events: 1;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ fixed: 1 1;
+ align: 0 0;
+ min: 348 65;
+ max: 348 65;
+ color: 192 192 192 255;
+ rel1 { relative: 0.0 0.0; to: "bg_clipper"; offset: 786 58;}
+ rel2 { relative: 1.0 1.0; to: "bg_clipper"; }
+ }
+ 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: focusbtBgColor;
+ visible: 1;
+ }
+ }
+ part{
+ name: "bookmarkmanager_text";
+ type: TEXT;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 1;
+ fixed: 1 1;
+ rel1 { relative: 0.0 0.0;to: "bookmarkmanager_button";}
+ rel2 { relative: 1.0 1.0;to: "bookmarkmanager_button";}
+ color: 0 0 0 255;
+ text {
+ text: "Bookmark Manager";
+ font: "Sans";
+ size: 27;
+ align: 0.5 0.5;
+ }
+ }
+ }
+ part {
+ name: "bookmarkmanager_over";
+ scale:1;
+ type: RECT;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0 0;
+ fixed: 1 1;
+ min: 348 65;
+ max: 348 65;
+ rel1 { relative: 0.0 0.0; to: "bookmarkmanager_button";}
+ rel2 { relative: 1.0 1.0; to: "bookmarkmanager_button";}
+ color_class: transparent;
+ }
+ }
+ part {
+ name: "bookmarkmanager_click";
+ scale:1;
+ type: SWALLOW;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0 0;
+ fixed: 1 1;
+ min: 348 65;
+ max: 348 65;
+ rel1 { relative: 0.0 0.0; to: "bookmarkmanager_over";}
+ rel2 { relative: 1.0 1.0; to: "bookmarkmanager_over";}
+ }
+ }
+ }
+ programs{
+ program {
+ name: "mouse_click_bookmarkmanager";
+ signal: "mouse,clicked,1";
+ source: "bookmarkmanager_over";
+ script {
+ emit("elm,action,click", "");
+ }
+ }
+ program {
+ name: "mouse_in_bookmarkmanager_click";
+ signal: "mouse,in";
+ source: "bookmarkmanager_*";
+ action: STATE_SET "highlight" 0.0;
+ target: "bookmarkmanager_button";
+ target: "bookmarkmanager_over";
+ target: "bookmarkmanager_text";
+ }
+ program {
+ name: "mouse_out_bookmarkmanager_click";
+ signal: "mouse,out";
+ source: "bookmarkmanager_*";
+ action: STATE_SET "default" 0.0;
+ target: "bookmarkmanager_button";
+ target: "bookmarkmanager_over";
+ target: "bookmarkmanager_text";
+ }
+ }
+ }
+}
--- /dev/null
+collections {
+ images {
+ image: "web_browsing_icon_error.png" COMP;
+ }
+ group { name: "error_message";
+ 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";
+ }
+ }
+ parts {
+ part{
+ name: "message_background";
+ type: RECT;
+ description{
+ state: "default" 0.0;
+ visible: 1;
+ rel1.relative: 0 0;
+ rel2.relative: 1 1;
+ color: 42 50 64 255;
+ }
+ }
+ 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;
+ }
+ }
+ 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";
+ }
+ }
+ }
+
+ 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.<br/>sdf Please check the followings:";
+ //min: 0 0;
+ //max: 1 1;
+ //align: 1 0;
+ //size: 35;
+ }
+ }
+ }
+
+
+ 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. <br/>"
+ "Check your network settings.<br/>"
+ "Try again later.<br/>"
+ "Click refresh to reload.";
+ }
+ }
+ }
+ }
+/*
+ programs {
+ program { name: "mouse_down";
+ signal: "mouse,down,1";
+ source: "logo";
+ action: STATE_SET "hide" 0.0;
+ target: "logo";
+ }
+ program { name: "mouse_up";
+ signal: "mouse,up,1";
+ source: "logo";
+ action: STATE_SET "default" 0.0;
+ target: "logo";
+ }
+ }
+*/
+ }
+}
include_directories(${CMAKE_SOURCE_DIR}/services/HistoryService)
include_directories(${CMAKE_SOURCE_DIR}/services/MoreMenuUI)
include_directories(${CMAKE_SOURCE_DIR}/services/HistoryUI)
-include_directories(${CMAKE_SOURCE_DIR}/services/MainUI)
+include_directories(${CMAKE_SOURCE_DIR}/services/QuickAccess)
include_directories(${CMAKE_SOURCE_DIR}/services/SettingsUI)
include_directories(${CMAKE_SOURCE_DIR}/services/TabUI)
include_directories(${CMAKE_SOURCE_DIR}/services/ZoomUI)
add_dependencies(${PROJECT_NAME} HistoryService)
add_dependencies(${PROJECT_NAME} MoreMenuUI)
add_dependencies(${PROJECT_NAME} BookmarkManagerUI)
-add_dependencies(${PROJECT_NAME} MainUI)
+add_dependencies(${PROJECT_NAME} QuickAccess)
add_dependencies(${PROJECT_NAME} HistoryUI)
add_dependencies(${PROJECT_NAME} TabUI)
add_dependencies(${PROJECT_NAME} SettingsUI)
target_link_libraries(${PROJECT_NAME} StorageService)
target_link_libraries(${PROJECT_NAME} HistoryService)
target_link_libraries(${PROJECT_NAME} MoreMenuUI)
-target_link_libraries(${PROJECT_NAME} MainUI)
+target_link_libraries(${PROJECT_NAME} QuickAccess)
target_link_libraries(${PROJECT_NAME} HistoryUI)
target_link_libraries(${PROJECT_NAME} TabUI)
target_link_libraries(${PROJECT_NAME} SettingsUI)
, m_webPageUI()
, m_moreMenuUI()
, m_bookmarkManagerUI()
- , m_mainUI()
+ , m_quickAccess()
, m_historyUI()
, m_settingsUI()
, m_tabUI()
<tizen_browser::base_ui::WebPageUI,tizen_browser::core::AbstractService>
(tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.webpageui"));
- m_mainUI =
+ m_quickAccess =
std::dynamic_pointer_cast
- <tizen_browser::base_ui::MainUI,tizen_browser::core::AbstractService>
- (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.mainui"));
+ <tizen_browser::base_ui::QuickAccess,tizen_browser::core::AbstractService>
+ (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.quickaccess"));
m_tabUI =
std::dynamic_pointer_cast
m_webPageUI->forwardPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine<Evas_Object>::forward, m_webEngine.get()));
m_webPageUI->stopLoadingPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine<Evas_Object>::stopLoading, m_webEngine.get()));
m_webPageUI->reloadPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine<Evas_Object>::reload, m_webEngine.get()));
- m_webPageUI->showMainUI.connect(boost::bind(&SimpleUI::showMainUI, this));
- m_webPageUI->hideMainUI.connect(boost::bind(&MainUI::hideUI, m_mainUI));
+ m_webPageUI->showQuickAccess.connect(boost::bind(&SimpleUI::showQuickAccess, this));
+ m_webPageUI->hideQuickAccess.connect(boost::bind(&QuickAccess::hideUI, m_quickAccess));
- M_ASSERT(m_mainUI.get());
- m_mainUI->getDetailPopup().openURLInNewTab.connect(boost::bind(&SimpleUI::onOpenURLInNewTab, this, _1, _2));
- m_mainUI->openURLInNewTab.connect(boost::bind(&SimpleUI::onOpenURLInNewTab, this, _1, _2));
- m_mainUI->mostVisitedTileClicked.connect(boost::bind(&SimpleUI::onMostVisitedTileClicked, this, _1, _2));
- m_mainUI->mostVisitedClicked.connect(boost::bind(&SimpleUI::onMostVisitedClicked, this));
- m_mainUI->bookmarkClicked.connect(boost::bind(&SimpleUI::onBookmarkButtonClicked, this));
- m_mainUI->bookmarkManagerClicked.connect(boost::bind(&SimpleUI::showBookmarkManagerUI, this));
+ M_ASSERT(m_quickAccess.get());
+ m_quickAccess->getDetailPopup().openURLInNewTab.connect(boost::bind(&SimpleUI::onOpenURLInNewTab, this, _1, _2));
+ m_quickAccess->openURLInNewTab.connect(boost::bind(&SimpleUI::onOpenURLInNewTab, this, _1, _2));
+ m_quickAccess->mostVisitedTileClicked.connect(boost::bind(&SimpleUI::onMostVisitedTileClicked, this, _1, _2));
+ m_quickAccess->mostVisitedClicked.connect(boost::bind(&SimpleUI::onMostVisitedClicked, this));
+ m_quickAccess->bookmarkClicked.connect(boost::bind(&SimpleUI::onBookmarkButtonClicked, this));
+ m_quickAccess->bookmarkManagerClicked.connect(boost::bind(&SimpleUI::showBookmarkManagerUI, this));
M_ASSERT(m_tabUI.get());
m_tabUI->closeTabUIClicked.connect(boost::bind(&SimpleUI::closeTabUI, this));
M_ASSERT(m_webPageUI.get());
m_webPageUI->init(m_viewManager->getContent());
- M_ASSERT(m_mainUI.get());
- m_mainUI->init(m_webPageUI->getContent());
+ M_ASSERT(m_quickAccess.get());
+ m_quickAccess->init(m_webPageUI->getContent());
M_ASSERT(m_tabUI.get());
m_tabUI->init(m_viewManager->getContent());
return m_webPageUI->isErrorPageActive();
}
-void SimpleUI::showMainUI()
+void SimpleUI::showQuickAccess()
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- m_mainUI->showMostVisited(getMostVisitedItems());
- m_mainUI->showUI();
+ m_quickAccess->showMostVisited(getMostVisitedItems());
+ m_quickAccess->showUI();
}
void SimpleUI::switchViewToQuickAccess()
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
M_ASSERT(m_viewManager);
- m_webPageUI->switchViewToQuickAccess(m_mainUI->getContent());
+ m_webPageUI->switchViewToQuickAccess(m_quickAccess->getContent());
m_webEngine->disconnectCurrentWebViewSignals();
m_viewManager->popStackTo(m_webPageUI.get());
}
void SimpleUI::onMostVisitedTileClicked(std::shared_ptr< services::HistoryItem > historyItem, int itemsNumber)
{
BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- m_mainUI->openDetailPopup(historyItem, m_historyService->getHistoryItemsByURL(historyItem->getUrl(), itemsNumber));
+ m_quickAccess->openDetailPopup(historyItem, m_historyService->getHistoryItemsByURL(historyItem->getUrl(), itemsNumber));
}
void SimpleUI::onClearHistoryClicked()
void SimpleUI::onMostVisitedClicked()
{
BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- m_mainUI->showMostVisited(getMostVisitedItems());
+ m_quickAccess->showMostVisited(getMostVisitedItems());
}
void SimpleUI::onBookmarkButtonClicked()
{
BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
- m_mainUI->showBookmarks(getBookmarks());
+ m_quickAccess->showBookmarks(getBookmarks());
}
void SimpleUI::onBookmarkClicked(std::shared_ptr<tizen_browser::services::BookmarkItem> bookmarkItem)
{
BROWSER_LOGD("[%s]", __func__);
if (m_webPageUI->isHomePageActive()) {
- m_mainUI->backButtonClicked();
+ m_quickAccess->backButtonClicked();
} else {
if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus)
m_webEngine->backButtonClicked();
if(!m_webEngine->isPrivateMode()){
m_historyService->addHistoryItem(std::make_shared<tizen_browser::services::HistoryItem> (m_webEngine->getURI(),
m_webEngine->getTitle(),
- m_webEngine->getFavicon()), m_webEngine->getSnapshotData(MainUI::MAX_THUMBNAIL_WIDTH, MainUI::MAX_THUMBNAIL_HEIGHT));
+ m_webEngine->getFavicon()), m_webEngine->getSnapshotData(QuickAccess::MAX_THUMBNAIL_WIDTH, QuickAccess::MAX_THUMBNAIL_HEIGHT));
}
m_webPageUI->loadFinished();
}
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
M_ASSERT(m_viewManager);
- bool desktopMode = m_webPageUI->isHomePageActive() ? m_mainUI->isDesktopMode() : m_webEngine->isDesktopMode();
+ bool desktopMode = m_webPageUI->isHomePageActive() ? m_quickAccess->isDesktopMode() : m_webEngine->isDesktopMode();
m_moreMenuUI->setDesktopMode(desktopMode);
m_viewManager->pushViewToStack(m_moreMenuUI.get());
m_moreMenuUI->showCurrentTab();
m_viewManager->popStackTo(m_webPageUI.get());
m_webEngine->reload();
} else {
- m_mainUI->setDesktopMode(false);
+ m_quickAccess->setDesktopMode(false);
}
}
m_webEngine->switchToDesktopMode();
m_webEngine->reload();
} else {
- m_mainUI->setDesktopMode(true);
+ m_quickAccess->setDesktopMode(true);
}
}
#include "MoreMenuUI.h"
#include "HistoryUI.h"
#include "SettingsUI.h"
-#include "MainUI.h"
+#include "QuickAccess.h"
#include "TabUI.h"
#include "ZoomUI.h"
#include "HistoryService.h"
void bookmarkAdded();
void bookmarkDeleted();
- void showMainUI();
+ void showQuickAccess();
void switchViewToQuickAccess();
void switchViewToWebPage();
void updateView();
std::shared_ptr<services::HistoryService> m_historyService;
std::shared_ptr<MoreMenuUI> m_moreMenuUI;
std::shared_ptr<BookmarkManagerUI> m_bookmarkManagerUI;
- std::shared_ptr<MainUI> m_mainUI;
+ std::shared_ptr<QuickAccess> m_quickAccess;
std::shared_ptr<HistoryUI> m_historyUI;
std::shared_ptr<SettingsUI> m_settingsUI;
std::shared_ptr<TabUI> m_tabUI;
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/QuickAccess)
include_directories(${CMAKE_SOURCE_DIR}/services/SettingsUI)
include_directories(${CMAKE_SOURCE_DIR}/services/TabUI)
add_library(${PROJECT_NAME} SHARED ${WebPageUI_SRCS})
add_dependencies(${PROJECT_NAME} MoreMenuUI)
-add_dependencies(${PROJECT_NAME} MainUI)
+add_dependencies(${PROJECT_NAME} QuickAccess)
add_dependencies(${PROJECT_NAME} TabUI)
target_link_libraries(${PROJECT_NAME} MoreMenuUI)
-target_link_libraries(${PROJECT_NAME} MainUI)
+target_link_libraries(${PROJECT_NAME} QuickAccess)
target_link_libraries(${PROJECT_NAME} TabUI)
target_link_libraries(${PROJECT_NAME} ${EFL_LDFLAGS})
evas_object_show(elm_object_part_content_get(m_mainLayout, "uri_bar_buttons_right"));
if (m_homePageActive)
- showMainUI();
+ showQuickAccess();
}
evas_object_hide(m_mainLayout);
if (m_homePageActive)
- hideMainUI();
+ hideQuickAccess();
evas_object_hide(elm_object_part_content_get(m_mainLayout, "web_view"));
m_URIEntry->editingCanceled();
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_homePageActive)
{
- hideMainUI();
+ hideQuickAccess();
m_homePageActive = false;
}
setMainContent(content);
refreshFocusChain();
m_URIEntry->changeUri("");
m_URIEntry->setFocus();
- showMainUI();
+ showQuickAccess();
}
void WebPageUI::faviconClicked(void* data, Evas_Object*, const char*, const char*)
boost::signals2::signal<void ()> reloadPage;
boost::signals2::signal<void ()> showTabUI;
boost::signals2::signal<void ()> showMoreMenu;
- boost::signals2::signal<void ()> hideMainUI;
- boost::signals2::signal<void ()> showMainUI;
+ boost::signals2::signal<void ()> hideQuickAccess;
+ boost::signals2::signal<void ()> showQuickAccess;
static void faviconClicked(void* data, Evas_Object* obj, const char* emission, const char* source);