1 #ifndef DALI_TOOLKIT_TEXT_VIEW_H
2 #define DALI_TOOLKIT_TEXT_VIEW_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali-toolkit/internal/text/text-view-interface.h>
23 #include <dali-toolkit/internal/text/visual-model-impl.h>
32 * @brief View provides an interface between the Text layout engine and rendering back-end.
34 class View : public ViewInterface
38 * @brief Create a new instance of a View.
43 * @brief Virtual destructor.
48 * @brief Set the visual model.
50 * @param[in] visualModel The visual model used by the View.
52 void SetVisualModel(VisualModelPtr visualModel);
55 * @copydoc Dali::Toolkit::Text::ViewInterface::GetControlSize()
57 const Vector2& GetControlSize() const override;
60 * @copydoc Dali::Toolkit::Text::ViewInterface::GetLayoutSize()
62 const Vector2& GetLayoutSize() const override;
65 * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfGlyphs()
67 Length GetNumberOfGlyphs() const override;
70 * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphs()
72 virtual Length GetGlyphs(GlyphInfo* glyphs,
73 Vector2* glyphPositions,
75 GlyphIndex glyphIndex,
76 Length numberOfGlyphs) const;
79 * @copydoc Dali::Toolkit::Text::ViewInterface::GetColors()
81 const Vector4* const GetColors() const override;
84 * @copydoc Dali::Toolkit::Text::ViewInterface::GetColorIndices()
86 const ColorIndex* const GetColorIndices() const override;
89 * @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColors()
91 const Vector4* const GetBackgroundColors() const override;
94 * @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColorIndices()
96 const ColorIndex* const GetBackgroundColorIndices() const override;
99 * @copydoc Dali::Toolkit::Text::ViewInterface::GetTextColor()
101 const Vector4& GetTextColor() const override;
104 * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowOffset()
106 const Vector2& GetShadowOffset() const override;
109 * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowColor()
111 const Vector4& GetShadowColor() const override;
114 * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineColor()
116 const Vector4& GetUnderlineColor() const override;
119 * @copydoc Dali::Toolkit::Text::ViewInterface::IsUnderlineEnabled()
121 bool IsUnderlineEnabled() const override;
124 * @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
126 const GlyphInfo* GetHyphens() const override;
129 * @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
131 const Length* GetHyphenIndices() const override;
134 * @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
136 Length GetHyphensCount() const override;
139 * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineHeight()
141 float GetUnderlineHeight() const override;
144 * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfUnderlineRuns()
146 Length GetNumberOfUnderlineRuns() const override;
149 * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineRuns()
151 virtual void GetUnderlineRuns(GlyphRun* underlineRuns,
152 UnderlineRunIndex index,
153 Length numberOfRuns) const;
156 * @copydoc Dali::Toolkit::Text::ViewInterface::GetOutlineColor()
158 const Vector4& GetOutlineColor() const override;
161 * @copydoc Dali::Toolkit::Text::ViewInterface::GetOutlineWidth()
163 uint16_t GetOutlineWidth() const override;
167 View(const View& handle);
170 View& operator=(const View& handle);
178 } // namespace Toolkit
182 #endif // DALI_TOOLKIT_TEXT_VIEW_H