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