2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <boost/signals2/signal.hpp>
23 #include "AbstractUIComponent.h"
24 #include "AbstractService.h"
25 #include "ServiceFactory.h"
26 #include "service_macros.h"
27 #include "BookmarkItem.h"
29 namespace tizen_browser{
32 class BROWSER_EXPORT BookmarksUI
33 : public tizen_browser::interfaces::AbstractUIComponent
34 , public tizen_browser::core::AbstractService
39 void init(Evas_Object *main_layout);
40 Evas_Object *getContent();
41 virtual std::string getName();
42 void addBookmarkItem(std::shared_ptr<tizen_browser::services::BookmarkItem>);
43 void addBookmarkItems(std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> >);
44 void removeBookmarkItem(const std::string& uri);
45 void deleteAllItems();
46 std::shared_ptr<tizen_browser::services::BookmarkItem> getSelectedBookmarkItem();
49 boost::signals2::signal<void (std::shared_ptr<tizen_browser::services::BookmarkItem>)> bookmarkClicked;
50 boost::signals2::signal<void (std::shared_ptr<tizen_browser::services::BookmarkItem>)> bookmarkDeleteClicked;
52 static Evas_Object * _grid_content_get(void *data, Evas_Object *obj, const char *part);
53 static void _itemSelected(void * data, Evas_Object * obj, void * event_info);
54 static void _item_deleted(void *data, Evas_Object *obj);
55 static void _thumbSelected(void * data, Evas_Object * obj, void * event_info);
56 static void _deleteBookmark(void *data, Evas_Object *obj, void *event_info);
57 void setEmptyGengrid(bool setEmpty);
60 Evas_Object *m_gengrid;
61 Evas_Object *m_parent;
62 Elm_Gengrid_Item_Class * m_item_class;
63 std::map<std::string,Elm_Object_Item*> m_map_bookmark_views;
65 Evas_Object *createNoBookmarksLabel();
67 static void focusItem(void* data, Evas_Object* obj, void* event_info);
68 static void unFocusItem(void* data, Evas_Object* obj, void* event_info);
75 #endif // BOOKMARKSUI_H