[dali_2.1.30] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / markup-processor-underline.h
1 #ifndef DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_UNDERLINE_H
2 #define DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_UNDERLINE_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 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/dali-vector.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/text/underlined-character-run.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31 namespace Text
32 {
33 struct Tag;
34 struct Attribute;
35
36 /**
37  * @brief Fill the underlined character run with the type attribute value.
38  *
39  * @param[in] attribute the type attribute.
40  * @param[out] underlinedCharacterRun The underlined character run
41  */
42 void ProcessTypeAttribute(const Attribute& attribute, UnderlinedCharacterRun& underlinedCharacterRun);
43
44 /**
45  * @brief Fill the underlined character run with the dash-gap attribute value.
46  *
47  * @param[in] attribute the dash-gap attribute.
48  * @param[out] underlinedCharacterRun The underlined character run
49  */
50 void ProcessDashGapAttribute(const Attribute& attribute, UnderlinedCharacterRun& underlinedCharacterRun);
51
52 /**
53  * @brief Fill the underlined character run with the dash-width attribute value.
54  *
55  * @param[in] attribute the dash-width attribute.
56  * @param[out] underlinedCharacterRun The underlined character run
57  */
58 void ProcessDashWidthAttribute(const Attribute& attribute, UnderlinedCharacterRun& underlinedCharacterRun);
59
60 /**
61  * @brief Fill the underlined character run with the height attribute value.
62  *
63  * @param[in] attribute the height attribute.
64  * @param[out] underlinedCharacterRun The underlined character run
65  */
66 void ProcessHeightAttribute(const Attribute& attribute, UnderlinedCharacterRun& underlinedCharacterRun);
67
68 /**
69  * @brief Fill the underlined character run with the color attribute value.
70  *
71  * @param[in] attribute the color attribute.
72  * @param[out] underlinedCharacterRun The underlined character run
73  */
74 void ProcessColorAttribute(const Attribute& attribute, UnderlinedCharacterRun& underlinedCharacterRun);
75
76 /**
77  * @brief Retrieves the underline run info from the tag and sets it to the underline run.
78  *
79  * @param[in] tag The underline tag and its attributes.
80  * @param[in,out] underlinedCharacterRun The underlined character run
81  */
82 void ProcessUnderlineTag(const Tag& tag, UnderlinedCharacterRun& underlinedCharacterRun);
83
84 /**
85  * @brief Override the run's attributes which contained in the previous run. This is to handle the nested tags.
86  *
87  * @param[in,out] underlinedCharacterRuns The list of underlined character run
88  */
89 void OverrideNestedUnderlinedCharacterRuns(Vector<UnderlinedCharacterRun>& underlinedCharacterRuns);
90
91 } // namespace Text
92
93 } // namespace Toolkit
94
95 } // namespace Dali
96
97 #endif // DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_UNDERLINE_H