Resolve incorrect position for Ellipsis when mixed LTR & RTL languages and set layout...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / segmentation.h
1 #ifndef DALI_TOOLKIT_TEXT_SEGMENTATION_H
2 #define DALI_TOOLKIT_TEXT_SEGMENTATION_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 <dali/public-api/common/dali-vector.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/text/text-definitions.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31 namespace Text
32 {
33 class LogicalModel;
34
35 /**
36  * Sets line break info.
37  *
38  * Possible values for LineBreakInfo are:
39  *
40  *  - 0 is a LINE_MUST_BREAK.  Text must be broken into a new line.
41  *  - 1 is a LINE_ALLOW_BREAK. Is possible to break the text into a new line.
42  *  - 2 is a LINE_NO_BREAK.    Text can't be broken into a new line.
43  *
44  * @param[in] text Vector of UTF-32 characters.
45  * @param[in] startIndex The character from where the break info is set.
46  * @param[in] numberOfCharacters The number of characters.
47  * @param[out] lineBreakInfo The line break info
48  */
49 void SetLineBreakInfo(const Vector<Character>& text,
50                       CharacterIndex           startIndex,
51                       Length                   numberOfCharacters,
52                       Vector<LineBreakInfo>&   lineBreakInfo);
53
54 /**
55  * Sets word break info.
56  *
57  * - 0 is a WORD_BREAK.    Text can be broken into a new word.
58  * - 1 is a WORD_NO_BREAK. Text can't be broken into a new word.
59  *
60  * @param[in] text Vector of UTF-32 characters.
61  * @param[in] startIndex The character from where the break info is set.
62  * @param[in] numberOfCharacters The number of characters.
63  * @param[out] wordBreakInfo The word break info.
64  */
65 void SetWordBreakInfo(const Vector<Character>& text,
66                       CharacterIndex           startIndex,
67                       Length                   numberOfCharacters,
68                       Vector<WordBreakInfo>&   wordBreakInfo);
69
70 } // namespace Text
71
72 } // namespace Toolkit
73
74 } // namespace Dali
75
76 #endif // DALI_TOOLKIT_TEXT_SEGMENTATION_H