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