Merge changes I26f3edb0,Iba714851 into new_text
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-view.h
1 #ifndef __DALI_TOOLKIT_TEXT_VIEW_H__
2 #define __DALI_TOOLKIT_TEXT_VIEW_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/text/text-view-interface.h>
23 #include <dali-toolkit/internal/text/visual-model-impl.h>
24
25 namespace Dali
26 {
27
28 struct Vector2;
29
30 namespace Toolkit
31 {
32
33 namespace Text
34 {
35
36 /**
37  * @brief View provides an interface between the Text layout engine and rendering back-end.
38  */
39 class View : public ViewInterface
40 {
41 public:
42
43   /**
44    * @brief Create a new instance of a View.
45    */
46   View();
47
48   /**
49    * @brief Virtual destructor.
50    */
51   virtual ~View();
52
53   /**
54    * @brief Set the visual model.
55    *
56    * @param[in] visualModel The visual model used by the View.
57    */
58   void SetVisualModel( VisualModelPtr visualModel );
59
60   /**
61    * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfGlyphs()
62    */
63   virtual Length GetNumberOfGlyphs() const;
64
65   /**
66    * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphs()
67    */
68   virtual void GetGlyphs( GlyphInfo* glyphs,
69                           GlyphIndex glyphIndex,
70                           Length numberOfGlyphs ) const;
71
72   /**
73    * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphPositions()
74    */
75   virtual void GetGlyphPositions( Vector2* glyphPositions,
76                                   GlyphIndex glyphIndex,
77                                   Length numberOfGlyphs ) const;
78
79   /**
80    * @copydoc Dali::Toolkit::Text::ViewInterface::GetTextColor()
81    */
82   virtual const Vector4& GetTextColor() const;
83
84   /**
85    * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowOffset()
86    */
87   virtual const Vector2& GetShadowOffset() const;
88
89   /**
90    * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowColor()
91    */
92   virtual const Vector4& GetShadowColor() const;
93
94   /**
95    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineColor()
96    */
97   virtual const Vector4& GetUnderlineColor() const;
98
99   /**
100    * @copydoc Dali::Toolkit::Text::ViewInterface::IsUnderlineEnabled()
101    */
102   virtual bool IsUnderlineEnabled() const;
103
104   /**
105    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineHeight()
106    */
107   virtual float GetUnderlineHeight() const;
108
109 private:
110
111   // Undefined
112   View( const View& handle );
113
114   // Undefined
115   View& operator=( const View& handle );
116
117 private:
118
119   struct Impl;
120   Impl* mImpl;
121 };
122 } // namespace Text
123
124 } // namespace Toolkit
125
126 } // namespace Dali
127
128 #endif // __DALI_TOOLKIT_TEXT_VIEW_H__