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.
17 #ifndef BOOKSMARK_MANAGER_H
18 #define BOOKSMARK_MANAGER_H
20 #include <Elementary.h>
29 #include "MenuButton.h"
31 namespace tizen_browser
36 struct BookmarksManagerItem{
37 std::shared_ptr<Action> action;
38 BookmarksManagerItem();
39 BookmarksManagerItem(std::shared_ptr<Action> action);
40 BookmarksManagerItem(const BookmarksManagerItem& source);
41 BookmarksManagerItem(const BookmarksManagerItem* source);
42 ~BookmarksManagerItem();
46 class BookmarksManager: public MenuButton
49 BookmarksManager(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton);
51 virtual Evas_Object *getContent();
52 virtual ListSize calculateSize();
53 virtual Evas_Object* getFirstFocus();
54 void addAction(sharedAction action);
55 void onEnabledChanged(sharedAction action);
56 void refreshAction(sharedAction action);
57 void setPointerModeEnabled (bool enabled);
61 virtual bool canBeDismissed();
63 static char *gridTextGet(void *data, Evas_Object* obj, const char *part);
64 static Evas_Object *gridOptionLabelGet(void* data, Evas_Object* /*obj*/, const char* part);
65 static void itemClicked(void *data, Evas_Object *o, void *event_info);
66 static void block_clicked(void *data, Evas_Object *obj, void *event_info);
68 void showInternalPopup(Elm_Object_Item* parent);
69 static void dismissedCtxPopup(void* data, Evas_Object* obj, void* event_info);
70 static void radioChanged(void *data, Evas_Object *obj, void *event_info);
74 Evas_Object *m_genlist;
75 Evas_Object *m_internalPopup;
76 Elm_Object_Item *m_trackedItem;
77 Elm_Genlist_Item_Class *m_itemClass;
78 bool m_internalPopupVisible;
79 bool m_pointerModeEnabled;
80 std::map<Elm_Object_Item*, std::shared_ptr<BookmarksManagerItem>> m_bookmarks_managerItemsMap;
81 std::map<sharedAction, Elm_Object_Item*> m_actionButtonMap;
86 CheckState m_checkState;
87 void realShow(Evas_Object* popup);
91 static void focusItem(void* data, Evas_Object* obj, void* event_info);
92 static void unFocusItem(void* data, Evas_Object* obj, void* event_info);
97 }//namespace tizen_browser
99 #endif // BOOKSMARK_MANAGER_H