Add text wrapping hyphen mode support
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / text-abstraction / text-abstraction-definitions.h
1 #ifndef DALI_TEXT_ABSTRACTION_DEFINITIONS_H
2 #define DALI_TEXT_ABSTRACTION_DEFINITIONS_H
3
4 /*
5  * Copyright (c) 2021 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 // EXTERNAL INCLUDES
22 #include <stdint.h>
23
24 namespace Dali
25 {
26 namespace TextAbstraction
27 {
28 typedef uint32_t FontId;             ///< The unique identifier for a font face (generated by FontClient)
29 typedef uint32_t PointSize26Dot6;    ///< The point size in 26.6 fractional points
30 typedef uint32_t FaceIndex;          ///< Used with fonts which allow several font faces
31 typedef uint32_t GlyphIndex;         ///< Uniquely identifies a glyph within a particular font
32 typedef uint32_t Character;          ///< A UTF-32 representation of a character
33 typedef uint32_t CharacterIndex;     ///< An index into an array of characters
34 typedef uint32_t Length;             ///< The length of an array
35 typedef uint32_t BidiInfoIndex;      ///< Index to the bidirectional info for a paragraph.
36 typedef char     LineBreakInfo;      ///< Line break info (must break, allow break, no break).
37 typedef char     WordBreakInfo;      ///< Word break info (break, no break).
38 typedef bool     CharacterDirection; ///< The character's direction: @e false is left to right, @e true is right to left.
39 typedef uint32_t ColorIndex;         ///< An index into an array of colors.
40
41 /**
42  * @brief Enumerates the possible line break info values.
43  */
44 enum
45 {
46   LINE_MUST_BREAK        = 0u, ///< Text must be broken into a new line.
47   LINE_ALLOW_BREAK       = 1u, ///< Is possible to break the text into a new line.
48   LINE_NO_BREAK          = 2u, ///< Text can't be broken into a new line.
49   LINE_INSIDEACHAR       = 3u, ///< A UTF-8/16 sequence is unfinished.
50   LINE_INDETERMINATE     = 4u, ///< End of input on a non-EOL char.
51   LINE_HYPHENATION_BREAK = 5u  ///< Text can be broken with adding hyphen.
52 };
53
54 /**
55  * @brief Enumerates the possible word break info values.
56  */
57 enum
58 {
59   WORD_BREAK    = 0u, ///< Text can be broken into a new word.
60   WORD_NO_BREAK = 1u, ///< Text can't be broken into a new word.
61 };
62
63 enum GlyphType
64 {
65   BITMAP_GLYPH, ///< Glyph stored as pixels.
66   VECTOR_GLYPH  ///< Glyph stored as vectors (scalable). This feature requires highp shader support and is not available on all platforms.
67 };
68
69 struct VectorBlob
70 {
71   unsigned char r;
72   unsigned char g;
73   unsigned char b;
74   unsigned char a;
75 };
76
77 /**
78 * @brief Defines how a color is blended.
79 */
80 enum class ColorBlendingMode
81 {
82   NONE,    ///< No blend.
83   MULTIPLY ///< The color is multiplied by another one.
84 };
85
86 } // namespace TextAbstraction
87
88 } // namespace Dali
89
90 #endif // DALI_TEXT_ABSTRACTION_DEFINITIONS_H