• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2024 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_BASE_PROPERTIES_POPUP_PARAM_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_BASE_PROPERTIES_POPUP_PARAM_H
18 
19 #include <optional>
20 #include <string>
21 
22 #include "base/geometry/dimension.h"
23 #include "core/common/resource/resource_object.h"
24 #include "core/components/common/properties/border.h"
25 #include "core/components/common/properties/color.h"
26 #include "core/components/common/properties/decoration.h"
27 #include "core/components/common/properties/edge.h"
28 #include "core/components/common/properties/placement.h"
29 #include "core/components/common/properties/text_style.h"
30 #include "core/components_ng/event/click_event.h"
31 #include "core/components_ng/property/transition_property.h"
32 #include "core/components_ng/pattern/select/select_model.h"
33 #include "core/event/ace_event_handler.h"
34 #include "core/event/touch_event.h"
35 
36 namespace OHOS::Ace {
37 
38 using ComposeId = std::string;
39 
40 struct ButtonProperties {
41     bool showButton = false;
42     std::string value;
43     EventMarker actionId;
44     //  touchFunc used in Declarative mode.
45     TouchEventFunc touchFunc;
46     RefPtr<NG::ClickEvent> action; // button click action
47 };
48 
49 struct PopupGradientColor {
50     Color gradientColor;
51     double gradientNumber;
52 };
53 
54 struct PopupLinearGradientProperties {
55     GradientDirection popupDirection = GradientDirection::BOTTOM;
56     std::vector<PopupGradientColor> gradientColors;
57 };
58 
59 enum class PopupKeyboardAvoidMode {
60     DEFAULT,
61     NONE
62 };
63 
64 enum class TipsAnchorType {
65     TARGET = 0, // anchor to target node
66     CURSOR = 1  // anchor to cursor position
67 };
68 
69 using StateChangeFunc = std::function<void(const std::string&)>;
70 using OnWillDismiss = std::function<void(int32_t)>;
71 class PopupParam : public AceType {
72     DECLARE_ACE_TYPE(PopupParam, AceType);
73 
74 public:
75     PopupParam() = default;
76     ~PopupParam() override = default;
77 
SetIsShow(bool isShow)78     void SetIsShow(bool isShow)
79     {
80         isShow_ = isShow;
81     }
82 
IsShow()83     bool IsShow() const
84     {
85         return isShow_;
86     }
87 
SetHasAction(bool hasAction)88     void SetHasAction(bool hasAction)
89     {
90         hasAction_ = hasAction;
91     }
92 
HasAction()93     bool HasAction() const
94     {
95         return hasAction_;
96     }
97 
SetHasPlacement(bool hasPlacement)98     void SetHasPlacement(bool hasPlacement)
99     {
100         hasPlacement_ = hasPlacement;
101     }
102 
HasPlacement()103     bool HasPlacement() const
104     {
105         return hasPlacement_;
106     }
107 
SetPlacement(const Placement & placement)108     void SetPlacement(const Placement& placement)
109     {
110         placement_ = placement;
111     }
112 
SetMaskColor(const Color & maskColor)113     void SetMaskColor(const Color& maskColor)
114     {
115         maskColor_ = maskColor;
116         isMaskColorSetted_ = true;
117     }
118 
SetBackgroundColor(const Color & backgroundColor)119     void SetBackgroundColor(const Color& backgroundColor)
120     {
121         backgroundColor_ = backgroundColor;
122         isBackgroundColorSetted_ = true;
123     }
124 
SetOnVisibilityChange(const EventMarker & onVisibilityChange)125     void SetOnVisibilityChange(const EventMarker& onVisibilityChange)
126     {
127         onVisibilityChange_ = onVisibilityChange;
128     }
129 
GetPlacement()130     Placement GetPlacement() const
131     {
132         return placement_;
133     }
134 
SetAppearingTime(int32_t appearingTime)135     void SetAppearingTime(int32_t appearingTime)
136     {
137         appearingTime_ = appearingTime;
138     }
139 
GetAppearingTime()140     int32_t GetAppearingTime() const
141     {
142         return appearingTime_;
143     }
144 
SetDisappearingTime(int32_t disappearingTime)145     void SetDisappearingTime(int32_t disappearingTime)
146     {
147         disappearingTime_ = disappearingTime;
148     }
149 
GetDisappearingTime()150     int32_t GetDisappearingTime() const
151     {
152         return disappearingTime_;
153     }
154 
SetAppearingTimeWithContinuousOperation(int32_t appearingTimeWithContinuousOperation)155     void SetAppearingTimeWithContinuousOperation(int32_t appearingTimeWithContinuousOperation)
156     {
157         appearingTimeWithContinuousOperation_ = appearingTimeWithContinuousOperation;
158     }
159 
GetAppearingTimeWithContinuousOperation()160     int32_t GetAppearingTimeWithContinuousOperation() const
161     {
162         return appearingTimeWithContinuousOperation_;
163     }
164 
SetDisappearingTimeWithContinuousOperation(int32_t disappearingTimeWithContinuousOperation)165     void SetDisappearingTimeWithContinuousOperation(int32_t disappearingTimeWithContinuousOperation)
166     {
167         disappearingTimeWithContinuousOperation_ = disappearingTimeWithContinuousOperation;
168     }
169 
GetDisappearingTimeWithContinuousOperation()170     int32_t GetDisappearingTimeWithContinuousOperation() const
171     {
172         return disappearingTimeWithContinuousOperation_;
173     }
174 
GetMaskColor()175     const Color& GetMaskColor() const
176     {
177         return maskColor_;
178     }
179 
GetBackgroundColor()180     const Color& GetBackgroundColor() const
181     {
182         return backgroundColor_;
183     }
184 
GetOnVisibilityChange()185     const EventMarker& GetOnVisibilityChange() const
186     {
187         return onVisibilityChange_;
188     }
189 
GetMargin()190     const Edge& GetMargin() const
191     {
192         return margin_;
193     }
194 
SetMargin(const Edge & margin)195     void SetMargin(const Edge& margin)
196     {
197         margin_ = margin;
198     }
199 
GetTargetMargin()200     const Edge& GetTargetMargin() const
201     {
202         return targetMargin_;
203     }
204 
SetTargetMargin(const Edge & targetMargin)205     void SetTargetMargin(const Edge& targetMargin)
206     {
207         targetMargin_ = targetMargin;
208     }
209 
GetPadding()210     const Edge& GetPadding() const
211     {
212         return padding_;
213     }
214 
SetPadding(const Edge & padding)215     void SetPadding(const Edge& padding)
216     {
217         padding_ = padding;
218     }
219 
GetBorder()220     const Border& GetBorder() const
221     {
222         return border_;
223     }
224 
SetBorder(const Border & border)225     void SetBorder(const Border& border)
226     {
227         border_ = border;
228     }
229 
GetArrowOffset()230     const std::optional<Dimension>& GetArrowOffset() const
231     {
232         return arrowOffset_;
233     }
234 
SetArrowOffset(const std::optional<Dimension> & arrowOffset)235     void SetArrowOffset(const std::optional<Dimension>& arrowOffset)
236     {
237         arrowOffset_ = arrowOffset;
238     }
239 
GetTargetId()240     const ComposeId& GetTargetId() const
241     {
242         return targetId_;
243     }
244 
SetTargetId(const ComposeId & targetId)245     void SetTargetId(const ComposeId& targetId)
246     {
247         targetId_ = targetId;
248     }
249 
IsMaskColorSetted()250     bool IsMaskColorSetted() const
251     {
252         return isMaskColorSetted_;
253     }
254 
IsBackgroundColorSetted()255     bool IsBackgroundColorSetted() const
256     {
257         return isBackgroundColorSetted_;
258     }
259 
EnableArrow()260     bool EnableArrow() const
261     {
262         return enableArrow_;
263     }
264 
SetEnableArrow(bool enableArrow)265     void SetEnableArrow(bool enableArrow)
266     {
267         enableArrow_ = enableArrow;
268     }
269 
HasEnableHoverMode()270     bool HasEnableHoverMode() const
271     {
272         return enableHoverMode_.has_value();
273     }
274 
EnableHoverMode()275     bool EnableHoverMode() const
276     {
277         return enableHoverMode_.value_or(false);
278     }
279 
SetEnableHoverMode(bool enableHoverMode)280     void SetEnableHoverMode(bool enableHoverMode)
281     {
282         enableHoverMode_ = enableHoverMode;
283     }
284 
IsBlockEvent()285     bool IsBlockEvent() const
286     {
287         return blockEvent_;
288     }
289 
SetBlockEvent(bool blockEvent)290     void SetBlockEvent(bool blockEvent)
291     {
292         blockEvent_ = blockEvent;
293     }
294 
IsUseCustom()295     bool IsUseCustom() const
296     {
297         return useCustom_;
298     }
299 
SetUseCustomComponent(bool useCustom)300     void SetUseCustomComponent(bool useCustom)
301     {
302         useCustom_ = useCustom;
303     }
304 
GetTargetSpace()305     const std::optional<Dimension>& GetTargetSpace() const
306     {
307         return targetSpace_;
308     }
309 
GetChildWidth()310     const std::optional<Dimension>& GetChildWidth() const
311     {
312         return childwidth_;
313     }
314 
SetTargetSpace(const Dimension & targetSpace)315     void SetTargetSpace(const Dimension& targetSpace)
316     {
317         targetSpace_ = targetSpace;
318     }
319 
SetChildWidth(const Dimension & childWidth)320     void SetChildWidth(const Dimension& childWidth)
321     {
322         childwidth_ = childWidth;
323     }
324 
SetMessage(const std::string & msg)325     void SetMessage(const std::string& msg)
326     {
327         message_ = msg;
328     }
329 
GetMessage()330     std::string GetMessage() const
331     {
332         return message_;
333     }
334 
GetOnStateChange()335     StateChangeFunc GetOnStateChange()
336     {
337         return onStateChange_;
338     }
339 
SetOnStateChange(StateChangeFunc && onStateChange)340     void SetOnStateChange(StateChangeFunc&& onStateChange)
341     {
342         onStateChange_ = onStateChange;
343     }
344 
SetPrimaryButtonProperties(const ButtonProperties & prop)345     void SetPrimaryButtonProperties(const ButtonProperties& prop)
346     {
347         primaryButtonProperties_ = prop;
348     }
349 
SetSecondaryButtonProperties(const ButtonProperties & prop)350     void SetSecondaryButtonProperties(const ButtonProperties& prop)
351     {
352         secondaryButtonProperties_ = prop;
353     }
354 
GetPrimaryButtonProperties()355     const ButtonProperties& GetPrimaryButtonProperties() const
356     {
357         return primaryButtonProperties_;
358     }
359 
GetSecondaryButtonProperties()360     const ButtonProperties& GetSecondaryButtonProperties() const
361     {
362         return secondaryButtonProperties_;
363     }
364 
SetShowInSubWindow(bool isShowInSubWindow)365     void SetShowInSubWindow(bool isShowInSubWindow)
366     {
367         isShowInSubWindow_ = isShowInSubWindow;
368     }
369 
IsShowInSubWindow()370     bool IsShowInSubWindow() const
371     {
372         return isShowInSubWindow_;
373     }
374 
SetTargetSize(const Size & targetSize)375     void SetTargetSize(const Size& targetSize)
376     {
377         targetSize_ = targetSize;
378     }
379 
GetTargetSize()380     const Size& GetTargetSize() const
381     {
382         return targetSize_;
383     }
384 
SetTargetOffset(const Offset & targetOffset)385     void SetTargetOffset(const Offset& targetOffset)
386     {
387         targetOffset_ = targetOffset;
388     }
389 
GetTargetOffset()390     const Offset& GetTargetOffset() const
391     {
392         return targetOffset_;
393     }
394 
SetTextColor(const Color & textColor)395     void SetTextColor(const Color& textColor)
396     {
397         textColor_ = textColor;
398     }
399 
GetTextColor()400     const std::optional<Color>& GetTextColor() const
401     {
402         return textColor_;
403     }
404 
SetFontSize(const Dimension & fontSize)405     void SetFontSize(const Dimension& fontSize)
406     {
407         fontSize_ = fontSize;
408     }
409 
GetFontSize()410     const std::optional<Dimension>& GetFontSize() const
411     {
412         return fontSize_;
413     }
414 
SetFontWeight(const FontWeight & fontWeight)415     void SetFontWeight(const FontWeight& fontWeight)
416     {
417         fontWeight_ = fontWeight;
418     }
419 
GetFontWeight()420     const std::optional<FontWeight>& GetFontWeight() const
421     {
422         return fontWeight_;
423     }
424 
SetFontStyle(const FontStyle & fontStyle)425     void SetFontStyle(const FontStyle& fontStyle)
426     {
427         fontStyle_ = fontStyle;
428     }
429 
GetFontStyle()430     const std::optional<FontStyle>& GetFontStyle() const
431     {
432         return fontStyle_;
433     }
434 
GetArrowWidth()435     const std::optional<Dimension>& GetArrowWidth() const
436     {
437         return arrowWidth_;
438     }
439 
SetArrowWidth(const Dimension & arrowWidth)440     void SetArrowWidth(const Dimension& arrowWidth)
441     {
442         arrowWidth_ = arrowWidth;
443     }
444 
GetArrowHeight()445     const std::optional<Dimension>& GetArrowHeight() const
446     {
447         return arrowHeight_;
448     }
449 
SetArrowHeight(const Dimension & arrowHeight)450     void SetArrowHeight(const Dimension& arrowHeight)
451     {
452         arrowHeight_ = arrowHeight;
453     }
454 
GetRadius()455     const std::optional<Dimension>& GetRadius() const
456     {
457         return radius_;
458     }
459 
SetRadius(const Dimension & radius)460     void SetRadius(const Dimension& radius)
461     {
462         radius_ = radius;
463     }
464 
SetShadow(const Shadow & shadow)465     void SetShadow(const Shadow& shadow)
466     {
467         shadow_ = shadow;
468     }
469 
GetShadow()470     const std::optional<Shadow>& GetShadow() const
471     {
472         return shadow_;
473     }
474 
SetErrorArrowWidth(bool setErrorArrowWidth)475     void SetErrorArrowWidth(bool setErrorArrowWidth)
476     {
477         setErrorArrowWidth_ = setErrorArrowWidth;
478     }
479 
GetErrorArrowWidth()480     bool GetErrorArrowWidth() const
481     {
482         return setErrorArrowWidth_;
483     }
484 
SetErrorArrowHeight(bool setErrorArrowHeight)485     void SetErrorArrowHeight(bool setErrorArrowHeight)
486     {
487         setErrorArrowHeight_ = setErrorArrowHeight;
488     }
489 
GetErrorArrowHeight()490     bool GetErrorArrowHeight() const
491     {
492         return setErrorArrowHeight_;
493     }
494 
SetErrorRadius(bool setErrorRadius)495     void SetErrorRadius(bool setErrorRadius)
496     {
497         setErrorRadius_ = setErrorRadius;
498     }
499 
GetErrorRadius()500     bool GetErrorRadius() const
501     {
502         return setErrorRadius_;
503     }
504 
SetFocusable(bool focusable)505     void SetFocusable(bool focusable)
506     {
507         focusable_ = focusable;
508     }
509 
GetFocusable()510     bool GetFocusable() const
511     {
512         return focusable_;
513     }
514 
SetBlurStyle(const BlurStyle & blurStyle)515     void SetBlurStyle(const BlurStyle& blurStyle)
516     {
517         blurStyle_ = blurStyle;
518     }
519 
GetBlurStyle()520     BlurStyle GetBlurStyle() const
521     {
522         return blurStyle_;
523     }
524 
SetInteractiveDismiss(bool interactiveDismiss)525     void SetInteractiveDismiss(bool interactiveDismiss)
526     {
527         interactiveDismiss_ = interactiveDismiss;
528     }
529 
GetInteractiveDismiss()530     bool GetInteractiveDismiss() const
531     {
532         return interactiveDismiss_;
533     }
534 
SetOnWillDismiss(const OnWillDismiss && onWillDismiss)535     void SetOnWillDismiss(const OnWillDismiss&& onWillDismiss)
536     {
537         onWillDismiss_ = std::move(onWillDismiss);
538     }
539 
GetOnWillDismiss()540     OnWillDismiss GetOnWillDismiss() const
541     {
542         return onWillDismiss_;
543     }
SetHasTransition(bool hasTransition)544     void SetHasTransition(bool hasTransition)
545     {
546         hasTransition_ = hasTransition;
547     }
548 
GetHasTransition()549     bool GetHasTransition() const
550     {
551         return hasTransition_;
552     }
553 
SetTransitionEffects(const RefPtr<NG::ChainedTransitionEffect> & transitionEffects)554     void SetTransitionEffects(const RefPtr<NG::ChainedTransitionEffect>& transitionEffects)
555     {
556         transitionEffects_ = transitionEffects;
557     }
558 
GetTransitionEffects()559     const RefPtr<NG::ChainedTransitionEffect> GetTransitionEffects() const
560     {
561         return transitionEffects_;
562     }
563 
SetIsCaretMode(bool isCaretMode)564     void SetIsCaretMode (bool isCaretMode)
565     {
566         isCaretMode_ = isCaretMode;
567     }
568 
IsCaretMode()569     bool IsCaretMode() const
570     {
571         return isCaretMode_;
572     }
573 
GetDoubleBindCallback()574     StateChangeFunc GetDoubleBindCallback()
575     {
576         return doubleBindCallback_;
577     }
578 
SetDoubleBindCallback(StateChangeFunc && callback)579     void SetDoubleBindCallback(StateChangeFunc&& callback)
580     {
581         doubleBindCallback_ = callback;
582     }
583 
SetKeyBoardAvoidMode(PopupKeyboardAvoidMode keyboardAvoidMode)584     void SetKeyBoardAvoidMode (PopupKeyboardAvoidMode keyboardAvoidMode)
585     {
586         keyboardAvoidMode_ = keyboardAvoidMode;
587     }
588 
GetKeyBoardAvoidMode()589     PopupKeyboardAvoidMode GetKeyBoardAvoidMode() const
590     {
591         return keyboardAvoidMode_;
592     }
593 
SetAvoidTarget(AvoidanceMode avoidTarget)594     void SetAvoidTarget(AvoidanceMode avoidTarget)
595     {
596         avoidTarget_ = avoidTarget;
597     }
598 
GetAvoidTarget()599     std::optional<AvoidanceMode> GetAvoidTarget() const
600     {
601         return avoidTarget_;
602     }
603 
SetFollowTransformOfTarget(bool followTransformOfTarget)604     void SetFollowTransformOfTarget (bool followTransformOfTarget)
605     {
606         followTransformOfTarget_ = followTransformOfTarget;
607     }
608 
IsFollowTransformOfTarget()609     bool IsFollowTransformOfTarget() const
610     {
611         return followTransformOfTarget_;
612     }
613 
GetIsPartialUpdate()614     std::optional<bool> GetIsPartialUpdate() const
615     {
616         return isPartialUpdate_;
617     }
618 
SetIsPartialUpdate(bool isPartialUpdate)619     void SetIsPartialUpdate(bool isPartialUpdate)
620     {
621         isPartialUpdate_ = isPartialUpdate;
622     }
623 
SetTipsFlag(bool isTips)624     void SetTipsFlag(bool isTips)
625     {
626         isTips_ = isTips;
627     }
628 
IsTips()629     bool IsTips() const
630     {
631         return isTips_;
632     }
SetOutlineLinearGradient(const PopupLinearGradientProperties & outlineLinearGradient)633     void SetOutlineLinearGradient(const PopupLinearGradientProperties& outlineLinearGradient)
634     {
635         outlineLinearGradient_ = outlineLinearGradient;
636     }
637 
GetOutlineLinearGradient()638     const PopupLinearGradientProperties& GetOutlineLinearGradient() const
639     {
640         return outlineLinearGradient_;
641     }
642 
SetOutlineWidth(const std::optional<Dimension> & outlineWidth)643     void SetOutlineWidth(const std::optional<Dimension>& outlineWidth)
644     {
645         outlineWidth_ = outlineWidth;
646     }
647 
GetOutlineWidth()648     const std::optional<Dimension>& GetOutlineWidth() const
649     {
650         return outlineWidth_;
651     }
652 
SetInnerBorderLinearGradient(const PopupLinearGradientProperties & innerBorderLinearGradient)653     void SetInnerBorderLinearGradient(const PopupLinearGradientProperties& innerBorderLinearGradient)
654     {
655         innerBorderLinearGradient_ = innerBorderLinearGradient;
656     }
657 
GetInnerBorderLinearGradient()658     const PopupLinearGradientProperties& GetInnerBorderLinearGradient() const
659     {
660         return innerBorderLinearGradient_;
661     }
662 
SetInnerBorderWidth(const std::optional<Dimension> & innerBorderWidth)663     void SetInnerBorderWidth(const std::optional<Dimension>& innerBorderWidth)
664     {
665         innerBorderWidth_ = innerBorderWidth;
666     }
667 
GetInnerBorderWidth()668     const std::optional<Dimension>& GetInnerBorderWidth() const
669     {
670         return innerBorderWidth_;
671     }
672 
SetAnchorType(TipsAnchorType anchorType)673     void SetAnchorType(TipsAnchorType anchorType)
674     {
675         anchorType_ = anchorType;
676     }
677 
GetAnchorType()678     TipsAnchorType GetAnchorType() const
679     {
680         return anchorType_;
681     }
682 
SetTextColorResourceObject(RefPtr<ResourceObject> & obj)683     void SetTextColorResourceObject(RefPtr<ResourceObject>& obj)
684     {
685         resourceTextColorObj_ = obj;
686     }
687 
GetTextColorResourceObject()688     const RefPtr<ResourceObject>& GetTextColorResourceObject()
689     {
690         return resourceTextColorObj_;
691     }
692 
SetPopupColorResourceObject(RefPtr<ResourceObject> & obj)693     void SetPopupColorResourceObject(RefPtr<ResourceObject>& obj)
694     {
695         resourcePopupColorObj_ = obj;
696     }
697 
GetPopupColorResourceObject()698     const RefPtr<ResourceObject>& GetPopupColorResourceObject()
699     {
700         return resourcePopupColorObj_;
701     }
702 
SetMaskColorResourceObject(RefPtr<ResourceObject> & obj)703     void SetMaskColorResourceObject(RefPtr<ResourceObject>& obj)
704     {
705         resourceMaskColorObj_ = obj;
706     }
707 
GetMaskColorResourceObject()708     const RefPtr<ResourceObject>& GetMaskColorResourceObject()
709     {
710         return resourceMaskColorObj_;
711     }
712 
SetMaskResourceObject(RefPtr<ResourceObject> & obj)713     void SetMaskResourceObject(RefPtr<ResourceObject>& obj)
714     {
715         resourceMaskObj_ = obj;
716     }
717 
GetMaskResourceObject()718     const RefPtr<ResourceObject>& GetMaskResourceObject()
719     {
720         return resourceMaskObj_;
721     }
722 
SetWidthResourceObject(RefPtr<ResourceObject> & obj)723     void SetWidthResourceObject(RefPtr<ResourceObject>& obj)
724     {
725         resourceWidthObj_ = obj;
726     }
727 
GetWidthResourceObject()728     const RefPtr<ResourceObject>& GetWidthResourceObject()
729     {
730         return resourceWidthObj_;
731     }
732 
SetArrowWidthResourceObject(RefPtr<ResourceObject> & obj)733     void SetArrowWidthResourceObject(RefPtr<ResourceObject>& obj)
734     {
735         resourceArrowWidthObj_ = obj;
736     }
737 
GetArrowWidthResourceObject()738     const RefPtr<ResourceObject>& GetArrowWidthResourceObject()
739     {
740         return resourceArrowWidthObj_;
741     }
742 
SetArrowHeightResourceObject(RefPtr<ResourceObject> & obj)743     void SetArrowHeightResourceObject(RefPtr<ResourceObject>& obj)
744     {
745         resourceArrowHeightObj_ = obj;
746     }
747 
GetArrowHeightResourceObject()748     const RefPtr<ResourceObject>& GetArrowHeightResourceObject()
749     {
750         return resourceArrowHeightObj_;
751     }
752 
SetRadiusResourceObject(RefPtr<ResourceObject> & obj)753     void SetRadiusResourceObject(RefPtr<ResourceObject>& obj)
754     {
755         resourceRadiusObj_ = obj;
756     }
757 
GetRadiusResourceObject()758     const RefPtr<ResourceObject>& GetRadiusResourceObject()
759     {
760         return resourceRadiusObj_;
761     }
762 
SetOutlineWidthObject(RefPtr<ResourceObject> & obj)763     void SetOutlineWidthObject(RefPtr<ResourceObject>& obj)
764     {
765         resourceOutlineWidthObj_ = obj;
766     }
767 
GetOutlineWidthResourceObject()768     const RefPtr<ResourceObject>& GetOutlineWidthResourceObject()
769     {
770         return resourceOutlineWidthObj_;
771     }
772 
SetBorderWidthObject(RefPtr<ResourceObject> & obj)773     void SetBorderWidthObject(RefPtr<ResourceObject>& obj)
774     {
775         resourceBorderWidthObj_ = obj;
776     }
777 
GetBorderWidthResourceObject()778     const RefPtr<ResourceObject>& GetBorderWidthResourceObject()
779     {
780         return resourceBorderWidthObj_;
781     }
782 
SetIsWithTheme(bool isWithTheme)783     void SetIsWithTheme(bool isWithTheme)
784     {
785         isWithTheme_ = isWithTheme;
786     }
787 
GetIsWithTheme()788     bool GetIsWithTheme()
789     {
790         return isWithTheme_;
791     }
792 
793 private:
794     bool isShow_ = true;
795     bool hasAction_ = false;
796     bool hasPlacement_ = false;
797     bool enableArrow_ = true;
798     bool isMaskColorSetted_ = false;
799     bool isBackgroundColorSetted_ = false;
800     bool useCustom_ = false;
801     bool isShowInSubWindow_ = false;
802     bool blockEvent_ = true;
803     bool setErrorArrowWidth_ = false;
804     bool setErrorArrowHeight_ = false;
805     bool setErrorRadius_ = false;
806     bool focusable_ = false;
807     bool interactiveDismiss_ = true;
808     bool isCaretMode_ = true;
809     std::optional<bool> enableHoverMode_ = std::nullopt;
810     bool followTransformOfTarget_ = false;
811     bool isTips_ = false;
812     bool isWithTheme_ = false;
813     TipsAnchorType anchorType_ = TipsAnchorType::TARGET;
814     int32_t appearingTime_ = 700;
815     int32_t disappearingTime_ = 300;
816     int32_t appearingTimeWithContinuousOperation_ = 300;
817     int32_t disappearingTimeWithContinuousOperation_ = 0;
818     std::optional<bool> isPartialUpdate_;
819     Color maskColor_;
820     Color backgroundColor_;
821     Placement placement_ = Placement::BOTTOM;
822     BlurStyle blurStyle_ = BlurStyle::COMPONENT_ULTRA_THICK;
823     EventMarker onVisibilityChange_;
824     Edge padding_;
825     Edge margin_;
826     Edge targetMargin_;
827     Border border_;
828     std::optional<Dimension> arrowOffset_;
829     ComposeId targetId_;
830     std::optional<Dimension> targetSpace_;
831     std::optional<Dimension> childwidth_;
832     std::string message_;
833     Offset targetOffset_;
834     Size targetSize_;
835     std::optional<FontWeight> fontWeight_;
836     std::optional<Color> textColor_;
837     std::optional<Dimension> fontSize_;
838     std::optional<FontStyle> fontStyle_;
839 
840     std::optional<Dimension> arrowWidth_;
841     std::optional<Dimension> arrowHeight_;
842     std::optional<Dimension> radius_;
843     std::optional<Shadow> shadow_;
844     // Used in NG mode
845     StateChangeFunc onStateChange_;
846     ButtonProperties primaryButtonProperties_;   // first button.
847     ButtonProperties secondaryButtonProperties_; // second button.
848     OnWillDismiss onWillDismiss_;
849     bool hasTransition_ = false;
850     RefPtr<NG::ChainedTransitionEffect> transitionEffects_ = nullptr;
851     StateChangeFunc doubleBindCallback_;
852     PopupKeyboardAvoidMode keyboardAvoidMode_ = PopupKeyboardAvoidMode::NONE;
853     std::optional<AvoidanceMode> avoidTarget_ = AvoidanceMode::COVER_TARGET;
854     std::optional<Dimension> outlineWidth_;
855     std::optional<Dimension> innerBorderWidth_;
856     PopupLinearGradientProperties outlineLinearGradient_;
857     PopupLinearGradientProperties innerBorderLinearGradient_;
858     RefPtr<ResourceObject> resourceTextColorObj_;
859     RefPtr<ResourceObject> resourcePopupColorObj_;
860     RefPtr<ResourceObject> resourceMaskColorObj_;
861     RefPtr<ResourceObject> resourceMaskObj_;
862     RefPtr<ResourceObject> resourceWidthObj_;
863     RefPtr<ResourceObject> resourceArrowWidthObj_;
864     RefPtr<ResourceObject> resourceArrowHeightObj_;
865     RefPtr<ResourceObject> resourceRadiusObj_;
866     RefPtr<ResourceObject> resourceOutlineWidthObj_;
867     RefPtr<ResourceObject> resourceBorderWidthObj_;
868 };
869 
870 } // namespace OHOS::Ace
871 
872 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_BASE_PROPERTIES_POPUP_PARAM_H
873