Merge "Set proper locale to harfbuzz" into devel/master
[platform/core/uifw/dali-adaptor.git] / text / dali / devel-api / text-abstraction / segmentation.h
1 #ifndef __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__
2 #define __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__
3
4 /*
5  * Copyright (c) 2015 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 // INTERNAL INCLUDES
22 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
23
24 // EXTERNAL INCLUDES
25 #include <dali/public-api/object/base-handle.h>
26
27 namespace Dali
28 {
29
30 namespace TextAbstraction
31 {
32
33 namespace Internal DALI_INTERNAL
34 {
35
36 class Segmentation;
37
38 } // Internal
39
40 } // TextAbstraction
41
42 namespace TextAbstraction
43 {
44
45 /**
46  *   Segmentation API
47  *
48  */
49 class DALI_IMPORT_API Segmentation : public BaseHandle
50 {
51
52 public:
53
54   /**
55    * @brief Create an uninitialized TextAbstraction handle.
56    *
57    */
58   Segmentation();
59
60   /**
61    * @brief Destructor
62    *
63    * This is non-virtual since derived Handle types must not contain data or virtual methods.
64    */
65   ~Segmentation();
66
67   /**
68    * @brief This constructor is used by Segmentation::Get().
69    *
70    * @param[in] implementation A pointer to the internal segmentation object.
71    */
72   explicit DALI_INTERNAL Segmentation( Internal::Segmentation* implementation );
73
74   /**
75    * @brief Retrieve a handle to the Segmentation instance.
76    *
77    * @return A handle to the Segmentation
78    */
79   static Segmentation Get();
80
81   /**
82    * @brief Retrieves the line break info.
83    *
84    * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
85    *
86    * Possible values for LineBreakInfo are:
87    *
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.
91    *
92      @verbatim
93      i.e. Hello big\nworld produces:
94           2222212220 22220
95      @endverbatim
96    *
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.
100    */
101   void GetLineBreakPositions( const Character* const text,
102                               Length numberOfCharacters,
103                               LineBreakInfo* breakInfo );
104
105   /**
106    * @brief Retrieves the word break info.
107    *
108    * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
109    *
110    * Possible values for WordBreakInfo are:
111    *
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.
114    *
115      @verbatim
116      i.e. Hello big\nworld produces:
117           1111001100 11110
118      @endverbatim
119    *
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.
123    */
124   void GetWordBreakPositions( const Character* const text,
125                               Length numberOfCharacters,
126                               WordBreakInfo* breakInfo );
127 };
128
129 } // namespace TextAbstraction
130
131 } // namespace Dali
132
133 #endif // __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__