Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiAnim_VisualElementImpl.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_VisualElementImpl.h
20  * @brief       This is the header file for the _VisualElementImpl class.
21  *
22  * This header file contains the declarations of the _VisualElementImpl class.
23  */
24
25 #ifndef _FUI_ANIM_INTERNAL_VISUAL_ELEMENT_IMPL_H_
26 #define _FUI_ANIM_INTERNAL_VISUAL_ELEMENT_IMPL_H_
27
28 #include <FBaseString.h>
29 #include <FBaseColArrayList.h>
30 #include <FGrpFloatMatrix4.h>
31 #include <FGrpCanvas.h>
32 #include <FGrpRectangle.h>
33 #include <FGrpFloatPoint.h>
34 #include <FGrpFloatDimension.h>
35 #include <FGrpFloatRectangle.h>
36 #include <FUiAnimVisualElementAnimation.h>
37 #include <FUiAnimVisualElementSurface.h>
38 #include <FUiAnimVisualElement.h>
39
40
41 #include "FUi_PropertyBase.h"
42
43 #include "FUiAnim_RootVisualElement.h"
44 #include "FUiAnim_VisualElementSharedData.h"
45 #include "FUiAnim_TransformMatrix3Df.h"
46 #include "FUiAnim_VisualElementCoordinateSystem.h"
47
48 #define SUPPORT_CUSTOMIZING_ATTACH_DETACH_ANIMATION
49
50 namespace Tizen { namespace Ui
51 {
52 class _ControlImpl;
53 class _ControlManagerImpl;
54 class _EflUiEventManager;
55 }}
56
57 namespace Tizen { namespace Ui { namespace Controls
58 {
59 class _FrameImpl;
60 }}}
61
62 namespace Tizen { namespace Web { namespace Controls
63 {
64 class _WebImpl;
65 }}}
66
67 namespace Tizen { namespace Ui { namespace Animations
68 {
69
70 class _IVisualElementObserver;
71 class IVisualElementAnimationProvider;
72 class IVisualElementContentProvider;
73 class IVisualElementEventListener;
74 class _AnimationManager;
75
76
77 extern const wchar_t* VePropBounds;
78 extern const wchar_t* VePropContentBounds;
79 extern const wchar_t* VePropContentOpacity;
80 extern const wchar_t* VePropRenderOperation;
81 extern const wchar_t* VePropOpacity;
82 extern const wchar_t* VePropShowState;
83 extern const wchar_t* VePropAnchor;
84 extern const wchar_t* VePropAnchorZ;
85 extern const wchar_t* VePropTransform;
86 extern const wchar_t* VePropChildrenTransform;
87 extern const wchar_t* VePropZPosition;
88 extern const wchar_t* VePropZOrderGroup;
89 extern const wchar_t* VePropClipToParent;
90 extern const wchar_t* VePropClipChildren;
91 extern const wchar_t* VePropName;
92 extern const wchar_t* VePropSurfaceOpaque;
93 extern const wchar_t* VePropPropertyPropagationEnabled;
94 extern const wchar_t* VePropImplicitAnimationEnabled;
95
96 #if defined(SUPPORT_CUSTOMIZING_ATTACH_DETACH_ANIMATION)
97 extern const wchar_t* VePropActionDetach;
98 extern const wchar_t* VePropActionInsert;
99 #endif
100
101 extern const wchar_t* VeSubPropBounds;
102 extern const wchar_t* VeSubPropBoundsPosition;
103 extern const wchar_t* VeSubPropBoundsSize;
104
105 extern const wchar_t* VeSubPropTransform;
106 extern const wchar_t* VeSubPropTransformRotationX;
107 extern const wchar_t* VeSubPropTransformRotationY;
108 extern const wchar_t* VeSubPropTransformRotationZ;
109 extern const wchar_t* VeSubPropTransformScaleX;
110 extern const wchar_t* VeSubPropTransformScaleY;
111 extern const wchar_t* VeSubPropTransformScaleZ;
112 extern const wchar_t* VeSubPropTransformTranslationX;
113 extern const wchar_t* VeSubPropTransformTranslationY;
114 extern const wchar_t* VeSubPropTransformTranslationZ;
115 extern const wchar_t* VeSubPropTransformRotationAnchorX;
116 extern const wchar_t* VeSubPropTransformRotationAnchorY;
117 extern const wchar_t* VeSubPropTransformRotationAnchorZ;
118 extern const wchar_t* VeSubPropTransformScaleAnchorX;
119 extern const wchar_t* VeSubPropTransformScaleAnchorY;
120 extern const wchar_t* VeSubPropTransformScaleAnchorZ;
121
122 extern const wchar_t* VeSubPropTransformRotationXY;
123 extern const wchar_t* VeSubPropTransformScaleXY;
124 extern const wchar_t* VeSubPropTransformTranslationXY;
125 extern const wchar_t* VeSubPropTransformRotationAnchorXY;
126 extern const wchar_t* VeSubPropTransformScaleAnchorXY;
127
128 extern const wchar_t* VeSubPropChildrenTransform;
129 extern const wchar_t* VeSubPropChildrenTransformRotationX;
130 extern const wchar_t* VeSubPropChildrenTransformRotationY;
131 extern const wchar_t* VeSubPropChildrenTransformRotationZ;
132 extern const wchar_t* VeSubPropChildrenTransformScaleX;
133 extern const wchar_t* VeSubPropChildrenTransformScaleY;
134 extern const wchar_t* VeSubPropChildrenTransformScaleZ;
135 extern const wchar_t* VeSubPropChildrenTransformTranslationX;
136 extern const wchar_t* VeSubPropChildrenTransformTranslationY;
137 extern const wchar_t* VeSubPropChildrenTransformTranslationZ;
138 extern const wchar_t* VeSubPropChildrenTransformRotationAnchorX;
139 extern const wchar_t* VeSubPropChildrenTransformRotationAnchorY;
140 extern const wchar_t* VeSubPropChildrenTransformRotationAnchorZ;
141 extern const wchar_t* VeSubPropChildrenTransformScaleAnchorX;
142 extern const wchar_t* VeSubPropChildrenTransformScaleAnchorY;
143 extern const wchar_t* VeSubPropChildrenTransformScaleAnchorZ;
144
145 extern const wchar_t* VeSubPropChildrenTransformRotationXY;
146 extern const wchar_t* VeSubPropChildrenTransformScaleXY;
147 extern const wchar_t* VeSubPropChildrenTransformTranslationXY;
148 extern const wchar_t* VeSubPropChildrenTransformRotationAnchorXY;
149 extern const wchar_t* VeSubPropChildrenTransformScaleAnchorXY;
150
151 extern const wchar_t* VePrivPropShowOpacity;
152
153
154 extern Tizen::Base::String* pVePropBounds;
155 extern Tizen::Base::String* pVePropContentBounds;
156 extern Tizen::Base::String* pVePropContentOpacity;
157 extern Tizen::Base::String* pVePropRenderOperation;
158 extern Tizen::Base::String* pVePropOpacity;
159 extern Tizen::Base::String* pVePropShowState;
160 extern Tizen::Base::String* pVePropAnchor;
161 extern Tizen::Base::String* pVePropAnchorZ;
162 extern Tizen::Base::String* pVePropTransform;
163 extern Tizen::Base::String* pVePropChildrenTransform;
164 extern Tizen::Base::String* pVePropZPosition;
165 extern Tizen::Base::String* pVePropZOrderGroup;
166 extern Tizen::Base::String* pVePropClipToParent;
167 extern Tizen::Base::String* pVePropClipChildren;
168 extern Tizen::Base::String* pVePropName;
169 extern Tizen::Base::String* pVePropSurfaceOpaque;
170 extern Tizen::Base::String* pVePropPropertyPropagationEnabled;
171 extern Tizen::Base::String* pVePropImplicitAnimationEnabled;
172
173 #if defined(SUPPORT_CUSTOMIZING_ATTACH_DETACH_ANIMATION)
174 extern Tizen::Base::String* pVePropActionDetach;
175 extern Tizen::Base::String* pVePropActionAttach;
176 #endif
177
178 extern Tizen::Base::String* pVeSubPropBounds;
179 extern Tizen::Base::String* pVeSubPropBoundsPosition;
180 extern Tizen::Base::String* pVeSubPropBoundsSize;
181
182 extern Tizen::Base::String* pVeSubPropTransform;
183 extern Tizen::Base::String* pVeSubPropTransformRotationX;
184 extern Tizen::Base::String* pVeSubPropTransformRotationY;
185 extern Tizen::Base::String* pVeSubPropTransformRotationZ;
186 extern Tizen::Base::String* pVeSubPropTransformScaleX;
187 extern Tizen::Base::String* pVeSubPropTransformScaleY;
188 extern Tizen::Base::String* pVeSubPropTransformScaleZ;
189 extern Tizen::Base::String* pVeSubPropTransformTranslationX;
190 extern Tizen::Base::String* pVeSubPropTransformTranslationY;
191 extern Tizen::Base::String* pVeSubPropTransformTranslationZ;
192 extern Tizen::Base::String* pVeSubPropTransformRotationAnchorX;
193 extern Tizen::Base::String* pVeSubPropTransformRotationAnchorY;
194 extern Tizen::Base::String* pVeSubPropTransformRotationAnchorZ;
195 extern Tizen::Base::String* pVeSubPropTransformScaleAnchorX;
196 extern Tizen::Base::String* pVeSubPropTransformScaleAnchorY;
197 extern Tizen::Base::String* pVeSubPropTransformScaleAnchorZ;
198
199 extern Tizen::Base::String* pVeSubPropTransformRotationXY;
200 extern Tizen::Base::String* pVeSubPropTransformScaleXY;
201 extern Tizen::Base::String* pVeSubPropTransformTranslationXY;
202 extern Tizen::Base::String* pVeSubPropTransformRotationAnchorXY;
203 extern Tizen::Base::String* pVeSubPropTransformScaleAnchorXY;
204
205 extern Tizen::Base::String* pVeSubPropChildrenTransform;
206 extern Tizen::Base::String* pVeSubPropChildrenTransformRotationX;
207 extern Tizen::Base::String* pVeSubPropChildrenTransformRotationY;
208 extern Tizen::Base::String* pVeSubPropChildrenTransformRotationZ;
209 extern Tizen::Base::String* pVeSubPropChildrenTransformScaleX;
210 extern Tizen::Base::String* pVeSubPropChildrenTransformScaleY;
211 extern Tizen::Base::String* pVeSubPropChildrenTransformScaleZ;
212 extern Tizen::Base::String* pVeSubPropChildrenTransformTranslationX;
213 extern Tizen::Base::String* pVeSubPropChildrenTransformTranslationY;
214 extern Tizen::Base::String* pVeSubPropChildrenTransformTranslationZ;
215 extern Tizen::Base::String* pVeSubPropChildrenTransformRotationAnchorX;
216 extern Tizen::Base::String* pVeSubPropChildrenTransformRotationAnchorY;
217 extern Tizen::Base::String* pVeSubPropChildrenTransformRotationAnchorZ;
218 extern Tizen::Base::String* pVeSubPropChildrenTransformScaleAnchorX;
219 extern Tizen::Base::String* pVeSubPropChildrenTransformScaleAnchorY;
220 extern Tizen::Base::String* pVeSubPropChildrenTransformScaleAnchorZ;
221
222 extern Tizen::Base::String* pVeSubPropChildrenTransformRotationXY;
223 extern Tizen::Base::String* pVeSubPropChildrenTransformScaleXY;
224 extern Tizen::Base::String* pVeSubPropChildrenTransformTranslationXY;
225 extern Tizen::Base::String* pVeSubPropChildrenTransformRotationAnchorXY;
226 extern Tizen::Base::String* pVeSubPropChildrenTransformScaleAnchorXY;
227
228 extern Tizen::Base::String* pVePrivPropShowOpacity;
229
230
231 /**
232 * @class        _VisualElementImpl
233 * @brief        This class provides methods to control VisualElement.
234 * @since 2.0
235 */
236
237
238 class _OSP_EXPORT_ _VisualElementImpl
239         : public Tizen::Ui::_PropertyBase
240 {
241         DECLARE_CLASS_BEGIN(_VisualElementImpl, Tizen::Ui::_PropertyBase);
242         DECLARE_PROPERTY(VePropBounds, GetBoundsProperty, SetBoundsProperty);
243         DECLARE_PROPERTY(VeSubPropBoundsPosition, GetBoundsPositionSubProperty, SetBoundsPositionSubProperty);
244         DECLARE_PROPERTY(VeSubPropBoundsSize, GetBoundsSizeSubProperty, SetBoundsSizeSubProperty);
245         DECLARE_PROPERTY(VePropRenderOperation, GetRenderOperationProperty, SetRenderOperationProperty);
246         DECLARE_PROPERTY(VePropContentBounds, GetContentBoundsProperty, SetContentBoundsProperty);
247         DECLARE_PROPERTY(VePropContentOpacity, GetContentOpacityProperty, SetContentOpacityProperty);
248         DECLARE_PROPERTY(VePropOpacity, GetOpacityProperty, SetOpacityProperty);
249         DECLARE_PROPERTY(VePropShowState, GetShowStateProperty, SetShowStateProperty);
250         DECLARE_PROPERTY(VePropAnchor, GetAnchorProperty, SetAnchorProperty);
251         DECLARE_PROPERTY(VePropAnchorZ, GetAnchorZProperty, SetAnchorZProperty);
252         DECLARE_PROPERTY(VePropTransform, GetTransformMatrixProperty, SetTransformMatrixProperty);
253         DECLARE_PROPERTY(VeSubPropTransformRotationX, GetTransformRotationXSubProperty, SetTransformRotationXSubProperty);
254         DECLARE_PROPERTY(VeSubPropTransformRotationY, GetTransformRotationYSubProperty, SetTransformRotationYSubProperty);
255         DECLARE_PROPERTY(VeSubPropTransformRotationZ, GetTransformRotationZSubProperty, SetTransformRotationZSubProperty);
256         DECLARE_PROPERTY(VeSubPropTransformRotationAnchorXY, GetTransformRotationAnchorXYSubProperty, SetTransformRotationAnchorXYSubProperty);
257         DECLARE_PROPERTY(VeSubPropTransformRotationXY, GetTransformRotationXYSubProperty, SetTransformRotationXYSubProperty);
258         DECLARE_PROPERTY(VeSubPropTransformScaleX, GetTransformScaleXSubProperty, SetTransformScaleXSubProperty);
259         DECLARE_PROPERTY(VeSubPropTransformScaleY, GetTransformScaleYSubProperty, SetTransformScaleYSubProperty);
260         DECLARE_PROPERTY(VeSubPropTransformScaleZ, GetTransformScaleZSubProperty, SetTransformScaleZSubProperty);
261         DECLARE_PROPERTY(VeSubPropTransformScaleAnchorXY, GetTransformScaleAnchorXYSubProperty, SetTransformScaleAnchorXYSubProperty);
262         DECLARE_PROPERTY(VeSubPropTransformScaleXY, GetTransformScaleXYSubProperty, SetTransformScaleXYSubProperty);
263         DECLARE_PROPERTY(VeSubPropTransformTranslationX, GetTransformTranslationXSubProperty, SetTransformTranslationXSubProperty);
264         DECLARE_PROPERTY(VeSubPropTransformTranslationY, GetTransformTranslationYSubProperty, SetTransformTranslationYSubProperty);
265         DECLARE_PROPERTY(VeSubPropTransformTranslationZ, GetTransformTranslationZSubProperty, SetTransformTranslationZSubProperty);
266         DECLARE_PROPERTY(VeSubPropTransformTranslationXY, GetTransformTranslationXYSubProperty, SetTransformTranslationXYSubProperty);
267         DECLARE_PROPERTY(VePropChildrenTransform, GetChildrenTransformMatrixProperty, SetChildrenTransformMatrixProperty);
268         DECLARE_PROPERTY(VeSubPropChildrenTransformRotationX, GetChildrenTransformRotationXSubProperty, SetChildrenTransformRotationXSubProperty);
269         DECLARE_PROPERTY(VeSubPropChildrenTransformRotationY, GetChildrenTransformRotationYSubProperty, SetChildrenTransformRotationYSubProperty);
270         DECLARE_PROPERTY(VeSubPropChildrenTransformRotationZ, GetChildrenTransformRotationZSubProperty, SetChildrenTransformRotationZSubProperty);
271         DECLARE_PROPERTY(VeSubPropChildrenTransformRotationAnchorXY, GetChildrenTransformRotationAnchorXYSubProperty, SetChildrenTransformRotationAnchorXYSubProperty);
272         DECLARE_PROPERTY(VeSubPropChildrenTransformRotationXY, GetChildrenTransformRotationXYSubProperty, SetChildrenTransformRotationXYSubProperty);
273         DECLARE_PROPERTY(VeSubPropChildrenTransformScaleX, GetChildrenTransformScaleXSubProperty, SetChildrenTransformScaleXSubProperty);
274         DECLARE_PROPERTY(VeSubPropChildrenTransformScaleY, GetChildrenTransformScaleYSubProperty, SetChildrenTransformScaleYSubProperty);
275         DECLARE_PROPERTY(VeSubPropChildrenTransformScaleZ, GetChildrenTransformScaleZSubProperty, SetChildrenTransformScaleZSubProperty);
276         DECLARE_PROPERTY(VeSubPropChildrenTransformScaleAnchorXY, GetChildrenTransformScaleAnchorXYSubProperty, SetChildrenTransformScaleAnchorXYSubProperty);
277         DECLARE_PROPERTY(VeSubPropChildrenTransformScaleXY, GetChildrenTransformScaleXYSubProperty, SetChildrenTransformScaleXYSubProperty);
278         DECLARE_PROPERTY(VeSubPropChildrenTransformTranslationX, GetChildrenTransformTranslationXSubProperty, SetChildrenTransformTranslationXSubProperty);
279         DECLARE_PROPERTY(VeSubPropChildrenTransformTranslationY, GetChildrenTransformTranslationYSubProperty, SetChildrenTransformTranslationYSubProperty);
280         DECLARE_PROPERTY(VeSubPropChildrenTransformTranslationZ, GetChildrenTransformTranslationZSubProperty, SetChildrenTransformTranslationZSubProperty);
281         DECLARE_PROPERTY(VeSubPropChildrenTransformTranslationXY, GetChildrenTransformTranslationXYSubProperty, SetChildrenTransformTranslationXYSubProperty);
282         DECLARE_PROPERTY(VePropZPosition, GetZPositionProperty, SetZPositionProperty);
283         DECLARE_PROPERTY(VePropZOrderGroup, GetZOrderGroupProperty, SetZOrderGroupProperty);
284         DECLARE_PROPERTY(VePropClipToParent, GetClipToParentProperty, SetClipToParentProperty);
285         DECLARE_PROPERTY(VePropClipChildren, GetClipChildrenProperty, SetClipChildrenProperty);
286         DECLARE_PROPERTY(VePropName, GetNameProperty, SetNameProperty);
287         DECLARE_PROPERTY(VePropSurfaceOpaque, GetSurfaceOpaqueProperty, SetSurfaceOpaqueProperty);
288         DECLARE_PROPERTY(VePropImplicitAnimationEnabled, GetImplicitAnimationProperty, SetImplicitAnimationProperty);
289         DECLARE_PROPERTY(VePropPropertyPropagationEnabled, GetPropertyPropagationProperty, SetPropertyPropagationProperty);
290
291         // private and internal property
292         DECLARE_PROPERTY(VePrivPropShowOpacity, GetShowOpacityPrivateProperty, SetShowOpacityPrivateProperty);
293         DECLARE_CLASS_END();
294
295
296 public:
297         IVisualElementAnimationProvider* GetAnimationProvider(void) const;
298
299         result SetAnimationProvider(IVisualElementAnimationProvider* pProvider);
300
301         IVisualElementContentProvider* GetContentProvider(void) const;
302
303         result SetContentProvider(IVisualElementContentProvider* pProvider);
304
305         IVisualElementEventListener* GetVisualElementEventListener(void) const;
306
307         result SetVisualElementEventListener(IVisualElementEventListener* pListener);
308
309         static _VisualElementImpl* GetInstance(VisualElement& element)
310         {
311                 return element._pVisualElementImpl;
312         }
313
314         static const _VisualElementImpl* GetInstance(const VisualElement& element)
315         {
316                 return element._pVisualElementImpl;
317         }
318
319         static result FlushI(void);
320
321         static const int Z_ORDER_GROUP_ALWAYS_BELOW_BOTTOM = -1000; // lowest drawing gadget.(Background)
322         static const int Z_ORDER_GROUP_NORMAL = 0;                  // level of the default group.
323         static const int Z_ORDER_GROUP_ALWAYS_ON_TOP = 1000;        // highest drawing gadget.
324
325         result SetZOrderGroup(int zorderGroup);
326         int GetZOrderGroup(void) const;
327
328         VisualElementSurface* GetSurfaceN(void) const;
329         result SetSurface(const VisualElementSurface* pSurface);
330
331         result SetContentBounds(const Tizen::Graphics::FloatRectangle& contentBounds);
332         Tizen::Graphics::FloatRectangle GetContentBounds(void) const;
333
334         /**
335          * Checks whether the back buffer is enabled or not.
336          *
337          * @since               2.0
338          * @return              @c true if the back buffer is enabled @n
339          *              @c false, otherwise
340          */
341         bool GetBackBufferEnabled(void) const;
342
343         /**
344          * Sets whether the back buffer is enabled or not.
345          *
346          * @since               2.0
347          * @return              An error code.
348          * @param[in]   enabled                 Set to @c true if need to enable the back buffer @n
349          *                              @c false, otherwise
350          */
351         result SetBackBufferEnabled(bool enabled);
352
353         /**
354          * Checks whether the VisualElement will be redrawn or not when resized.
355          *
356          * @since               2.0
357          * @return              @c true if the VisualElement is redrawn @n
358          *              @c false, otherwise
359          */
360         bool GetRedrawOnResizeEnabled(void) const;
361
362         /**
363          * Sets whether the VisualElement is redrawn or not when resized.
364          *
365          * @since               2.0
366          * @return              An error code.
367          * @param[in]   enabled                 Set to @c true if need to redraw the VisualElement when resized @n
368          *                              @c false, otherwise
369          */
370         result SetRedrawOnResizeEnabled(bool enabled);
371
372         /**
373          * Gets the bounding box information of the VisualElement.
374          *
375          * @since               2.0
376          * @return              Rectangular coordinates.
377          */
378         Tizen::Graphics::FloatRectangle GetBoundingBox(void) const;
379
380         Tizen::Graphics::FloatRectangle GetBounds(void) const;
381         result SetBounds(const Tizen::Graphics::FloatRectangle& bounds);
382
383         float GetZPosition(void) const;
384         result SetZPosition(float zPosition);
385
386         bool IsVisible(void) const;
387         bool GetShowState(void) const;
388         result SetShowState(bool show);
389
390         /**
391          * Gets the current opacity of the VisualElement.
392          *
393          * @since               2.0
394          * @return              The opacity of the VisualElement.
395          * @exception   E_SUCCESS                       The method was successful.
396          * @exception   E_INVALID_STATE         This instance is in an invalid state.
397          * @see                 SetOpacity()
398          */
399         float GetContentOpacity(void) const;
400
401         /**
402          * Changes the opacity of the VisualElement.
403          *
404          * @since               2.0
405          * @return              An error code
406          * @param[in]   contentOpacity          The new opacity.
407          * @exception   E_SUCCESS                       The method was successful.
408          * @exception   E_INVALID_STATE         This instance is in an invalid state.
409          * @see                 GetOpacity()
410          *
411          */
412         result SetContentOpacity(float contentOpacity);
413
414         /**
415          * Gets absolute opacity of the VisualElement .
416          *
417          * @since               2.0
418          * @return              0.0 ~ 1.0 multiplied by parent's absolute opacity.
419          * @exception   E_SUCCESS                       The method was successful.
420          * @exception   E_INVALID_STATE         This instance is in an invalid state.
421          */
422         float GetOpacityFromRoot(void) const;
423
424         float GetOpacity(void) const;
425         result SetOpacity(float opacity);
426
427         Tizen::Graphics::FloatPoint GetAnchor(void) const;
428         result SetAnchor(const Tizen::Graphics::FloatPoint& anchor);
429
430         float GetAnchorZ(void) const;
431         result SetAnchorZ(float anchorZ);
432
433         Tizen::Graphics::FloatMatrix4 GetTransformMatrix(void) const;
434         result SetTransformMatrix(const Tizen::Graphics::FloatMatrix4& xform);
435
436         Tizen::Graphics::FloatMatrix4 GetChildrenTransformMatrix(void) const;
437         result SetChildrenTransformMatrix(const Tizen::Graphics::FloatMatrix4& xform);
438
439         /**
440          * Checks whether the VisualElement has been clipped to parent or not.
441          *
442          * @since               2.0
443          * @return              @c true, if the VisualElement has been clipped @n
444          *              @c false, otherwise
445          * @exception   E_SUCCESS                       The method was successful.
446          * @exception   E_INVALID_STATE         This instance is in an invalid state.
447          * @see                 SetClipToParent()
448          */
449         bool IsClipToParent(void) const;
450
451         /**
452          * Changes the clipping state of the VisualElement.
453          *
454          * @since               2.0
455          * @return              An error code
456          * @param[in]   clipToParent    Set to @c true if need to be clipped to the parent VisualElement @n
457          *                              @c false, otherwise
458          * @exception   E_SUCCESS                       The method was successful.
459          * @exception   E_INVALID_STATE         This instance is in an invalid state.
460          * @see                 IsClipToParent()
461          *
462          */
463         result SetClipToParent(bool clipToParent);
464
465         bool IsClipChildrenEnabled(void) const;
466         result SetClipChildrenEnabled(bool clipChildren);
467
468         /**
469          * Gets the Root of the VisualElementImpl.
470          *
471          * @since               2.0
472          * @return              The root of the VisualElement
473          * @exception   E_SUCCESS                       The method was successful.
474          * @exception   E_INVALID_STATE         This instance is in an invalid state.
475          */
476         _VisualElementImpl* GetRoot(void) const;
477
478
479         /**
480          * Gets the Root of the VisualElement.
481          *
482          * @since               2.0
483          * @return              The root of the VisualElement. The return type is _RootVisualElement.
484          * @exception   E_SUCCESS                       The method was successful.
485          * @exception   E_INVALID_STATE         This instance is in an invalid state.
486          */
487
488         _RootVisualElement* GetRootPublic(void) const
489         {
490                 if (unlikely(IsPropsInvalidated(HIERARCHY_PROPERTY_COORDINATES)))
491                 {
492                         const_cast< _VisualElementImpl* >(this)->RebuildCoordinates();
493                 }
494
495                 if (unlikely(!__pRoot))
496                         return null;
497
498                 return dynamic_cast< _RootVisualElement* >(__pRoot->__pPublicInstance);
499         }
500
501         _VisualElementImpl* GetParent(void) const;
502
503         int GetChildrenCount(void) const;
504         Tizen::Base::Collection::IList* GetPublicChildrenN(void) const;
505
506         bool IsChildOf(const _VisualElementImpl& element) const;
507         result SetZOrder(const _VisualElementImpl* pReference, bool above);
508
509         result AddChild(_VisualElementImpl& child);
510         result InsertChild(_VisualElementImpl& child, const _VisualElementImpl* pReference, bool above);
511         result RemoveChild(_VisualElementImpl& child, bool deallocate = false);
512
513         Tizen::Base::String GetName(void) const;
514         result SetName(const Tizen::Base::String& name);
515
516         result SetUserData(void* pUserData);
517         void* GetUserData(void) const;
518
519         _VisualElementImpl* GetChild(const Tizen::Base::String& name, bool searchAllDescendants) const;
520
521         result SetFlushNeeded(void);
522         result Flush(void);
523         result InvalidateRectangle(const Tizen::Graphics::FloatRectangle* pRectangle);
524
525         /**
526          * Gets the rectangular region information was invalidated.
527          *
528          * @since               2.0
529          * @return              The rectangular region information was invalidated.
530          */
531         Tizen::Graphics::FloatRectangle GetInvalidatedRectangle(void) const;
532         Tizen::Graphics::FloatRectangle GetUpdateRectangle(void) const;
533
534         /**
535          * Checks whether the VisualElement is opaque or not.
536          *
537          * @since               2.0
538          * @return              @c true, if the VisualElement is opaque @n
539          *              @c false, otherwise
540          */
541         virtual bool IsOpaque(void) const;
542
543         /**
544          * Checks whether the surface is opaque or not.
545          *
546          * @since               2.0
547          * @return              @c true, if the surface is opaque @n
548          *              @c false, otherwise
549          */
550         bool IsSurfaceOpaque(void) const;
551
552         /**
553          * Changes the opaque of the surface.
554          *
555          * @since               2.0
556          * @return              An error code
557          * @param[in]   isSurfaceOpaque         The new show state.
558          * @exception   E_SUCCESS                       The method was successful.
559          * @see                 IsSurfaceOpaque()
560          *
561          */
562         result SetSurfaceOpaque(bool isSurfaceOpaque);
563
564         result Draw(void);
565         Tizen::Graphics::Canvas* GetCanvasN(void);
566         Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds);
567
568         /**
569          * Gets the top-most child VisualElement indicated by @c point.
570          *
571          * @since               2.0
572          * @return              the child VisualElement indicated by point.
573          * @param[in]   point                           The position to find the child VisualElement.
574          */
575         _VisualElementImpl* GetChildAt(const Tizen::Graphics::FloatPoint& point);
576
577         result ConvertCoordinates(Tizen::Graphics::FloatPoint& point, const _VisualElementImpl* pFromElement) const;
578         result ConvertCoordinates(Tizen::Graphics::FloatRectangle& rectangle, const _VisualElementImpl* pFromElement) const;
579
580         /**
581          * Converts the specified four 3-dimensional coordinates @c (x, y, z) in @c pFromVisualElement coordinate space to this instance's coordinate space.
582          *
583          * @since                       2.0
584          *
585          * @return                      An error code
586          * @param[in,out]       x                                       The values of X-axis to be converted.
587          * @param[in,out]       y                                       The values of Y-axis to be converted.
588          * @param[in,out]       z                                       The values of Z-axis to be converted.
589          * @param[in]           count                           The number of coordinates in the @c (x, y, z) array.
590          * @param[in]           pFromVisualElement      The %VisualElement instance with @c (x, y, z) in its coordinate space.
591          * @exception           E_SUCCESS                       The method is successful.
592          * @exception           E_INVALID_ARG           The input parameter is incorrect.
593          * @exception           E_SYSTEM                        A system error has occurred.
594          * @remarks                     This instance and @c pFromVisualElement must share a common parent.@n
595          *                                      If @c null, it is regarded that the @c point is in the root %c VisualElement(%c Frame) coordinate space.
596          * @see                         ConvertCoordinates(Tizen::Graphics::FloatRectangle& rectangle, const VisualElement* pFromVisualElement)
597          * @see                         ConvertCoordinates(Tizen::Graphics::FloatPoint& point, const VisualElement* pFromVisualElement)
598          */
599         result ConvertCoordinates(float* x, float* y, float* z, int count, const _VisualElementImpl* pFromElement) const;
600
601         result AddAnimation(const Tizen::Base::String* keyName, VisualElementAnimation& animation);
602         result RemoveAnimation(const Tizen::Base::String& keyName);
603
604         VisualElementAnimation* GetAnimationN(const Tizen::Base::String& keyName) const;
605
606         /**
607          * Gets the animation playing for the specified property.
608          *
609          * @since               2.0
610          * @return      The pointer to the animation
611          * @param[in]   property                        The name of the property.
612          * @exception   E_SUCCESS               The method was successful.
613          * @see                 AddAnimation()
614          * @see                 RemoveAnimation()
615          */
616         VisualElementAnimation* GetAnimationForPropertyN(const Tizen::Base::String& property) const;
617
618         result RemoveAllAnimations(void);
619
620         /**
621          * Scrolls the VisualElement.
622          *
623          * @since               2.0
624          * @param[in]   pointOffset                     The new position to scroll
625          * @param[in]   scrollSelf                      TBD
626          * @return              An error code
627          * @exception   E_SUCCESS           The method was successful.
628          */
629         result ScrollByPoint(const Tizen::Graphics::FloatPoint& pointOffset, bool scrollSelf);
630
631         /**
632          * Gets the VisualElement for presentation.
633          *
634          * @since               2.0
635          * @return              the VisualElement for presentation.
636          */
637         _VisualElementImpl* GetPresentation(void) const
638         {
639                 ClearLastResult();
640                 return __pPresentation;
641         }
642
643         /**
644          * Gets the VisualElement for presentation.
645          *
646          * @since               2.0
647          * @return              the VisualElement for presentation.
648          */
649         _VisualElementImpl* GetModel(void) const
650         {
651                 ClearLastResult();
652                 return __pModel;
653         }
654
655         // only using in the control
656         void SetHidingParentNeeded(bool need)
657         {
658                 __isHidingParent = need;
659                 if(this == __pModel && __pPresentation)
660                 {
661                         __pPresentation->__isHidingParent = need;
662                 }
663         }
664
665
666         // only using in internal instance( RootVisualElement or Dummy)
667         void SetInternal(bool internal)
668         {
669                 __isInternal = internal;
670                 if(this == __pModel && __pPresentation)
671                 {
672                         __pPresentation->__isInternal = internal;
673                 }
674         }
675
676         /**
677          * Gets the VisualElement's native node.
678          *
679          * @since               2.0
680          * @return              INativeNode , this value Platform dependency .
681          */
682         class _INativeNode* GetNativeNode(void) const
683         {
684                 return GetSharedData().pNativeNode;
685         }
686
687         /**
688          * This method returned the status that the VisualElement could enable the implicit animation to do.
689          *
690          * @since               2.0
691          * @return              true/false implicit animation enable status.
692          */
693         bool GetImplicitAnimationEnabled(void) const;
694
695         /**
696          * Set enable or disable the implicit animation of the VisualElement .
697          *
698          * @since               2.0
699          */
700         result SetImplicitAnimationEnabled(bool enable);
701
702         /**
703          * Checks whether the property propagation is enabled or not.
704          *
705          * @since               2.0
706          * @return              @c true if the property propagation is enabled @n
707          *              @c false, otherwise
708          * @exception   E_INVALID_STATE         This instance is in an invalid state.
709          */
710         bool GetPropertyPropagationEnabled(void) const;
711
712         /**
713          * Sets whether the property propagation is enabled or not.
714          *
715          * @since               2.0
716          * @return              An error code.
717          * @param[in]   enable                          Set to @c true if need to enable the property propagation @n
718          *                                  @c false, otherwise
719          * @exception   E_SUCCESS                       The method was successful.
720          * @exception   E_INVALID_STATE         This instance is in an invalid state.
721          */
722         result SetPropertyPropagationEnabled(bool enable);
723
724         /**
725          * This method fill the canvas with the drawn surface.
726          *
727          * @since               2.0
728          * @param[in]   canvas                                  capture target.
729          * @param[in]   boundsToDraw                    capture region of the VisualElement.
730          * @param[in]   withChildren                    capture with the children.
731          * @return              An error code
732          */
733         result Capture(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& boundsToDraw, bool withChilren);
734         //Tizen::Graphics::Bitmap*      CaptureBitmapN(bool withChildren = false);
735
736         /**
737          * This method return stored public VisualElement instance pointer.
738          *
739          * @since               2.0
740          * @return              pointer of the public VisualElement instance.
741          */
742         VisualElement* GetPublic(void) const
743         {
744                 return __pPublicInstance;
745         }
746
747
748         result SetImageSource(const Tizen::Base::String& filePath);
749         result SetRenderOperation(VisualElement::RenderOperation renderOperation);
750
751
752         /**
753          * Gets the rendering operation of the VisualElement.
754          *
755          * @since               2.0
756          * @return              The rendering operation of the VisualElement.
757          * @see                 SetRenderOperation()
758          */
759         VisualElement::RenderOperation GetRenderOperation(void) const;
760
761         result SetPropertyI(const Tizen::Base::String& property, const Variant& value);
762         result InvokeOnSetPropertyRequested(const Tizen::Base::String& property, const Variant& value);
763
764         Variant InvokeOnGetPropertyRequested(const Tizen::Base::String& property) const
765         {
766                 if (__pPublicInstance)
767                 {
768                         return __pPublicInstance->OnGetPropertyRequested(property);
769                 }
770
771                 return Variant();
772         }
773         /**
774          * The hit testing default logic.
775          *
776          * @since               2.0
777          * @return              hit test result.
778          * @param[in]   point   hit test position.
779          * @see                 InvokeHitTest()
780          */
781         int HitTestI(const Tizen::Graphics::FloatPoint& point);
782
783
784         /**
785          * The creating animation for the property.
786          *
787          * @since               2.0
788          * @return              animation instance for the property.
789          * @param[in]   property        property name.
790          * @see                 InvokeCreateAnimationForProperty()
791          */
792         VisualElementAnimation* CreateAnimationForPropertyI(const Tizen::Base::String& property);
793
794         typedef void (*BoundsChangedCallback)(void*);
795         void SetBoundsChangedCallback(BoundsChangedCallback pCallback, void* pData);
796
797 protected:
798 //      virtual _VisualElementImpl* CloneN(void);
799
800         void InvalidateHierarchyProps(int invalidProps, bool broadcastToChildren, bool propagateToParentsOnly);
801
802 private:
803         _VisualElementImpl(void);
804         _VisualElementImpl(VisualElement& element);
805         _VisualElementImpl(VisualElement& presentation, _VisualElementImpl& modelImpl);
806         virtual ~_VisualElementImpl(void);
807         _VisualElementImpl& operator =(const _VisualElementImpl& rhs);
808
809         result Construct(void);
810         void Destroy(void);
811
812
813         Variant GetBoundsProperty(void) const;
814         result SetBoundsProperty(const Variant& v);
815
816         Variant GetBoundsPositionSubProperty(void) const;
817         result SetBoundsPositionSubProperty(const Variant& v);
818
819         Variant GetBoundsSizeSubProperty(void) const;
820         result SetBoundsSizeSubProperty(const Variant& v);
821
822         Variant GetZPositionProperty(void) const;
823         result SetZPositionProperty(const Variant& v);
824
825         Variant GetZOrderGroupProperty(void) const;
826         result SetZOrderGroupProperty(const Variant& v);
827
828         Variant GetShowStateProperty(void) const;
829         result SetShowStateProperty(const Variant& v);
830
831         Variant GetShowOpacityPrivateProperty(void) const;
832         result SetShowOpacityPrivateProperty(const Variant& v);
833
834         Variant GetRenderOperationProperty(void) const;
835         result SetRenderOperationProperty(const Variant& v);
836
837         Variant GetContentOpacityProperty(void) const;
838         result SetContentOpacityProperty(const Variant& v);
839
840         Variant GetContentBoundsProperty(void) const;
841         result SetContentBoundsProperty(const Variant& v);
842
843         Variant GetOpacityProperty(void) const;
844         result SetOpacityProperty(const Variant& v);
845
846         Variant GetAnchorProperty(void) const;
847         result SetAnchorProperty(const Variant& v);
848
849         Variant GetAnchorZProperty(void) const;
850         result SetAnchorZProperty(const Variant& v);
851
852         Variant GetTransformMatrixProperty(void) const;
853         result SetTransformMatrixProperty(const Variant& v);
854
855         Variant GetTransformRotationXSubProperty(void) const;
856         result SetTransformRotationXSubProperty(const Variant& v);
857
858         Variant GetTransformRotationYSubProperty(void) const;
859         result SetTransformRotationYSubProperty(const Variant& v);
860
861         Variant GetTransformRotationZSubProperty(void) const;
862         result SetTransformRotationZSubProperty(const Variant& v);
863
864         Variant GetTransformRotationXYSubProperty(void) const;
865         result SetTransformRotationXYSubProperty(const Variant& v);
866
867         Variant GetTransformRotationAnchorXSubProperty(void) const;
868         result SetTransformRotationAnchorXSubProperty(const Variant& v);
869
870         Variant GetTransformRotationAnchorYSubProperty(void) const;
871         result SetTransformRotationAnchorYSubProperty(const Variant& v);
872
873         Variant GetTransformRotationAnchorZSubProperty(void) const;
874         result SetTransformRotationAnchorZSubProperty(const Variant& v);
875
876         Variant GetTransformRotationAnchorXYSubProperty(void) const;
877         result SetTransformRotationAnchorXYSubProperty(const Variant& v);
878
879         Variant GetTransformScaleXSubProperty(void) const;
880         result SetTransformScaleXSubProperty(const Variant& v);
881
882         Variant GetTransformScaleYSubProperty(void) const;
883         result SetTransformScaleYSubProperty(const Variant& v);
884
885         Variant GetTransformScaleZSubProperty(void) const;
886         result SetTransformScaleZSubProperty(const Variant& v);
887
888         Variant GetTransformScaleXYSubProperty(void) const;
889         result SetTransformScaleXYSubProperty(const Variant& v);
890
891         Variant GetTransformScaleAnchorXSubProperty(void) const;
892         result SetTransformScaleAnchorXSubProperty(const Variant& v);
893
894         Variant GetTransformScaleAnchorYSubProperty(void) const;
895         result SetTransformScaleAnchorYSubProperty(const Variant& v);
896
897         Variant GetTransformScaleAnchorZSubProperty(void) const;
898         result SetTransformScaleAnchorZSubProperty(const Variant& v);
899
900         Variant GetTransformScaleAnchorXYSubProperty(void) const;
901         result SetTransformScaleAnchorXYSubProperty(const Variant& v);
902
903         Variant GetTransformTranslationXSubProperty(void) const;
904         result SetTransformTranslationXSubProperty(const Variant& v);
905
906         Variant GetTransformTranslationYSubProperty(void) const;
907         result SetTransformTranslationYSubProperty(const Variant& v);
908
909         Variant GetTransformTranslationZSubProperty(void) const;
910         result SetTransformTranslationZSubProperty(const Variant& v);
911
912         Variant GetTransformTranslationXYSubProperty(void) const;
913         result SetTransformTranslationXYSubProperty(const Variant& v);
914
915         Variant GetChildrenTransformMatrixProperty(void) const;
916         result SetChildrenTransformMatrixProperty(const Variant& v);
917
918         Variant GetChildrenTransformRotationXSubProperty(void) const;
919         result SetChildrenTransformRotationXSubProperty(const Variant& v);
920
921         Variant GetChildrenTransformRotationYSubProperty(void) const;
922         result SetChildrenTransformRotationYSubProperty(const Variant& v);
923
924         Variant GetChildrenTransformRotationZSubProperty(void) const;
925         result SetChildrenTransformRotationZSubProperty(const Variant& v);
926
927         Variant GetChildrenTransformRotationXYSubProperty(void) const;
928         result SetChildrenTransformRotationXYSubProperty(const Variant& v);
929
930         Variant GetChildrenTransformRotationAnchorXSubProperty(void) const;
931         result SetChildrenTransformRotationAnchorXSubProperty(const Variant& v);
932
933         Variant GetChildrenTransformRotationAnchorYSubProperty(void) const;
934         result SetChildrenTransformRotationAnchorYSubProperty(const Variant& v);
935
936         Variant GetChildrenTransformRotationAnchorZSubProperty(void) const;
937         result SetChildrenTransformRotationAnchorZSubProperty(const Variant& v);
938
939         Variant GetChildrenTransformRotationAnchorXYSubProperty(void) const;
940         result SetChildrenTransformRotationAnchorXYSubProperty(const Variant& v);
941
942         Variant GetChildrenTransformScaleXSubProperty(void) const;
943         result SetChildrenTransformScaleXSubProperty(const Variant& v);
944
945         Variant GetChildrenTransformScaleYSubProperty(void) const;
946         result SetChildrenTransformScaleYSubProperty(const Variant& v);
947
948         Variant GetChildrenTransformScaleZSubProperty(void) const;
949         result SetChildrenTransformScaleZSubProperty(const Variant& v);
950
951         Variant GetChildrenTransformScaleXYSubProperty(void) const;
952         result SetChildrenTransformScaleXYSubProperty(const Variant& v);
953
954         Variant GetChildrenTransformScaleAnchorXSubProperty(void) const;
955         result SetChildrenTransformScaleAnchorXSubProperty(const Variant& v);
956
957         Variant GetChildrenTransformScaleAnchorYSubProperty(void) const;
958         result SetChildrenTransformScaleAnchorYSubProperty(const Variant& v);
959
960         Variant GetChildrenTransformScaleAnchorZSubProperty(void) const;
961         result SetChildrenTransformScaleAnchorZSubProperty(const Variant& v);
962
963         Variant GetChildrenTransformScaleAnchorXYSubProperty(void) const;
964         result SetChildrenTransformScaleAnchorXYSubProperty(const Variant& v);
965
966         Variant GetChildrenTransformTranslationXSubProperty(void) const;
967         result SetChildrenTransformTranslationXSubProperty(const Variant& v);
968
969         Variant GetChildrenTransformTranslationYSubProperty(void) const;
970         result SetChildrenTransformTranslationYSubProperty(const Variant& v);
971
972         Variant GetChildrenTransformTranslationZSubProperty(void) const;
973         result SetChildrenTransformTranslationZSubProperty(const Variant& v);
974
975         Variant GetChildrenTransformTranslationXYSubProperty(void) const;
976         result SetChildrenTransformTranslationXYSubProperty(const Variant& v);
977
978         Variant GetClipToParentProperty(void) const;
979         result SetClipToParentProperty(const Variant& v);
980
981         Variant GetClipChildrenProperty(void) const;
982         result SetClipChildrenProperty(const Variant& v);
983
984         Variant GetNameProperty(void) const;
985         result SetNameProperty(const Variant& v);
986
987         Variant GetSurfaceOpaqueProperty(void) const;
988         result SetSurfaceOpaqueProperty(const Variant& v);
989
990         Variant GetImplicitAnimationProperty(void) const;
991         result SetImplicitAnimationProperty(const Variant& v);
992
993         Variant GetPropertyPropagationProperty(void) const;
994         result SetPropertyPropagationProperty(const Variant& v);
995
996         static void AdjustSizeForSurface(float& width, float& height)
997         {
998                 float originalWidth = width;
999                 float originalHeight = height;
1000                 _VisualElementCoordinateSystem::MakeIntegralDimension(width, height);
1001
1002                 if (originalWidth > 0.0f && width == 0.0f)
1003                 {
1004                         width = 1.0f;
1005                 }
1006
1007                 if (originalHeight > 0.0f && height == 0.0f)
1008                 {
1009                         height = 1.0f;
1010                 }
1011         }
1012
1013         result SetBoundsI(const Tizen::Graphics::FloatRectangle& bounds);
1014         result SetZPositionI(float zPosition);
1015         result SetShowOpacityI(float showOpacity);
1016         result SetShowStateI(bool show);
1017         result SetContentBoundsI(const Tizen::Graphics::FloatRectangle& contentBounds);
1018         result SetContentOpacityI(float contentOpacity);
1019         result SetOpacityI(float opacity);
1020         result SetAnchorI(const Tizen::Graphics::FloatPoint& anchor);
1021         result SetAnchorZI(float anchorZ);
1022         result SetPropertyPropagationEnabledI(bool enable);
1023         result SetTransformMatrixI(const Tizen::Graphics::FloatMatrix4& xform, bool updateDecomposed = true);
1024         result SetChildrenTransformMatrixI(const Tizen::Graphics::FloatMatrix4& xform, bool updateDecomposed = true);
1025         result SetZOrderGroupI(int zOrderGroup);
1026
1027         bool CheckIfAnimatable(const Tizen::Base::String& property) const;
1028         bool IsSurfaceNeeded(void) const;
1029         void RebuildSurfaces(void);
1030         void ResetSurfaceIfNeeded(void);
1031         _VisualElementImpl* GetRenderTarget(void) const;
1032         _VisualElementImpl* GetClipSource(void) const
1033         {
1034                 if (unlikely(IsPropsInvalidated(HIERARCHY_PROPERTY_COORDINATES)))
1035                 {
1036                         const_cast< _VisualElementImpl* >(this)->RebuildCoordinates();
1037                 }
1038
1039                 return __pClipSource;
1040         }
1041
1042         int GetChildIndex(const _VisualElementImpl& child) const;
1043         result RemoveChildWithoutReconfiguring(int indexChild, bool invalidate);
1044         result RemoveAllChild(void);
1045         void RemoveFromParent(void);
1046
1047         void RebuildNativeNodeTree(_VisualElementImpl& parent);
1048         void ExposeRectangle(const Tizen::Graphics::FloatRectangle* pDirtyRectangle, bool invalidate);
1049
1050         bool IsVisibleI(void) const
1051         {
1052                 if (unlikely(IsPropsInvalidated(HIERARCHY_PROPERTY_COORDINATES | HIERARCHY_PROPERTY_SHOWSTATE | HIERARCHY_PROPERTY_OPACITY | HIERARCHY_PROPERTY_CONTENTOPACITY)))
1053                 {
1054                         const_cast< _VisualElementImpl* >(this)->RebuildVisibility();
1055                 }
1056
1057                 return __isVisible;
1058         }
1059
1060         void SetRootNeedsContentUpdate(void)
1061         {
1062                 if (unlikely(__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT))
1063                 {
1064                         _RootVisualElement* pRoot = GetRootPublic();
1065                         if (likely(pRoot))
1066                         {
1067                                 pRoot->SetNeedsContentUpdate(true);
1068                         }
1069                 }
1070         }
1071
1072         bool IsAncestorDestroying(void) const
1073         {
1074                 const _VisualElementImpl* pElement = __pParent;
1075
1076                 while (pElement != null)
1077                 {
1078                         if (pElement->__isDestroying)
1079                         {
1080                                 return true;
1081                         }
1082
1083                         pElement = pElement->GetParent();
1084                 }
1085
1086                 return false;
1087         }
1088         // Presentation update method(observer)
1089         void UpdatePresentationWhenChildRemoved(_VisualElementImpl& child, bool deallocate);
1090         void UpdatePresentationWhenZOrderChanged(const _VisualElementImpl* pReferenceModel, bool above);
1091         result UpdatePresentationWhenCustomPropertyChanged(const Tizen::Base::String& property, const Variant& value);
1092
1093         // invoke the delegation method.
1094         void InvokeOnConstructed(void);
1095
1096         void InvokeOnDestructing(void);
1097
1098         result InvokeOnChildAttaching( _VisualElementImpl& child);
1099
1100         void InvokeOnChildAttached( _VisualElementImpl& child);
1101
1102         result InvokeOnChildDetaching( _VisualElementImpl& child);
1103
1104         void InvokeOnChildDetached( _VisualElementImpl& child);
1105
1106         result InvokeOnAttaching( _VisualElementImpl& parent);
1107
1108         void InvokeOnAttached(void);
1109
1110         result InvokeOnDetaching(void);
1111
1112         void InvokeOnDetached( _VisualElementImpl& parent);
1113
1114         result InvokeOnAnimationAdded( const VisualElementAnimation* pAnimation);
1115
1116         result InvokeOnAnimationRemoved( const VisualElementAnimation* pAnimation);
1117
1118         void InvokeOnShowStateChanged(bool showState);
1119
1120         /**
1121          * Called when transform matrix is about to be changed.
1122          *
1123          * @since               2.0
1124          * @param[in]           source                          VisualElement instance to be changed.
1125          * @param[in,out]       newTransform            Transform matrix to be applied.
1126          */
1127         result InvokeOnTransformMatrixChanging(Tizen::Graphics::FloatMatrix4& newTransform);
1128
1129         /**
1130          * Called when transform matrix is changed.
1131          *
1132          * @since               2.0
1133          * @param[in]           source                          VisualElement instance changed.
1134          * @param[in]           oldTransform            The old transform matrix
1135          */
1136         void InvokeOnTransformMatrixChanged(const Tizen::Graphics::FloatMatrix4& oldTransform);
1137
1138         /**
1139          * Called when transform matrix for children is about to be changed.
1140          *
1141          * @since               2.0
1142          * @param[in]           source                          VisualElement instance to be changed.
1143          * @param[in,out]       newTransform            Transform matrix for children to be applied.
1144          */
1145         result InvokeOnChildrenTransformMatrixChanging(Tizen::Graphics::FloatMatrix4& newTransform);
1146
1147         /**
1148          * Called when transform matrix for children is changed.
1149          *
1150          * @since               2.0
1151          * @param[in]           source                          VisualElement instance changed.
1152          * @param[in]           oldTransform            The old transform matrix
1153          */
1154         void InvokeOnChildrenTransformMatrixChanged(const Tizen::Graphics::FloatMatrix4& oldTransform);
1155
1156         /**
1157          * Called when bounds is about to be changed.
1158          *
1159          * @since               2.0
1160          * @param[in]           source                          VisualElement instance to be changed.
1161          * @param[in,out]       newBounds                       The new bounds
1162          */
1163         result InvokeOnBoundsChanging(Tizen::Graphics::FloatRectangle& newBounds);
1164
1165         /**
1166          * Called when bounds is changed.
1167          *
1168          * @since               2.0
1169          * @param[in]           source                          VisualElement instance changed.
1170          * @param[in]           oldBounds               The old bounds
1171          */
1172         void InvokeOnBoundsChanged(const Tizen::Graphics::FloatRectangle& oldBounds);
1173
1174         /**
1175          * For checking that point is in the VisualElement region.
1176          *
1177          * @since               2.0
1178          * @param[in]   point                           the point to check in self coordinate system.
1179          *
1180          */
1181         int InvokeHitTest(const Tizen::Graphics::FloatPoint& point);
1182
1183
1184         /**
1185          * Overrides this method to check the element can draw.
1186          *
1187          * @since               2.0
1188          */
1189         bool InvokePrepareDraw(void);
1190
1191         /**
1192          * Overrides this method to provide user-specific draw code.
1193          *
1194          * @since               2.0
1195          */
1196         void InvokeOnDraw( Tizen::Graphics::Canvas& canvas);
1197
1198         /**
1199          * Overrides this method to provide user-specific implicit animation.
1200          *
1201          * return return _Animation instance for the specified property, or null to disable implcit animation for the property.
1202          * @since               2.0
1203          */
1204         VisualElementAnimation* InvokeCreateAnimationForProperty(const Tizen::Base::String& property);
1205
1206         VisualElement* CreateElementForImplicitAnimationN(void) const;
1207         result CreateElementTreeForDetachImplicitAnimation(_VisualElementImpl& child);
1208
1209         Tizen::Graphics::FloatRectangle GetVisibleRect(void) const;
1210         Tizen::Graphics::FloatRectangle GetDrawableRect(void) const;
1211
1212         const Tizen::Graphics::FloatRectangle& GetBoundingBoxI(void) const;
1213         const Tizen::Graphics::FloatMatrix4& GetMatrixToSuper(void) const;
1214         const Tizen::Graphics::FloatMatrix4& GetMatrixToTop(void) const;
1215         const Tizen::Graphics::FloatMatrix4& GetMatrixFromTop(void) const;
1216         Tizen::Graphics::FloatMatrix4 CalcMatrixToBase(const _VisualElementImpl& base) const;
1217         const Tizen::Graphics::FloatMatrix4& GetMatrixToClipSource(void) const;
1218
1219         void DrawRectangleIfNeeded(const Tizen::Graphics::FloatRectangle& drawRect);
1220         void DrawRectangle(const Tizen::Graphics::FloatRectangle& drawRect);
1221
1222         void LockInvalidate(bool lock);
1223         void InvalidateHierarchyPropsDownward(int invalidProps, bool broadcastToChildren, bool propagateToParentsOnly);
1224         void InvalidateVisibleRectToRenderTarget(const Tizen::Graphics::FloatRectangle* pDirtyRectangle);
1225         void RebuildCoordinates(void);
1226         void RebuildVisibility(void);
1227         void RebuildHierarchyProps(int props, bool checkSurface, bool reconfSurfaceOnly);
1228         void UpdateHierarchyProps(void);
1229         void FlushNativeChanges(void);
1230
1231         void SetSurfaceChanged(void);
1232
1233         bool IsPropsInvalidated(int props) const
1234         {
1235                 return (__invalidatedProps & props) != 0;
1236         }
1237
1238         void SetPropsValidaty(int validProps, int invalidProps)
1239         {
1240                 __invalidatedProps &= ~validProps;
1241                 __invalidatedProps |= invalidProps;
1242
1243                 if (this == __pPresentation)
1244                         GetSharedData().invalidatedNativeProps |= invalidProps;
1245         }
1246
1247         bool IsDrawingObject(void) const
1248         {
1249                 return (this == __pModel);
1250         }
1251
1252         result InvalidateRectangleI(const Tizen::Graphics::FloatRectangle* pRectangle);
1253
1254         int GetZOrderGroupIndex(int orderGroup, int& begin, int& end) const;
1255         result ChangeZOrder(_VisualElementImpl& child, const _VisualElementImpl* pReference, bool above, int zorderGroup);
1256
1257         _VisualElementImpl* GetChildAtPointI(const Tizen::Graphics::FloatPoint& point, int parentHitTest);
1258
1259         result AddAnimationI(const Tizen::Base::String* pKeyName, VisualElementAnimation& animation);
1260         result AddAnimationGroupI(const Tizen::Base::String* pKeyName, VisualElementAnimation& animation);
1261
1262         result CaptureI(Tizen::Graphics::Canvas& outputCanvas, const Tizen::Graphics::FloatRectangle& rectDest, _VisualElementImpl& reference, const Tizen::Graphics::FloatRectangle& clipRect, bool withChilren, int depth);
1263
1264         _VisualElementSharedData& GetSharedData(void) const
1265         {
1266                 return *__pSharedData;
1267         }
1268
1269         bool CreateImplicitAnimationIfNeeded(const Tizen::Base::String& property, const Variant& newValue, const Variant& currentPresntationValue, const Tizen::Base::String** pSubList);
1270
1271 public:
1272         enum
1273         {
1274                 HITTEST_NOWHERE = 0,
1275                 HITTEST_NOMORECHILDREN = 1,
1276                 HITTEST_MATCH = 2
1277         };
1278
1279 protected:
1280         enum {
1281                 HIERARCHY_PROPERTY_COORDINATES                  = 0x01,
1282                 HIERARCHY_PROPERTY_OPACITY                              = 0x02,
1283                 HIERARCHY_PROPERTY_SHOWSTATE                    = 0x04,
1284                 HIERARCHY_PROPERTY_CONTENTOPACITY               = 0x08,
1285                 HIERARCHY_PROPERTY_NATIVENODE                   = HIERARCHY_PROPERTY_CONTENTOPACITY,
1286                 HIERARCHY_PROPERTY_SURFACE                              = 0x10, // only for presentation element
1287                 HIERARCHY_PROPERTY_CONTENT                              = 0x20,
1288                 HIERARCHY_PROPERTY_CONTENTBOUNDS                = 0x40,
1289                 HIERARCHY_PROPERTY_MASK                                 = 0x7F
1290         };
1291
1292         int _zOrderGroup;
1293
1294 private:
1295         _VisualElementSharedData* __pSharedData;
1296         _VisualElementImpl* __pParent;
1297         _VisualElementImpl* __pModel;
1298         _VisualElementImpl* __pPresentation;
1299
1300 //      _RootVisualElement* __pRoot;
1301         _VisualElementImpl* __pRoot;
1302         bool __isRoot;
1303         bool __isVisible;
1304         float __showOpacity;
1305
1306         bool __needRecreateSurface;
1307
1308         Tizen::Graphics::FloatRectangle __bounds;
1309         Tizen::Graphics::FloatDimension __alignedSize;
1310         Tizen::Graphics::FloatRectangle __contentBounds;
1311         bool __useContentBounds;
1312         float __zPosition;
1313         float __contentOpacity;
1314         float __opacity;
1315         Tizen::Graphics::FloatPoint __anchor;
1316         float __anchorZ;
1317         Tizen::Graphics::FloatMatrix4 __transform;
1318         _TransformMatrix3Df __decomposedTransform;
1319         Tizen::Graphics::FloatMatrix4 __childrenTransform;
1320         _TransformMatrix3Df __decomposedChildrenTransform;
1321
1322         unsigned int __childrenNeedsUpdateProps;
1323         unsigned int __invalidatedProps;
1324
1325         bool __matrixFromTopValid;
1326         bool __matrixFromTopInvertible;
1327         bool __matrixToSuperValid;
1328         bool __matrixToTopValid;
1329         bool __matrixToClipSourceValid;
1330         bool __boundingBoxValid;
1331         bool __visibleRectValid;
1332         bool __needTransform;
1333         bool __needClipForUntransformed;
1334         bool __isImplicitAnimationEnabled;
1335
1336         bool __isClipChildren;
1337
1338         Tizen::Graphics::FloatRectangle __boundingBox;
1339         Tizen::Graphics::FloatRectangle __boundingBoxToClipSource;
1340         Tizen::Graphics::FloatMatrix4 __matrixToSuper;
1341         Tizen::Graphics::FloatMatrix4 __matrixToTop;
1342         Tizen::Graphics::FloatMatrix4 __matrixFromTop;
1343         Tizen::Graphics::FloatMatrix4 __matrixToClipSource;
1344         _VisualElementImpl* __pClipSource;
1345
1346         Tizen::Graphics::FloatRectangle __visibleRect;
1347
1348         bool __isPropertyPropagationEnabled;
1349         bool __isDestroying;
1350         bool __isHidingParent;
1351         bool __isInternal;
1352         bool __isAllowedTreeModification;
1353
1354         class ChildrenListT : public Tizen::Base::Collection::ArrayListT<_VisualElementImpl*>
1355         {
1356         public:
1357                 _VisualElementImpl* GetChildAt(int index) const
1358                 {
1359                         _VisualElementImpl* pChild = null;
1360                         if (likely(GetAt(index, pChild) == E_SUCCESS))
1361                                 return pChild;
1362
1363                         return null;
1364                 }
1365         };
1366
1367         ChildrenListT __children;
1368
1369         VisualElement* __pPublicInstance; // for public class instance pointer
1370
1371         Tizen::Base::String __imageFilePath;
1372         VisualElement::RenderOperation __renderOperation;
1373
1374         BoundsChangedCallback   __pBoundsChangedCallback;
1375         void* __pBoundsChangedCallbackData;
1376
1377         friend class _VeDebug;
1378         friend class _EflNode;
1379         friend class _VisualElementModelObserver;
1380         friend class VisualElement;
1381         friend class _VisualElement;
1382         friend class _ControlVisualElement;
1383         friend class _RootVisualElement;
1384         friend class _AnimationManager;
1385         friend class _DisplayManager;
1386 };              // _VisualElementImpl
1387
1388 }}}             // Tizen::Ui::Animations
1389
1390 #endif //_FUI_ANIM_INTERNAL_VISUAL_ELEMENT_IMPL_H_
1391