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_TEXT_PICKER_TEXT_PICKER_PATTERN_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_TEXT_PICKER_TEXT_PICKER_PATTERN_H 18 19 #include <optional> 20 21 #include "core/components/theme/app_theme.h" 22 #include "core/components/picker/picker_theme.h" 23 #include "core/components/dialog/dialog_theme.h" 24 #include "core/components_ng/pattern/linear_layout/linear_layout_pattern.h" 25 #include "core/components_ng/pattern/picker/picker_type_define.h" 26 #include "core/components_ng/pattern/text_picker/textpicker_row_accessibility_property.h" 27 #include "core/components_ng/pattern/text_picker/textpicker_event_hub.h" 28 #include "core/components_ng/pattern/text_picker/textpicker_layout_property.h" 29 #include "core/components_ng/pattern/text_picker/textpicker_paint_method.h" 30 #include "core/components_ng/pattern/text_picker/toss_animation_controller.h" 31 32 #ifdef SUPPORT_DIGITAL_CROWN 33 #include "core/event/crown_event.h" 34 #endif 35 namespace OHOS::Ace::NG { 36 class InspectorFilter; 37 using EventCallback = std::function<void(bool)>; 38 using ColumnChangeCallback = std::function<void(const RefPtr<FrameNode>&, bool, uint32_t, bool)>; 39 40 namespace { 41 const Dimension TEXT_FOCUS_PAINT_WIDTH = 2.0_vp; 42 } 43 class TextPickerPattern : public LinearLayoutPattern { 44 DECLARE_ACE_TYPE(TextPickerPattern, LinearLayoutPattern); 45 46 public: TextPickerPattern()47 TextPickerPattern() : LinearLayoutPattern(false) {}; 48 49 ~TextPickerPattern() override = default; 50 IsAtomicNode()51 bool IsAtomicNode() const override 52 { 53 return true; 54 } 55 CreateEventHub()56 RefPtr<EventHub> CreateEventHub() override 57 { 58 return MakeRefPtr<TextPickerEventHub>(); 59 } 60 CreateLayoutProperty()61 RefPtr<LayoutProperty> CreateLayoutProperty() override 62 { 63 return MakeRefPtr<TextPickerLayoutProperty>(); 64 } 65 CreateAccessibilityProperty()66 RefPtr<AccessibilityProperty> CreateAccessibilityProperty() override 67 { 68 return MakeRefPtr<TextPickerRowAccessibilityProperty>(); 69 } 70 CreateNodePaintMethod()71 RefPtr<NodePaintMethod> CreateNodePaintMethod() override 72 { 73 auto textPickerPaintMethod = MakeRefPtr<TextPickerPaintMethod>(WeakClaim(this)); 74 textPickerPaintMethod->SetDefaultPickerItemHeight(CalculateHeight()); 75 textPickerPaintMethod->SetEnabled(enabled_); 76 return textPickerPaintMethod; 77 } 78 CreateLayoutAlgorithm()79 RefPtr<LayoutAlgorithm> CreateLayoutAlgorithm() override 80 { 81 return MakeRefPtr<LinearLayoutAlgorithm>(); 82 } 83 84 void SetEventCallback(EventCallback&& value); 85 86 void FireChangeEvent(bool refresh); 87 88 void SetScrollStopEventCallback(EventCallback&& value); 89 90 void FireScrollStopEvent(bool refresh); 91 92 void SetEnterSelectedAreaEventCallback(EventCallback&& value); 93 94 void FireEnterSelectedAreaEvent(bool refresh); 95 96 void OnColumnsBuilding(); 97 98 void FlushOptions(); 99 100 void SetDefaultPickerItemHeight(); 101 102 std::map<uint32_t, RefPtr<FrameNode>> GetColumnNodes(); 103 104 RefPtr<FrameNode> GetColumnNode(); 105 106 uint32_t GetShowOptionCount() const; 107 SetSelected(uint32_t value)108 void SetSelected(uint32_t value) 109 { 110 selectedIndex_ = value; 111 } 112 GetSelected()113 uint32_t GetSelected() const 114 { 115 return selectedIndex_; 116 } 117 SetRange(const std::vector<NG::RangeContent> & value)118 void SetRange(const std::vector<NG::RangeContent>& value) 119 { 120 if (value.empty()) { 121 return; 122 } 123 range_ = value; 124 } 125 GetRange()126 std::vector<NG::RangeContent> GetRange() const 127 { 128 return range_; 129 } 130 SetColumnWidths(const std::vector<Dimension> & widths)131 void SetColumnWidths(const std::vector<Dimension>& widths) 132 { 133 columnWidths_.clear(); 134 for (size_t i = 0; i < widths.size(); i++) { 135 columnWidths_.emplace_back(widths[i]); 136 } 137 } 138 GetColumnWidths()139 std::vector<Dimension> GetColumnWidths() const 140 { 141 return columnWidths_; 142 } 143 GetMultiOptions()144 std::vector<NG::TextCascadePickerOptions> GetMultiOptions() const 145 { 146 return cascadeOriginptions_; 147 } 148 SetColumnsKind(uint32_t columnKind)149 void SetColumnsKind(uint32_t columnKind) 150 { 151 columnsKind_ = columnKind; 152 } 153 ClearOption()154 void ClearOption() 155 { 156 options_.clear(); 157 } 158 AppendOption(const NG::RangeContent & value)159 void AppendOption(const NG::RangeContent& value) 160 { 161 options_.emplace_back(value); 162 } 163 GetOptionCount()164 uint32_t GetOptionCount() const 165 { 166 return options_.size(); 167 } 168 169 std::string GetSelectedObject(bool isColumnChange, int32_t status = 0, bool isEnterSelectedAreaEvent = false) const; 170 GetOption(uint32_t index)171 std::string GetOption(uint32_t index) const 172 { 173 if (index >= GetOptionCount()) { 174 return ""; 175 } 176 return options_[index].text_; 177 } 178 SetBackgroundColor(const Color & color)179 void SetBackgroundColor(const Color& color) 180 { 181 if (backgroundColor_ == color) { 182 return; 183 } 184 auto host = GetHost(); 185 CHECK_NULL_VOID(host); 186 backgroundColor_ = color; 187 host->MarkDirtyNode(PROPERTY_UPDATE_RENDER); 188 } 189 GetBackgroundColor()190 Color GetBackgroundColor() 191 { 192 return backgroundColor_; 193 } 194 GetFocusPattern()195 FocusPattern GetFocusPattern() const override 196 { 197 auto pipeline = PipelineBase::GetCurrentContext(); 198 CHECK_NULL_RETURN(pipeline, FocusPattern()); 199 auto pickerTheme = pipeline->GetTheme<PickerTheme>(); 200 CHECK_NULL_RETURN(pickerTheme, FocusPattern()); 201 auto focusColor = pickerTheme->GetFocusColor(); 202 203 FocusPaintParam focusPaintParams; 204 focusPaintParams.SetPaintColor(focusColor); 205 206 return { FocusType::NODE, true, FocusStyleType::CUSTOM_REGION, focusPaintParams }; 207 } 208 209 void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override; 210 SetCascadeOptions(const std::vector<NG::TextCascadePickerOptions> & options,const std::vector<NG::TextCascadePickerOptions> & cascadeOptions)211 void SetCascadeOptions(const std::vector<NG::TextCascadePickerOptions>& options, 212 const std::vector<NG::TextCascadePickerOptions>& cascadeOptions) 213 { 214 cascadeOptions_.clear(); 215 cascadeOriginptions_.clear(); 216 for (auto& option : cascadeOptions) { 217 cascadeOptions_.emplace_back(std::move(option)); 218 } 219 for (auto& option : options) { 220 cascadeOriginptions_.emplace_back(std::move(option)); 221 } 222 } 223 GetCascadeOptionCount()224 uint32_t GetCascadeOptionCount() const 225 { 226 return cascadeOptions_.size(); 227 } 228 GetOptionCount(const RefPtr<FrameNode> & frmeNode)229 uint32_t GetOptionCount(const RefPtr<FrameNode>& frmeNode) 230 { 231 uint32_t count = 0; 232 auto it = optionsWithNode_.find(frmeNode); 233 if (it != optionsWithNode_.end()) { 234 count = it->second.size(); 235 } 236 return count; 237 } 238 SetIsCascade(bool isCascade)239 void SetIsCascade(bool isCascade) 240 { 241 isCascade_ = isCascade; 242 } 243 GetIsCascade()244 bool GetIsCascade() const 245 { 246 return isCascade_; 247 } 248 SetConfirmNode(WeakPtr<FrameNode> buttonConfirmNode)249 void SetConfirmNode(WeakPtr<FrameNode> buttonConfirmNode) 250 { 251 weakButtonConfirm_ = buttonConfirmNode; 252 } 253 SetCancelNode(WeakPtr<FrameNode> buttonCancelNode)254 void SetCancelNode(WeakPtr<FrameNode> buttonCancelNode) 255 { 256 weakButtonCancel_ = buttonCancelNode; 257 } 258 SetForwardNode(WeakPtr<FrameNode> buttonForwardNode)259 void SetForwardNode(WeakPtr<FrameNode> buttonForwardNode) 260 { 261 weakButtonForward_ = buttonForwardNode; 262 } 263 SetBackwardNode(WeakPtr<FrameNode> buttonBackwardNode)264 void SetBackwardNode(WeakPtr<FrameNode> buttonBackwardNode) 265 { 266 weakButtonBackward_ = buttonBackwardNode; 267 } 268 269 void OnLanguageConfigurationUpdate() override; 270 void OnFontConfigurationUpdate() override; 271 void OnFontScaleConfigurationUpdate() override; 272 SetValues(const std::vector<std::string> & values)273 void SetValues(const std::vector<std::string>& values) 274 { 275 values_.clear(); 276 for (auto& value : values) { 277 values_.emplace_back(value); 278 } 279 } 280 GetValues()281 const std::vector<std::string>& GetValues() 282 { 283 return values_; 284 } 285 GetSelecteds()286 const std::vector<uint32_t>& GetSelecteds() 287 { 288 return selecteds_; 289 } 290 SetHasSelectAttr(bool value)291 void SetHasSelectAttr(bool value) 292 { 293 isHasSelectAttr_ = value; 294 } 295 SetResizePickerItemHeight(double resizePickerItemHeight)296 void SetResizePickerItemHeight(double resizePickerItemHeight) 297 { 298 resizePickerItemHeight_ = resizePickerItemHeight; 299 } 300 GetResizePickerItemHeight()301 double GetResizePickerItemHeight() const 302 { 303 return resizePickerItemHeight_; 304 } 305 SetResizeFlag(bool resizeFlag)306 void SetResizeFlag(bool resizeFlag) 307 { 308 resizeFlag_ = resizeFlag; 309 } 310 GetResizeFlag()311 bool GetResizeFlag() const 312 { 313 return resizeFlag_; 314 } 315 SetIsShowInDialog(bool isShowInDialog)316 void SetIsShowInDialog(bool isShowInDialog) 317 { 318 isShowInDialog_ = isShowInDialog; 319 } 320 GetIsShowInDialog()321 bool GetIsShowInDialog() const 322 { 323 return isShowInDialog_; 324 } 325 GetDefaultPickerItemHeight()326 double GetDefaultPickerItemHeight() const 327 { 328 return defaultPickerItemHeight_; 329 } 330 331 void SetSelecteds(const std::vector<uint32_t>& values); 332 333 void HandleColumnChange(const RefPtr<FrameNode>& tag, bool isAdd, uint32_t index, bool needNotify); 334 335 void SetChangeCallback(ColumnChangeCallback&& value); 336 337 void ProcessCascadeOptions(const std::vector<NG::TextCascadePickerOptions>& options, 338 std::vector<NG::TextCascadePickerOptions>& reOptions, uint32_t index); 339 340 size_t ProcessCascadeOptionDepth(const NG::TextCascadePickerOptions& option); 341 342 void OnColorConfigurationUpdate() override; 343 344 bool OnThemeScopeUpdate(int32_t themeScopeId) override; 345 346 void OnDirectionConfigurationUpdate() override; 347 SetContentRowNode(RefPtr<FrameNode> & contentRowNode)348 void SetContentRowNode(RefPtr<FrameNode>& contentRowNode) 349 { 350 contentRowNode_ = contentRowNode; 351 } 352 SetPickerTag(bool isPicker)353 void SetPickerTag(bool isPicker) 354 { 355 isPicker_ = isPicker; 356 } 357 358 void CheckAndUpdateColumnSize(SizeF& size, RefPtr<FrameNode>& frameNode, bool isNeedAdaptForAging = false); 359 bool NeedAdaptForAging(); 360 SetDivider(const ItemDivider & divider)361 void SetDivider(const ItemDivider& divider) 362 { 363 divider_ = divider; 364 } 365 GetDivider()366 ItemDivider GetDivider() 367 { 368 return divider_; 369 } 370 SetCustomDividerFlag(bool customDividerFlag)371 void SetCustomDividerFlag(bool customDividerFlag) 372 { 373 customDividerFlag_ = customDividerFlag; 374 } 375 GetCustomDividerFlag()376 bool GetCustomDividerFlag() 377 { 378 return customDividerFlag_; 379 } SetGradientHeight(const Dimension & value)380 void SetGradientHeight(const Dimension& value) 381 { 382 value_ = value; 383 } 384 GetGradientHeight()385 Dimension GetGradientHeight() 386 { 387 return value_; 388 } 389 390 void SetCanLoop(bool isLoop); 391 void SetDigitalCrownSensitivity(int32_t crownSensitivity); 392 GetCanLoop()393 bool GetCanLoop() 394 { 395 return canloop_; 396 } 397 HasUserDefinedDisappearFontFamily(bool isUserDefined)398 void HasUserDefinedDisappearFontFamily(bool isUserDefined) 399 { 400 hasUserDefinedDisappearFontFamily_ = isUserDefined; 401 } 402 GetHasUserDefinedDisappearFontFamily()403 bool GetHasUserDefinedDisappearFontFamily() 404 { 405 return hasUserDefinedDisappearFontFamily_; 406 } 407 HasUserDefinedNormalFontFamily(bool isUserDefined)408 void HasUserDefinedNormalFontFamily(bool isUserDefined) 409 { 410 hasUserDefinedNormalFontFamily_ = isUserDefined; 411 } 412 GetHasUserDefinedNormalFontFamily()413 bool GetHasUserDefinedNormalFontFamily() 414 { 415 return hasUserDefinedNormalFontFamily_; 416 } 417 HasUserDefinedSelectedFontFamily(bool isUserDefined)418 void HasUserDefinedSelectedFontFamily(bool isUserDefined) 419 { 420 hasUserDefinedSelectedFontFamily_ = isUserDefined; 421 } 422 GetHasUserDefinedSelectedFontFamily()423 bool GetHasUserDefinedSelectedFontFamily() 424 { 425 return hasUserDefinedSelectedFontFamily_; 426 } 427 SetRangeType(int32_t rangeType)428 void SetRangeType(int32_t rangeType) 429 { 430 rangeType_ = rangeType; 431 } 432 GetRangeType()433 int32_t GetRangeType() 434 { 435 return rangeType_; 436 } 437 updateFontConfigurationEvent(const std::function<void ()> & closeDialogEvent)438 void updateFontConfigurationEvent(const std::function<void()>& closeDialogEvent) 439 { 440 closeDialogEvent_ = closeDialogEvent; 441 } 442 GetTextProperties()443 const PickerTextProperties& GetTextProperties() const 444 { 445 return textProperties_; 446 } 447 SetTextProperties(const PickerTextProperties & properties)448 void SetTextProperties(const PickerTextProperties& properties) 449 { 450 textProperties_ = properties; 451 if (properties.disappearTextStyle_.fontSize.has_value() && properties.disappearTextStyle_.fontSize->IsValid()) { 452 isUserSetGradientFont_ = true; 453 gradientHeight_ = properties.disappearTextStyle_.fontSize.value(); 454 } 455 456 if (properties.normalTextStyle_.fontSize.has_value() && properties.normalTextStyle_.fontSize->IsValid()) { 457 isUserSetGradientFont_ = true; 458 gradientHeight_ = std::max(properties.normalTextStyle_.fontSize.value(), gradientHeight_); 459 } 460 461 if (properties.selectedTextStyle_.fontSize.has_value() && properties.selectedTextStyle_.fontSize->IsValid()) { 462 isUserSetDividerSpacingFont_ = true; 463 dividerSpacing_ = properties.selectedTextStyle_.fontSize.value(); 464 } 465 } 466 GetIsUserSetDividerSpacingFont()467 bool GetIsUserSetDividerSpacingFont() 468 { 469 return isUserSetDividerSpacingFont_; 470 } 471 GetIsUserSetGradientFont()472 bool GetIsUserSetGradientFont() 473 { 474 return isUserSetGradientFont_; 475 } 476 GetDividerSpacing()477 Dimension GetDividerSpacing() 478 { 479 return dividerSpacing_; 480 } 481 GetTextGradientHeight()482 Dimension GetTextGradientHeight() 483 { 484 return gradientHeight_; 485 } 486 SetPaintDividerSpacing(float & value)487 void SetPaintDividerSpacing(float& value) 488 { 489 paintDividerSpacing_ = value; 490 } 491 GetPaintDividerSpacing()492 float GetPaintDividerSpacing() 493 { 494 return paintDividerSpacing_; 495 } 496 SetUserDefinedOpacity(double opacity)497 void SetUserDefinedOpacity(double opacity) 498 { 499 curOpacity_ = opacity; 500 } 501 502 void SetDisableTextStyleAnimation(bool isDisableTextStyleAnimation); 503 GetDisableTextStyleAnimation()504 bool GetDisableTextStyleAnimation() const 505 { 506 return isDisableTextStyleAnimation_; 507 } 508 SetIsEnableHaptic(bool isEnableHapticFeedback)509 void SetIsEnableHaptic(bool isEnableHapticFeedback) 510 { 511 if (isEnableHaptic_ != isEnableHapticFeedback) { 512 isHapticChanged_ = true; 513 } 514 isEnableHaptic_ = isEnableHapticFeedback; 515 } 516 GetIsEnableHaptic()517 bool GetIsEnableHaptic() const 518 { 519 return isEnableHaptic_; 520 } 521 522 void ColumnPatternInitHapticController(); 523 void UpdateUserSetSelectColor(); 524 std::string GetTextPickerRange() const; SetSingleRange(bool isSingleRange)525 inline void SetSingleRange(bool isSingleRange) 526 { 527 isSingleRange_ = isSingleRange; 528 } 529 530 private: 531 void OnModifyDone() override; 532 void InitCrownAndKeyEvent(); 533 void SetCallBack(); 534 void SetLayoutDirection(TextDirection textDirection); 535 void OnAttachToFrameNode() override; 536 bool OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config) override; 537 538 void InitOnKeyEvent(const RefPtr<FocusHub>& focusHub); 539 bool OnKeyEvent(const KeyEvent& event); 540 bool HandleDirectionKey(KeyCode code); 541 void InitFocusEvent(); 542 void InitSelectorProps(); 543 void HandleFocusEvent(); 544 void HandleBlurEvent(); 545 void AddIsFocusActiveUpdateEvent(); 546 void RemoveIsFocusActiveUpdateEvent(); 547 void GetInnerFocusButtonPaintRect(RoundRect& paintRect, float focusButtonXOffset); 548 void CalcLeftTotalColumnWidth(const RefPtr<FrameNode>& host, float& leftTotalColumnWidth, float childSize); 549 void UpdateFocusButtonState(); 550 void SetHaveFocus(bool haveFocus); 551 void UpdateColumnButtonStyles(const RefPtr<FrameNode>& columnNode, bool haveFocus, bool needMarkDirty); 552 const RefPtr<FrameNode> GetFocusButtonNode() const; 553 double CalculateHeight(); 554 555 void ClearFocus(); 556 void SetDefaultFocus(); 557 bool IsCircle(); 558 #ifdef SUPPORT_DIGITAL_CROWN 559 void InitOnCrownEvent(const RefPtr<FocusHub>& focusHub); 560 bool OnCrownEvent(const CrownEvent& event); 561 #endif 562 void InitDisabled(); 563 void GetInnerFocusPaintRect(RoundRect& paintRect); 564 void PaintFocusState(); 565 void SetButtonIdeaSize(); 566 std::string GetRangeStr() const; 567 std::string GetOptionsMultiStr() const; 568 std::string GetOptionsMultiStrInternal() const; 569 std::string GetColumnWidthsStr() const; 570 std::string GetOptionsCascadeStr( 571 const std::vector<NG::TextCascadePickerOptions>& options) const; 572 bool ChangeCurrentOptionValue(NG::TextCascadePickerOptions& option, 573 uint32_t value, uint32_t curColumn, uint32_t replaceColumn); 574 void OnColumnsBuildingUnCascade(); 575 void OnColumnsBuildingCascade(); 576 std::string GetSelectedObjectMulti(const std::vector<std::string>& values, 577 const std::vector<uint32_t>& indexs, int32_t status) const; 578 void SupplementOption(const std::vector<NG::TextCascadePickerOptions>& reOptions, 579 std::vector<NG::RangeContent>& rangeContents, uint32_t patterIndex); 580 void ProcessCascadeOptionsValues(const std::vector<std::string>& rangeResultValue, uint32_t index); 581 void SetFocusCornerRadius(RoundRect& paintRect); 582 void UpdateConfirmButtonMargin( 583 const RefPtr<FrameNode>& buttonConfirmNode, const RefPtr<DialogTheme>& dialogTheme); 584 void UpdateCancelButtonMargin( 585 const RefPtr<FrameNode>& buttonCancelNode, const RefPtr<DialogTheme>& dialogTheme); 586 void CheckFocusID(int32_t childSize); 587 bool ParseDirectionKey(RefPtr<TextPickerColumnPattern>& textPickerColumnPattern, KeyCode& code, int32_t childSize); 588 RectF CalculatePaintRect(int32_t currentFocusIndex, 589 float centerX, float centerY, float paintRectWidth, float paintRectHeight, float columnWidth); 590 void AdjustFocusBoxOffset(float& centerX, float& centerY); 591 float CalculateColumnSize(int32_t index, float childCount, const SizeF& pickerContentSize); 592 int32_t CalculateIndex(RefPtr<FrameNode>& frameNode); 593 594 bool enabled_ = true; 595 int32_t focusKeyID_ = 0; 596 double defaultPickerItemHeight_ = 0.0; 597 double resizePickerItemHeight_ = 0.0; 598 bool focusEventInitialized_ = false; 599 bool haveFocus_ = false; 600 bool useButtonFocusArea_ = false; 601 Dimension selectorItemRadius_ = 8.0_vp; 602 std::function<void(bool)> isFocusActiveUpdateEvent_; 603 uint32_t selectedIndex_ = 0; 604 std::vector<NG::RangeContent> range_; 605 std::vector<NG::RangeContent> options_; 606 uint32_t columnsKind_ = 0; 607 std::vector<NG::TextCascadePickerOptions> cascadeOptions_; 608 std::map<WeakPtr<FrameNode>, std::vector<NG::RangeContent>> optionsWithNode_; 609 std::vector<NG::TextCascadePickerOptions> cascadeOriginptions_; 610 bool isCascade_ = false; 611 bool isHasSelectAttr_ = false; 612 WeakPtr<FrameNode> weakButtonConfirm_; 613 WeakPtr<FrameNode> weakButtonCancel_; 614 WeakPtr<FrameNode> weakButtonForward_; 615 WeakPtr<FrameNode> weakButtonBackward_; 616 std::vector<std::string> values_; 617 std::vector<uint32_t> selecteds_; 618 Color backgroundColor_ = Color::WHITE; 619 bool resizeFlag_ = false; 620 bool isShowInDialog_ = false; 621 bool canloop_ = true; 622 623 // inner focus switch 624 bool operationOn_ = false; 625 626 bool hasUserDefinedDisappearFontFamily_ = false; 627 bool hasUserDefinedNormalFontFamily_ = false; 628 bool hasUserDefinedSelectedFontFamily_ = false; 629 630 double curOpacity_ = 1.0; 631 632 ACE_DISALLOW_COPY_AND_MOVE(TextPickerPattern); 633 634 WeakPtr<NG::FrameNode> contentRowNode_; 635 bool isPicker_ = true; 636 bool isFiredSelectsChange_ = false; 637 std::optional<std::string> firedSelectsStr_; 638 639 ItemDivider divider_; 640 bool customDividerFlag_ = false; 641 Dimension value_; 642 int32_t rangeType_ = 0; 643 std::function<void()> closeDialogEvent_; 644 bool isUserSetDividerSpacingFont_ = false; 645 bool isUserSetGradientFont_ = false; 646 Dimension gradientHeight_; 647 Dimension dividerSpacing_; 648 float paintDividerSpacing_ = 1.0f; 649 bool isNeedUpdateSelectedIndex_ = true; 650 PickerTextProperties textProperties_; 651 std::vector<Dimension> columnWidths_; 652 653 bool isDisableTextStyleAnimation_ = false; 654 bool isEnableHaptic_ = true; 655 bool isHapticChanged_ = false; 656 int32_t selectedColumnId_ = INVALID_SELECTED_COLUMN_INDEX; 657 bool isSingleRange_ = true; 658 }; 659 } // namespace OHOS::Ace::NG 660 661 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_TEXT_PICKER_TEXT_PICKER_PATTERN_H 662