Fork for IVI: mesa fixing
[profile/ivi/uifw.git] / src / ui / inc / FUiAnim_VisualElement.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  * @file                FUiAnim_VisualElement.h
19  * @brief               This is the header file for the _VisualElement class.
20  *
21  * This header file contains declarations of the @e _VisualElement class.
22  */
23 #ifndef _FUIANIM_INTERNAL_VISUAL_ELEMENT_H_
24 #define _FUIANIM_INTERNAL_VISUAL_ELEMENT_H_
25
26 #include <FUiAnimVisualElement.h>
27 #include "FUi_Colorf.h"
28
29 namespace Tizen { namespace Ui { namespace Animations
30 {
31
32 class _OSP_EXPORT_ _VisualElement
33         : public VisualElement
34 {
35
36 public:
37         /**
38          * This is the default constructor for this class.
39          *
40          * @since 2.0
41          */
42         _VisualElement(void);
43
44
45 protected:
46         /**
47          * This is the destructor for this class.
48          *
49          * @since 2.0
50          */
51         virtual ~_VisualElement(void);
52
53 public:
54         IVisualElementAnimationProvider* GetAnimationProvider(void) const;
55
56         IVisualElementContentProvider* GetContentProvider(void) const;
57
58         IVisualElementEventListener* GetVisualElementEventListener(void) const;
59
60 public:
61
62         /**
63          * Clones the instance of VisualElement.
64          *
65          * @since 2.0
66          * @return              The pointer to the cloned VisualElement instance.
67          */
68         virtual VisualElement* CloneN(void) const;
69
70         /**
71          * Gets the current background color of the VisualElement.
72          *
73          * @since 2.0
74          * @return              The background color of the VisualElement.
75          * @see                 SetBackgroundColor()
76          */
77         _Colorf GetBackgroundColor(void) const;
78
79         /**
80          * Changes the background color of the VisualElement.
81          *
82          * @since 2.0
83          * @return              An error code
84          * @param[in]   color                   The new background color.
85          * @exception   E_SUCCESS               The method was successful.
86          * @see                 GetBackgroundColor()
87          *
88          */
89         result SetBackgroundColor(const _Colorf& color);
90
91
92         /**
93          * Sets the custom data of the VisualElement.
94          *
95          * @since 2.0
96          * @param[in]   pUserData       data to save.
97          */
98         void SetControlUserData(void* pUserData);
99
100         /**
101          * Gets the custom data of the VisualElement.
102          *
103          * @since 2.0
104          */
105         void* GetControlUserData(void) const;
106
107         /**
108          * Gets the top-most child ControlVisualElement indicated by @c point.
109          *
110          * @since 2.0
111          * @return              the child ControlVisualElement indicated by point.
112          * @param[in]   point                           The position to find the child ControlVisualElement.
113          */
114 //      _VisualElement* GetControlChildAtPoint(Tizen::Graphics::FloatPoint& point);
115
116         /**
117          * Overrides this method to check the element can draw.
118          *
119          * @since 2.0
120          */
121         virtual bool OnPrepareDraw(void);
122
123         result SetClipToParent(bool clipToParent);
124         result SetBackBufferEnabled(bool enable);
125         result SetSurfaceOpaque(bool isSurfaceOpaque);
126
127         Tizen::Graphics::FloatRectangle GetBoundingBox(void);
128         result SetZOrder(const VisualElement* pReference, bool above);
129
130         result SetImageSource(const Tizen::Base::String& fileName);
131         result SetContentOpacity(float contentOpacity);
132
133         result ScrollByPoint(const Tizen::Graphics::FloatPoint& pointOffset, bool scrollSelf);
134
135         result Capture(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& boundsToDraw, bool withChilren);
136         class _INativeNode* GetNativeNode(void) const;
137
138         _VisualElement* GetPresentation(void);
139         _VisualElement* GetModel(void);
140
141 protected:
142         _VisualElement(const _VisualElement& rhs);
143
144
145 private:
146         void* __pUserData;
147 };              // _VisualElement
148
149 }}}             // Tizen::Ui::Animations
150
151 #endif //_FUIANIM_INTERNAL_VISUAL_ELEMENT_H_
152