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/public-api/math/vector4.h>
25 #include <dali-toolkit/internal/text/text-definitions.h>
39 * @brief Abstract interface to provide the information necessary displaying text.
42 * - The font & glyph IDs needed to get bitmaps etc. from TextAbstraction
43 * - The visual position of each glyph within the layout
44 * - A window into the text layout e.g. which page of a document to view
56 * @brief Virtual destructor
58 virtual ~ViewInterface();
61 * Retrieves the number of glyphs.
63 * @return The number of glyphs.
65 virtual Length GetNumberOfGlyphs() const = 0;
68 * @brief Retrieves glyphs in the given buffer.
70 * The size of the @p glyphs buffer needs to be big enough to copy the @p numberOfGlyphs.
71 * @param[out] glyphs Pointer to a buffer where the glyphs are copied.
72 * @param[in] glyphIndex Index to the first glyph.
73 * @param[in] numberOfGlyphs Number of glyphs to be copied.
75 virtual void GetGlyphs( GlyphInfo* glyphs,
76 GlyphIndex glyphIndex,
77 Length numberOfGlyphs ) const = 0;
80 * @brief Retrieves the glyph positions.
82 * @pre The size of the @p positions buffer needs to be big enough to copy the @p numberOfGlyphs positions.
83 * @param[out] glyphPositions Pointer to a buffer where the glyph positions are copied.
84 * @param[in] glyphIndex Index to the first glyph position.
85 * @param[in] numberOfGlyphs The number of positions to be copied.
87 virtual void GetGlyphPositions( Vector2* glyphPositions,
88 GlyphIndex glyphIndex,
89 Length numberOfGlyphs ) const = 0;
92 * @brief Retrieves the text color
94 * @return The text color
96 virtual const Vector4& GetTextColor() const = 0;
99 * @brief Retrieves the shadow offset, 0 indicates no shadow.
101 * @return The shadow offset.
103 virtual const Vector2& GetShadowOffset() const = 0;
106 * @brief Retrieves the shadow color.
108 * @return The shadow color.
110 virtual const Vector4& GetShadowColor() const = 0;
113 * @brief Retrieves the underline color.
115 * @return The underline color.
117 virtual const Vector4& GetUnderlineColor() const = 0;
120 * @brief Returns whether underline is enabled or not.
122 * @return The underline state.
124 virtual bool IsUnderlineEnabled() const = 0;
127 * @brief Retrieves the underline height override
129 * @return Returns the override height for an underline, 0 indicates that adaptor will determine the height
131 virtual float GetUnderlineHeight() const = 0;
137 } // namespace Toolkit
141 #endif // __DALI_TOOLKIT_TEXT_VIEW_INTERFACE_H__