Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiAnim_VisualElementSharedData.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_VisualElementSharedData.h
20  * @brief               This is the header file for the _VisualElementSharedData class.
21  *
22  * This header file contains the declarations of the _VisualElementSharedData class.
23  */
24
25 #ifndef _FUI_ANIM_INTERNAL_VISUAL_ELEMENT_SHAREDDATA_H_
26 #define _FUI_ANIM_INTERNAL_VISUAL_ELEMENT_SHAREDDATA_H_
27
28 #include <FGrpDimension.h>
29
30 #include "FUiAnim_INativeNode.h"
31
32
33 namespace Tizen { namespace Ui { namespace Animations
34 {
35
36 class   IVisualElementAnimationProvider;
37 class   IVisualElementContentProvider;
38 class   IVisualElementEventListener;
39 class   _NativeLayer;
40 class _OSP_EXPORT_ _VisualElementSharedData
41 {
42 public:
43         _VisualElementSharedData(void);
44         virtual ~_VisualElementSharedData(void);
45
46         result Construct(void);
47
48         virtual void AddRef(void);
49         virtual void Release(void);
50         int GetReferenceCount(void) const;
51
52         void LockInvalidate(bool lock);
53         result NodeReconfigure(_VisualElementImpl& presentation, bool surfaceOnly)
54         {
55                 ClearLastResult();
56                 SysTryReturn(NID_UI, pNativeNode, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] The Native Node is not valid.");
57
58                 return pNativeNode->Reconfigure(pSurface, presentation, surfaceOnly);
59         }
60
61         result CreateSurface(const Tizen::Graphics::Dimension& size, _NativeLayer& layer);
62         void RemoveSurface(_VisualElementImpl& presentation);
63         result SetImage(const Tizen::Base::String& fileName);
64
65         bool NeedNativeReconfigure(void) const
66         {
67                 return (invalidatedNativeProps != 0) || surfaceChanged;
68         }
69
70
71 public:
72         int invalidatedNativeProps;
73         bool surfaceChanged;
74         _INativeNode* pNativeNode;
75         VisualElementSurface* pSurface;
76         Tizen::Graphics::FloatRectangle invalidatedRegion;
77         bool drawOnPresentation;
78         bool needSurface;
79         bool redrawOnResize;
80         bool isSurfaceOpaque;
81         bool fixedSurfaceSize;
82         int invalidationLockCount;
83         Tizen::Graphics::FloatRectangle updateRegion;
84
85         IVisualElementAnimationProvider* pAnimationProvider;
86         IVisualElementContentProvider* pContentProvider;
87         IVisualElementEventListener* pEventListener;
88
89         Tizen::Base::String name;
90
91         void* pUserData;
92
93 private:
94         _VisualElementSharedData(const _VisualElementSharedData& rhs);
95         _VisualElementSharedData& operator =(const _VisualElementSharedData& rhs);
96
97 private:
98         int __refCount;
99 };              // _VisualElementSharedData
100
101
102 }}}             // Tizen::Ui::Animations
103
104 #endif //_FUI_ANIM_INTERNAL_VISUAL_ELEMENT_SHAREDDATA_H_
105