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/devel-api/text-abstraction/text-abstraction-definitions.h>
25 #include <dali/public-api/object/base-handle.h>
30 namespace TextAbstraction
33 namespace Internal DALI_INTERNAL
42 namespace TextAbstraction
49 class DALI_IMPORT_API Segmentation : public BaseHandle
55 * @brief Create an uninitialized TextAbstraction handle.
63 * This is non-virtual since derived Handle types must not contain data or virtual methods.
68 * @brief This constructor is used by Segmentation::Get().
70 * @param[in] implementation A pointer to the internal segmentation object.
72 explicit DALI_INTERNAL Segmentation( Internal::Segmentation* implementation );
75 * @brief Retrieve a handle to the Segmentation instance.
77 * @return A handle to the Segmentation
79 static Segmentation Get();
82 * @brief Retrieves the line break info.
84 * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
86 * Possible values for LineBreakInfo are:
88 * - 0 is a LINE_MUST_BREAK. Text must be broken into a new line.
89 * - 1 is a LINE_ALLOW_BREAK. Is possible to break the text into a new line.
90 * - 2 is a LINE_NO_BREAK. Text can't be broken into a new line.
93 i.e. Hello big\nworld produces:
97 * @param[in] text Pointer to the first character of the text coded in UTF32.
98 * @param[in] numberOfCharacters The number of characters.
99 * @param[out] breakInfo The line break info.
101 void GetLineBreakPositions( const Character* const text,
102 Length numberOfCharacters,
103 LineBreakInfo* breakInfo );
106 * @brief Retrieves the word break info.
108 * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
110 * Possible values for WordBreakInfo are:
112 * - 0 is a WORD_BREAK. Text can be broken into a new word.
113 * - 1 is a WORD_NO_BREAK. Text can't be broken into a new word.
116 i.e. Hello big\nworld produces:
120 * @param[in] text Pointer to the first character of the text coded in UTF32.
121 * @param[in] numberOfCharacters The number of characters.
122 * @param[out] breakInfo The word break info.
124 void GetWordBreakPositions( const Character* const text,
125 Length numberOfCharacters,
126 WordBreakInfo* breakInfo );
129 } // namespace TextAbstraction
133 #endif // __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__