Resolved the AppWidgetLayer crash
[framework/osp/uifw.git] / src / ui / inc / FUiAnim_EflLayer.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        FUiAnim_EflLayer.h
20  * @brief       This is the header file for the _EflLayer class.
21  *
22  * This header file contains the declarations of the _EflLayer class.
23  */
24
25 #ifndef _FUI_ANIM_INTERNAL_EFL_LAYER_H_
26 #define _FUI_ANIM_INTERNAL_EFL_LAYER_H_
27
28 #define ECORE_EVAS_ASYNC_VISIBILITY_BUG_HACK
29
30
31 #include <Ecore_Evas.h>
32 #include <Ecore.h>
33 #include <Ecore_X.h>
34
35 #include <FGrpFloatRectangle.h>
36 #include "FUiAnim_NativeLayer.h"
37
38 namespace Tizen { namespace Ui { namespace Animations
39 {
40
41 class _OSP_EXPORT_ _EflLayer
42         : public _NativeLayer
43 {
44 public:
45         _EflLayer(void);
46         _EflLayer(bool isMainType);
47         virtual ~_EflLayer(void);
48
49         virtual result OnConstructed(void);
50         virtual result SetBounds(const Tizen::Graphics::FloatRectangle& bounds);
51         virtual Tizen::Graphics::FloatRectangle GetBounds(void) const;
52         virtual result SetShowState(bool show);
53         virtual bool GetShowState(void) const;
54         virtual void Flush(void);
55
56
57         void SetOpacity(float opacity);
58         float GetOpacity(void);
59
60         _RootVisualElement* GetRootVisualElement(void) const
61         {
62                 return _pRootVisualElement;
63         }
64
65         Evas* GetEvas(void) const
66         {
67                 return _pEvas;
68         }
69
70         Ecore_Evas* GetEcoreEvas(void) const
71         {
72                 return _pEcoreEvas;
73         }
74
75         Evas_Object* GetElmWin(void) const
76         {
77                 return _pWindow;
78         }
79
80         void SetEvasRenderNeeded(void)
81         {
82                 _needEvasRender = 1;
83         }
84
85         void SetVisibilityChangeCompleted(void)
86         {
87                 _isVisibilityChangeInProgress = false;
88         }
89
90         bool IsAsyncVisibilityChangeNeeded(void) const
91         {
92                 return _needAsyncVisibilityChangeRequest;
93         }
94
95         void SetAsyncVisibilityChangeNeeded(bool asyncVisibilityChange)
96         {
97                 _needAsyncVisibilityChangeRequest = asyncVisibilityChange;
98         }
99
100         void SetRenderNeeded(bool needRender)
101         {
102                 _needRender = needRender;
103         }
104         bool IsRenderNeeded()
105         {
106                 return _needRender;
107         }
108
109 protected:
110         result Initialize(Evas_Object* pWindow);
111         virtual result Configure(_RootVisualElement& rootElement);
112
113 protected:
114         _RootVisualElement* _pRootVisualElement;
115         Evas* _pEvas;
116         Ecore_Evas* _pEcoreEvas;
117         Evas_Object* _pWindow;
118         Ecore_Event_Handler* _pOnWindowDamagedHandler;
119         Ecore_Event_Handler* _pOnWindowConfiguredHandler;
120         Ecore_Event_Handler* _pOnWindowHideHandler;
121         Ecore_Event_Handler* _pOnWindowShowHandler;
122         int _needEvasRender;
123         bool _needShowStateChangeRequest;
124         bool _isShow;
125         bool _isVisibilityChangeInProgress;
126         bool _needAsyncVisibilityChangeRequest;
127         bool _isMainType;
128         bool _needRender;
129
130         static int _countOfLayer;
131
132 private:
133         bool __isWinObject;
134 };
135
136 }}} //namespace Tizen { namespace Ui { namespace Animations
137
138 #endif //_FUI_ANIM_INTERNAL_EFL_LAYER_H_