Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiAnimVisualElementContentProvider.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                FUiAnimVisualElementContentProvider.h
20  * @brief               This is the header file for the %VisualElementContentProvider class.
21  *
22  * This header file contains the declarations of the %VisualElementContentProvider class.
23  */
24
25 #ifndef _FUIANIM_VISUAL_ELEMENT_CONTENT_PROVIDER_H_
26 #define _FUIANIM_VISUAL_ELEMENT_CONTENT_PROVIDER_H_
27
28 #include <FUiAnimIVisualElementContentProvider.h>
29
30 namespace Tizen { namespace Graphics {
31 class Canvas;
32 class FloatPoint;
33 }} // Tizen::Graphics
34
35 namespace Tizen { namespace Ui { namespace Animations
36 {
37
38 class VisualElement;
39
40 /**
41 * @class           VisualElementContentProvider
42 * @brief           This class customizes content of %VisualElement.
43 *
44 * @since          2.0
45 *
46 * The %VisualElementContentProvider class provides the content and information on it. The class that needs to customize content must implement this interface, and
47 * using the VisualElement::SetContentProvider() method register to the VisualElement.
48 * This class implements IVisualElementContentProvider for the default operation of the contents.
49 */
50 class _OSP_EXPORT_ VisualElementContentProvider
51         : public IVisualElementContentProvider
52 {
53 public:
54         /**
55          * This is the default constructor for this class.
56          *
57          * @since               2.0
58          */
59         VisualElementContentProvider(void);
60
61
62         /**
63          * This is the destructor for this class.
64          *
65          * @since       2.0
66          */
67         virtual ~VisualElementContentProvider(void);
68
69 public:
70         /**
71          * Checks whether the %PrepareDraw() method is invoked by UI framework before DrawContent() is called. @n
72          * If this method returns @c true, VisualElement can call the %DrawContent() method.
73          *
74          * @since               2.0
75          *
76          * @return  @c true if DrawContent() can be called, @n
77          *              else @c false
78          * @param[in]   target                  The VisualElement instance to check
79          */
80         virtual bool PrepareDraw(VisualElement& target);
81
82
83         /**
84          * Fills the contents in the given canvas.
85          *
86          * @since               2.0
87          *
88          * @param[in]   target                  The VisualElement instance to draw
89          * @param[in]   canvas                  The graphic canvas for drawing
90          * @see VisualElement::OnDraw()
91          * @see VisualElement::InvalidateRectangle()
92          */
93         virtual void DrawContent(VisualElement& target, Tizen::Graphics::Canvas& canvas);
94
95
96         /**
97          * The %HitTest() method is called by VisualElement::GetChildAt(). @n
98          * The %VisualElement::GetChildAt() method traverses through a list of all the children, and performs a hit test search at the @c point using this method. @n
99          * You can modify hit test search result by overriding this method.
100          *
101          * @since               2.0
102          *
103          * @return              The hit test result
104          * @param[in]   target                  The VisualElement target to test
105          * @param[in]   point                   The position of source to check
106          * @remarks             Hit test results must be one of the following: @n
107          *                       - Tizen::Ui::Animations::HitTestResult::HIT_TEST_NOWHERE
108          *                       - Tizen::Ui::Animations::HitTestResult::HIT_TEST_MATCH
109          * @see VisualElement::GetChildAt()
110          */
111         virtual HitTestResult HitTest(VisualElement& target, const Tizen::Graphics::FloatPoint& point);
112
113 private:
114         VisualElementContentProvider(const VisualElementContentProvider& value);
115         VisualElementContentProvider& operator =(const VisualElementContentProvider& value);
116
117 };              // VisualElementContentProvider
118
119
120 }}}             // Tizen::Ui::Animations
121
122 #endif //_FUIANIM_VISUAL_ELEMENT_CONTENT_PROVIDER_H_