1 #ifndef DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_DATA_CLEARER_H
2 #define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_DATA_CLEARER_H
5 * Copyright (c) 2021 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-toolkit/internal/text/text-controller.h>
24 namespace Dali::Toolkit::Text
27 /// Provides methods to clear some of the model data in the Text::Controller::Impl
28 struct ControllerImplDataClearer
32 * @brief Helper to clear completely the parts of the model specified by the given @p operations.
34 * @note It never clears the text stored in utf32.
36 * @param[in] impl The text controller impl.
37 * @param[in] operations The operations required.
39 static void ClearFullModelData(Controller::Impl& impl, Controller::OperationsMask operations);
42 * @brief Helper to clear completely the parts of the model related with the characters specified by the given @p operations.
44 * @note It never clears the text stored in utf32.
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.
51 static void ClearCharacterModelData(Controller::Impl& impl, CharacterIndex startIndex, CharacterIndex endIndex, Controller::OperationsMask operations);
54 * @brief Helper to clear completely the parts of the model related with the glyphs specified by the given @p operations.
56 * @note It never clears the text stored in utf32.
57 * @note Character indices are transformed to glyph indices.
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.
64 static void ClearGlyphModelData(Controller::Impl& impl, CharacterIndex startIndex, CharacterIndex endIndex, Controller::OperationsMask operations);
67 * @brief Helper to clear the parts of the model specified by the given @p operations and from @p startIndex to @p endIndex.
69 * @note It never clears the text stored in utf32.
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.
76 static void ClearModelData(Controller::Impl& impl, CharacterIndex startIndex, CharacterIndex endIndex, Controller::OperationsMask operations);
79 } // namespace Dali::Toolkit::Text
81 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_DATA_CLEARER_H