Tizen 2.1 base
[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 Flora License, Version 1.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://floralicense.org/license/
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         virtual ~_EflLayer(void);
47
48         virtual result OnConstructed(void);
49         virtual result SetBounds(const Tizen::Graphics::FloatRectangle& bounds);
50         virtual Tizen::Graphics::FloatRectangle GetBounds(void) const;
51         virtual result SetShowState(bool show);
52         virtual bool GetShowState(void) const;
53         virtual void Flush(void);
54
55
56         void SetOpacity(float opacity);
57         float GetOpacity(void);
58
59         _RootVisualElement* GetRootVisualElement(void) const
60         {
61                 return _pRootVisualElement;
62         }
63
64         Evas* GetEvas(void) const
65         {
66                 return _pEvas;
67         }
68
69         Ecore_Evas* GetEcoreEvas(void) const
70         {
71                 return _pEcoreEvas;
72         }
73
74         Evas_Object* GetElmWin(void) const
75         {
76                 return _pWindow;
77         }
78
79         void SetEvasRenderNeeded(void)
80         {
81                 _needEvasRender = 1;
82         }
83
84         void SetVisibilityChangeCompleted(void)
85         {
86                 _isVisibilityChangeInProgress = false;
87         }
88
89         bool IsAsyncVisibilityChangeNeeded(void) const
90         {
91                 return _needAsyncVisibilityChangeRequest;
92         }
93
94         void SetAsyncVisibilityChangeNeeded(bool asyncVisibilityChange)
95         {
96                 _needAsyncVisibilityChangeRequest = asyncVisibilityChange;
97         }
98
99 protected:
100         result Initialize(Evas_Object* pWindow);
101         virtual result Configure(_RootVisualElement& rootElement);
102
103 protected:
104         _RootVisualElement* _pRootVisualElement;
105         Evas* _pEvas;
106         Ecore_Evas* _pEcoreEvas;
107         Evas_Object* _pWindow;
108         Ecore_Event_Handler* _pOnWindowDamagedHandler;
109         Ecore_Event_Handler* _pOnWindowConfiguredHandler;
110         Ecore_Event_Handler* _pOnWindowHideHandler;
111         Ecore_Event_Handler* _pOnWindowShowHandler;
112         int _needEvasRender;
113         bool _needShowStateChangeRequest;
114         bool _isShow;
115         bool _isVisibilityChangeInProgress;
116         bool _needAsyncVisibilityChangeRequest;
117
118         static int _countOfLayer;
119 };
120
121 }}} //namespace Tizen { namespace Ui { namespace Animations
122
123 #endif //_FUI_ANIM_INTERNAL_EFL_LAYER_H_