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