TextModel - Create paragraph info for a given range of characters inside a 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 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   virtual const Vector2& GetControlSize() const;
62
63   /**
64    * @copydoc Dali::Toolkit::Text::ViewInterface::GetLayoutSize()
65    */
66   virtual const Vector2& GetLayoutSize() const;
67
68   /**
69    * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfGlyphs()
70    */
71   virtual Length GetNumberOfGlyphs() const;
72
73   /**
74    * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphs()
75    */
76   virtual Length GetGlyphs( GlyphInfo* glyphs,
77                             Vector2* glyphPositions,
78                             Vector4* glyphColors,
79                             GlyphIndex glyphIndex,
80                             Length numberOfGlyphs ) const;
81
82   /**
83    * @copydoc Dali::Toolkit::Text::ViewInterface::GetTextColor()
84    */
85   virtual const Vector4& GetTextColor() const;
86
87   /**
88    * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowOffset()
89    */
90   virtual const Vector2& GetShadowOffset() const;
91
92   /**
93    * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowColor()
94    */
95   virtual const Vector4& GetShadowColor() const;
96
97   /**
98    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineColor()
99    */
100   virtual const Vector4& GetUnderlineColor() const;
101
102   /**
103    * @copydoc Dali::Toolkit::Text::ViewInterface::IsUnderlineEnabled()
104    */
105   virtual bool IsUnderlineEnabled() const;
106
107   /**
108    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineHeight()
109    */
110   virtual float GetUnderlineHeight() const;
111
112   /**
113    * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfUnderlineRuns()
114    */
115   virtual Length GetNumberOfUnderlineRuns() const;
116
117   /**
118    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineRuns()
119    */
120   virtual void GetUnderlineRuns( GlyphRun* underlineRuns,
121                                  UnderlineRunIndex index,
122                                  Length numberOfRuns ) const;
123
124 private:
125
126   // Undefined
127   View( const View& handle );
128
129   // Undefined
130   View& operator=( const View& handle );
131
132 private:
133
134   struct Impl;
135   Impl* mImpl;
136 };
137 } // namespace Text
138
139 } // namespace Toolkit
140
141 } // namespace Dali
142
143 #endif // __DALI_TOOLKIT_TEXT_VIEW_H__