1 #ifndef __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__
2 #define __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_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/text-abstraction/text-abstraction.h>
25 #include <dali/public-api/object/base-handle.h>
30 namespace Internal DALI_INTERNAL
33 namespace TextAbstraction
39 namespace TextAbstraction
46 class DALI_IMPORT_API Segmentation : public BaseHandle
52 * @brief Create an uninitialized TextAbstraction handle.
60 * This is non-virtual since derived Handle types must not contain data or virtual methods.
65 * @brief This constructor is used by Segmentation::Get().
67 * @param[in] implementation A pointer to the internal segmentation object.
69 explicit DALI_INTERNAL Segmentation( Dali::Internal::TextAbstraction::Segmentation* implementation );
72 * @brief Retrieve a handle to the Segmentation instance.
74 * @return A handle to the Segmentation
76 static Segmentation Get();
79 * @brief Retrieves the line break info.
81 * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
83 * Possible values for LineBreakInfo are:
85 * - 0 is a LINE_MUST_BREAK. Text must be broken into a new line.
86 * - 1 is a LINE_ALLOW_BREAK. Is possible to break the text into a new line.
87 * - 2 is a LINE_NO_BREAK. Text can't be broken into a new line.
90 i.e. Hello big\nworld produces:
94 * @param[in] text Pointer to the first character of the text coded in UTF32.
95 * @param[in] numberOfCharacters The number of characters.
96 * @param[out] breakInfo The line break info.
98 void GetLineBreakPositions( const Character* const text,
99 Length numberOfCharacters,
100 LineBreakInfo* breakInfo );
103 * @brief Retrieves the word break info.
105 * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
107 * Possible values for WordBreakInfo are:
109 * - 0 is a WORD_BREAK. Text can be broken into a new word.
110 * - 1 is a WORD_NO_BREAK. Text can't be broken into a new word.
113 i.e. Hello big\nworld produces:
117 * @param[in] text Pointer to the first character of the text coded in UTF32.
118 * @param[in] numberOfCharacters The number of characters.
119 * @param[out] breakInfo The word break info.
121 void GetWordBreakPositions( const Character* const text,
122 Length numberOfCharacters,
123 WordBreakInfo* breakInfo );
126 } // namespace TextAbstraction
130 #endif // __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__