[dali_2.3.20] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / text-controls / text-spannable.h
1 #ifndef DALI_TOOLKIT_TEXT_TEXT_SPANNABLE_H
2 #define DALI_TOOLKIT_TEXT_TEXT_SPANNABLE_H
3
4 /*
5  * Copyright (c) 2022 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/devel-api/text/spanned.h>
23 #include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
24 #include <dali-toolkit/public-api/controls/text-controls/text-field.h>
25 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31 namespace Text
32 {
33 /**
34  * @brief Set the @p spannedText into @p textLabel
35  * the spanned text contains content (text) and format (spans with ranges)
36  * the text is copied into text-controller and the spans are applied on ranges
37  *
38  * @note the TEXT in @p textLabel will be replaced with text from @p spannedText
39  * and all the applied styles @p textLabel will be replaced the styles from @p spannedText
40  * in-case there are styles were applied from markup-processor will be removed
41  *
42  *
43  * @param[in] textLabel The instance of TextLabel.
44  * @param[in] spannedText the text with spans.
45  */
46 DALI_TOOLKIT_API void SetSpannedText(TextLabel textLabel, const Spanned& spannedText);
47
48 /**
49  * @brief Set the @p spannedText into @p textField
50  * the spanned text contains content (text) and format (spans with ranges)
51  * the text is copied into text-controller and the spans are applied on ranges
52  *
53  * @note the TEXT in @p textField will be replaced with text from @p spannedText
54  * and all the applied styles @p textField will be replaced the styles from @p spannedText
55  * in-case there are styles were applied from markup-processor will be removed
56  *
57  *
58  * @param[in] textField The instance of TextField.
59  * @param[in] spannedText the text with spans.
60  */
61 DALI_TOOLKIT_API void SetSpannedText(TextField textField, const Spanned& spannedText);
62
63 /**
64  * @brief Set the @p spannedText into @p textEditor
65  * the spanned text contains content (text) and format (spans with ranges)
66  * the text is copied into text-controller and the spans are applied on ranges
67  *
68  * @note the TEXT in @p textEditor will be replaced with text from @p spannedText
69  * and all the applied styles @p textEditor will be replaced the styles from @p spannedText
70  * in-case there are styles were applied from markup-processor will be removed
71  *
72  *
73  * @param[in] textEditor The instance of TextEditor.
74  * @param[in] spannedText the text with spans.
75  */
76 DALI_TOOLKIT_API void SetSpannedText(TextEditor textEditor, const Spanned& spannedText);
77
78 } // namespace Text
79
80 } // namespace Toolkit
81
82 } // namespace Dali
83
84 #endif // DALI_TOOLKIT_TEXT_TEXT_SPANNABLE_H