1 #ifndef DALI_TOOLKIT_TEXT_MODEL_INTERFACE_H
2 #define DALI_TOOLKIT_TEXT_MODEL_INTERFACE_H
5 * Copyright (c) 2016 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/public-api/math/vector2.h>
25 #include <dali-toolkit/internal/text/layouts/layout-alignment.h>
26 #include <dali-toolkit/internal/text/line-run.h>
27 #include <dali-toolkit/internal/text/text-definitions.h>
39 * @brief Interface class used to retrieve the text's model from the text-controller.
45 * @brief Virtual destructor.
47 virtual ~ModelInterface()
51 * @brief Retrives the control's size.
53 * @return The control's size.
55 virtual const Size& GetControlSize() const = 0;
58 * @brief Retrives the layout's size.
60 * @return The layout's size.
62 virtual const Size& GetLayoutSize() const = 0;
65 * @brief Retrieves the text's scroll position.
67 * @return The scroll position.
69 virtual const Vector2& GetScrollPosition() const = 0;
72 * @brief Retrieves the text's horizontal alignment.
74 * @return The horizontal alignment.
76 virtual Layout::HorizontalAlignment GetHorizontalAlignment() const = 0;
79 * @brief Retrieves the text's vertical alignment.
81 * @return The vertical alignment.
83 virtual Layout::VerticalAlignment GetVerticalAlignment() const = 0;
86 * @brief Whether the text elide property is enabled.
88 * @return @e true if the text elide property is enabled, @e false otherwise.
90 virtual bool IsTextElideEnabled() const = 0;
93 * @brief Retrieves the number of laid-out lines.
95 * @return The number of laid-out lines.
97 virtual Length GetNumberOfLines() const = 0;
100 * @brief Retrieves the laid-out lines.
102 * @return A pointer to the vector with the laid-out lines.
104 virtual const LineRun* const GetLines() const = 0;
107 * @brief Retrieves the number of laid-out glyphs.
109 * @return The number of laid-out glyphs.
111 virtual Length GetNumberOfGlyphs() const = 0;
114 * @brief Retrieves the laid-out glyphs.
116 * @return A pointer to the vector with the laid-out glyphs.
118 virtual const GlyphInfo* const GetGlyphs() const = 0;
121 * @brief Retrieves the text layout.
123 * @return A pointer to the vector with the positions for each glyph.
125 virtual const Vector2* const GetLayout() const = 0;
128 * @brief Retrieves the vector of colors.
130 * @return Pointer to the vector of colors.
132 virtual const Vector4* const GetColors() const = 0;
135 * @brief Retrieves the vector of indices to the vector of colors.
137 * @return Pointer to a vector which stores for each glyph the index to the vector of colors.
139 virtual const ColorIndex* const GetColorIndices() const = 0;
142 * @brief Retrieves the text's default color.
144 * @return The default color.
146 virtual const Vector4& GetDefaultColor() const = 0;
151 } // namespace Toolkit
155 #endif // DALI_TOOLKIT_TEXT_MODEL_INTERFACE_H