1 #ifndef __DALI_TOOLKIT_TEXT_VIEW_INTERFACE_H__
2 #define __DALI_TOOLKIT_TEXT_VIEW_INTERFACE_H__
5 * Copyright (c) 2015 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-definitions.h>
37 * @brief Abstract interface to provide the information necessary displaying text.
40 * - The font & glyph IDs needed to get bitmaps etc. from TextAbstraction
41 * - The visual position of each glyph within the layout
42 * - A window into the text layout e.g. which page of a document to view
54 * @brief Virtual destructor
56 virtual ~ViewInterface();
59 * @brief Retrieves the target size of the UI control.
61 * @return The text's size.
63 virtual const Vector2& GetControlSize() const = 0;
66 * Retrieves the number of glyphs.
68 * @return The number of glyphs.
70 virtual Length GetNumberOfGlyphs() const = 0;
73 * @brief Retrieves glyphs and positions in the given buffers.
75 * @note The size of the @p glyphs and @p glyphPositions buffers need to be big enough to copy the @p numberOfGlyphs glyphs and positions.
76 * @note The returned number of glyphs may be less than @p numberOfGlyphs if a line has ellipsis.
78 * @param[out] glyphs Pointer to a buffer where the glyphs are copied.
79 * @param[out] glyphPositions Pointer to a buffer where the glyph positions are copied.
80 * @param[in] glyphIndex Index to the first glyph.
81 * @param[in] numberOfGlyphs Number of glyphs to be copied.
83 * @return The number of glyphs.
85 virtual Length GetGlyphs( GlyphInfo* glyphs,
86 Vector2* glyphPositions,
87 GlyphIndex glyphIndex,
88 Length numberOfGlyphs ) const = 0;
91 * @brief Retrieves the text color
93 * @return The text color
95 virtual const Vector4& GetTextColor() const = 0;
98 * @brief Retrieves the shadow offset, 0 indicates no shadow.
100 * @return The shadow offset.
102 virtual const Vector2& GetShadowOffset() const = 0;
105 * @brief Retrieves the shadow color.
107 * @return The shadow color.
109 virtual const Vector4& GetShadowColor() const = 0;
112 * @brief Retrieves the underline color.
114 * @return The underline color.
116 virtual const Vector4& GetUnderlineColor() const = 0;
119 * @brief Returns whether underline is enabled or not.
121 * @return The underline state.
123 virtual bool IsUnderlineEnabled() const = 0;
126 * @brief Retrieves the underline height override
128 * @return Returns the override height for an underline, 0 indicates that adaptor will determine the height
130 virtual float GetUnderlineHeight() const = 0;
136 } // namespace Toolkit
140 #endif // __DALI_TOOLKIT_TEXT_VIEW_INTERFACE_H__