1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_DECLARATION_COMMON_DECLARATION_CONSTANTS_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_DECLARATION_COMMON_DECLARATION_CONSTANTS_H
18 
19 #include <memory>
20 
21 #include "core/components/declaration/badge/badge_declaration.h"
22 #include "core/components/declaration/button/button_declaration.h"
23 #include "core/components/declaration/clock/clock_declaration.h"
24 #include "core/components/declaration/common/attribute.h"
25 #include "core/components/declaration/common/event.h"
26 #include "core/components/declaration/common/method.h"
27 #include "core/components/declaration/common/style.h"
28 #include "core/components/declaration/div/div_declaration.h"
29 #include "core/components/declaration/image/image_animator_declaration.h"
30 #include "core/components/declaration/input/input_declaration.h"
31 #include "core/components/declaration/piece/piece_declaration.h"
32 #include "core/components/declaration/qrcode/qrcode_declaration.h"
33 #include "core/components/declaration/richtext/rich_text_declaration.h"
34 #include "core/components/declaration/search/search_declaration.h"
35 #include "core/components/declaration/side_bar/side_bar_declaration.h"
36 #include "core/components/declaration/span/span_declaration.h"
37 #include "core/components/declaration/svg/svg_animate_declaration.h"
38 #include "core/components/declaration/svg/svg_base_declaration.h"
39 #include "core/components/declaration/svg/svg_circle_declaration.h"
40 #include "core/components/declaration/svg/svg_declaration.h"
41 #include "core/components/declaration/svg/svg_ellipse_declaration.h"
42 #include "core/components/declaration/svg/svg_fe_blend_declaration.h"
43 #include "core/components/declaration/svg/svg_fe_colormatrix_declaration.h"
44 #include "core/components/declaration/svg/svg_fe_composite_declaration.h"
45 #include "core/components/declaration/svg/svg_fe_flood_declaration.h"
46 #include "core/components/declaration/svg/svg_fe_func_declaration.h"
47 #include "core/components/declaration/svg/svg_fe_gaussianblur_declaration.h"
48 #include "core/components/declaration/svg/svg_fe_merge_declaration.h"
49 #include "core/components/declaration/svg/svg_fe_merge_node_declaration.h"
50 #include "core/components/declaration/svg/svg_fe_offset_declaration.h"
51 #include "core/components/declaration/svg/svg_filter_declaration.h"
52 #include "core/components/declaration/svg/svg_gradient_declaration.h"
53 #include "core/components/declaration/svg/svg_image_declaration.h"
54 #include "core/components/declaration/svg/svg_line_declaration.h"
55 #include "core/components/declaration/svg/svg_mask_declaration.h"
56 #include "core/components/declaration/svg/svg_path_declaration.h"
57 #include "core/components/declaration/svg/svg_pattern_declaration.h"
58 #include "core/components/declaration/svg/svg_polygon_declaration.h"
59 #include "core/components/declaration/svg/svg_rect_declaration.h"
60 #include "core/components/declaration/svg/svg_stop_declaration.h"
61 #include "core/components/declaration/svg/svg_text_declaration.h"
62 #include "core/components/declaration/svg/svg_text_path_declaration.h"
63 #include "core/components/declaration/swiper/swiper_declaration.h"
64 #include "core/components/declaration/text/text_declaration.h"
65 #include "core/components/declaration/textfield/textfield_declaration.h"
66 #include "core/components/declaration/texttimer/texttimer_declaration.h"
67 #include "core/components/declaration/web/web_declaration.h"
68 #include "core/components/declaration/xcomponent/xcomponent_declaration.h"
69 
70 namespace OHOS::Ace {
71 
72 class DeclarationConstants {
73 public:
74     // attributes, styles, events and methods supported default.
75     static const std::vector<AttributeTag> DEFAULT_ATTRS;
76     static const std::vector<StyleTag> DEFAULT_STYLES;
77     static const std::vector<EventTag> DEFAULT_EVENTS;
78     static const std::vector<MethodTag> DEFAULT_METHODS;
79 
80     // default value of common attribute
81     static const std::shared_ptr<CommonAttribute> DEFAULT_COMMON_ATTR;
82     static const std::shared_ptr<CommonDisabledAttribute> DEFAULT_DISABLED_ATTR;
83     static const std::shared_ptr<CommonFocusableAttribute> DEFAULT_FOCUSABLE_ATTR;
84     static const std::shared_ptr<CommonTouchableAttribute> DEFAULT_TOUCHABLE_ATTR;
85     static const std::shared_ptr<CommonDataAttribute> DEFAULT_DATA_ATTR;
86     static const std::shared_ptr<CommonClickEffectAttribute> DEFAULT_CLICK_EFFECT_ATTR;
87     static const std::shared_ptr<CommonRenderAttribute> DEFAULT_RENDER_ATTR;
88     static const std::shared_ptr<CommonMultimodalAttribute> DEFAULT_MULTI_MODAL_ATTR;
89 
90     // default value of common style
91     static const std::shared_ptr<CommonStyle> DEFAULT_COMMON_STYLE;
92     static const std::shared_ptr<CommonSizeStyle> DEFAULT_SIZE_STYLE;
93     static const std::shared_ptr<CommonMarginStyle> DEFAULT_MARGIN_STYLE;
94     static const std::shared_ptr<CommonPaddingStyle> DEFAULT_PADDING_STYLE;
95     static const std::shared_ptr<CommonBorderStyle> DEFAULT_BORDER_STYLE;
96     static const std::shared_ptr<CommonBackgroundStyle> DEFAULT_BACKGROUND_STYLE;
97     static const std::shared_ptr<CommonFlexStyle> DEFAULT_FLEX_STYLE;
98     static const std::shared_ptr<CommonPositionStyle> DEFAULT_POSITION_STYLE;
99     static const std::shared_ptr<CommonOpacityStyle> DEFAULT_OPACITY_STYLE;
100     static const std::shared_ptr<CommonVisibilityStyle> DEFAULT_VISIBILITY_STYLE;
101     static const std::shared_ptr<CommonDisplayStyle> DEFAULT_DISPLAY_STYLE;
102     static const std::shared_ptr<CommonShadowStyle> DEFAULT_SHADOW_STYLE;
103     static const std::shared_ptr<CommonOverflowStyle> DEFAULT_OVERFLOW_STYLE;
104     static const std::shared_ptr<CommonFilterStyle> DEFAULT_FILTER_STYLE;
105     static const std::shared_ptr<CommonAnimationStyle> DEFAULT_ANIMATION_STYLE;
106     static const std::shared_ptr<CommonShareTransitionStyle> DEFAULT_SHARE_TRANSITION_STYLE;
107     static const std::shared_ptr<CommonCardTransitionStyle> DEFAULT_CARD_TRANSITION_STYLE;
108     static const std::shared_ptr<CommonPageTransitionStyle> DEFAULT_PAGE_TRANSITION_STYLE;
109     static const std::shared_ptr<CommonClipPathStyle> DEFAULT_CLIP_PATH_STYLE;
110     static const std::shared_ptr<CommonMaskStyle> DEFAULT_MASK_STYLE;
111     static const std::shared_ptr<CommonImageStyle> DEFAULT_IMAGE_STYLE;
112 
113     // default value of common event
114     static const std::shared_ptr<CommonRawEvent> DEFAULT_RAW_EVENT;
115     static const std::shared_ptr<CommonGestureEvent> DEFAULT_GESTURE_EVENT;
116     static const std::shared_ptr<CommonFocusEvent> DEFAULT_FOCUS_EVENT;
117     static const std::shared_ptr<CommonKeyEvent> DEFAULT_KEY_EVENT;
118     static const std::shared_ptr<CommonMouseEvent> DEFAULT_MOUSE_EVENT;
119     static const std::shared_ptr<CommonSwipeEvent> DEFAULT_SWIPE_EVENT;
120     static const std::shared_ptr<CommonAttachEvent> DEFAULT_ATTACH_EVENT;
121     static const std::shared_ptr<CommonCrownEvent> DEFAULT_CROWN_EVENT;
122 
123     // default value of common event
124     static const std::shared_ptr<CommonMethod> DEFAULT_METHOD;
125 
126     // default value of badge
127     static const std::shared_ptr<BadgeAttribute> DEFAULT_BADGE_ATTR;
128     static const std::shared_ptr<BadgeStyle> DEFAULT_BADGE_STYLE;
129     static const std::shared_ptr<BadgeEvent> DEFAULT_BADGE_EVENT;
130 
131     // default value of button
132     static const std::shared_ptr<ButtonAttribute> DEFAULT_BUTTON_ATTR;
133     static const std::shared_ptr<ButtonStyle> DEFAULT_BUTTON_STYLE;
134     static const std::shared_ptr<ButtonEvent> DEFAULT_BUTTON_EVENT;
135     static const std::shared_ptr<ButtonMethod> DEFAULT_BUTTON_METHOD;
136 
137     // default value of div
138     static const std::shared_ptr<DivAttribute> DEFAULT_DIV_ATTR;
139     static const std::shared_ptr<DivStyle> DEFAULT_DIV_STYLE;
140 
141     // default value of input
142     static const std::shared_ptr<InputAttribute> DEFAULT_INPUT_ATTR;
143 
144     // default value of piece
145     static const std::shared_ptr<PieceAttribute> DEFAULT_PIECE_ATTR;
146     static const std::shared_ptr<PieceStyle> DEFAULT_PIECE_STYLE;
147     static const std::shared_ptr<PieceEvent> DEFAULT_PIECE_EVENT;
148 
149     // default value of qrcode
150     static const std::shared_ptr<QrcodeAttribute> DEFAULT_QRCODE_ATTR;
151     static const std::shared_ptr<QrcodeStyle> DEFAULT_QRCODE_STYLE;
152 
153     // default value of search
154     static const std::shared_ptr<SearchAttribute> DEFAULT_SEARCH_ATTR;
155     static const std::shared_ptr<SearchStyle> DEFAULT_SEARCH_STYLE;
156     static const std::shared_ptr<SearchEvent> DEFAULT_SEARCH_EVENT;
157     static const std::shared_ptr<SearchMethod> DEFAULT_SEARCH_METHOD;
158 
159     // default value of side bar
160     static const std::shared_ptr<SideBarContainerAttribute> DEFAULT_SIDE_BAR_ATTR;
161     static const std::shared_ptr<RegionEvent> DEFAULT_REGION_EVENT;
162 
163     // default value of span
164     static const std::shared_ptr<SpanAttribute> DEFAULT_SPAN_ATTR;
165     static const std::shared_ptr<SpanStyle> DEFAULT_SPAN_STYLE;
166 
167     // default value of swiper
168     static const std::shared_ptr<SwiperAttribute> DEFAULT_SWIPER_ATTR;
169     static const std::shared_ptr<SwiperStyle> DEFAULT_SWIPER_STYLE;
170     static const std::shared_ptr<SwiperEvent> DEFAULT_SWIPER_EVENT;
171     static const std::shared_ptr<SwiperMethod> DEFAULT_SWIPER_METHOD;
172 
173     // default value of text
174     static const std::shared_ptr<TextSpecializedAttribute> DEFAULT_TEXT_ATTR;
175     static const std::shared_ptr<TextSpecializedStyle> DEFAULT_TEXT_STYLE;
176 
177     // default value of textfield
178     static const std::shared_ptr<TextFieldAttribute> DEFAULT_TEXTFIELD_ATTR;
179     static const std::shared_ptr<TextFieldStyle> DEFAULT_TEXTFIELD_STYLE;
180     static const std::shared_ptr<TextFieldEvent> DEFAULT_TEXTFIELD_EVENT;
181     static const std::shared_ptr<TextFieldMethod> DEFAULT_TEXTFIELD_METHOD;
182 
183     // default value of texttimer
184     static const std::shared_ptr<TextTimerAttribute> DEFAULT_TEXTTIMER_ATTR;
185     static const std::shared_ptr<TextTimerStyle> DEFAULT_TEXTTIMER_STYLE;
186     static const std::shared_ptr<TextTimerEvent> DEFAULT_TEXTTIMER_EVENT;
187     static const std::shared_ptr<TextTimerMethod> DEFAULT_TEXTTIMER_METHOD;
188 
189     // default value of svg
190     static const std::shared_ptr<SvgAnimateAttribute> DEFAULT_SVG_ANIMATE_ATTR;
191     static const std::shared_ptr<SvgAttribute> DEFAULT_SVG_ATTR;
192     static const std::shared_ptr<SvgBaseAttribute> DEFAULT_SVG_BASE_ATTR;
193     static const std::shared_ptr<SvgCircleAttribute> DEFAULT_SVG_CIRCLE_ATTR;
194     static const std::shared_ptr<SvgEllipseAttribute> DEFAULT_SVG_ELLIPSE_ATTR;
195     static const std::shared_ptr<SvgImageAttribute> DEFAULT_SVG_IMAGE_ATTR;
196     static const std::shared_ptr<SvgLineAttribute> DEFAULT_SVG_LINE_ATTR;
197     static const std::shared_ptr<SvgMaskAttribute> DEFAULT_SVG_MASK_ATTR;
198     static const std::shared_ptr<SvgPathAttribute> DEFAULT_SVG_PATH_ATTR;
199     static const std::shared_ptr<SvgPatternAttribute> DEFAULT_SVG_PATTERN_ATTR;
200     static const std::shared_ptr<SvgPolygonAttribute> DEFAULT_SVG_POLYGON_ATTR;
201     static const std::shared_ptr<SvgRectAttribute> DEFAULT_SVG_RECT_ATTR;
202     static const std::shared_ptr<SvgTextAttribute> DEFAULT_SVG_TEXT_ATTR;
203     static const std::shared_ptr<SvgTextPathAttribute> DEFAULT_SVG_TEXT_PATH_ATTR;
204     static const std::shared_ptr<SvgStopAttribute> DEFAULT_SVG_STOP_ATTR;
205     static const std::shared_ptr<SvgGradientAttribute> DEFAULT_SVG_GRADIENT_ATTR;
206     static const std::shared_ptr<SvgFilterAttribute> DEFAULT_SVG_FILTER_ATTR;
207     static const std::shared_ptr<SvgFeColorMatrixAttribute> DEFAULT_SVG_FE_COLORMATRIX_ATTR;
208     static const std::shared_ptr<SvgFeAttribute> DEFAULT_SVG_FE_COMPONENT_TRANSFER_ATTR;
209     static const std::shared_ptr<SvgFeCompositeAttribute> DEFAULT_SVG_FE_COMPOSITE_ATTR;
210     static const std::shared_ptr<SvgFeOffsetAttribute> DEFAULT_SVG_FE_OFFSET_ATTR;
211     static const std::shared_ptr<SvgFeFuncAttribute> DEFAULT_SVG_FE_FUNC_ATTR;
212     static const std::shared_ptr<SvgFeFloodAttribute> DEFAULT_SVG_FE_FLOOD_ATTR;
213     static const std::shared_ptr<SvgFeGaussianBlurAttribute> DEFAULT_SVG_FE_GAUSSIAN_BLUR_ATTR;
214     static const std::shared_ptr<SvgFeMergeAttribute> DEFAULT_SVG_FE_MERGE_ATTR;
215     static const std::shared_ptr<SvgFeMergeNodeAttribute> DEFAULT_SVG_FE_MERGE_NODE_ATTR;
216     static const std::shared_ptr<SvgFeBlendAttribute> DEFAULT_SVG_FE_BLEND_ATTR;
217 
218     // default value of image_animator
219     static const std::shared_ptr<ImageAnimatorAttribute> DEFAULT_IMAGE_ANIMATOR_ATTR;
220 
221     // default value of web
222     static const std::shared_ptr<WebAttribute> DEFAULT_WEB_ATTR;
223     static const std::shared_ptr<WebEvent> DEFAULT_WEB_EVENT;
224     static const std::shared_ptr<WebMethod> DEFAULT_WEB_METHOD;
225 
226     // default value of richtext
227     static const std::shared_ptr<RichTextAttribute> DEFAULT_RICH_TEXT_ATTR;
228     static const std::shared_ptr<RichTextEvent> DEFAULT_RICH_TEXT_EVENT;
229 
230     // default value of clock
231     static const std::shared_ptr<ClockAttribute> DEFAULT_CLOCK_ATTR;
232     static const std::shared_ptr<ClockStyle> DEFAULT_CLOCK_STYLE;
233     static const std::shared_ptr<ClockEvent> DEFAULT_CLOCK_EVENT;
234 
235     // default value of xcomponent
236     static const std::shared_ptr<XComponentAttribute> DEFAULT_XCOMPONENT_ATTR;
237     static const std::shared_ptr<XComponentEvent> DEFAULT_XCOMPONENT_EVENT;
238 };
239 
240 } // namespace OHOS::Ace
241 
242 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_DECLARATION_COMMON_DECLARATION_CONSTANTS_H
243