Set the window name
[platform/framework/native/uifw.git] / src / ui / inc / FUi_EcoreEvas.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FUi_EcoreEvas.h
20  * @brief               This is the header file for the _EcoreEvas class.
21  *
22  * This header file contains the declarations of the %_EcoreEvas class.
23  */
24
25 #ifndef _FUI_INTERNAL_ECORE_EVAS_H_
26 #define _FUI_INTERNAL_ECORE_EVAS_H_
27
28 #include <Ecore_Evas.h>
29 #include <Ecore.h>
30 #include <Ecore_X.h>
31 #include <FBaseErrorDefine.h>
32 #include <FBaseObject.h>
33 #include "FUi_Types.h"
34
35 namespace Tizen { namespace App
36 {
37 class _IActiveWindowEventListener;
38 }} // Tizen::App
39
40 namespace Tizen { namespace Graphics
41 {
42 class Rectangle;
43 class FloatRectangle;
44 }} // Tizen::Graphics
45
46 namespace Tizen { namespace Ui { namespace Animations
47 {
48 class _RootVisualElement;
49 class _NativeLayer;
50 class _EflLayer;
51 }}} // Tizen::Ui::Animations
52
53
54 namespace Tizen { namespace Ui
55 {
56 enum _ClipFormat
57 {
58         _CLIP_FORMAT_TARGETS = -1,
59         _CLIP_FORMAT_NONE = 0x00,
60         _CLIP_FORMAT_TEXT = 0x01,
61         _CLIP_FORMAT_MARKUP = 0x02,
62         _CLIP_FORMAT_IMAGE = 0x04,
63         _CLIP_FORMAT_VCARD = 0x08,
64         _CLIP_FORMAT_HTML = 0x10,
65 };
66
67 enum _IndicatorOpacity
68 {
69         _INDICATOR_OPACITY_UNKNOWN,
70         _INDICATOR_OPACITY_OPAQUE,
71         _INDICATOR_OPACITY_TRANSLUCENT,
72         _INDICATOR_OPACITY_TRANSPARENT,
73 };
74
75 enum _WindowLevel
76 {
77         _WINDOW_LEVEL_UNKNOWN,
78         _WINDOW_LEVEL_NORMAL,
79         _WINDOW_LEVEL_NOTIFICATION_MIDDLE,
80         _WINDOW_LEVEL_NOTIFICATION_HIGH,
81 };
82
83 enum _RenderBackend
84 {
85         _RENDER_BACKEND_DEFAULT,
86         _RENDER_BACKEND_SW,
87         _RENDER_BACKEND_GL,
88 };
89
90 class _Control;
91 class _Window;
92 class _ActiveWindowEvent;
93
94 class _OSP_EXPORT_ _EcoreEvas
95         : public Tizen::Base::Object
96 {
97 public:
98         static _EcoreEvas* CreateInstanceN(void);
99         virtual ~_EcoreEvas(void);
100
101         unsigned int GetActiveWindow(void);
102         int GetProcessId(unsigned int window);
103         void SetRenderBackend(_RenderBackend backend);
104         _RenderBackend GetRenderBackend(void);
105         void SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner);
106         void SetOwner(const _Window& ownee, const _Control& owner);
107
108         void ActivateWindow(const _Window& window);
109         void MinimizeWindow(_Window& window);
110
111         void RotateWindow(const _Window& window, int orientation, bool rotateEvas = true);
112         int GetWindowRotation(const _Window& window);
113         void SetWindowPreferredRotation(const _Window& window, int rotation);
114         void SetWindowAvailabledRotation(const _Window& window, int* rotations, unsigned int count);
115         void RegisterWindowStateCallback(const _Window& window);
116         void SetWindowRotationBounds(const _Window& window, int rotation, const Tizen::Graphics::Rectangle& bounds);
117         void SetWindowRotationBounds(const _Window& window, int rotation, const Tizen::Graphics::FloatRectangle& bounds);
118
119         void SetWindowName(const _Window& window, const Tizen::Base::String& name);
120         void SetWindowType(const _Window& window, int winType);
121         result SetFloatingMode(const _Window& window, bool enable);
122         bool GetFloatingMode(const _Window& window) const;
123         void SetWindowActivationEnabled(const _Window& window, bool enable);
124         bool IsWindowActivationEnabled(const _Window& window);
125         void SetWindowLevel(const _Window& window, _WindowLevel level);
126         _WindowLevel GetWindowLevel(const _Window& window) const;
127         void SetWindowBounds(const _Window& window, const Tizen::Graphics::Rectangle& bounds);
128         void SetWindowBounds(const _Window& window, const Tizen::Graphics::FloatRectangle& bounds);
129         void SetWindowVisibleState(const _Window& window, bool visibleState);
130         void AllowSetWindowBounds(bool allow);
131         bool IsWindowVisible(const _Window& window);
132
133         result SetEventPropagation(const _Control& control, bool enable);
134         result SetFocus(const _Control& control, bool focus);
135
136         result SetIndicatorShowState(const _Window& window, bool showState);
137         bool GetIndicatorShowState(const _Window& window) const;
138
139         result CopyClip(_ClipFormat format, const char* pChar);
140         bool RetrieveClipN(int index, int* format, char** pData);
141         int GetClipCount(void) const;
142         bool GetSelectedCbhmItem(Ecore_X_Atom* pDataType, char** pBuffer) const;
143         void OpenClipboard(unsigned long clipFormats);
144         void CloseClipboard(void);
145         bool IsClipboardOpened(void);
146
147         bool IsAccessibilityScreenReaderActivated(void);
148
149         // [ToDo] Remove API
150         bool GetFloatingMode(void) const;
151         Tizen::Graphics::Rectangle GetIndicatorBounds(const _Window& window) const;
152         result SetIndicatorOpacity(const _Window& window, _IndicatorOpacity opacity);
153         _IndicatorOpacity GetIndicatorOpacity(const _Window& window) const;
154         void AddActiveWindowEventListener(const Tizen::App::_IActiveWindowEventListener& listener);
155         void RemoveActiveWindowEventListener(const Tizen::App::_IActiveWindowEventListener& listener);
156         Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void)const;
157         void SetFrame(const _Control& control);
158         const _Control* GetFrame(void) const;
159         Evas* GetEvas(void) const;
160         Ecore_Evas* GetEcoreEvas(void) const;
161         Evas_Object* GetWindowObject(void) const;
162         Ecore_X_Window GetXWindow(void) const;
163         void SetQuickPanelScrollEnabled(const _Window& window, bool enable);
164         bool IsQuickPanelScrollEnabled(const _Window& window);
165
166 private:
167         Tizen::Ui::Animations::_EflLayer* GetEflLayer(const _Window& window) const;
168         _EcoreEvas(void);
169
170         result InitializeAtomList(void);
171         bool IsValidClipFormat(_ClipFormat clipFormat);
172         Ecore_X_Window GetCbhmWindow(void) const;
173         bool SendCbhmMessage(Ecore_X_Window xwin, const char* pMsg);
174         bool SetCbhmItem(Ecore_X_Window xwin, Ecore_X_Atom dataType, char* pItemData);
175         void* GetCbhmReply(Ecore_X_Window xwin, Ecore_X_Atom property, Ecore_X_Atom* pDataType, int* pNum) const;
176         int GetCbhmItemCount(void) const;
177         bool GetCbhmItem(int index, Ecore_X_Atom* pDataType, char** pBuffer) const;
178
179         _EcoreEvas(const _EcoreEvas& rhs);
180         _EcoreEvas& operator =(const _EcoreEvas& rhs);
181
182 private:
183         Ecore_Event_Handler* __pWindowVisibilityChanged;
184         Ecore_Event_Handler* __pWindowPropertyChanged;
185         Ecore_Event_Handler* __pWindowShown;
186         Ecore_Event_Handler* __pClientMessageReceived;
187         Ecore_Event_Handler* __pClearClip;
188         Ecore_Event_Handler* __pNotifyClip;
189         Ecore_Event_Handler* __pClipboardClosed;
190
191         Evas* __pEvas;
192         Evas_Object* __pForegroundWindow;
193         const _Control* __pFrame;
194         bool __changeBounds;
195         bool __openClipboard;
196 }; // _EcoreEvas
197
198 }} // Tizen::Ui
199
200 #endif // _FUI_INTERNAL_ECORE_EVAS_H_