fix incorrect calculaion of natural size in text
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller-impl-data-clearer.h
1 #ifndef DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_DATA_CLEARER_H
2 #define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_DATA_CLEARER_H
3
4 /*
5  * Copyright (c) 2021 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-toolkit/internal/text/text-controller.h>
23
24 namespace Dali::Toolkit::Text
25 {
26
27 /// Provides methods to clear some of the model data in the Text::Controller::Impl
28 struct ControllerImplDataClearer
29 {
30
31   /**
32    * @brief Helper to clear completely the parts of the model specified by the given @p operations.
33    *
34    * @note It never clears the text stored in utf32.
35    *
36    * @param[in] impl The text controller impl.
37    * @param[in] operations The operations required.
38    */
39   static void ClearFullModelData(Controller::Impl& impl, Controller::OperationsMask operations);
40
41   /**
42    * @brief Helper to clear completely the parts of the model related with the characters specified by the given @p operations.
43    *
44    * @note It never clears the text stored in utf32.
45    *
46    * @param[in] impl The text controller impl.
47    * @param[in] startIndex Index to the first character to be cleared.
48    * @param[in] endIndex Index to the last character to be cleared.
49    * @param[in] operations The operations required.
50    */
51   static void ClearCharacterModelData(Controller::Impl& impl, CharacterIndex startIndex, CharacterIndex endIndex, Controller::OperationsMask operations);
52
53   /**
54    * @brief Helper to clear completely the parts of the model related with the glyphs specified by the given @p operations.
55    *
56    * @note It never clears the text stored in utf32.
57    * @note Character indices are transformed to glyph indices.
58    *
59    * @param[in] impl The text controller impl.
60    * @param[in] startIndex Index to the first character to be cleared.
61    * @param[in] endIndex Index to the last character to be cleared.
62    * @param[in] operations The operations required.
63    */
64   static void ClearGlyphModelData(Controller::Impl& impl, CharacterIndex startIndex, CharacterIndex endIndex, Controller::OperationsMask operations);
65
66   /**
67    * @brief Helper to clear the parts of the model specified by the given @p operations and from @p startIndex to @p endIndex.
68    *
69    * @note It never clears the text stored in utf32.
70    *
71    * @param[in] impl The text controller impl.
72    * @param[in] startIndex Index to the first character to be cleared.
73    * @param[in] endIndex Index to the last character to be cleared.
74    * @param[in] operations The operations required.
75    */
76   static void ClearModelData(Controller::Impl& impl, CharacterIndex startIndex, CharacterIndex endIndex, Controller::OperationsMask operations);
77 };
78
79 } // namespace Dali::Toolkit::Text
80
81 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_DATA_CLEARER_H