2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
18 * @author Jaroslaw Osmanski (j.osmanski@samsung.com)
20 * @brief Window data header file.
23 #ifndef WINDOW_INITIALIZE_H_
24 #define WINDOW_INITIALIZE_H_
26 #include <dpl/framework_efl.h>
30 #include <dpl/noncopyable.h>
34 * Current layout structure
37 * m_platform_layout (elm_layout)
38 * m_navigation (elm_navigation)
39 * m_user_layout (elm_layout)
40 * widget_area (elm_webview)
44 const char *const WRT_OPTION_LABEL_BACKWARD = "Backward";
45 const char *const WRT_OPTION_LABEL_FORWARD = "Forward";
46 const char *const WRT_OPTION_LABEL_RELOAD = "Reload";
47 const char *const WRT_OPTION_LABEL_FULLVIEW = "Full view";
49 const char *const WRT_OPTION_ICON_BACKWARD = "/usr/etc/wrt/icon_left_arrow.png";
50 const char *const WRT_OPTION_ICON_FORWARD = "/usr/etc/wrt/icon_right_arrow.png";
51 const char *const WRT_OPTION_ICON_RELOAD = "/usr/etc/wrt/icon_refresh.png";
52 const char *const WRT_OPTION_ICON_WINDOWVIEW = "/usr/etc/wrt/mp_stop.png";
55 class WindowData : private DPL::Noncopyable
58 typedef void (*CallbackType)(
59 void* data, Evas_Object* obj, void* event_info);
60 typedef void (*EvasCallbackType)(
61 void* data, Evas* evas, Evas_Object* obj, void* event_info);
63 struct EventWithFunction
65 CallbackType function;
66 std::string eventName;
67 EventWithFunction(CallbackType a_function,
68 const char * a_eventName) :
70 eventName(a_eventName)
74 typedef std::vector<EventWithFunction> EventWithFunctionVector;
78 Evas_Object* m_conformant;
85 Evas_Smart_Cb callback;
88 typedef std::list<CtxMenuItem> CtxMenuItems;
90 explicit WindowData(unsigned long pid, bool manualInit=false);
91 virtual ~WindowData();
94 void setEvasObjectForLayout(Evas_Object* evas_object);
95 void unsetEvasObjectForLayout();
96 void addNaviBackButtonCallback(
98 CallbackType callback,
100 void* delNaviBackButtonCallback(
102 CallbackType callBack);
103 void addFloatBackButtonCallback(
105 CallbackType callback,
107 void* delFloatBackButtonCallback(
109 CallbackType callBack);
110 void userlayoutCallbackAdd(
111 const Evas_Callback_Type event,
112 EvasCallbackType callback,
114 void* userlayoutCallbackDel(
115 const Evas_Callback_Type event,
116 EvasCallbackType callback);
117 void emitSignalForUserLayout(
118 const char* emission,
121 void changeViewMode();
122 void createToolbar(CtxMenuItems ctxMenuItems);
125 void createOptionButton();
126 void destroyOptionButton();
130 CtxMenuItems ctxMenuItems);
131 void initFullViewMode();
133 static void moreButtonCallback(void *data,
136 static void changeViewModeCallback(void *data,
139 static void controlHiddenOptionCallback(void *data,
141 const char *emission,
143 static Eina_Bool hideToolbarCallback(void *data);
144 void toggleFullscreen(bool fullscreen);
147 Evas_Object* m_platform_layout;
148 Evas_Object* m_user_layout;
149 Evas_Object* m_navigation;
150 Evas_Object* m_naviBackButton;
151 Evas_Object* m_floatBackButton;
152 bool optionheaderClose;
154 CtxMenuItems m_ctxMenuItems;
155 Ecore_Timer *m_toolbarTimer;
158 Evas_Object* createWindow(unsigned long pid);
159 Evas_Object* createPlatformLayout(Evas_Object* parent);
160 Evas_Object* createNavigationBar(Evas_Object* parent);
161 Evas_Object* createUserLayout(Evas_Object* parent);
162 Evas_Object* createConformant(Evas_Object* parent);
163 Evas_Object* createProgress(Evas_Object* parent);
164 void showHiddenOption(Evas_Object* parent);
165 void hideHiddenOption(Evas_Object* parent);
167 void alignProgressPosition();
168 void toggleIndicator(bool indicator);
169 void createFloatBackButton();
172 #endif /* WINDOW_INITIALIZE_H_ */