Merge "DALi Version 1.9.30" into devel/master
[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) 2019 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 namespace Toolkit
29 {
30
31 namespace Text
32 {
33
34 /**
35  * @brief View provides an interface between the Text layout engine and rendering back-end.
36  */
37 class View : public ViewInterface
38 {
39 public:
40
41   /**
42    * @brief Create a new instance of a View.
43    */
44   View();
45
46   /**
47    * @brief Virtual destructor.
48    */
49   virtual ~View();
50
51   /**
52    * @brief Set the visual model.
53    *
54    * @param[in] visualModel The visual model used by the View.
55    */
56   void SetVisualModel( VisualModelPtr visualModel );
57
58   /**
59    * @copydoc Dali::Toolkit::Text::ViewInterface::GetControlSize()
60    */
61   const Vector2& GetControlSize() const override;
62
63   /**
64    * @copydoc Dali::Toolkit::Text::ViewInterface::GetLayoutSize()
65    */
66   const Vector2& GetLayoutSize() const override;
67
68   /**
69    * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfGlyphs()
70    */
71   Length GetNumberOfGlyphs() const override;
72
73   /**
74    * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphs()
75    */
76   virtual Length GetGlyphs( GlyphInfo* glyphs,
77                             Vector2* glyphPositions,
78                             float& minLineOffset,
79                             GlyphIndex glyphIndex,
80                             Length numberOfGlyphs ) const;
81
82   /**
83    * @copydoc Dali::Toolkit::Text::ViewInterface::GetColors()
84    */
85   const Vector4* const GetColors() const override;
86
87   /**
88    * @copydoc Dali::Toolkit::Text::ViewInterface::GetColorIndices()
89    */
90   const ColorIndex* const GetColorIndices() const override;
91
92   /**
93    * @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColors()
94    */
95   const Vector4* const GetBackgroundColors() const override;
96
97   /**
98    * @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColorIndices()
99    */
100   const ColorIndex* const GetBackgroundColorIndices() const override;
101
102   /**
103    * @copydoc Dali::Toolkit::Text::ViewInterface::GetTextColor()
104    */
105   const Vector4& GetTextColor() const override;
106
107   /**
108    * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowOffset()
109    */
110   const Vector2& GetShadowOffset() const override;
111
112   /**
113    * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowColor()
114    */
115   const Vector4& GetShadowColor() const override;
116
117   /**
118    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineColor()
119    */
120   const Vector4& GetUnderlineColor() const override;
121
122   /**
123    * @copydoc Dali::Toolkit::Text::ViewInterface::IsUnderlineEnabled()
124    */
125   bool IsUnderlineEnabled() const override;
126
127   /**
128    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineHeight()
129    */
130   float GetUnderlineHeight() const override;
131
132   /**
133    * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfUnderlineRuns()
134    */
135   Length GetNumberOfUnderlineRuns() const override;
136
137   /**
138    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineRuns()
139    */
140   virtual void GetUnderlineRuns( GlyphRun* underlineRuns,
141                                  UnderlineRunIndex index,
142                                  Length numberOfRuns ) const;
143
144   /**
145    * @copydoc Dali::Toolkit::Text::ViewInterface::GetOutlineColor()
146    */
147   const Vector4& GetOutlineColor() const override;
148
149   /**
150    * @copydoc Dali::Toolkit::Text::ViewInterface::GetOutlineWidth()
151    */
152   uint16_t GetOutlineWidth() const override;
153
154 private:
155
156   // Undefined
157   View( const View& handle );
158
159   // Undefined
160   View& operator=( const View& handle );
161
162 private:
163
164   struct Impl;
165   Impl* mImpl;
166 };
167 } // namespace Text
168
169 } // namespace Toolkit
170
171 } // namespace Dali
172
173 #endif // DALI_TOOLKIT_TEXT_VIEW_H