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_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_DECLARATION_COMMON_DECLARATION_H
18 
19 #include <functional>
20 #include <string>
21 #include <unordered_map>
22 #include <vector>
23 
24 #include "base/json/json_util.h"
25 #include "base/memory/ace_type.h"
26 #include "core/animation/scheduler.h"
27 #include "core/components/declaration/common/attribute.h"
28 #include "core/components/declaration/common/event.h"
29 #include "core/components/declaration/common/method.h"
30 #include "core/components/declaration/common/style.h"
31 #include "core/components/scroll/scroll_position_controller.h"
32 #include "core/pipeline/pipeline_base.h"
33 #include "frameworks/core/components/transform/click_spring_effect.h"
34 #include "base/geometry/calc_dimension.h"
35 
36 namespace OHOS::Ace {
37 
38 using OnSetAttributeFunc = std::function<void()>;
39 using OnSetStyleFinishedFunc = std::function<void()>;
40 using CachePseudoClassStyleFunc = std::function<void(std::pair<std::string, std::string>)>;
41 
42 class ACE_EXPORT Declaration : public virtual AceType {
43     DECLARE_ACE_TYPE(Declaration, AceType);
44 
45 public:
46     Declaration();
47     ~Declaration() override;
48 
49     virtual void SetAttr(const std::vector<std::pair<std::string, std::string>>& attrs);
50     virtual void SetStyle(const std::vector<std::pair<std::string, std::string>>& styles);
51     virtual void AddEvent(int32_t pageId, const std::string& eventId, const std::vector<std::string>& events);
52     virtual void CallMethod(const std::string& method, const std::string& args);
53     virtual void OnRequestFocus(bool shouldFocus);
54     virtual void OnScrollBy(double dx, double dy, bool isSmooth);
55     virtual void SetShowAttr(const std::string& showValue);
56     // Initialize declaration theme style when created.
InitializeStyle()57     virtual void InitializeStyle() {}
Clear()58     virtual void Clear() {}
59 
60     Attribute& GetAttribute(AttributeTag tag) const;
61     Style& GetStyle(StyleTag tag) const;
62     Event& GetEvent(EventTag tag) const;
63     Method& GetMethod(MethodTag tag) const;
64 
65     template<class T>
MaybeResetAttribute(AttributeTag tag)66     T& MaybeResetAttribute(AttributeTag tag)
67     {
68         auto& attr = static_cast<T&>(GetAttribute(tag));
69         if (!attr.IsValid() || !attr.IsShared()) {
70             return attr;
71         }
72         auto newAttr = std::make_shared<T>(attr);
73         newAttr->isShared = false;
74         attributes_[tag] = newAttr;
75         return *newAttr;
76     }
77 
78     template<class T>
MaybeResetStyle(StyleTag tag)79     T& MaybeResetStyle(StyleTag tag)
80     {
81         auto& style = static_cast<T&>(GetStyle(tag));
82         if (!style.IsValid() || !style.IsShared()) {
83             return style;
84         }
85         auto newStyle = std::make_shared<T>(style);
86         newStyle->isShared = false;
87         styles_[tag] = newStyle;
88         return *newStyle;
89     }
90 
91     template<class T>
MaybeResetEvent(EventTag tag)92     T& MaybeResetEvent(EventTag tag)
93     {
94         auto& event = static_cast<T&>(GetEvent(tag));
95         if (!event.IsValid() || !event.IsShared()) {
96             return event;
97         }
98         auto newEvent = std::make_shared<T>(event);
99         newEvent->isShared = false;
100         events_[tag] = newEvent;
101         return *newEvent;
102     }
103 
104     template<class T>
MaybeResetMethod(MethodTag tag)105     T& MaybeResetMethod(MethodTag tag)
106     {
107         auto& method = static_cast<T&>(GetMethod(tag));
108         if (!method.IsValid() || !method.IsShared()) {
109             return method;
110         }
111         auto newMethod = std::make_shared<T>(method);
112         newMethod->isShared = false;
113         methods_[tag] = newMethod;
114         return *newMethod;
115     }
116 
117     void Init();
118     void SetCurrentStyle(const std::pair<std::string, std::string>& style);
119     void BindPipelineContext(const WeakPtr<PipelineBase>& pipelineContext);
120     void ResetDefaultStyles();
121     void SetClickEvent(const EventMarker& onClick);
122     void SetRemoteMessageEvent(const EventMarker& remoteMessage);
123 
SetOnSetAttribute(const OnSetAttributeFunc & onSetAttribute)124     void SetOnSetAttribute(const OnSetAttributeFunc& onSetAttribute)
125     {
126         onSetAttribute_ = onSetAttribute;
127     }
128 
SetOnSetStyleFinished(const OnSetStyleFinishedFunc & onSetStyleFinished)129     void SetOnSetStyleFinished(const OnSetStyleFinishedFunc& onSetStyleFinished)
130     {
131         onSetStyleFinished_ = onSetStyleFinished;
132     }
133 
SetCachePseudoClassStyle(const CachePseudoClassStyleFunc & cachePseudoClassStyle)134     void SetCachePseudoClassStyle(const CachePseudoClassStyleFunc& cachePseudoClassStyle)
135     {
136         cachePseudoClassStyle_ = cachePseudoClassStyle;
137     }
138 
SetFocusableController(const RefPtr<FocusableController> & focusableController)139     void SetFocusableController(const RefPtr<FocusableController>& focusableController)
140     {
141         focusableController_ = focusableController;
142     }
143 
SetPositionController(const RefPtr<ScrollPositionController> & positionController)144     void SetPositionController(const RefPtr<ScrollPositionController>& positionController)
145     {
146         positionController_ = positionController;
147     }
148 
GetBackDecoration()149     const RefPtr<Decoration>& GetBackDecoration() const
150     {
151         return backDecoration_;
152     }
153 
SetBackDecoration(const RefPtr<Decoration> & backDecoration)154     void SetBackDecoration(const RefPtr<Decoration>& backDecoration)
155     {
156         backDecoration_ = backDecoration;
157     }
158 
GetFrontDecoration()159     const RefPtr<Decoration>& GetFrontDecoration() const
160     {
161         return frontDecoration_;
162     }
163 
SetShareId(const std::string & shareId)164     void SetShareId(const std::string& shareId)
165     {
166         shareId_ = shareId;
167     }
168 
GetShareId()169     const std::string& GetShareId() const
170     {
171         return shareId_;
172     }
173 
SetIsSubscriptEnable(bool isSubscriptEnable)174     void SetIsSubscriptEnable(bool isSubscriptEnable)
175     {
176         isSubscriptEnable_ = isSubscriptEnable;
177     }
178 
IsDisabled()179     bool IsDisabled() const
180     {
181         return isDisabled_;
182     }
183 
IsWaiting()184     bool IsWaiting() const
185     {
186         return isWaiting_;
187     }
188 
IsChecked()189     bool IsChecked() const
190     {
191         return isChecked_;
192     }
193 
SetIsChecked(bool isChecked)194     void SetIsChecked(bool isChecked)
195     {
196         isChecked_ = isChecked;
197     }
198 
IsHover()199     bool IsHover() const
200     {
201         return isHover_;
202     }
203 
SetIsHover(bool isHover)204     void SetIsHover(bool isHover)
205     {
206         isHover_ = isHover;
207     }
208 
HasTransformStyle()209     bool HasTransformStyle() const
210     {
211         return hasTransformStyle_;
212     }
213 
HasBackGroundColor()214     bool HasBackGroundColor() const
215     {
216         return hasBackGroundColor_;
217     }
SetHasBackGroundColor(bool hasBackGroundColor)218     void SetHasBackGroundColor(bool hasBackGroundColor)
219     {
220         hasBackGroundColor_ = hasBackGroundColor;
221     }
222 
HasDecorationStyle()223     bool HasDecorationStyle() const
224     {
225         return hasDecorationStyle_;
226     }
SetHasDecorationStyle(bool hasDecorationStyle)227     void SetHasDecorationStyle(bool hasDecorationStyle)
228     {
229         hasDecorationStyle_ = hasDecorationStyle;
230     }
231 
HasPositionProcessed()232     bool HasPositionProcessed() const
233     {
234         return hasPositionProcessed_;
235     }
SetHasPositionProcessed(bool hasPositionProcessed)236     void SetHasPositionProcessed(bool hasPositionProcessed)
237     {
238         hasPositionProcessed_ = hasPositionProcessed;
239     }
240 
HasBoxStyle()241     bool HasBoxStyle() const
242     {
243         return hasBoxStyle_;
244     }
SetHasBoxStyle(bool hasBoxStyle)245     void SetHasBoxStyle(bool hasBoxStyle)
246     {
247         hasBoxStyle_ = hasBoxStyle;
248     }
249 
HasShadowStyle()250     bool HasShadowStyle() const
251     {
252         return hasShadowStyle_;
253     }
SetHasShadowStyle(bool hasShadowStyle)254     void SetHasShadowStyle(bool hasShadowStyle)
255     {
256         hasShadowStyle_ = hasShadowStyle;
257     }
258 
HasFrontDecorationStyle()259     bool HasFrontDecorationStyle() const
260     {
261         return hasFrontDecorationStyle_;
262     }
SetHasFrontDecorationStyle(bool hasFrontDecorationStyle)263     void SetHasFrontDecorationStyle(bool hasFrontDecorationStyle)
264     {
265         hasFrontDecorationStyle_ = hasFrontDecorationStyle;
266     }
267 
HasBorderStyle()268     bool HasBorderStyle() const
269     {
270         return hasBorderStyle_;
271     }
SetHasBorderStyle(bool hasBorderStyle)272     void SetHasBorderStyle(bool hasBorderStyle)
273     {
274         hasBorderStyle_ = hasBorderStyle;
275     }
276 
HasBorderRadiusStyle()277     bool HasBorderRadiusStyle() const
278     {
279         return hasBorderRadiusStyle_;
280     }
SetHasBorderRadiusStyle(bool hasBorderRadiusStyle)281     void SetHasBorderRadiusStyle(bool hasBorderRadiusStyle)
282     {
283         hasBorderRadiusStyle_ = hasBorderRadiusStyle;
284     }
285 
HasClickEffect()286     bool HasClickEffect() const
287     {
288         return hasClickEffect_;
289     }
SetHasClickEffect(bool hasClickEffect)290     void SetHasClickEffect(bool hasClickEffect)
291     {
292         hasClickEffect_ = hasClickEffect;
293     }
294 
HasTransitionAnimation()295     bool HasTransitionAnimation() const
296     {
297         return hasTransitionAnimation_;
298     }
SetHasTransitionAnimation(bool hasTransitionAnimation)299     void SetHasTransitionAnimation(bool hasTransitionAnimation)
300     {
301         hasTransitionAnimation_ = hasTransitionAnimation;
302     }
303 
HasOverflowStyle()304     bool HasOverflowStyle() const
305     {
306         return hasOverflowStyle_;
307     }
SetHasOverflowStyle(bool hasOverflowStyle)308     void SetHasOverflowStyle(bool hasOverflowStyle)
309     {
310         hasOverflowStyle_ = hasOverflowStyle;
311     }
312 
HasTransformOriginStyle()313     bool HasTransformOriginStyle() const
314     {
315         return hasTransformOriginStyle_;
316     }
SetHasTransformOriginStyle(bool hasTransformOriginStyle)317     void SetHasTransformOriginStyle(bool hasTransformOriginStyle)
318     {
319         hasTransformOriginStyle_ = hasTransformOriginStyle;
320     }
321 
HasDisplayStyle()322     bool HasDisplayStyle() const
323     {
324         return hasDisplayStyle_;
325     }
SetHasDisplayStyle(bool hasDisplayStyle)326     void SetHasDisplayStyle(bool hasDisplayStyle)
327     {
328         hasDisplayStyle_ = hasDisplayStyle;
329     }
330 
HasIdAttr()331     bool HasIdAttr() const
332     {
333         return hasIdAttr_;
334     }
SetHasIdAttr(bool hasIdAttr)335     void SetHasIdAttr(bool hasIdAttr)
336     {
337         hasIdAttr_ = hasIdAttr;
338     }
339 
HasLeft()340     bool HasLeft() const
341     {
342         return hasLeft_;
343     }
SetHasLeft(bool hasLeft)344     void SetHasLeft(bool hasLeft)
345     {
346         hasLeft_ = hasLeft;
347     }
348 
HasTop()349     bool HasTop() const
350     {
351         return hasTop_;
352     }
SetHasTop(bool hasTop)353     void SetHasTop(bool hasTop)
354     {
355         hasTop_ = hasTop;
356     }
357 
HasRight()358     bool HasRight() const
359     {
360         return hasRight_;
361     }
SetHasRight(bool hasRight)362     void SetHasRight(bool hasRight)
363     {
364         hasRight_ = hasRight;
365     }
366 
HasBottom()367     bool HasBottom() const
368     {
369         return hasBottom_;
370     }
SetHasBottom(bool hasBottom)371     void SetHasBottom(bool hasBottom)
372     {
373         hasBottom_ = hasBottom;
374     }
375 
HasPositionStyle()376     bool HasPositionStyle() const
377     {
378         return hasPositionStyle_;
379     }
SetHasPositionStyle(bool hasPositionStyle)380     void SetHasPositionStyle(bool hasPositionStyle)
381     {
382         hasPositionStyle_ = hasPositionStyle;
383     }
384 
GetUseLiteStyle()385     bool GetUseLiteStyle() const
386     {
387         return useLiteStyle_;
388     }
SetUseLiteStyle(bool useLiteStyle)389     void SetUseLiteStyle(bool useLiteStyle)
390     {
391         useLiteStyle_ = useLiteStyle;
392     }
393 
SetFlexShrink(double flexShrink)394     void SetFlexShrink(double flexShrink)
395     {
396         auto& flexStyle = MaybeResetStyle<CommonFlexStyle>(StyleTag::COMMON_FLEX_STYLE);
397         flexStyle.flexShrink = flexShrink;
398     }
399 
400     bool IsRightToLeft() const;
401 
402     static void SetMaskGradient(const std::string& value, Declaration& declaration);
403 
404 protected:
405     virtual void InitCommonAttribute();
406     virtual void InitCommonStyle();
407     virtual void InitCommonEvent();
408     virtual void InitCommonMethod();
InitSpecialized()409     virtual void InitSpecialized() {}
410 
411     // Each subclass needs to override this function to obtain the properties. If it returns true, it means that the
412     // property has been consumed. If it returns false, it means it is handed over to the parent class.
SetSpecializedAttr(const std::pair<std::string,std::string> & attr)413     virtual bool SetSpecializedAttr(const std::pair<std::string, std::string>& attr)
414     {
415         return false;
416     }
417 
418     // Each subclass needs to override this function to obtain the style. If it returns true, it means that the
419     // style has been consumed. If it returns false, it means it is handed over to the parent class.
SetSpecializedStyle(const std::pair<std::string,std::string> & style)420     virtual bool SetSpecializedStyle(const std::pair<std::string, std::string>& style)
421     {
422         return false;
423     }
424 
425     // Each subclass needs to override this function to obtain the event. If it returns true, it means that the
426     // event has been consumed. If it returns false, it means it is handed over to the parent class.
SetSpecializedEvent(int32_t pageId,const std::string & eventId,const std::string & event)427     virtual bool SetSpecializedEvent(int32_t pageId, const std::string& eventId, const std::string& event)
428     {
429         return false;
430     }
431 
CallSpecializedMethod(const std::string & method,const std::string & args)432     virtual void CallSpecializedMethod(const std::string& method, const std::string& args) {}
433 
434     // When the multi-mode input subscript is set to auto, need to determine whether the current component has the
435     // ability to support the subscript.
IsSubscriptEnable()436     virtual bool IsSubscriptEnable() const
437     {
438         return isSubscriptEnable_;
439     }
440 
441     void AddCommonAttribute(AttributeTag tag);
442     void AddCommonStyle(StyleTag tag);
443     void AddCommonEvent(EventTag tag);
444     void AddCommonMethod(MethodTag tag);
445 
446     void AddSpecializedAttribute(std::shared_ptr<Attribute>&& specializedAttribute);
447     void AddSpecializedStyle(std::shared_ptr<Style>&& specializedStyle);
448     void AddSpecializedEvent(std::shared_ptr<Event>&& specializedEvent);
449     void AddSpecializedRemoteMessageEvent(std::shared_ptr<Event>&& specializedEvent);
450     void AddSpecializedMethod(std::shared_ptr<Method>&& specializedMethod);
451 
452     static void SetBackgroundImagePosition(const std::string& value, Declaration& declaration);
453     static void SetBackgroundImageSize(const std::string& value, Declaration& declaration);
454     static void SetPaddingOverall(const std::string& value, Declaration& declaration);
455     static void SetMarginOverall(const std::string& value, Declaration& declaration);
456     static void SetBorderOverall(const std::string& value, Declaration& declaration);
457     static void SetBorderWidthForFourEdges(const std::string& value, Declaration& declaration);
458     static void SetBorderColorForFourEdges(const std::string& value, Declaration& declaration);
459     static void SetBorderStyleForFourEdges(const std::string& value, Declaration& declaration);
460     static void SetBackground(const std::string& value, Declaration& declaration);
461     static void SetGradientType(const std::string& gradientType, Declaration& declaration);
462     static void SetGradientDirections(const std::unique_ptr<JsonValue>& gradientDirections, Declaration& declaration);
463     static void SetGradientColor(const std::unique_ptr<JsonValue>& gradientColorValues, Declaration& declaration);
464     static void SetGradientShape(const std::string& gradientShape, Declaration& declaration);
465     static void SetGradientSize(const std::string& gradientSize, Declaration& declaration);
466     static void SetGradientPosition(const std::string& gradientPosition, Declaration& declaration);
467     static void SetGradientAngle(const std::string& gradientPosition, Declaration& declaration);
468     static void SetGradientRotation(const std::string& gradientRotation, Declaration& declaration);
469     static void SetTransform(const std::string& value, Declaration& declaration);
470     static void SetBorderImage(const std::string& value, Declaration& declaration);
471     static void SetBorderImageUrl(const std::unique_ptr<JsonValue>& values, Declaration& declaration);
472     static void SetBorderImageGradient(const std::unique_ptr<JsonValue>& values, Declaration& declaration);
473 
474     static void SetBorderImageWidthForFourEdges(const std::string& value, Declaration& declaration);
475     static void SetBorderImageSliceForFourEdges(const std::string& value, Declaration& declaration);
476     static void SetBorderImageOutSetForFourEdges(const std::string& value, Declaration& declaration);
477     static void SetBorderImageRepeatForFourEdges(const std::string& value, Declaration& declaration);
478     static void SetBorderImageGradientType(const std::string& gradientType, Declaration& declaration);
479     static void SetBorderImageGradientDirections(
480         const std::unique_ptr<JsonValue>& gradientDirections, Declaration& declaration);
481     static void SetBorderImageGradientColor(const std::unique_ptr<JsonValue>& gradientColorValues,
482         Declaration& declaration);
483     static void SetBorderImageFindUrl(const std::string& value, Declaration& declaration);
484 
485     std::string GetTransformJsonValue(const std::string& value);
486     std::string GetTransformType(const std::unique_ptr<JsonValue>& transformJson);
487     std::string GetTransformTypeValue(const std::unique_ptr<JsonValue>& transformJson);
488 
489     RefPtr<ThemeManager> GetThemeManager() const;
490     RefPtr<ThemeConstants> GetThemeConstants() const;
491 
492     template<typename T>
GetTheme()493     RefPtr<T> GetTheme() const
494     {
495         auto context = pipelineContext_.Upgrade();
496         if (!context) {
497             return nullptr;
498         }
499         auto themeManager = context->GetThemeManager();
500         if (!themeManager) {
501             return nullptr;
502         }
503         return themeManager->GetTheme<T>();
504     }
505 
506     template<typename T>
ParseThemeReference(const std::string & value,std::function<T ()> && noRefFunc,std::function<T (uint32_t refId)> && idRefFunc,const T & errorValue)507     T ParseThemeReference(const std::string& value, std::function<T()>&& noRefFunc,
508         std::function<T(uint32_t refId)>&& idRefFunc, const T& errorValue) const
509     {
510         const auto& parseResult = ThemeUtils::ParseThemeIdReference(value, GetThemeConstants());
511         if (!parseResult.parseSuccess) {
512             return noRefFunc();
513         }
514         auto themeConstants = GetThemeConstants();
515         if (!themeConstants) {
516             return errorValue;
517         }
518         // Refer to a theme id resource.
519         if (parseResult.isIdRef) {
520             return idRefFunc(parseResult.id);
521         }
522         // Refer to a theme attribute.
523         auto themeStyle = themeConstants->GetThemeStyle();
524         if (!themeStyle) {
525             return errorValue;
526         }
527         return themeStyle->GetAttr<T>(parseResult.refAttr, errorValue);
528     }
529 
530     /*
531      * Parse color from string content and reference for id/attr, including format:
532      * #rrggbb, #aarrggbb, "@id001", "@attr_sys_color".
533      */
534     Color ParseColor(const std::string& value, uint32_t maskAlpha = COLOR_ALPHA_MASK) const;
535 
536     /*
537      * Parse double from string content and reference for id/attr, including format:
538      * 100.01, "@id001", "@attr_sys_alpha".
539      */
540     double ParseDouble(const std::string& value) const;
541 
542     /*
543      * Parse dimension from string content and reference for id/attr, including format:
544      * 10px, "@id001", "@attr_sys_dimension".
545      */
546     Dimension ParseDimension(const std::string& value, bool useVp = false) const;
547 
548     /*
549      * Parse calcdimension from string content and reference for id/attr, including format:
550      * calc(100% - 10px), 10px, "@id001", "@attr_sys_dimension".
551      */
552     CalcDimension ParseCalcDimension(const std::string& value, bool useVp = false) const;
553 
554     /*
555      * Parse line height from string content and reference for id/attr, including format:
556      * 1.5, "@id001", "@attr_sys_line_height".
557      */
558     Dimension ParseLineHeight(const std::string& value) const;
559 
560     /*
561      * Parse font family list from string content and reference for id/attr, including format:
562      * sans-serif, "@id001", "@attr_sys_font_family".
563      */
564     std::vector<std::string> ParseFontFamilies(const std::string& value) const;
565 
566     /*
567      * Parse dimension list from string content and reference for id/attr, including format:
568      * 10px, "@id001", "@attr_sys_dimension".
569      */
570     std::vector<Dimension> ParsePreferFontSizes(const std::string& value) const;
571 
572     /*
573      * Parse image src from string content and reference for id/attr, including format:
574      * "@app.media.customized_image", "@sys.media.123".
575      */
576     std::string ParseImageSrc(const std::string& imgSrc) const;
577 
578     WeakPtr<PipelineBase> pipelineContext_;
579 
580 private:
581     std::unordered_map<AttributeTag, std::shared_ptr<Attribute>> attributes_;
582     std::unordered_map<StyleTag, std::shared_ptr<Style>> styles_;
583     std::unordered_map<EventTag, std::shared_ptr<Event>> events_;
584     std::unordered_map<MethodTag, std::shared_ptr<Method>> methods_;
585 
586     RefPtr<Decoration> backDecoration_;
587     RefPtr<Decoration> frontDecoration_;
588     RefPtr<FocusableController> focusableController_;
589     RefPtr<ScrollPositionController> positionController_;
590 
591     OnSetAttributeFunc onSetAttribute_;
592     OnSetStyleFinishedFunc onSetStyleFinished_;
593     CachePseudoClassStyleFunc cachePseudoClassStyle_;
594 
595     std::string shareId_;
596 
597     bool isSubscriptEnable_ = false;
598     bool isDisabled_ = false;
599     bool isWaiting_ = false;
600     bool isChecked_ = false;
601     bool isHover_ = false;
602     bool hasTransformStyle_ = false;
603     bool hasBackGroundColor_ = false;
604     bool hasPositionProcessed_ = false;
605     bool hasBoxStyle_ = false;
606     bool hasShadowStyle_ = false;
607     bool hasDecorationStyle_ = false;
608     bool hasFrontDecorationStyle_ = false;
609     bool hasBorderStyle_ = false;
610     bool hasBorderRadiusStyle_ = false;
611     bool hasClickEffect_ = false;
612     bool hasTransitionAnimation_ = false;
613     bool hasOverflowStyle_ = false;
614     bool hasTransformOriginStyle_ = false;
615     bool hasDisplayStyle_ = false;
616     bool hasPositionStyle_ = false;
617     bool hasLeft_ = false;
618     bool hasTop_ = false;
619     bool hasRight_ = false;
620     bool hasBottom_ = false;
621     bool useLiteStyle_ = false;
622     // The target node (with id attribute) for popup should be added gesture event handler,
623     // it's ok to take 'id' as a flag, even not all dom nodes with id attribute should do this.
624     bool hasIdAttr_ = false;
625 };
626 
627 }; // namespace OHOS::Ace
628 
629 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_DECLARATION_COMMON_DECLARATION_H