1/* 2 * Copyright (c) 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/** 17 * @file 18 * @kit ArkUI 19 */ 20 21 22 23 24 25/** 26 * Defines text only item of SegmentButton. 27 * 28 * @interface SegmentButtonTextItem 29 * @syscap SystemCapability.ArkUI.ArkUI.Full 30 * @crossplatform 31 * @since 11 32 */ 33 /** 34 * Defines text only item of SegmentButton. 35 * 36 * @interface SegmentButtonTextItem 37 * @syscap SystemCapability.ArkUI.ArkUI.Full 38 * @crossplatform 39 * @atomicservice 40 * @since 12 41 */ 42 43interface SegmentButtonTextItem { 44 /** 45 * The text of text only item. 46 * 47 * @type { ResourceStr } 48 * @syscap SystemCapability.ArkUI.ArkUI.Full 49 * @crossplatform 50 * @since 11 51 */ 52 /** 53 * The text of text only item. 54 * 55 * @type { ResourceStr } 56 * @syscap SystemCapability.ArkUI.ArkUI.Full 57 * @crossplatform 58 * @atomicservice 59 * @since 12 60 */ 61 text: ResourceStr; 62 63 /** 64 * The accessibilityLevel of buttonItem. 65 * 66 * @type { ?string } 67 * @default "auto" 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @crossplatform 70 * @atomicservice 71 * @since 13 72 */ 73 accessibilityLevel?: string; 74 75 /** 76 * The accessibilityDescription of buttonItem. 77 * 78 * @type { ?ResourceStr } 79 * @default "" 80 * @syscap SystemCapability.ArkUI.ArkUI.Full 81 * @crossplatform 82 * @atomicservice 83 * @since 13 84 */ 85 accessibilityDescription?: ResourceStr; 86} 87 88/** 89 * Defines icon only item of SegmentButton. 90 * 91 * @interface SegmentButtonIconItem 92 * @syscap SystemCapability.ArkUI.ArkUI.Full 93 * @crossplatform 94 * @since 11 95 */ 96 /** 97 * Defines icon only item of SegmentButton. 98 * 99 * @interface SegmentButtonIconItem 100 * @syscap SystemCapability.ArkUI.ArkUI.Full 101 * @crossplatform 102 * @atomicservice 103 * @since 12 104 */ 105interface SegmentButtonIconItem { 106 /** 107 * The icon of icon only item. 108 * 109 * @type { ResourceStr } 110 * @syscap SystemCapability.ArkUI.ArkUI.Full 111 * @crossplatform 112 * @since 11 113 */ 114 /** 115 * The icon of icon only item. 116 * 117 * @type { ResourceStr } 118 * @syscap SystemCapability.ArkUI.ArkUI.Full 119 * @crossplatform 120 * @atomicservice 121 * @since 12 122 */ 123 icon: ResourceStr; 124 125 /** 126 * The accessibilityText of icon. 127 * 128 * @type { ?ResourceStr } 129 * @default "" 130 * @syscap SystemCapability.ArkUI.ArkUI.Full 131 * @crossplatform 132 * @atomicservice 133 * @since 13 134 */ 135 iconAccessibilityText?: ResourceStr; 136 137 /** 138 * The icon of icon only item in the selected state. 139 * 140 * @type { ResourceStr } 141 * @syscap SystemCapability.ArkUI.ArkUI.Full 142 * @crossplatform 143 * @since 11 144 */ 145 /** 146 * The icon of icon only item in the selected state. 147 * 148 * @type { ResourceStr } 149 * @syscap SystemCapability.ArkUI.ArkUI.Full 150 * @crossplatform 151 * @atomicservice 152 * @since 12 153 */ 154 selectedIcon: ResourceStr; 155 156 /** 157 * The accessibilityText of selectedIcon. 158 * 159 * @type { ?ResourceStr } 160 * @default "" 161 * @syscap SystemCapability.ArkUI.ArkUI.Full 162 * @crossplatform 163 * @atomicservice 164 * @since 13 165 */ 166 selectedIconAccessibilityText?: ResourceStr; 167 168 /** 169 * The accessibilityLevel of buttonItem. 170 * 171 * @type { ?string } 172 * @default "auto" 173 * @syscap SystemCapability.ArkUI.ArkUI.Full 174 * @crossplatform 175 * @atomicservice 176 * @since 13 177 */ 178 accessibilityLevel?: string; 179 180 /** 181 * The accessibilityDescription of buttonItem. 182 * 183 * @type { ?ResourceStr } 184 * @default "" 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @crossplatform 187 * @atomicservice 188 * @since 13 189 */ 190 accessibilityDescription?: ResourceStr; 191} 192 193/** 194 * Defines icon and text item of SegmentButton. 195 * 196 * @interface SegmentButtonIconTextItem 197 * @syscap SystemCapability.ArkUI.ArkUI.Full 198 * @crossplatform 199 * @since 11 200 */ 201 /** 202 * Defines icon and text item of SegmentButton. 203 * 204 * @interface SegmentButtonIconTextItem 205 * @syscap SystemCapability.ArkUI.ArkUI.Full 206 * @crossplatform 207 * @atomicservice 208 * @since 12 209 */ 210interface SegmentButtonIconTextItem { 211 /** 212 * The icon of icon and text item. 213 * 214 * @type { ResourceStr } 215 * @syscap SystemCapability.ArkUI.ArkUI.Full 216 * @crossplatform 217 * @since 11 218 */ 219 /** 220 * The icon of icon and text item. 221 * 222 * @type { ResourceStr } 223 * @syscap SystemCapability.ArkUI.ArkUI.Full 224 * @crossplatform 225 * @atomicservice 226 * @since 12 227 */ 228 icon: ResourceStr; 229 230 /** 231 * The accessibilityText of icon. 232 * 233 * @type { ?ResourceStr } 234 * @default "" 235 * @syscap SystemCapability.ArkUI.ArkUI.Full 236 * @crossplatform 237 * @atomicservice 238 * @since 13 239 */ 240 iconAccessibilityText?: ResourceStr; 241 242 /** 243 * The icon of icon and text item in the selected state. 244 * 245 * @type { ResourceStr } 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @crossplatform 248 * @since 11 249 */ 250 /** 251 * The icon of icon and text item in the selected state. 252 * 253 * @type { ResourceStr } 254 * @syscap SystemCapability.ArkUI.ArkUI.Full 255 * @crossplatform 256 * @atomicservice 257 * @since 12 258 */ 259 selectedIcon: ResourceStr; 260 261 /** 262 * The accessibilityText of selectedIcon. 263 * 264 * @type { ?ResourceStr } 265 * @default "" 266 * @syscap SystemCapability.ArkUI.ArkUI.Full 267 * @crossplatform 268 * @atomicservice 269 * @since 13 270 */ 271 selectedIconAccessibilityText?: ResourceStr; 272 273 /** 274 * The text of icon and text item. 275 * 276 * @type { ResourceStr } 277 * @syscap SystemCapability.ArkUI.ArkUI.Full 278 * @crossplatform 279 * @since 11 280 */ 281 /** 282 * The text of icon and text item. 283 * 284 * @type { ResourceStr } 285 * @syscap SystemCapability.ArkUI.ArkUI.Full 286 * @crossplatform 287 * @atomicservice 288 * @since 12 289 */ 290 text: ResourceStr; 291 292 /** 293 * The accessibilityLevel of buttonItem. 294 * 295 * @type { ?string } 296 * @default "auto" 297 * @syscap SystemCapability.ArkUI.ArkUI.Full 298 * @crossplatform 299 * @atomicservice 300 * @since 13 301 */ 302 accessibilityLevel?: string; 303 304 /** 305 * The accessibilityDescription of buttonItem. 306 * 307 * @type { ?ResourceStr } 308 * @default "" 309 * @syscap SystemCapability.ArkUI.ArkUI.Full 310 * @crossplatform 311 * @atomicservice 312 * @since 13 313 */ 314 accessibilityDescription?: ResourceStr; 315} 316 317/** 318 * Defines the DimensionNoPercentage type. 319 * 320 * @syscap SystemCapability.ArkUI.ArkUI.Full 321 * @crossplatform 322 * @since 11 323 */ 324 /** 325 * Defines the DimensionNoPercentage type. 326 * 327 * @syscap SystemCapability.ArkUI.ArkUI.Full 328 * @crossplatform 329 * @atomicservice 330 * @since 12 331 */ 332declare type DimensionNoPercentage = PX | VP | FP | LPX | Resource; 333 334/** 335 * Defines the BorderRadiusMode type. 336 * @enum { number } 337 * @syscap SystemCapability.ArkUI.ArkUI.Full 338 * @crossplatform 339 * @atomicservice 340 * @since 20 341 */ 342declare enum BorderRadiusMode { 343 /** 344 * Default mode, radius is auto calculated by framework. 345 * @syscap SystemCapability.ArkUI.ArkUI.Full 346 * @crossplatform 347 * @atomicservice 348 * @since 20 349 */ 350 DEFAULT = 0, 351 352 /** 353 * Custom mode, radius can be set by developers. 354 * @syscap SystemCapability.ArkUI.ArkUI.Full 355 * @crossplatform 356 * @atomicservice 357 * @since 20 358 */ 359 CUSTOM = 1 360} 361 362/** 363 * Defines SegmentButton common options. 364 * 365 * @interface CommonSegmentButtonOptions 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @crossplatform 368 * @since 11 369 */ 370 /** 371 * Defines SegmentButton common options. 372 * 373 * @interface CommonSegmentButtonOptions 374 * @syscap SystemCapability.ArkUI.ArkUI.Full 375 * @crossplatform 376 * @atomicservice 377 * @since 12 378 */ 379interface CommonSegmentButtonOptions { 380 /** 381 * The font color of buttons. 382 * 383 * @type { ?ResourceColor } 384 * @syscap SystemCapability.ArkUI.ArkUI.Full 385 * @crossplatform 386 * @since 11 387 */ 388 /** 389 * The font color of buttons. 390 * 391 * @type { ?ResourceColor } 392 * @syscap SystemCapability.ArkUI.ArkUI.Full 393 * @crossplatform 394 * @atomicservice 395 * @since 12 396 */ 397 fontColor?: ResourceColor; 398 399 /** 400 * The font color of selected button. 401 * 402 * @type { ?ResourceColor } 403 * @syscap SystemCapability.ArkUI.ArkUI.Full 404 * @crossplatform 405 * @since 11 406 */ 407 /** 408 * The font color of selected button. 409 * 410 * @type { ?ResourceColor } 411 * @syscap SystemCapability.ArkUI.ArkUI.Full 412 * @crossplatform 413 * @atomicservice 414 * @since 12 415 */ 416 selectedFontColor?: ResourceColor; 417 418 /** 419 * The font size of buttons. 420 * 421 * @type { ?DimensionNoPercentage } 422 * @default $r('sys.float.ohos_id_text_size_body2') 423 * @syscap SystemCapability.ArkUI.ArkUI.Full 424 * @crossplatform 425 * @since 11 426 */ 427 /** 428 * The font size of buttons. 429 * 430 * @type { ?DimensionNoPercentage } 431 * @default $r('sys.float.ohos_id_text_size_body2') 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @crossplatform 434 * @atomicservice 435 * @since 12 436 */ 437 fontSize?: DimensionNoPercentage; 438 439 /** 440 * The font size of selected button. 441 * 442 * @type { ?DimensionNoPercentage } 443 * @default $r('sys.float.ohos_id_text_size_body2') 444 * @syscap SystemCapability.ArkUI.ArkUI.Full 445 * @crossplatform 446 * @since 11 447 */ 448 /** 449 * The font size of selected button. 450 * 451 * @type { ?DimensionNoPercentage } 452 * @default $r('sys.float.ohos_id_text_size_body2') 453 * @syscap SystemCapability.ArkUI.ArkUI.Full 454 * @crossplatform 455 * @atomicservice 456 * @since 12 457 */ 458 selectedFontSize?: DimensionNoPercentage; 459 460 /** 461 * The font weight of buttons. 462 * 463 * @type { ?FontWeight } 464 * @default FontWeight.Regular 465 * @syscap SystemCapability.ArkUI.ArkUI.Full 466 * @crossplatform 467 * @since 11 468 */ 469 /** 470 * The font weight of buttons. 471 * 472 * @type { ?FontWeight } 473 * @default FontWeight.Regular 474 * @syscap SystemCapability.ArkUI.ArkUI.Full 475 * @crossplatform 476 * @atomicservice 477 * @since 12 478 */ 479 fontWeight?: FontWeight; 480 481 /** 482 * The font weight of selected button. 483 * 484 * @type { ?FontWeight } 485 * @default FontWeight.Medium 486 * @syscap SystemCapability.ArkUI.ArkUI.Full 487 * @crossplatform 488 * @since 11 489 */ 490 /** 491 * The font weight of selected button. 492 * 493 * @type { ?FontWeight } 494 * @default FontWeight.Medium 495 * @syscap SystemCapability.ArkUI.ArkUI.Full 496 * @crossplatform 497 * @atomicservice 498 * @since 12 499 */ 500 selectedFontWeight?: FontWeight; 501 502 /** 503 * The background color of SegmentButton. 504 * 505 * @type { ?ResourceColor } 506 * @default $r('sys.color.ohos_id_color_button_normal') 507 * @syscap SystemCapability.ArkUI.ArkUI.Full 508 * @crossplatform 509 * @since 11 510 */ 511 /** 512 * The background color of SegmentButton. 513 * 514 * @type { ?ResourceColor } 515 * @default $r('sys.color.ohos_id_color_button_normal') 516 * @syscap SystemCapability.ArkUI.ArkUI.Full 517 * @crossplatform 518 * @atomicservice 519 * @since 12 520 */ 521 backgroundColor?: ResourceColor; 522 523 /** 524 * The background color of selected button. 525 * 526 * @type { ?ResourceColor } 527 * @syscap SystemCapability.ArkUI.ArkUI.Full 528 * @crossplatform 529 * @since 11 530 */ 531 /** 532 * The background color of selected button. 533 * 534 * @type { ?ResourceColor } 535 * @syscap SystemCapability.ArkUI.ArkUI.Full 536 * @crossplatform 537 * @atomicservice 538 * @since 12 539 */ 540 selectedBackgroundColor?: ResourceColor; 541 542 /** 543 * The image size of buttons. 544 * 545 * @type { ?SizeOptions } 546 * @default SizeOptions { width: 24, height: 24 } 547 * @syscap SystemCapability.ArkUI.ArkUI.Full 548 * @crossplatform 549 * @since 11 550 */ 551 /** 552 * The image size of buttons. 553 * 554 * @type { ?SizeOptions } 555 * @default SizeOptions { width: 24, height: 24 } 556 * @syscap SystemCapability.ArkUI.ArkUI.Full 557 * @crossplatform 558 * @atomicservice 559 * @since 12 560 */ 561 imageSize?: SizeOptions; 562 563 /** 564 * The padding of buttons. 565 * 566 * @type { ?Padding | Dimension } 567 * @default For text only / icon only buttons Padding { top: 4, right: 8, bottom: 4, left: 8 }. 568 * For text & icon buttons Padding { top: 6, right: 8, bottom: 6, left: 8 }. 569 * @syscap SystemCapability.ArkUI.ArkUI.Full 570 * @crossplatform 571 * @since 11 572 */ 573 /** 574 * The padding of buttons. 575 * 576 * @type { ?Padding | Dimension } 577 * @default For text only / icon only buttons Padding { top: 4, right: 8, bottom: 4, left: 8 }. 578 * For text & icon buttons Padding { top: 6, right: 8, bottom: 6, left: 8 }. 579 * @syscap SystemCapability.ArkUI.ArkUI.Full 580 * @crossplatform 581 * @atomicservice 582 * @since 12 583 */ 584 buttonPadding?: Padding | Dimension; 585 586 /** 587 * The localized padding of buttons. 588 * 589 * @type { ?LocalizedPadding } 590 * @default For text only / icon only buttons LocalizedPadding 591 * { top: LengthMetrics.vp(4), end: LengthMetrics.vp(8), bottom: LengthMetrics.vp(4), start: LengthMetrics.vp(8) }. 592 * For text & icon buttons LocalizedPadding 593 * {{ top: LengthMetrics.vp(6), end: LengthMetrics.vp(8), bottom: LengthMetrics.vp(6), start: LengthMetrics.vp(8) }. 594 * @syscap SystemCapability.ArkUI.ArkUI.Full 595 * @crossplatform 596 * @atomicservice 597 * @since 12 598 */ 599 localizedButtonPadding?: LocalizedPadding; 600 601 /** 602 * The padding of text in button. 603 * 604 * @type { ?Padding | Dimension } 605 * @default 0 606 * @syscap SystemCapability.ArkUI.ArkUI.Full 607 * @crossplatform 608 * @since 11 609 */ 610 /** 611 * The padding of text in button. 612 * 613 * @type { ?Padding | Dimension } 614 * @default 0 615 * @syscap SystemCapability.ArkUI.ArkUI.Full 616 * @crossplatform 617 * @atomicservice 618 * @since 12 619 */ 620 textPadding?: Padding | Dimension; 621 622 /** 623 * The localized padding of text in button. 624 * 625 * @type { ?LocalizedPadding } 626 * @syscap SystemCapability.ArkUI.ArkUI.Full 627 * @crossplatform 628 * @atomicservice 629 * @since 12 630 */ 631 localizedTextPadding?: LocalizedPadding; 632 633 /** 634 * The blurStyle of background. 635 * 636 * @type { ?BlurStyle } 637 * @syscap SystemCapability.ArkUI.ArkUI.Full 638 * @crossplatform 639 * @since 11 640 */ 641 /** 642 * The blurStyle of background. 643 * 644 * @type { ?BlurStyle } 645 * @syscap SystemCapability.ArkUI.ArkUI.Full 646 * @crossplatform 647 * @atomicservice 648 * @since 12 649 */ 650 backgroundBlurStyle?: BlurStyle; 651 652 /** 653 * Indicates the attribute of the current segment button direction. 654 * 655 * @type { ?Direction } 656 * @syscap SystemCapability.ArkUI.ArkUI.Full 657 * @crossplatform 658 * @atomicservice 659 * @since 12 660 */ 661 direction?: Direction; 662 663 /** 664 * The border radius mode of SegmentButton. 665 * 666 * @type { ?BorderRadiusMode } 667 * @default BorderRadiusMode.Default 668 * @syscap SystemCapability.ArkUI.ArkUI.Full 669 * @crossplatform 670 * @atomicservice 671 * @since 20 672 */ 673 borderRadiusMode?: BorderRadiusMode; 674 675 /** 676 * The background border radius of SegmentButton. 677 * Only takes effect when borderRadiusMode is set to BorderRadiusMode.Custom. 678 * 679 * @type { ?LengthMetrics } 680 * @syscap SystemCapability.ArkUI.ArkUI.Full 681 * @crossplatform 682 * @atomicservice 683 * @since 20 684 */ 685 backgroundBorderRadius?: LengthMetrics; 686 687 /** 688 * The border radius of selected item in SegmentButton. 689 * Only takes effect when borderRadiusMode is set to BorderRadiusMode.Custom. 690 * 691 * @type { ?LengthMetrics } 692 * @syscap SystemCapability.ArkUI.ArkUI.Full 693 * @crossplatform 694 * @atomicservice 695 * @since 20 696 */ 697 itemBorderRadius?: LengthMetrics; 698} 699 700/** 701 * Defines the ItemRestriction type. 702 * 703 * @syscap SystemCapability.ArkUI.ArkUI.Full 704 * @crossplatform 705 * @since 11 706 */ 707 /** 708 * Defines the ItemRestriction type. 709 * 710 * @syscap SystemCapability.ArkUI.ArkUI.Full 711 * @crossplatform 712 * @atomicservice 713 * @since 12 714 */ 715declare type ItemRestriction<T> = [T, T, T?, T?, T?]; 716 717/** 718 * Defines the SegmentButtonItemTuple type. 719 * 720 * @syscap SystemCapability.ArkUI.ArkUI.Full 721 * @crossplatform 722 * @since 11 723 */ 724 /** 725 * Defines the SegmentButtonItemTuple type. 726 * 727 * @syscap SystemCapability.ArkUI.ArkUI.Full 728 * @crossplatform 729 * @atomicservice 730 * @since 12 731 */ 732declare type SegmentButtonItemTuple = ItemRestriction<SegmentButtonTextItem> | ItemRestriction<SegmentButtonIconItem> | ItemRestriction<SegmentButtonIconTextItem>; 733 734/** 735 * Defines the SegmentButtonItemArray type. 736 * 737 * @syscap SystemCapability.ArkUI.ArkUI.Full 738 * @crossplatform 739 * @since 11 740 */ 741 /** 742 * Defines the SegmentButtonItemArray type. 743 * 744 * @syscap SystemCapability.ArkUI.ArkUI.Full 745 * @crossplatform 746 * @atomicservice 747 * @since 12 748 */ 749declare type SegmentButtonItemArray = Array<SegmentButtonTextItem> | Array<SegmentButtonIconItem> | Array<SegmentButtonIconTextItem>; 750 751/** 752 * Defines SegmentButton tab options. 753 * 754 * @interface TabSegmentButtonConstructionOptions 755 * @extends CommonSegmentButtonOptions 756 * @syscap SystemCapability.ArkUI.ArkUI.Full 757 * @crossplatform 758 * @since 11 759 */ 760 /** 761 * Defines SegmentButton tab options. 762 * 763 * @interface TabSegmentButtonConstructionOptions 764 * @extends CommonSegmentButtonOptions 765 * @syscap SystemCapability.ArkUI.ArkUI.Full 766 * @crossplatform 767 * @atomicservice 768 * @since 12 769 */ 770interface TabSegmentButtonConstructionOptions extends CommonSegmentButtonOptions { 771 /** 772 * The items of tab type of SegmentButton. 773 * 774 * @type { ItemRestriction<SegmentButtonTextItem> } 775 * @syscap SystemCapability.ArkUI.ArkUI.Full 776 * @crossplatform 777 * @since 11 778 */ 779 /** 780 * The items of tab type of SegmentButton. 781 * 782 * @type { ItemRestriction<SegmentButtonTextItem> } 783 * @syscap SystemCapability.ArkUI.ArkUI.Full 784 * @crossplatform 785 * @atomicservice 786 * @since 12 787 */ 788 buttons: ItemRestriction<SegmentButtonTextItem>; 789} 790 791/** 792 * Defines SegmentButton capsule options. 793 * 794 * @interface CapsuleSegmentButtonConstructionOptions 795 * @extends CommonSegmentButtonOptions 796 * @syscap SystemCapability.ArkUI.ArkUI.Full 797 * @crossplatform 798 * @since 11 799 */ 800 /** 801 * Defines SegmentButton capsule options. 802 * 803 * @interface CapsuleSegmentButtonConstructionOptions 804 * @extends CommonSegmentButtonOptions 805 * @syscap SystemCapability.ArkUI.ArkUI.Full 806 * @crossplatform 807 * @atomicservice 808 * @since 12 809 */ 810interface CapsuleSegmentButtonConstructionOptions extends CommonSegmentButtonOptions { 811 /** 812 * The items of capsule type of SegmentButton. 813 * 814 * @type { SegmentButtonItemTuple } 815 * @syscap SystemCapability.ArkUI.ArkUI.Full 816 * @crossplatform 817 * @since 11 818 */ 819 /** 820 * The items of capsule type of SegmentButton. 821 * 822 * @type { SegmentButtonItemTuple } 823 * @syscap SystemCapability.ArkUI.ArkUI.Full 824 * @crossplatform 825 * @atomicservice 826 * @since 12 827 */ 828 buttons: SegmentButtonItemTuple; 829 830 /** 831 * Support multiple selections flag. 832 * 833 * @type { ?boolean } 834 * @default false 835 * @syscap SystemCapability.ArkUI.ArkUI.Full 836 * @crossplatform 837 * @since 11 838 */ 839 /** 840 * Support multiple selections flag. 841 * 842 * @type { ?boolean } 843 * @default false 844 * @syscap SystemCapability.ArkUI.ArkUI.Full 845 * @crossplatform 846 * @atomicservice 847 * @since 12 848 */ 849 multiply?: boolean; 850} 851 852/** 853 * Defines the type of SegmentButton options of tab type. 854 * 855 * @interface TabSegmentButtonOptions 856 * @extends TabSegmentButtonConstructionOptions 857 * @syscap SystemCapability.ArkUI.ArkUI.Full 858 * @crossplatform 859 * @since 11 860 */ 861 /** 862 * Defines the type of SegmentButton options of tab type. 863 * 864 * @interface TabSegmentButtonOptions 865 * @extends TabSegmentButtonConstructionOptions 866 * @syscap SystemCapability.ArkUI.ArkUI.Full 867 * @crossplatform 868 * @atomicservice 869 * @since 12 870 */ 871interface TabSegmentButtonOptions extends TabSegmentButtonConstructionOptions { 872 /** 873 * The type of SegmentButton. 874 * 875 * @type { "tab" } 876 * @syscap SystemCapability.ArkUI.ArkUI.Full 877 * @crossplatform 878 * @since 11 879 */ 880 /** 881 * The type of SegmentButton. 882 * 883 * @type { "tab" } 884 * @syscap SystemCapability.ArkUI.ArkUI.Full 885 * @crossplatform 886 * @atomicservice 887 * @since 12 888 */ 889 type: "tab"; 890} 891 892/** 893 * Defines the type of SegmentButton options of capsule type. 894 * 895 * @interface CapsuleSegmentButtonOptions 896 * @extends CapsuleSegmentButtonConstructionOptions 897 * @syscap SystemCapability.ArkUI.ArkUI.Full 898 * @crossplatform 899 * @since 11 900 */ 901 /** 902 * Defines the type of SegmentButton options of capsule type. 903 * 904 * @interface CapsuleSegmentButtonOptions 905 * @extends CapsuleSegmentButtonConstructionOptions 906 * @syscap SystemCapability.ArkUI.ArkUI.Full 907 * @crossplatform 908 * @atomicservice 909 * @since 12 910 */ 911interface CapsuleSegmentButtonOptions extends CapsuleSegmentButtonConstructionOptions { 912 /** 913 * The type of SegmentButton. 914 * 915 * @type { "capsule" } 916 * @syscap SystemCapability.ArkUI.ArkUI.Full 917 * @crossplatform 918 * @since 11 919 */ 920 /** 921 * The type of SegmentButton. 922 * 923 * @type { "capsule" } 924 * @syscap SystemCapability.ArkUI.ArkUI.Full 925 * @crossplatform 926 * @atomicservice 927 * @since 12 928 */ 929 type: "capsule"; 930} 931 932/** 933 * Construct parameter types for SegmentButtonItemOptions. 934 * 935 * @syscap SystemCapability.ArkUI.ArkUI.Full 936 * @crossplatform 937 * @since 11 938 */ 939 /** 940 * Construct parameter types for SegmentButtonItemOptions. 941 * 942 * @syscap SystemCapability.ArkUI.ArkUI.Full 943 * @crossplatform 944 * @atomicservice 945 * @since 12 946 */ 947interface SegmentButtonItemOptionsConstructorOptions { 948 /** 949 * The icon of icon and text item. 950 * 951 * @type { ?ResourceStr } 952 * @syscap SystemCapability.ArkUI.ArkUI.Full 953 * @crossplatform 954 * @since 11 955 */ 956 /** 957 * The icon of icon and text item. 958 * 959 * @type { ?ResourceStr } 960 * @syscap SystemCapability.ArkUI.ArkUI.Full 961 * @crossplatform 962 * @atomicservice 963 * @since 12 964 */ 965 icon?: ResourceStr; 966 967 /** 968 * The accessibilityText of icon. 969 * 970 * @type { ?ResourceStr } 971 * @default "" 972 * @syscap SystemCapability.ArkUI.ArkUI.Full 973 * @crossplatform 974 * @atomicservice 975 * @since 13 976 */ 977 iconAccessibilityText?: ResourceStr; 978 979 /** 980 * The icon of icon and text item in the selected state. 981 * 982 * @type { ?ResourceStr } 983 * @syscap SystemCapability.ArkUI.ArkUI.Full 984 * @crossplatform 985 * @since 11 986 */ 987 /** 988 * The icon of icon and text item in the selected state. 989 * 990 * @type { ?ResourceStr } 991 * @syscap SystemCapability.ArkUI.ArkUI.Full 992 * @crossplatform 993 * @atomicservice 994 * @since 12 995 */ 996 selectedIcon?: ResourceStr; 997 998 /** 999 * The accessibilityText of selectedIcon. 1000 * 1001 * @type { ?ResourceStr } 1002 * @default "" 1003 * @syscap SystemCapability.ArkUI.ArkUI.Full 1004 * @crossplatform 1005 * @atomicservice 1006 * @since 13 1007 */ 1008 selectedIconAccessibilityText?: ResourceStr; 1009 1010 /** 1011 * The text of icon and text item. 1012 * 1013 * @type { ?ResourceStr } 1014 * @syscap SystemCapability.ArkUI.ArkUI.Full 1015 * @crossplatform 1016 * @since 11 1017 */ 1018 /** 1019 * The text of icon and text item. 1020 * 1021 * @type { ?ResourceStr } 1022 * @syscap SystemCapability.ArkUI.ArkUI.Full 1023 * @crossplatform 1024 * @atomicservice 1025 * @since 12 1026 */ 1027 text?: ResourceStr; 1028 1029 /** 1030 * The accessibilityLevel of buttonItem. 1031 * 1032 * @type { ?string } 1033 * @default "auto" 1034 * @syscap SystemCapability.ArkUI.ArkUI.Full 1035 * @crossplatform 1036 * @atomicservice 1037 * @since 13 1038 */ 1039 accessibilityLevel?: string; 1040 1041 /** 1042 * The accessibilityDescription of buttonItem. 1043 * 1044 * @type { ?ResourceStr } 1045 * @default "" 1046 * @syscap SystemCapability.ArkUI.ArkUI.Full 1047 * @crossplatform 1048 * @atomicservice 1049 * @since 13 1050 */ 1051 accessibilityDescription?: ResourceStr; 1052} 1053 1054/** 1055 * The options for SegmentButton items. 1056 * 1057 * @syscap SystemCapability.ArkUI.ArkUI.Full 1058 * @crossplatform 1059 * @since 11 1060 */ 1061 /** 1062 * The options for SegmentButton items. 1063 * 1064 * @syscap SystemCapability.ArkUI.ArkUI.Full 1065 * @crossplatform 1066 * @atomicservice 1067 * @since 12 1068 */ 1069@Observed 1070declare class SegmentButtonItemOptions { 1071 /** 1072 * The icon of item. 1073 * 1074 * @type { ?ResourceStr } 1075 * @syscap SystemCapability.ArkUI.ArkUI.Full 1076 * @crossplatform 1077 * @since 11 1078 */ 1079 /** 1080 * The icon of item. 1081 * 1082 * @type { ?ResourceStr } 1083 * @syscap SystemCapability.ArkUI.ArkUI.Full 1084 * @crossplatform 1085 * @atomicservice 1086 * @since 12 1087 */ 1088 icon?: ResourceStr; 1089 1090 /** 1091 * The accessibilityText of icon. 1092 * 1093 * @type { ?ResourceStr } 1094 * @default "" 1095 * @syscap SystemCapability.ArkUI.ArkUI.Full 1096 * @crossplatform 1097 * @atomicservice 1098 * @since 13 1099 */ 1100 iconAccessibilityText?: ResourceStr; 1101 1102 /** 1103 * The icon of selected item. 1104 * 1105 * @type { ?ResourceStr } 1106 * @syscap SystemCapability.ArkUI.ArkUI.Full 1107 * @crossplatform 1108 * @since 11 1109 */ 1110 /** 1111 * The icon of selected item. 1112 * 1113 * @type { ?ResourceStr } 1114 * @syscap SystemCapability.ArkUI.ArkUI.Full 1115 * @crossplatform 1116 * @atomicservice 1117 * @since 12 1118 */ 1119 selectedIcon?: ResourceStr; 1120 1121 /** 1122 * The accessibilityText of selectedIcon. 1123 * 1124 * @type { ?ResourceStr } 1125 * @default "" 1126 * @syscap SystemCapability.ArkUI.ArkUI.Full 1127 * @crossplatform 1128 * @atomicservice 1129 * @since 13 1130 */ 1131 selectedIconAccessibilityText?: ResourceStr; 1132 1133 /** 1134 * The text of item. 1135 * 1136 * @type { ?ResourceStr } 1137 * @syscap SystemCapability.ArkUI.ArkUI.Full 1138 * @crossplatform 1139 * @since 11 1140 */ 1141 /** 1142 * The text of item. 1143 * 1144 * @type { ?ResourceStr } 1145 * @syscap SystemCapability.ArkUI.ArkUI.Full 1146 * @crossplatform 1147 * @atomicservice 1148 * @since 12 1149 */ 1150 text?: ResourceStr; 1151 1152 /** 1153 * The accessibilityLevel of buttonItem. 1154 * 1155 * @type { ?string } 1156 * @default "auto" 1157 * @syscap SystemCapability.ArkUI.ArkUI.Full 1158 * @crossplatform 1159 * @atomicservice 1160 * @since 13 1161 */ 1162 accessibilityLevel?: string; 1163 1164 /** 1165 * The accessibilityDescription of buttonItem. 1166 * 1167 * @type { ?ResourceStr } 1168 * @default "" 1169 * @syscap SystemCapability.ArkUI.ArkUI.Full 1170 * @crossplatform 1171 * @atomicservice 1172 * @since 13 1173 */ 1174 accessibilityDescription?: ResourceStr; 1175 1176 /** 1177 * The constructor used to create a SegmentButtonOptionsArray object. 1178 * 1179 * @param { SegmentButtonItemOptionsConstructorOptions } options - item info. 1180 * @syscap SystemCapability.ArkUI.ArkUI.Full 1181 * @crossplatform 1182 * @since 11 1183 */ 1184 /** 1185 * The constructor used to create a SegmentButtonOptionsArray object. 1186 * 1187 * @param { SegmentButtonItemOptionsConstructorOptions } options - item info. 1188 * @syscap SystemCapability.ArkUI.ArkUI.Full 1189 * @crossplatform 1190 * @atomicservice 1191 * @since 12 1192 */ 1193 constructor(options: SegmentButtonItemOptionsConstructorOptions); 1194} 1195 1196/** 1197 * The class for SegmentButton item options array. 1198 * 1199 * @extends Array<SegmentButtonItemOptions> 1200 * @syscap SystemCapability.ArkUI.ArkUI.Full 1201 * @crossplatform 1202 * @since 11 1203 */ 1204 /** 1205 * The class for SegmentButton item options array. 1206 * 1207 * @extends Array<SegmentButtonItemOptions> 1208 * @syscap SystemCapability.ArkUI.ArkUI.Full 1209 * @crossplatform 1210 * @atomicservice 1211 * @since 12 1212 */ 1213@Observed 1214declare class SegmentButtonItemOptionsArray extends Array<SegmentButtonItemOptions> { 1215 /** 1216 * The constructor used to create a SegmentButtonItemOptionsArray object. 1217 * 1218 * @param { SegmentButtonItemTuple } elements - The SegmentButton items. 1219 * @syscap SystemCapability.ArkUI.ArkUI.Full 1220 * @crossplatform 1221 * @since 11 1222 */ 1223 /** 1224 * The constructor used to create a SegmentButtonItemOptionsArray object. 1225 * 1226 * @param { SegmentButtonItemTuple } elements - The SegmentButton items. 1227 * @syscap SystemCapability.ArkUI.ArkUI.Full 1228 * @crossplatform 1229 * @atomicservice 1230 * @since 12 1231 */ 1232 constructor(elements: SegmentButtonItemTuple); 1233 1234 /** 1235 * Appends new elements to the end of SegmentButtonItemOptionsArray. 1236 * 1237 * @param { SegmentButtonItemArray } items - New elements to add to SegmentButtonItemOptionsArray. 1238 * @returns { number } Returns the new length of SegmentButtonItemOptionsArray. 1239 * @syscap SystemCapability.ArkUI.ArkUI.Full 1240 * @crossplatform 1241 * @since 11 1242 */ 1243 /** 1244 * Appends new elements to the end of SegmentButtonItemOptionsArray. 1245 * 1246 * @param { SegmentButtonItemArray } items - New elements to add to SegmentButtonItemOptionsArray. 1247 * @returns { number } Returns the new length of SegmentButtonItemOptionsArray. 1248 * @syscap SystemCapability.ArkUI.ArkUI.Full 1249 * @crossplatform 1250 * @atomicservice 1251 * @since 12 1252 */ 1253 push(...items: SegmentButtonItemArray): number; 1254 1255 /** 1256 * Removes the last element from SegmentButtonItemOptionsArray. 1257 * 1258 * @returns { SegmentButtonItemOptions | undefined } Returns the removed element. 1259 * @syscap SystemCapability.ArkUI.ArkUI.Full 1260 * @crossplatform 1261 * @since 11 1262 */ 1263 /** 1264 * Removes the last element from SegmentButtonItemOptionsArray. 1265 * 1266 * @returns { SegmentButtonItemOptions | undefined } Returns the removed element. 1267 * @syscap SystemCapability.ArkUI.ArkUI.Full 1268 * @crossplatform 1269 * @atomicservice 1270 * @since 12 1271 */ 1272 pop(): SegmentButtonItemOptions | undefined; 1273 1274 /** 1275 * Removes the first element from SegmentButtonItemOptionsArray. 1276 * 1277 * @returns { SegmentButtonItemOptions | undefined } Returns the removed element. 1278 * @syscap SystemCapability.ArkUI.ArkUI.Full 1279 * @crossplatform 1280 * @since 11 1281 */ 1282 /** 1283 * Removes the first element from SegmentButtonItemOptionsArray. 1284 * 1285 * @returns { SegmentButtonItemOptions | undefined } Returns the removed element. 1286 * @syscap SystemCapability.ArkUI.ArkUI.Full 1287 * @crossplatform 1288 * @atomicservice 1289 * @since 12 1290 */ 1291 shift(): SegmentButtonItemOptions | undefined; 1292 1293 /** 1294 * Appends new elements to the start of SegmentButtonItemOptionsArray. 1295 * 1296 * @param { SegmentButtonItemArray } items - New elements to add to SegmentButtonItemOptionsArray. 1297 * @returns { number } Returns the new length of SegmentButtonItemOptionsArray. 1298 * @syscap SystemCapability.ArkUI.ArkUI.Full 1299 * @crossplatform 1300 * @since 11 1301 */ 1302 /** 1303 * Appends new elements to the start of SegmentButtonItemOptionsArray. 1304 * 1305 * @param { SegmentButtonItemArray } items - New elements to add to SegmentButtonItemOptionsArray. 1306 * @returns { number } Returns the new length of SegmentButtonItemOptionsArray. 1307 * @syscap SystemCapability.ArkUI.ArkUI.Full 1308 * @crossplatform 1309 * @atomicservice 1310 * @since 12 1311 */ 1312 unshift(...items: SegmentButtonItemArray): number; 1313 1314 /** 1315 * Changes the elements of SegmentButtonItemOptionsArray by removing or replacing existing elements and/or adding new elements in place. 1316 * 1317 * @param { number } start - The zero-based location in the array from which to start removing elements. 1318 * @param { number } deleteCount - The number of elements to remove. 1319 * @param { SegmentButtonItemOptions[] } items - Elements to insert into the array in place of the deleted elements. 1320 * @returns { SegmentButtonItemOptions[] } Returns a SegmentButtonItemOptions array containing the deleted elements. 1321 * @syscap SystemCapability.ArkUI.ArkUI.Full 1322 * @crossplatform 1323 * @since 11 1324 */ 1325 /** 1326 * Changes the elements of SegmentButtonItemOptionsArray by removing or replacing existing elements and/or adding new elements in place. 1327 * 1328 * @param { number } start - The zero-based location in the array from which to start removing elements. 1329 * @param { number } deleteCount - The number of elements to remove. 1330 * @param { SegmentButtonItemOptions[] } items - Elements to insert into the array in place of the deleted elements. 1331 * @returns { SegmentButtonItemOptions[] } Returns a SegmentButtonItemOptions array containing the deleted elements. 1332 * @syscap SystemCapability.ArkUI.ArkUI.Full 1333 * @crossplatform 1334 * @atomicservice 1335 * @since 12 1336 */ 1337 splice(start: number, deleteCount: number, ...items: SegmentButtonItemOptions[]): SegmentButtonItemOptions[]; 1338 1339 /** 1340 * The function used to create a SegmentButtonItemOptionsArray object. 1341 * 1342 * @param { SegmentButtonItemTuple } elements - The SegmentButton items. 1343 * @returns { SegmentButtonItemOptionsArray } Returns the a new SegmentButtonItemOptionsArray object. 1344 * @syscap SystemCapability.ArkUI.ArkUI.Full 1345 * @crossplatform 1346 * @since 11 1347 */ 1348 /** 1349 * The function used to create a SegmentButtonItemOptionsArray object. 1350 * 1351 * @param { SegmentButtonItemTuple } elements - The SegmentButton items. 1352 * @returns { SegmentButtonItemOptionsArray } Returns the a new SegmentButtonItemOptionsArray object. 1353 * @syscap SystemCapability.ArkUI.ArkUI.Full 1354 * @crossplatform 1355 * @atomicservice 1356 * @since 12 1357 */ 1358 static create(elements: SegmentButtonItemTuple): SegmentButtonItemOptionsArray; 1359} 1360 1361/** 1362 * The class for SegmentButton options. 1363 * 1364 * @syscap SystemCapability.ArkUI.ArkUI.Full 1365 * @crossplatform 1366 * @since 11 1367 */ 1368 /** 1369 * The class for SegmentButton options. 1370 * 1371 * @syscap SystemCapability.ArkUI.ArkUI.Full 1372 * @crossplatform 1373 * @atomicservice 1374 * @since 12 1375 */ 1376@Observed 1377declare class SegmentButtonOptions { 1378 /** 1379 * The type of SegmentButton. 1380 * 1381 * @type { "tab" | "capsule" } 1382 * @syscap SystemCapability.ArkUI.ArkUI.Full 1383 * @crossplatform 1384 * @since 11 1385 */ 1386 /** 1387 * The type of SegmentButton. 1388 * 1389 * @type { "tab" | "capsule" } 1390 * @syscap SystemCapability.ArkUI.ArkUI.Full 1391 * @crossplatform 1392 * @atomicservice 1393 * @since 12 1394 */ 1395 type: "tab" | "capsule"; 1396 1397 /** 1398 * The support multiple selections flag of SegmentButton. 1399 * 1400 * @type { boolean } 1401 * @syscap SystemCapability.ArkUI.ArkUI.Full 1402 * @crossplatform 1403 * @since 11 1404 */ 1405 /** 1406 * The support multiple selections flag of SegmentButton. 1407 * 1408 * @type { boolean } 1409 * @syscap SystemCapability.ArkUI.ArkUI.Full 1410 * @crossplatform 1411 * @atomicservice 1412 * @since 12 1413 */ 1414 multiply: boolean; 1415 1416 /** 1417 * The buttons information of SegmentButton. 1418 * 1419 * @type { SegmentButtonOptionsArray } 1420 * @syscap SystemCapability.ArkUI.ArkUI.Full 1421 * @crossplatform 1422 * @since 11 1423 */ 1424 /** 1425 * The buttons information of SegmentButton. 1426 * 1427 * @type { SegmentButtonOptionsArray } 1428 * @syscap SystemCapability.ArkUI.ArkUI.Full 1429 * @crossplatform 1430 * @atomicservice 1431 * @since 12 1432 */ 1433 buttons: SegmentButtonItemOptionsArray; 1434 1435 /** 1436 * The font color of buttons. 1437 * 1438 * @type { ResourceColor } 1439 * @syscap SystemCapability.ArkUI.ArkUI.Full 1440 * @crossplatform 1441 * @since 11 1442 */ 1443 /** 1444 * The font color of buttons. 1445 * 1446 * @type { ResourceColor } 1447 * @syscap SystemCapability.ArkUI.ArkUI.Full 1448 * @crossplatform 1449 * @atomicservice 1450 * @since 12 1451 */ 1452 fontColor: ResourceColor; 1453 1454 /** 1455 * The font color of selected button. 1456 * 1457 * @type { ResourceColor } 1458 * @syscap SystemCapability.ArkUI.ArkUI.Full 1459 * @crossplatform 1460 * @since 11 1461 */ 1462 /** 1463 * The font color of selected button. 1464 * 1465 * @type { ResourceColor } 1466 * @syscap SystemCapability.ArkUI.ArkUI.Full 1467 * @crossplatform 1468 * @atomicservice 1469 * @since 12 1470 */ 1471 selectedFontColor: ResourceColor; 1472 1473 /** 1474 * The font size of buttons. 1475 * 1476 * @type { DimensionNoPercentage } 1477 * @syscap SystemCapability.ArkUI.ArkUI.Full 1478 * @crossplatform 1479 * @since 11 1480 */ 1481 /** 1482 * The font size of buttons. 1483 * 1484 * @type { DimensionNoPercentage } 1485 * @syscap SystemCapability.ArkUI.ArkUI.Full 1486 * @crossplatform 1487 * @atomicservice 1488 * @since 12 1489 */ 1490 fontSize: DimensionNoPercentage; 1491 1492 /** 1493 * The font size of selected button. 1494 * 1495 * @type { DimensionNoPercentage } 1496 * @syscap SystemCapability.ArkUI.ArkUI.Full 1497 * @crossplatform 1498 * @since 11 1499 */ 1500 /** 1501 * The font size of selected button. 1502 * 1503 * @type { DimensionNoPercentage } 1504 * @syscap SystemCapability.ArkUI.ArkUI.Full 1505 * @crossplatform 1506 * @atomicservice 1507 * @since 12 1508 */ 1509 selectedFontSize: DimensionNoPercentage; 1510 1511 /** 1512 * The font weight of buttons. 1513 * 1514 * @type { FontWeight } 1515 * @syscap SystemCapability.ArkUI.ArkUI.Full 1516 * @crossplatform 1517 * @since 11 1518 */ 1519 /** 1520 * The font weight of buttons. 1521 * 1522 * @type { FontWeight } 1523 * @syscap SystemCapability.ArkUI.ArkUI.Full 1524 * @crossplatform 1525 * @atomicservice 1526 * @since 12 1527 */ 1528 fontWeight: FontWeight; 1529 1530 /** 1531 * The font weight of selected button. 1532 * 1533 * @type { FontWeight } 1534 * @syscap SystemCapability.ArkUI.ArkUI.Full 1535 * @crossplatform 1536 * @since 11 1537 */ 1538 /** 1539 * The font weight of selected button. 1540 * 1541 * @type { FontWeight } 1542 * @syscap SystemCapability.ArkUI.ArkUI.Full 1543 * @crossplatform 1544 * @atomicservice 1545 * @since 12 1546 */ 1547 selectedFontWeight: FontWeight; 1548 1549 /** 1550 * The background color of SegmentButton. 1551 * 1552 * @type { ResourceColor } 1553 * @syscap SystemCapability.ArkUI.ArkUI.Full 1554 * @crossplatform 1555 * @since 11 1556 */ 1557 /** 1558 * The background color of SegmentButton. 1559 * 1560 * @type { ResourceColor } 1561 * @syscap SystemCapability.ArkUI.ArkUI.Full 1562 * @crossplatform 1563 * @atomicservice 1564 * @since 12 1565 */ 1566 backgroundColor: ResourceColor; 1567 1568 /** 1569 * The background color of selected button. 1570 * 1571 * @type { ResourceColor } 1572 * @syscap SystemCapability.ArkUI.ArkUI.Full 1573 * @crossplatform 1574 * @since 11 1575 */ 1576 /** 1577 * The background color of selected button. 1578 * 1579 * @type { ResourceColor } 1580 * @syscap SystemCapability.ArkUI.ArkUI.Full 1581 * @crossplatform 1582 * @atomicservice 1583 * @since 12 1584 */ 1585 selectedBackgroundColor: ResourceColor; 1586 1587 /** 1588 * The image size of buttons. 1589 * 1590 * @type { SizeOptions } 1591 * @syscap SystemCapability.ArkUI.ArkUI.Full 1592 * @crossplatform 1593 * @since 11 1594 */ 1595 /** 1596 * The image size of buttons. 1597 * 1598 * @type { SizeOptions } 1599 * @syscap SystemCapability.ArkUI.ArkUI.Full 1600 * @crossplatform 1601 * @atomicservice 1602 * @since 12 1603 */ 1604 imageSize: SizeOptions; 1605 1606 /** 1607 * The padding of buttons. 1608 * 1609 * @type { Padding | Dimension } 1610 * @syscap SystemCapability.ArkUI.ArkUI.Full 1611 * @crossplatform 1612 * @since 11 1613 */ 1614 /** 1615 * The padding of buttons. 1616 * 1617 * @type { Padding | Dimension } 1618 * @syscap SystemCapability.ArkUI.ArkUI.Full 1619 * @crossplatform 1620 * @atomicservice 1621 * @since 12 1622 */ 1623 buttonPadding: Padding | Dimension; 1624 1625 /** 1626 * The localized padding of buttons. 1627 * 1628 * @type { ?LocalizedPadding } 1629 * @syscap SystemCapability.ArkUI.ArkUI.Full 1630 * @crossplatform 1631 * @atomicservice 1632 * @since 12 1633 */ 1634 localizedButtonPadding?: LocalizedPadding; 1635 1636 /** 1637 * The padding of text in button. 1638 * 1639 * @type { Padding | Dimension } 1640 * @syscap SystemCapability.ArkUI.ArkUI.Full 1641 * @crossplatform 1642 * @since 11 1643 */ 1644 /** 1645 * The padding of text in button. 1646 * 1647 * @type { Padding | Dimension } 1648 * @syscap SystemCapability.ArkUI.ArkUI.Full 1649 * @crossplatform 1650 * @atomicservice 1651 * @since 12 1652 */ 1653 textPadding: Padding | Dimension; 1654 1655 /** 1656 * The localized padding of text in button. 1657 * 1658 * @type { ?LocalizedPadding } 1659 * @syscap SystemCapability.ArkUI.ArkUI.Full 1660 * @crossplatform 1661 * @atomicservice 1662 * @since 12 1663 */ 1664 localizedTextPadding?: LocalizedPadding; 1665 1666 /** 1667 * The blurStyle of background. 1668 * 1669 * @type { BlurStyle } 1670 * @syscap SystemCapability.ArkUI.ArkUI.Full 1671 * @crossplatform 1672 * @since 11 1673 */ 1674 /** 1675 * The blurStyle of background. 1676 * 1677 * @type { BlurStyle } 1678 * @syscap SystemCapability.ArkUI.ArkUI.Full 1679 * @crossplatform 1680 * @atomicservice 1681 * @since 12 1682 */ 1683 backgroundBlurStyle: BlurStyle; 1684 1685 /** 1686 * The constructor used to create a SegmentButtonOptions object. 1687 * 1688 * @param { TabSegmentButtonOptions | CapsuleSegmentButtonOptions } options - The options of SegmentButton. 1689 * @syscap SystemCapability.ArkUI.ArkUI.Full 1690 * @crossplatform 1691 * @since 11 1692 */ 1693 /** 1694 * The constructor used to create a SegmentButtonOptions object. 1695 * 1696 * @param { TabSegmentButtonOptions | CapsuleSegmentButtonOptions } options - The options of SegmentButton. 1697 * @syscap SystemCapability.ArkUI.ArkUI.Full 1698 * @crossplatform 1699 * @atomicservice 1700 * @since 12 1701 */ 1702 constructor(options: TabSegmentButtonOptions | CapsuleSegmentButtonOptions); 1703 1704 /** 1705 * The function used to create a SegmentButtonOptions of tab type. 1706 * 1707 * @param { TabSegmentButtonConstructionOptions } options - The options of SegmentButton. 1708 * @returns { SegmentButtonOptions } Returns the a new SegmentButtonOptions object of tab type. 1709 * @static 1710 * @syscap SystemCapability.ArkUI.ArkUI.Full 1711 * @crossplatform 1712 * @since 11 1713 */ 1714 /** 1715 * The function used to create a SegmentButtonOptions of tab type. 1716 * 1717 * @param { TabSegmentButtonConstructionOptions } options - The options of SegmentButton. 1718 * @returns { SegmentButtonOptions } Returns the a new SegmentButtonOptions object of tab type. 1719 * @static 1720 * @syscap SystemCapability.ArkUI.ArkUI.Full 1721 * @crossplatform 1722 * @atomicservice 1723 * @since 12 1724 */ 1725 static tab(options: TabSegmentButtonConstructionOptions): SegmentButtonOptions; 1726 1727 /** 1728 * The function used to create a SegmentButtonOptions of capsule type. 1729 * 1730 * @param { CapsuleSegmentButtonConstructionOptions } options - The options of SegmentButton. 1731 * @returns { SegmentButtonOptions } Returns the a new SegmentButtonOptions object of capsule type. 1732 * @static 1733 * @syscap SystemCapability.ArkUI.ArkUI.Full 1734 * @crossplatform 1735 * @since 11 1736 */ 1737 /** 1738 * The function used to create a SegmentButtonOptions of capsule type. 1739 * 1740 * @param { CapsuleSegmentButtonConstructionOptions } options - The options of SegmentButton. 1741 * @returns { SegmentButtonOptions } Returns the a new SegmentButtonOptions object of capsule type. 1742 * @static 1743 * @syscap SystemCapability.ArkUI.ArkUI.Full 1744 * @crossplatform 1745 * @atomicservice 1746 * @since 12 1747 */ 1748 static capsule(options: CapsuleSegmentButtonConstructionOptions): SegmentButtonOptions; 1749 1750 /** 1751 * Indicates the attribute of the current segment button direction. 1752 * 1753 * @type { ?Direction } 1754 * @syscap SystemCapability.ArkUI.ArkUI.Full 1755 * @crossplatform 1756 * @atomicservice 1757 * @since 12 1758 */ 1759 direction?: Direction; 1760 1761 /** 1762 * The border radius mode of SegmentButton. 1763 * 1764 * @type { ?BorderRadiusMode } 1765 * @default BorderRadiusMode.Default 1766 * @syscap SystemCapability.ArkUI.ArkUI.Full 1767 * @crossplatform 1768 * @atomicservice 1769 * @since 20 1770 */ 1771 borderRadiusMode?: BorderRadiusMode; 1772 1773 /** 1774 * The background border radius of SegmentButton. 1775 * Only takes effect when borderRadiusMode is set to BorderRadiusMode.Custom. 1776 * 1777 * @type { ?LengthMetrics } 1778 * @syscap SystemCapability.ArkUI.ArkUI.Full 1779 * @crossplatform 1780 * @atomicservice 1781 * @since 20 1782 */ 1783 backgroundBorderRadius?: LengthMetrics; 1784 1785 /** 1786 * The border radius of selected item in SegmentButton. 1787 * Only takes effect when borderRadiusMode is set to BorderRadiusMode.Custom. 1788 * 1789 * @type { ?LengthMetrics } 1790 * @syscap SystemCapability.ArkUI.ArkUI.Full 1791 * @crossplatform 1792 * @atomicservice 1793 * @since 20 1794 */ 1795 itemBorderRadius?: LengthMetrics; 1796} 1797 1798/** 1799 * Declare Component SegmentButton 1800 * 1801 * @syscap SystemCapability.ArkUI.ArkUI.Full 1802 * @crossplatform 1803 * @since 11 1804 */ 1805 /** 1806 * Declare Component SegmentButton 1807 * 1808 * @syscap SystemCapability.ArkUI.ArkUI.Full 1809 * @crossplatform 1810 * @atomicservice 1811 * @since 12 1812 */ 1813@Component 1814declare struct SegmentButton { 1815 /** 1816 * The options of SegmentButton. 1817 * 1818 * @type { SegmentButtonOptions } 1819 * @syscap SystemCapability.ArkUI.ArkUI.Full 1820 * @crossplatform 1821 * @since 11 1822 */ 1823 /** 1824 * The options of SegmentButton. 1825 * 1826 * @type { SegmentButtonOptions } 1827 * @syscap SystemCapability.ArkUI.ArkUI.Full 1828 * @crossplatform 1829 * @atomicservice 1830 * @since 12 1831 */ 1832 @ObjectLink 1833 options: SegmentButtonOptions; 1834 1835 /** 1836 * The selectedIndex. 1837 * 1838 * @type { number[] } 1839 * @syscap SystemCapability.ArkUI.ArkUI.Full 1840 * @crossplatform 1841 * @since 11 1842 */ 1843 /** 1844 * The selectedIndex. 1845 * 1846 * @type { number[] } 1847 * @syscap SystemCapability.ArkUI.ArkUI.Full 1848 * @crossplatform 1849 * @atomicservice 1850 * @since 12 1851 */ 1852 @Link 1853 selectedIndexes: number[]; 1854 1855 /** 1856 * The max font scale of the segmented button option text. 1857 * @type { number | Resource } 1858 * @syscap SystemCapability.ArkUI.ArkUI.Full 1859 * @crossplatform 1860 * @atomicservice 1861 * @since 14 1862 */ 1863 @Prop 1864 maxFontScale: number | Resource; 1865 1866 /** 1867 * The click event callback will be triggered when a option button of SegmentButton is clicked. 1868 * 1869 * @type { ?Callback<number> } 1870 * @syscap SystemCapability.ArkUI.ArkUI.Full 1871 * @crossplatform 1872 * @atomicservice 1873 * @since 13 1874 */ 1875 onItemClicked?: Callback<number>; 1876} 1877 1878export { 1879 SegmentButton, 1880 SegmentButtonOptions, 1881 SegmentButtonItemOptionsArray, 1882 TabSegmentButtonOptions, 1883 TabSegmentButtonConstructionOptions, 1884 CapsuleSegmentButtonOptions, 1885 CapsuleSegmentButtonConstructionOptions, 1886 SegmentButtonTextItem, 1887 SegmentButtonIconItem, 1888 SegmentButtonIconTextItem, 1889 DimensionNoPercentage, 1890 CommonSegmentButtonOptions, 1891 ItemRestriction, 1892 SegmentButtonItemTuple, 1893 SegmentButtonItemArray, 1894 SegmentButtonItemOptionsConstructorOptions, 1895 SegmentButtonItemOptions, 1896 BorderRadiusMode 1897}; 1898