1  /*
2   * Copyright (c) 2022-2023 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_NG_PATTERNS_TIME_PICKER_TIME_PICKER_ROW_PATTERN_H
17  #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_TIME_PICKER_TIME_PICKER_ROW_PATTERN_H
18  
19  #include <optional>
20  
21  #include "base/i18n/date_time_sequence.h"
22  #include "base/i18n/localization.h"
23  #include "base/i18n/time_format.h"
24  #include "core/components/common/properties/color.h"
25  #include "core/components_ng/base/inspector_filter.h"
26  #include "core/components_ng/pattern/linear_layout/linear_layout_pattern.h"
27  #include "core/components_ng/pattern/time_picker/timepicker_column_pattern.h"
28  #include "core/components_ng/pattern/time_picker/timepicker_event_hub.h"
29  #include "core/components_ng/pattern/time_picker/timepicker_layout_property.h"
30  #include "core/components_ng/pattern/time_picker/timepicker_paint_method.h"
31  #include "core/components_ng/pattern/time_picker/timepicker_row_accessibility_property.h"
32  #include "core/components_v2/inspector/utils.h"
33  
34  namespace OHOS::Ace::NG {
35  namespace {
36  const Dimension TIME_FOCUS_PAINT_WIDTH = 2.0_vp;
37  }
38  
39  class TimePickerRowPattern : public LinearLayoutPattern {
40      DECLARE_ACE_TYPE(TimePickerRowPattern, LinearLayoutPattern);
41  
42  public:
TimePickerRowPattern()43      TimePickerRowPattern() : LinearLayoutPattern(false) {};
44  
45      ~TimePickerRowPattern() override = default;
46  
IsAtomicNode()47      bool IsAtomicNode() const override
48      {
49          return true;
50      }
51  
CreateEventHub()52      RefPtr<EventHub> CreateEventHub() override
53      {
54          return MakeRefPtr<TimePickerEventHub>();
55      }
56  
CreateNodePaintMethod()57      RefPtr<NodePaintMethod> CreateNodePaintMethod() override
58      {
59          auto paintMethod = MakeRefPtr<TimePickerPaintMethod>();
60          paintMethod->SetEnabled(enabled_);
61          paintMethod->SetBackgroundColor(backgroundColor_);
62          return paintMethod;
63      }
64  
CreateLayoutAlgorithm()65      RefPtr<LayoutAlgorithm> CreateLayoutAlgorithm() override
66      {
67          return MakeRefPtr<LinearLayoutAlgorithm>();
68      }
69  
SetConfirmNode(WeakPtr<FrameNode> buttonConfirmNode)70      void SetConfirmNode(WeakPtr<FrameNode> buttonConfirmNode)
71      {
72          weakButtonConfirm_ = buttonConfirmNode;
73      }
74  
updateFontConfigurationEvent(const std::function<void ()> & closeDialogEvent)75      void updateFontConfigurationEvent(const std::function<void()>& closeDialogEvent)
76      {
77          closeDialogEvent_ = closeDialogEvent;
78      }
79  
SetIsShowInDialog(bool isShowInDialog)80      void SetIsShowInDialog(bool isShowInDialog)
81      {
82          isShowInDialog_ = isShowInDialog;
83      }
84  
GetIsShowInDialog()85      bool GetIsShowInDialog() const
86      {
87          return isShowInDialog_;
88      }
89  
SetIsShowInDatePickerDialog(bool isShowInDatePickerDialog)90      void SetIsShowInDatePickerDialog(bool isShowInDatePickerDialog)
91      {
92          isShowInDatePickerDialog_ = isShowInDatePickerDialog;
93      }
94  
GetIsShowInDatePickerDialog()95      bool GetIsShowInDatePickerDialog() const
96      {
97          return isShowInDatePickerDialog_;
98      }
99  
SetCancelNode(WeakPtr<FrameNode> buttonCancelNode)100      void SetCancelNode(WeakPtr<FrameNode> buttonCancelNode)
101      {
102          weakButtonCancel_ = buttonCancelNode;
103      }
104  
105      void OnLanguageConfigurationUpdate() override;
106      void OnFontConfigurationUpdate() override;
107  
CreateLayoutProperty()108      RefPtr<LayoutProperty> CreateLayoutProperty() override
109      {
110          return MakeRefPtr<TimePickerLayoutProperty>();
111      }
112  
CreateAccessibilityProperty()113      RefPtr<AccessibilityProperty> CreateAccessibilityProperty() override
114      {
115          return MakeRefPtr<TimePickerRowAccessibilityProperty>();
116      }
117  
118      void OnColumnsBuilding();
119  
GetAllChildNode()120      const std::unordered_map<std::string, WeakPtr<FrameNode>>& GetAllChildNode()
121      {
122          return allChildNode_;
123      }
124  
125      void UpdateAllChildNode();
126  
127      void HandleHourColumnBuilding();
128  
129      void HandleMinAndSecColumnBuilding();
130  
131      void FlushColumn();
132  
133      void FlushAmPmFormatString();
134  
135      void OnDataLinking(
136          const RefPtr<FrameNode>& tag, bool isAdd, uint32_t index, std::vector<RefPtr<FrameNode>>& resultTags);
137  
138      void HandleHour12Change(bool isAdd, uint32_t index, std::vector<RefPtr<FrameNode>>& resultTags);
139  
140      void SetChangeCallback(ColumnChangeCallback&& value);
141  
142      void HandleColumnChange(const RefPtr<FrameNode>& tag, bool isAdd, uint32_t index, bool needNotify);
143  
144      void SetEventCallback(EventCallback&& value);
145  
146      void FireChangeEvent(bool refresh);
147  
148      std::string GetSelectedObject(bool isColumnChange, int32_t status = -1);
149  
150      PickerTime GetCurrentTime();
151  
152      uint32_t GetHourFromAmPm(bool isAm, uint32_t amPmhour) const;
153  
HasTitleNode()154      bool HasTitleNode() const
155      {
156          return titleId_.has_value();
157      }
158  
GetTitleId()159      int32_t GetTitleId()
160      {
161          if (!titleId_.has_value()) {
162              titleId_ = ElementRegister::GetInstance()->MakeUniqueId();
163          }
164          return titleId_.value();
165      }
166  
GetShowCount()167      uint32_t GetShowCount() const
168      {
169          return showCount_;
170      }
171  
SetShowCount(uint32_t showCount)172      void SetShowCount(uint32_t showCount)
173      {
174          showCount_ = showCount;
175      }
176  
GetOptionCount(const RefPtr<FrameNode> & frameNode)177      uint32_t GetOptionCount(const RefPtr<FrameNode>& frameNode)
178      {
179          return optionsTotalCount_[frameNode];
180      }
181  
GetOptionValue(const RefPtr<FrameNode> & frmeNode,uint32_t index)182      std::string GetOptionValue(const RefPtr<FrameNode>& frmeNode, uint32_t index)
183      {
184          if (index >= GetOptionCount(frmeNode)) {
185              return nullptr;
186          }
187          return options_[frmeNode][index];
188      }
189  
HasDividerNode()190      bool HasDividerNode() const
191      {
192          return DividerId_.has_value();
193      }
194  
GetDividerId()195      int32_t GetDividerId()
196      {
197          if (!DividerId_.has_value()) {
198              DividerId_ = ElementRegister::GetInstance()->MakeUniqueId();
199          }
200          return DividerId_.value();
201      }
202  
203      const std::string& GetOptionsValue(const RefPtr<FrameNode>& frameNode, uint32_t optionIndex);
204  
GetOptionsCount()205      const std::map<WeakPtr<FrameNode>, uint32_t>& GetOptionsCount() const
206      {
207          return optionsTotalCount_;
208      }
209  
SetHour24(bool value)210      void SetHour24(bool value)
211      {
212          isForceUpdate_ = value != hour24_;
213          hour24_ = value;
214      }
215  
GetHour24()216      bool GetHour24() const
217      {
218          auto timePickerLayoutProperty = GetLayoutProperty<TimePickerLayoutProperty>();
219          CHECK_NULL_RETURN(timePickerLayoutProperty, hour24_);
220          return timePickerLayoutProperty->GetIsUseMilitaryTimeValue(hour24_);
221      }
222  
SetDateTimeOptionUpdate(bool value)223      void SetDateTimeOptionUpdate(bool value)
224      {
225          isDateTimeOptionUpdate_ = value;
226      }
227  
SetPrefixHour(ZeroPrefixType & value)228      void SetPrefixHour(ZeroPrefixType& value)
229      {
230          prefixHour_ = value;
231      }
232  
GetPrefixHour()233      ZeroPrefixType GetPrefixHour() const
234      {
235          return prefixHour_;
236      }
237  
ClearOptionsHour()238      void ClearOptionsHour()
239      {
240          // when switch IsUseMilitaryTime state, should clear options_[hourColumn]
241          // Hour24 : Index = [0, 23] -> hour = [0, 23]
242          // Hour12 : Index = [0, 11] -> hour = [1, 12]
243          auto hourColumn = allChildNode_["hour"];
244          options_[hourColumn].clear();
245      }
246  
SetSelectedTime(const PickerTime & value)247      void SetSelectedTime(const PickerTime& value)
248      {
249          selectedTime_ = value;
250          isFiredTimeChange_ = firedTimeStr_.has_value() && firedTimeStr_.value() == value.ToString(true, hasSecond_);
251          firedTimeStr_.reset();
252      }
253  
GetSelectedTime()254      const PickerTime& GetSelectedTime()
255      {
256          return selectedTime_;
257      }
258  
SetDialogTitleDate(const PickerDate & value)259      void SetDialogTitleDate(const PickerDate& value)
260      {
261          dialogTitleDate_ = value;
262      }
263  
GetDialogTitleDate()264      const PickerDate& GetDialogTitleDate()
265      {
266          return dialogTitleDate_;
267      }
268  
HasAmPmNode()269      bool HasAmPmNode() const
270      {
271          return amPmId_.has_value();
272      }
273  
GetAmPmId()274      int32_t GetAmPmId()
275      {
276          if (!amPmId_.has_value()) {
277              amPmId_ = ElementRegister::GetInstance()->MakeUniqueId();
278          }
279          return amPmId_.value();
280      }
281  
HasHourNode()282      bool HasHourNode() const
283      {
284          return hourId_.has_value();
285      }
286  
GetHourId()287      int32_t GetHourId()
288      {
289          if (!hourId_.has_value()) {
290              hourId_ = ElementRegister::GetInstance()->MakeUniqueId();
291          }
292          return hourId_.value();
293      }
294  
HasMinuteNode()295      bool HasMinuteNode() const
296      {
297          return minuteId_.has_value();
298      }
299  
GetMinuteId()300      int32_t GetMinuteId()
301      {
302          if (!minuteId_.has_value()) {
303              minuteId_ = ElementRegister::GetInstance()->MakeUniqueId();
304          }
305          return minuteId_.value();
306      }
307  
HasSecondNode()308      bool HasSecondNode() const
309      {
310          return secondId_.has_value();
311      }
312  
GetSecondId()313      int32_t GetSecondId()
314      {
315          if (!secondId_.has_value()) {
316              secondId_ = ElementRegister::GetInstance()->MakeUniqueId();
317          }
318          return secondId_.value();
319      }
320  
GetHasSecond()321      bool GetHasSecond() const
322      {
323          return hasSecond_;
324      }
SetHasSecond(bool value)325      void SetHasSecond(bool value)
326      {
327          hasSecond_ = value;
328      }
329  
SetPrefixMinute(ZeroPrefixType value)330      void SetPrefixMinute(ZeroPrefixType value)
331      {
332          prefixMinute_ = value;
333      }
334  
GetPrefixMinute()335      ZeroPrefixType GetPrefixMinute() const
336      {
337          auto timePickerLayoutProperty = GetLayoutProperty<TimePickerLayoutProperty>();
338          CHECK_NULL_RETURN(timePickerLayoutProperty, prefixMinute_);
339          return static_cast<ZeroPrefixType>(
340              timePickerLayoutProperty->GetPrefixMinuteValue(0));
341      }
342  
SetPrefixSecond(ZeroPrefixType value)343      void SetPrefixSecond(ZeroPrefixType value)
344      {
345          prefixSecond_ = value;
346      }
347  
GetPrefixSecond()348      ZeroPrefixType GetPrefixSecond() const
349      {
350          auto timePickerLayoutProperty = GetLayoutProperty<TimePickerLayoutProperty>();
351          CHECK_NULL_RETURN(timePickerLayoutProperty, prefixSecond_);
352          return static_cast<ZeroPrefixType>(
353              timePickerLayoutProperty->GetPrefixSecondValue(0));
354      }
355  
GetWheelModeEnabled()356      bool GetWheelModeEnabled() const
357      {
358          auto timePickerLayoutProperty = GetLayoutProperty<TimePickerLayoutProperty>();
359          CHECK_NULL_RETURN(timePickerLayoutProperty, wheelModeEnabled_);
360          return timePickerLayoutProperty->GetLoopValue(true);
361      }
362  
SetWheelModeEnabled(bool value)363      void SetWheelModeEnabled(bool value)
364      {
365          wheelModeEnabled_ = value;
366      }
367  
GetColumn(int32_t tag)368      RefPtr<FrameNode> GetColumn(int32_t tag) const
369      {
370          auto iter = std::find_if(timePickerColumns_.begin(), timePickerColumns_.end(), [tag](const auto& c) {
371                  auto column = c.Upgrade();
372                  return column && column->GetId() == tag;
373              });
374          return (iter == timePickerColumns_.end()) ? nullptr : (*iter).Upgrade();
375      }
376  
SetColumn(const RefPtr<FrameNode> & value)377      void SetColumn(const RefPtr<FrameNode>& value)
378      {
379          timePickerColumns_.emplace_back(value);
380      }
381  
SetBackgroundColor(const Color & color)382      void SetBackgroundColor(const Color& color)
383      {
384          backgroundColor_ = color;
385      }
386  
GetBackgroundColor()387      const Color GetBackgroundColor() const
388      {
389          return backgroundColor_;
390      }
391  
SetIsEnableHaptic(bool value)392      void SetIsEnableHaptic(bool value)
393      {
394          if (isEnableHaptic_ != value) {
395              isHapticChanged_ = true;
396          }
397          isEnableHaptic_ = value;
398      }
399  
GetIsEnableHaptic()400      bool GetIsEnableHaptic() const
401      {
402          return isEnableHaptic_;
403      }
404  
405      bool IsAmHour(uint32_t hourOf24) const;
406  
407      uint32_t GetAmPmHour(uint32_t hourOf24) const;
408  
409      std::string GetAmFormatString() const;
410  
411      std::string GetPmFormatString() const;
412  
413      std::string AddZeroPrefix(const std::string& value) const;
414  
415      std::string GetHourFormatString(uint32_t hour) const;
416  
417      std::string GetMinuteFormatString(uint32_t minute) const;
418  
419      std::string GetSecondFormatString(uint32_t Second) const;
420  
GetFocusPattern()421      FocusPattern GetFocusPattern() const override
422      {
423          auto pipeline = PipelineBase::GetCurrentContext();
424          CHECK_NULL_RETURN(pipeline, FocusPattern());
425          auto pickerTheme = pipeline->GetTheme<PickerTheme>();
426          CHECK_NULL_RETURN(pickerTheme, FocusPattern());
427          auto focusColor = pickerTheme->GetFocusColor();
428          FocusPaintParam focusPaintParams;
429          focusPaintParams.SetPaintColor(focusColor);
430          focusPaintParams.SetPaintWidth(TIME_FOCUS_PAINT_WIDTH);
431          return { FocusType::NODE, true, FocusStyleType::CUSTOM_REGION, focusPaintParams };
432      }
433  
ToJsonValue(std::unique_ptr<JsonValue> & json,const InspectorFilter & filter)434      void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override
435      {
436          /* no fixed attr below, just return */
437          if (filter.IsFastFilter()) {
438              return;
439          }
440          json->PutExtAttr("selected", selectedTime_.ToString(false, false).c_str(), filter);
441      }
442  
443      void CreateAmPmNode();
444      void OnColorConfigurationUpdate() override;
445  
SetContentRowNode(RefPtr<FrameNode> & contentRowNode)446      void SetContentRowNode(RefPtr<FrameNode>& contentRowNode)
447      {
448          contentRowNode_ = contentRowNode;
449      }
450  
SetbuttonTitleNode(RefPtr<FrameNode> & buttonTitleNode)451      void SetbuttonTitleNode(RefPtr<FrameNode>& buttonTitleNode)
452      {
453          buttonTitleNode_ = buttonTitleNode;
454      }
455  
SetPickerTag(bool isPicker)456      void SetPickerTag(bool isPicker)
457      {
458          isPicker_ = isPicker;
459      }
460  
461      void SetFocusDisable();
462      void SetFocusEnable();
463  
UpdateLanguageAndAmPmTimeOrder()464      void UpdateLanguageAndAmPmTimeOrder()
465      {
466          if (language_ == "ug") {
467              isPreLanguageUg_ = true;
468          }
469          language_ = AceApplicationInfo::GetInstance().GetLanguage();
470  
471          auto preAmPmTimeOrder = amPmTimeOrder_;
472          amPmTimeOrder_ = DateTimeSequence::GetAmPmTimeOrder(language_).amPmTimeOrder;
473          preAmPmTimeOrder == amPmTimeOrder_ ? isAmPmTimeOrderUpdate_ = false : isAmPmTimeOrderUpdate_ = true;
474      }
475  
HasUserDefinedDisappearFontFamily(bool isUserDefined)476      void HasUserDefinedDisappearFontFamily(bool isUserDefined)
477      {
478          hasUserDefinedDisappearFontFamily_ = isUserDefined;
479      }
480  
GetHasUserDefinedDisappearFontFamily()481      bool GetHasUserDefinedDisappearFontFamily()
482      {
483          return hasUserDefinedDisappearFontFamily_;
484      }
485  
HasUserDefinedNormalFontFamily(bool isUserDefined)486      void HasUserDefinedNormalFontFamily(bool isUserDefined)
487      {
488          hasUserDefinedNormalFontFamily_ = isUserDefined;
489      }
490  
GetHasUserDefinedNormalFontFamily()491      bool GetHasUserDefinedNormalFontFamily()
492      {
493          return hasUserDefinedNormalFontFamily_;
494      }
495  
HasUserDefinedSelectedFontFamily(bool isUserDefined)496      void HasUserDefinedSelectedFontFamily(bool isUserDefined)
497      {
498          hasUserDefinedSelectedFontFamily_ = isUserDefined;
499      }
500  
GetHasUserDefinedSelectedFontFamily()501      bool GetHasUserDefinedSelectedFontFamily()
502      {
503          return hasUserDefinedSelectedFontFamily_;
504      }
505  
GetTextProperties()506      const PickerTextProperties& GetTextProperties() const
507      {
508          return textProperties_;
509      }
510  
SetTextProperties(const PickerTextProperties & properties)511      void SetTextProperties(const PickerTextProperties& properties)
512      {
513          textProperties_ = properties;
514          if (properties.disappearTextStyle_.fontSize.has_value() && properties.disappearTextStyle_.fontSize->IsValid()) {
515              isUserSetGradientFont_ = true;
516              gradientHeight_ = properties.disappearTextStyle_.fontSize.value();
517          }
518  
519          if (properties.normalTextStyle_.fontSize.has_value() && properties.normalTextStyle_.fontSize->IsValid()) {
520              isUserSetGradientFont_ = true;
521              gradientHeight_ = std::max(properties.normalTextStyle_.fontSize.value(), gradientHeight_);
522          }
523  
524          if (properties.selectedTextStyle_.fontSize.has_value() && properties.selectedTextStyle_.fontSize->IsValid()) {
525              isUserSetDividerSpacingFont_ = true;
526              dividerSpacing_ = properties.selectedTextStyle_.fontSize.value();
527          }
528      }
529  
GetIsUserSetDividerSpacingFont()530      bool GetIsUserSetDividerSpacingFont()
531      {
532          return isUserSetDividerSpacingFont_;
533      }
534  
GetIsUserSetGradientFont()535      bool GetIsUserSetGradientFont()
536      {
537          return isUserSetGradientFont_;
538      }
539  
GetDividerSpacing()540      Dimension GetDividerSpacing()
541      {
542          return dividerSpacing_;
543      }
544  
GetGradientHeight()545      Dimension GetGradientHeight()
546      {
547          return gradientHeight_;
548      }
549  
SetPaintDividerSpacing(float & value)550      void SetPaintDividerSpacing(float& value)
551      {
552          paintDividerSpacing_ = value;
553      }
554  
GetPaintDividerSpacing()555      float GetPaintDividerSpacing()
556      {
557          return paintDividerSpacing_;
558      }
559  
SetUserDefinedOpacity(double opacity)560      void SetUserDefinedOpacity(double opacity)
561      {
562          curOpacity_ = opacity;
563      }
564  
565  private:
566      void OnModifyDone() override;
567      void OnAttachToFrameNode() override;
568      bool OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config) override;
569  
570      void InitOnKeyEvent(const RefPtr<FocusHub>& focusHub);
571      bool OnKeyEvent(const KeyEvent& event);
572      bool HandleDirectionKey(KeyCode code);
573      void InitDisabled();
574      void GetInnerFocusPaintRect(RoundRect& paintRect);
575      void PaintFocusState();
576      void SetButtonIdeaSize();
577      double SetAmPmButtonIdeaSize();
578      void GetAllChildNodeWithSecond();
579      void CreateOrDeleteSecondNode();
580      RefPtr<FrameNode> GetAmPmNode(std::list<RefPtr<UINode>>::iterator& iter);
581      RefPtr<FrameNode> GetHourNode(std::list<RefPtr<UINode>>::iterator& iter);
582      RefPtr<FrameNode> GetMinuteNode(std::list<RefPtr<UINode>>::iterator& iter);
583      RefPtr<FrameNode> GetSecondNode(std::list<RefPtr<UINode>>::iterator& iter);
584      void UpdateAllChildNodeForUg();
585      void UpdateNodePositionForUg();
586      void MountSecondNode(const RefPtr<FrameNode>& stackSecondNode);
587      void RemoveSecondNode();
588      void ColumnPatternInitHapticController();
589  
590      RefPtr<ClickEvent> clickEventListener_;
591      bool enabled_ = true;
592      int32_t focusKeyID_ = 0;
593      std::unordered_map<std::string, WeakPtr<FrameNode>> allChildNode_;
594      std::map<WeakPtr<FrameNode>, std::unordered_map<uint32_t, std::string>> options_;
595      std::map<WeakPtr<FrameNode>, uint32_t> optionsTotalCount_;
596      uint32_t showCount_ = 0;
597      Color backgroundColor_ = Color::WHITE;
598      // true, use 24 hours style; false, use 12 hours style.
599      bool hour24_ = SystemProperties::Is24HourClock();
600      ZeroPrefixType prefixHour_ = ZeroPrefixType::AUTO;
601      ZeroPrefixType prefixMinute_ = ZeroPrefixType::AUTO;
602      ZeroPrefixType prefixSecond_ = ZeroPrefixType::AUTO;
603      PickerTime selectedTime_ = PickerTime::Current();
604      PickerDate dialogTitleDate_ = PickerDate::Current();
605      std::optional<int32_t> amPmId_;
606      std::optional<int32_t> hourId_;
607      std::optional<int32_t> minuteId_;
608      std::optional<int32_t> secondId_;
609      std::optional<int32_t> titleId_;
610      std::optional<int32_t> ButtonTitleId_;
611      std::optional<int32_t> DividerId_;
612      WeakPtr<FrameNode> weakButtonConfirm_;
613      WeakPtr<FrameNode> weakButtonCancel_;
614      std::function<void()> closeDialogEvent_;
615      bool hasSecond_ = false;
616      bool wheelModeEnabled_ = true;
617      std::vector<WeakPtr<FrameNode>> timePickerColumns_;
618      std::vector<std::string> vecAmPm_ = Localization::GetInstance()->GetAmPmStrings();
619  
620      bool hasUserDefinedDisappearFontFamily_ = false;
621      bool hasUserDefinedNormalFontFamily_ = false;
622      bool hasUserDefinedSelectedFontFamily_ = false;
623  
624      double curOpacity_ = 1.0;
625  
626      ACE_DISALLOW_COPY_AND_MOVE(TimePickerRowPattern);
627  
628      WeakPtr<FrameNode> buttonTitleNode_;
629      WeakPtr<FrameNode> contentRowNode_;
630      bool isPicker_ = false;
631      bool isFiredTimeChange_ = false;
632      bool isForceUpdate_ = false;
633      bool isDateTimeOptionUpdate_ = false;
634      bool isEnableHaptic_ = true;
635      bool isHapticChanged_ = false;
636      std::optional<std::string> firedTimeStr_;
637      std::string language_;
638      std::string amPmTimeOrder_;
639      bool isAmPmTimeOrderUpdate_ = false;
640      bool isPreLanguageUg_ = false;
641      bool isShowInDialog_ = false;
642      bool isUserSetDividerSpacingFont_ = false;
643      bool isUserSetGradientFont_ = false;
644      Dimension gradientHeight_;
645      Dimension dividerSpacing_;
646      float paintDividerSpacing_ = 1.0f;
647      PickerTextProperties textProperties_;
648      bool isShowInDatePickerDialog_ = false;
649  };
650  } // namespace OHOS::Ace::NG
651  
652  #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_TIME_PICKER_TIME_PICKER_ROW_PATTERN_H
653