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