1 #ifndef DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H
2 #define DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H
5 * Copyright (c) 2019 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/devel-api/text-abstraction/text-abstraction-definitions.h>
23 #include <dali/public-api/dali-adaptor-common.h>
26 #include <dali/public-api/object/base-handle.h>
31 namespace TextAbstraction
34 namespace Internal DALI_INTERNAL
43 namespace TextAbstraction
50 class DALI_ADAPTOR_API Segmentation : public BaseHandle
56 * @brief Create an uninitialized TextAbstraction handle.
64 * This is non-virtual since derived Handle types must not contain data or virtual methods.
69 * @brief This constructor is used by Segmentation::Get().
71 * @param[in] implementation A pointer to the internal segmentation object.
73 explicit DALI_INTERNAL Segmentation( Internal::Segmentation* implementation );
76 * @brief Retrieve a handle to the Segmentation instance.
78 * @return A handle to the Segmentation
80 static Segmentation Get();
83 * @brief Retrieves the line break info.
85 * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
87 * Possible values for LineBreakInfo are:
89 * - 0 is a LINE_MUST_BREAK. Text must be broken into a new line.
90 * - 1 is a LINE_ALLOW_BREAK. Is possible to break the text into a new line.
91 * - 2 is a LINE_NO_BREAK. Text can't be broken into a new line.
94 i.e. Hello big\nworld produces:
98 * @param[in] text Pointer to the first character of the text coded in UTF32.
99 * @param[in] numberOfCharacters The number of characters.
100 * @param[out] breakInfo The line break info.
102 void GetLineBreakPositions( const Character* const text,
103 Length numberOfCharacters,
104 LineBreakInfo* breakInfo );
107 * @brief Retrieves the word break info.
109 * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
111 * Possible values for WordBreakInfo are:
113 * - 0 is a WORD_BREAK. Text can be broken into a new word.
114 * - 1 is a WORD_NO_BREAK. Text can't be broken into a new word.
117 i.e. Hello big\nworld produces:
121 * @param[in] text Pointer to the first character of the text coded in UTF32.
122 * @param[in] numberOfCharacters The number of characters.
123 * @param[out] breakInfo The word break info.
125 void GetWordBreakPositions( const Character* const text,
126 Length numberOfCharacters,
127 WordBreakInfo* breakInfo );
130 } // namespace TextAbstraction
134 #endif // DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H