set(QuickAccess_SRCS
QuickAccess.cpp
- DetailPopup.cpp
)
include(Coreheaders)
else (${PROFILE} MATCHES "mobile") # tv profile
set(edcFiles
QuickAccess.edc
- DetailPopup.edc
)
endif (${PROFILE} MATCHES "mobile")
+++ /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 "app_i18n.h"
-#include "services/HistoryService/HistoryItem.h"
-#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_object_translatable_part_text_set(m_layout, "history_title", "IDS_BR_MBODY_HISTORY");
- elm_layout_text_set(m_layout, "url", tools::clearURL(m_item->getUrl()).c_str());
-
- 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 = m_item->getThumbnail()->getEvasImage(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_layout = nullptr;
-#if !PROFILE_MOBILE
- m_quickAccess->refreshFocusChain();
-#endif
-}
-
-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->openURL(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->openURL(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->openURL(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("");
-}
-
-}
-}
+++ /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/HistoryItemTypedef.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)> openURL;
-
- 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__
, m_currPage(QuickAccess::QUICKACCESS_PAGE)
, m_quickAccess_item_class(nullptr)
, m_mostVisited_item_class(nullptr)
- , m_detailPopup(this)
, m_index(nullptr)
, m_verticalScroller(nullptr)
- , m_quickAccessTileclass(nullptr)
+ , m_quickAccess_tile_class(nullptr)
, m_landscapeView(isOrientationLandscape())
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
clearMostVisitedGengrid();
elm_gengrid_item_class_free(m_quickAccess_item_class);
elm_gengrid_item_class_free(m_mostVisited_item_class);
- elm_gengrid_item_class_free(m_quickAccessTileclass);
+ elm_gengrid_item_class_free(m_quickAccess_tile_class);
eina_list_free(m_parentFocusChain);
}
m_mostVisited_item_class->func.state_get = nullptr;
m_mostVisited_item_class->func.del = _grid_mostVisited_del;
}
- if (!m_quickAccessTileclass) {
- m_quickAccessTileclass = elm_gengrid_item_class_new();
- m_quickAccessTileclass->item_style = "bookmark_manager";
- m_quickAccessTileclass->func.text_get = nullptr;
- m_quickAccessTileclass->func.content_get = nullptr;
- m_quickAccessTileclass->func.state_get = nullptr;
- m_quickAccessTileclass->func.del = nullptr;
+ if (!m_quickAccess_tile_class) {
+ m_quickAccess_tile_class = elm_gengrid_item_class_new();
+ m_quickAccess_tile_class->item_style = "bookmark_manager";
+ m_quickAccess_tile_class->func.text_get = nullptr;
+ m_quickAccess_tile_class->func.content_get = nullptr;
+ m_quickAccess_tile_class->func.state_get = nullptr;
+ m_quickAccess_tile_class->func.del = nullptr;
}
}
void QuickAccess::addQuickAccessItem(std::shared_ptr<tizen_browser::services::BookmarkItem> bi)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- //TODO: It should be guaranted that items added here are not folders.
if (bi->is_folder())
return;
BookmarkItemData *itemData = new BookmarkItemData(); // deleted in _grid_bookmark_del
itemData->item = bi;
itemData->quickAccess = this;
- elm_gengrid_item_append(m_quickAccessGengrid, m_quickAccess_item_class, itemData, _thumbBookmarkClicked, itemData);
+ elm_gengrid_item_append(m_quickAccessGengrid, m_quickAccess_item_class, itemData, _thumbQuickAccessClicked, itemData);
}
void QuickAccess::clearMostVisitedGengrid()
void QuickAccess::addToQuickAccessTile()
{
- elm_gengrid_item_append(m_quickAccessGengrid, m_quickAccessTileclass, this, _addToQuickAccess_clicked, this);
+ elm_gengrid_item_append(m_quickAccessGengrid, m_quickAccess_tile_class, this, _addToQuickAccess_clicked, this);
}
void QuickAccess::setIndexPage(const uintptr_t page) const
m_landscapeView = isOrientationLandscape();
createBox(m_horizontalScroller);
- setQuickAccessItems(m_QuickAccessItems);
- setMostVisitedItems(m_mostVisitedItems);
+ getQuickAccessItems();
+ getMostVisitedItems();
}
void QuickAccess::_quickAccess_tile_realized(void* data, Evas_Object*, void* event_info)
}
}
-void QuickAccess::_thumbBookmarkClicked(void * data, Evas_Object * , void *)
+void QuickAccess::_thumbQuickAccessClicked(void * data, Evas_Object * , void *)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
HistoryItemData * itemData = reinterpret_cast<HistoryItemData *>(data);
evas_object_show(m_layout);
getMostVisitedItems();
- getBookmarksItems();
+ getQuickAccessItems();
showScrollerPage(m_currPage);
}
clearQuickAccessGengrid();
}
-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::showNoMostVisitedLabel()
{
elm_object_translatable_part_text_set(m_mostVisitedView, "elm.text.empty", "IDS_BR_BODY_NO_VISITED_SITES");
m_desktopMode = mode;
}
-DetailPopup& QuickAccess::getDetailPopup()
-{
- return m_detailPopup;
-}
-
bool QuickAccess::canBeBacked(int tabCount)
{
- if (m_detailPopup.isVisible())
- return true;
- else
- return (tabCount != 0);
+ return (tabCount != 0);
}
void QuickAccess::backButtonClicked()
{
- if (m_detailPopup.isVisible()) {
- m_detailPopup.hide();
- } else {
- hideUI();
- switchViewToWebPage();
- }
+ hideUI();
+ switchViewToWebPage();
}
bool QuickAccess::isMostVisitedActive() const
#include "ServiceFactory.h"
#include "service_macros.h"
#include "services/HistoryService/HistoryItem.h"
+#include "services/HistoryService/HistoryItemTypedef.h"
#include "BookmarkItem.h"
-#include "DetailPopup.h"
namespace tizen_browser{
namespace base_ui{
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();
bool canBeBacked(int tabCount);
void backButtonClicked();
inline bool isMostVisitedActive() const;
void showMostVisited();
void showQuickAccess();
- 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)> openURL;
boost::signals2::signal<void ()> getMostVisitedItems;
- boost::signals2::signal<void ()> getBookmarksItems;
- boost::signals2::signal<void ()> bookmarkManagerClicked;
+ boost::signals2::signal<void ()> getQuickAccessItems;
boost::signals2::signal<void ()> addQuickAccessClicked;
boost::signals2::signal<void ()> switchViewToWebPage;
static char* _grid_mostVisited_text_get(void *data, Evas_Object *obj, const char *part);
static Evas_Object * _grid_mostVisited_content_get(void *data, Evas_Object *obj, const char *part);
static void _grid_mostVisited_del(void *data, Evas_Object *obj);
- static void _thumbBookmarkClicked(void * data, Evas_Object * obj, void * event_info);
+ static void _thumbQuickAccessClicked(void * data, Evas_Object * obj, void * event_info);
static void _thumbMostVisitedClicked(void * data, Evas_Object * obj, void * event_info);
void setEmptyView(bool empty);
void showNoMostVisitedLabel();
int m_currPage;
Elm_Gengrid_Item_Class * m_quickAccess_item_class;
Elm_Gengrid_Item_Class * m_mostVisited_item_class;
- DetailPopup m_detailPopup;
std::shared_ptr<services::HistoryItemVector> m_mostVisitedItems;
bool m_gengridSetup;
std::string edjFilePath;
Evas_Object* m_index;
Evas_Object* m_verticalScroller;
- Elm_Gengrid_Item_Class * m_quickAccessTileclass;
+ Elm_Gengrid_Item_Class * m_quickAccess_tile_class;
std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > m_QuickAccessItems;
bool m_landscapeView;
static const int MOST_VISITED_PAGE = 1;
+++ /dev/null
-collections { base_scale: 2.0;
-
- 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
#include "HistoryItem.h"
#include "boost/date_time/gregorian/gregorian.hpp"
#include "boost/date_time/posix_time/posix_time.hpp"
-#include "DetailPopup.h"
#include "UrlHistoryList/UrlHistoryList.h"
#include "NotificationPopup.h"
#include "ContentPopup_mob.h"
m_webPageUI->requestCurrentPageForWebPageUI.connect(boost::bind(&SimpleUI::requestSettingsCurrentPage, this));
M_ASSERT(m_quickAccess.get());
- m_quickAccess->getDetailPopup().openURL.connect(boost::bind(&SimpleUI::onOpenURL, this, _1, _2));
m_quickAccess->openURL.connect(boost::bind(&SimpleUI::onOpenURL, this, _1, _2));
- m_quickAccess->mostVisitedTileClicked.connect(boost::bind(&SimpleUI::onMostVisitedTileClicked, this, _1, _2));
m_quickAccess->getMostVisitedItems.connect(boost::bind(&SimpleUI::onMostVisitedClicked, this));
- m_quickAccess->getBookmarksItems.connect(boost::bind(&SimpleUI::onBookmarkButtonClicked, this));
- m_quickAccess->bookmarkManagerClicked.connect(boost::bind(&SimpleUI::showBookmarkManagerUI, this,
- m_favoriteService->getRoot(), BookmarkManagerState::Default));
+ m_quickAccess->getQuickAccessItems.connect(boost::bind(&SimpleUI::onQuickAccessClicked, this));
m_quickAccess->switchViewToWebPage.connect(boost::bind(&SimpleUI::switchViewToWebPage, this));
#if PROFILE_MOBILE
m_quickAccess->isLandscape.connect(boost::bind(&SimpleUI::isLandscape, this));
}
}
-void SimpleUI::onMostVisitedTileClicked(std::shared_ptr< services::HistoryItem > historyItem, int itemsNumber)
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- m_quickAccess->openDetailPopup(historyItem, m_historyService->getHistoryItemsByURL(historyItem->getUrl(), itemsNumber));
-}
-
void SimpleUI::onClearHistoryAllClicked()
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_quickAccess->setMostVisitedItems(getMostVisitedItems());
}
-void SimpleUI::onBookmarkButtonClicked()
+void SimpleUI::onQuickAccessClicked()
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
//TODO: Elements added here shouldn't be bookmark items, but quick access items.
*/
void onOpenURL(const std::string& url);
void onOpenURL(const std::string& url, const std::string& title, bool desktopMode);
- void onMostVisitedTileClicked(std::shared_ptr<tizen_browser::services::HistoryItem> historyItem, int itemsNumber);
void onClearHistoryAllClicked();
void onDeleteHistoryItems(std::shared_ptr<const std::vector<int>> itemIds);
void onMostVisitedClicked();
- void onBookmarkButtonClicked();
+ void onQuickAccessClicked();
/**
* @brief Handles 'generateThumb' signals.