• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.@
14  */
15
16/**
17 * @file api/@ohos.arkui.advanced.SegmentedButton.d.ts
18 * @kit ArkUI
19 */
20
21import { ColorMetrics, LengthMetrics } from '@ohos.arkui.node';
22import { ImageModifier, SymbolGlyphModifier, TextModifier } from '@ohos.arkui.modifier';
23import { SizeT } from '@ohos.arkui.node';
24
25/**
26 * Defines the options of the segmented button item.
27 *
28 * @interface SegmentButtonV2ItemOptions
29 * @syscap SystemCapability.ArkUI.ArkUI.Full
30 * @crossplatform
31 * @atomicservice
32 * @since 18
33 */
34export interface SegmentButtonV2ItemOptions {
35    /**
36     * Sets the text of the segmented button item.
37     *
38     * @type { ?ResourceStr }
39     * @syscap SystemCapability.ArkUI.ArkUI.Full
40     * @crossplatform
41     * @atomicservice
42     * @since 18
43     */
44    text?: ResourceStr;
45
46    /**
47     * Sets the image icon of the segmented button item.
48     * This field will be useless if the symbol field is sets.
49     *
50     * @type { ?ResourceStr }
51     * @syscap SystemCapability.ArkUI.ArkUI.Full
52     * @crossplatform
53     * @atomicservice
54     * @since 18
55     */
56    icon?: ResourceStr;
57
58    /**
59     * Sets the symbol icon of the segmented button item.
60     *
61     * @type { ?Resource }
62     * @syscap SystemCapability.ArkUI.ArkUI.Full
63     * @crossplatform
64     * @atomicservice
65     * @since 18
66     */
67    symbol?: Resource;
68
69    /**
70     * Sets whether segmented button item is enabled?
71     *
72     * @type { ?boolean }
73     * @syscap SystemCapability.ArkUI.ArkUI.Full
74     * @crossplatform
75     * @atomicservice
76     * @since 18
77     */
78    enabled?: boolean;
79
80    /**
81     * Sets modifier for the text of the segmented button item.
82     *
83     * @type { ?TextModifier }
84     * @syscap SystemCapability.ArkUI.ArkUI.Full
85     * @crossplatform
86     * @atomicservice
87     * @since 18
88     */
89    textModifier?: TextModifier;
90
91    /**
92     * Sets modifier for the image icon of the segmented button item.
93     *
94     * @type { ?ImageModifier }
95     * @syscap SystemCapability.ArkUI.ArkUI.Full
96     * @crossplatform
97     * @atomicservice
98     * @since 18
99     */
100    iconModifier?: ImageModifier;
101
102    /**
103     * Sets modifier for the symbol icon of the segmented button item.
104     *
105     * @type { ?SymbolGlyphModifier }
106     * @syscap SystemCapability.ArkUI.ArkUI.Full
107     * @crossplatform
108     * @atomicservice
109     * @since 18
110     */
111    symbolModifier?: SymbolGlyphModifier;
112
113    /**
114     * Sets the accessibility text of the segmented button item.
115     *
116     * @type { ?ResourceStr }
117     * @syscap SystemCapability.ArkUI.ArkUI.Full
118     * @crossplatform
119     * @atomicservice
120     * @since 18
121     */
122    accessibilityText?: ResourceStr;
123
124    /**
125     * Sets the accessibility description of the segmented button item.
126     *
127     * @type { ?ResourceStr }
128     * @syscap SystemCapability.ArkUI.ArkUI.Full
129     * @crossplatform
130     * @atomicservice
131     * @since 18
132     */
133    accessibilityDescription?: ResourceStr;
134
135    /**
136     * Sets the accessibility level of the segmented button item.
137     *
138     * @type { ?string }
139     * @syscap SystemCapability.ArkUI.ArkUI.Full
140     * @crossplatform
141     * @atomicservice
142     * @since 18
143     */
144    accessibilityLevel?: string;
145}
146
147/**
148 * The callback function that will be invoked when the selectedIndex of the segmented button is changed.
149 *
150 * @typedef { function } OnSelectedIndexChange
151 * @param { number } selectedIndex - the index of selected item
152 * @syscap SystemCapability.ArkUI.ArkUI.Full
153 * @crossplatform
154 * @atomicservice
155 * @since 18
156 */
157export type OnSelectedIndexChange = (selectedIndex: number) => void;
158
159/**
160 * The callback function that will be invoked when the selectedIndexes of the segmented button is changed.
161 *
162 * @typedef { function } OnSelectedIndexesChange
163 * @param { number[] } selectedIndexes - the index of selected items
164 * @syscap SystemCapability.ArkUI.ArkUI.Full
165 * @crossplatform
166 * @atomicservice
167 * @since 18
168 */
169export type OnSelectedIndexesChange = (selectedIndexes: number[]) => void;
170
171/**
172 * Defines segmented button item.
173 *
174 * @interface SegmentButtonV2Item
175 * @syscap SystemCapability.ArkUI.ArkUI.Full
176 * @crossplatform
177 * @atomicservice
178 * @since 18
179 */
180@ObservedV2
181export declare class SegmentButtonV2Item {
182    /**
183     * Sets the text of the segmented button item.
184     *
185     * @type { ?ResourceStr }
186     * @syscap SystemCapability.ArkUI.ArkUI.Full
187     * @crossplatform
188     * @atomicservice
189     * @since 18
190     */
191    @Trace text?: ResourceStr;
192
193    /**
194     * Sets the image icon of the segmented button item.
195     * This field will be useless if the symbol field is sets.
196     *
197     * @type { ?ResourceStr }
198     * @syscap SystemCapability.ArkUI.ArkUI.Full
199     * @crossplatform
200     * @atomicservice
201     * @since 18
202     */
203    @Trace icon?: ResourceStr;
204
205    /**
206     * Sets the symbol icon of the segmented button item.
207     *
208     * @type { ?Resource }
209     * @syscap SystemCapability.ArkUI.ArkUI.Full
210     * @crossplatform
211     * @atomicservice
212     * @since 18
213     */
214    @Trace symbol?: Resource;
215
216    /**
217     * Sets whether segmented button item is enabled?
218     *
219     * @type { ?boolean }
220     * @syscap SystemCapability.ArkUI.ArkUI.Full
221     * @crossplatform
222     * @atomicservice
223     * @since 18
224     */
225    @Trace enabled: boolean;
226
227    /**
228     * Sets modifier for the text of the segmented button item.
229     *
230     * @type { ?TextModifier }
231     * @syscap SystemCapability.ArkUI.ArkUI.Full
232     * @crossplatform
233     * @atomicservice
234     * @since 18
235     */
236    @Trace textModifier?: TextModifier;
237
238    /**
239     * Sets modifier for the image icon of the segmented button item.
240     *
241     * @type { ?ImageModifier }
242     * @syscap SystemCapability.ArkUI.ArkUI.Full
243     * @crossplatform
244     * @atomicservice
245     * @since 18
246     */
247    @Trace iconModifier?: ImageModifier;
248
249    /**
250     * Sets modifier for the symbol icon of the segmented button item.
251     *
252     * @type { ?SymbolGlyphModifier }
253     * @syscap SystemCapability.ArkUI.ArkUI.Full
254     * @crossplatform
255     * @atomicservice
256     * @since 18
257     */
258    @Trace symbolModifier?: SymbolGlyphModifier;
259
260    /**
261     * Sets the accessibility text of the segmented button item.
262     *
263     * @type { ?ResourceStr }
264     * @syscap SystemCapability.ArkUI.ArkUI.Full
265     * @crossplatform
266     * @atomicservice
267     * @since 18
268     */
269    @Trace accessibilityText?: ResourceStr;
270
271    /**
272     * Sets the accessibility description of the segmented button item.
273     *
274     * @type { ?ResourceStr }
275     * @syscap SystemCapability.ArkUI.ArkUI.Full
276     * @crossplatform
277     * @atomicservice
278     * @since 18
279     */
280    @Trace accessibilityDescription?: ResourceStr;
281
282    /**
283     * Sets the accessibility level of the segmented button item.
284     *
285     * @type { ?string }
286     * @syscap SystemCapability.ArkUI.ArkUI.Full
287     * @crossplatform
288     * @atomicservice
289     * @since 18
290     */
291    @Trace accessibilityLevel?: string;
292
293    /**
294     * The constructor of SegmentedButtonItem
295     *
296     * @param { SegmentedButtonItemOptions } options - the options of the segmented button item
297     * @syscap SystemCapability.ArkUI.ArkUI.Full
298     * @crossplatform
299     * @atomicservice
300     * @since 18
301     */
302    constructor(options: SegmentButtonV2ItemOptions);
303
304    /**
305     * Is the segmented button item set with both text and icon?
306     *
307     * @type { boolean }
308     * @syscap SystemCapability.ArkUI.ArkUI.Full
309     * @crossplatform
310     * @atomicservice
311     * @since 18
312     */
313    get isHybrid(): boolean;
314}
315
316/**
317 * Defines the items of the segmented button.
318 *
319 * @extends Array<SegmentButtonV2Item>
320 * @syscap SystemCapability.ArkUI.ArkUI.Full
321 * @crossplatform
322 * @atomicservice
323 * @since 18
324 */
325@ObservedV2
326export declare class SegmentButtonV2Items extends Array<SegmentButtonV2Item> {
327    /**
328     * The constructor of SegmentedButtonItems
329     *
330     * @param { SegmentButtonV2ItemOptions[] } items - the options array of the segmented button items
331     * @syscap SystemCapability.ArkUI.ArkUI.Full
332     * @crossplatform
333     * @atomicservice
334     * @since 18
335     */
336    constructor(items: SegmentButtonV2ItemOptions[]);
337
338    /**
339     * Is there an option in the segmented button options that sets both text and icon?
340     *
341     * @type { boolean }
342     * @syscap SystemCapability.ArkUI.ArkUI.Full
343     * @crossplatform
344     * @atomicservice
345     * @since 18
346     */
347    get hasHybrid(): boolean;
348}
349
350/**
351 * Defines segmented button with tab style.
352 *
353 * @struct TabSegmentedButton
354 * @syscap SystemCapability.ArkUI.ArkUI.Full
355 * @crossplatform
356 * @atomicservice
357 * @since 18
358 */
359@ComponentV2
360export declare struct TabSegmentButtonV2 {
361    /**
362     * Sets the items of the segmented button.
363     *
364     * @type { SegmentButtonV2Items }
365     * @readonly
366     * @syscap SystemCapability.ArkUI.ArkUI.Full
367     * @crossplatform
368     * @atomicservice
369     * @since 18
370     */
371    @Require
372    @Param
373    readonly items: SegmentButtonV2Items;
374
375    /**
376     * Sets the selected index of the segmented button.
377     *
378     * @type { number }
379     * @readonly
380     * @syscap SystemCapability.ArkUI.ArkUI.Full
381     * @crossplatform
382     * @atomicservice
383     * @since 18
384     */
385    @Require
386    @Param
387    readonly selectedIndex: number;
388
389    /**
390     * Sets the callback function which will be invoked when the selected index of the segmented button is changed.
391     *
392     * @type { ?OnSelectedIndexChange }
393     * @readonly
394     * @syscap SystemCapability.ArkUI.ArkUI.Full
395     * @crossplatform
396     * @atomicservice
397     * @since 18
398     */
399    @Event
400    $selectedIndex?: OnSelectedIndexChange;
401
402    /**
403     * Sets the callback function which will be invoked when the item of the segmented button is clicked.
404     *
405     * @type { ?Callback<number> }
406     * @readonly
407     * @syscap SystemCapability.ArkUI.ArkUI.Full
408     * @crossplatform
409     * @atomicservice
410     * @since 18
411     */
412    @Event
413    onItemClicked?: Callback<number>;
414
415    /**
416     * Sets the min font scale for all items of the segmented button.
417     *
418     * @type { ?(number | Resource) }
419     * @readonly
420     * @syscap SystemCapability.ArkUI.ArkUI.Full
421     * @crossplatform
422     * @atomicservice
423     * @since 18
424     */
425    @Param
426    readonly itemMinFontScale?: number | Resource;
427
428    /**
429     * Sets the max font scale for all items of the segmented button.
430     *
431     * @type { ?(number | Resource) }
432     * @readonly
433     * @syscap SystemCapability.ArkUI.ArkUI.Full
434     * @crossplatform
435     * @atomicservice
436     * @since 18
437     */
438    @Param
439    readonly itemMaxFontScale?: number | Resource;
440
441    /**
442     * Sets the space for all item of the segmented button.
443     *
444     * @type { ?LengthMetrics }
445     * @readonly
446     * @syscap SystemCapability.ArkUI.ArkUI.Full
447     * @crossplatform
448     * @atomicservice
449     * @since 18
450     */
451    @Param
452    readonly itemSpace?: LengthMetrics;
453
454    /**
455     * Sets the font size for the text of all segmented button items that are not selected.
456     *
457     * @type { ?LengthMetrics }
458     * @readonly
459     * @syscap SystemCapability.ArkUI.ArkUI.Full
460     * @crossplatform
461     * @atomicservice
462     * @since 18
463     */
464    @Param
465    readonly itemFontSize?: LengthMetrics;
466
467    /**
468     * Sets the font size for the text of all segmented button selected items.
469     *
470     * @type { ?LengthMetrics }
471     * @readonly
472     * @syscap SystemCapability.ArkUI.ArkUI.Full
473     * @crossplatform
474     * @atomicservice
475     * @since 18
476     */
477    @Param
478    readonly itemSelectedFontSize?: LengthMetrics;
479
480    /**
481     * Sets the font color for the text of all segmented button selected items.
482     *
483     * @type { ?ColorMetrics }
484     * @readonly
485     * @syscap SystemCapability.ArkUI.ArkUI.Full
486     * @crossplatform
487     * @atomicservice
488     * @since 18
489     */
490    @Param
491    readonly itemFontColor?: ColorMetrics;
492
493    /**
494     * Sets the font color for the text of all segmented button selected items.
495     *
496     * @type { ?ColorMetrics }
497     * @readonly
498     * @syscap SystemCapability.ArkUI.ArkUI.Full
499     * @crossplatform
500     * @atomicservice
501     * @since 18
502     */
503    @Param
504    readonly itemSelectedFontColor?: ColorMetrics;
505
506    /**
507     * Sets the font weight for the text of all segmented button items that are not selected.
508     *
509     * @type { ?FontWeight }
510     * @readonly
511     * @syscap SystemCapability.ArkUI.ArkUI.Full
512     * @crossplatform
513     * @atomicservice
514     * @since 18
515     */
516    @Param
517    readonly itemFontWeight?: FontWeight;
518
519    /**
520     * Sets the font weight for the text of all segmented button selected items.
521     *
522     * @type { ?FontWeight }
523     * @readonly
524     * @syscap SystemCapability.ArkUI.ArkUI.Full
525     * @crossplatform
526     * @atomicservice
527     * @since 18
528     */
529    @Param
530    readonly itemSelectedFontWeight?: FontWeight;
531
532    /**
533     * Sets the border radius for all segmented button items.
534     *
535     * @type { ?LengthMetrics }
536     * @readonly
537     * @syscap SystemCapability.ArkUI.ArkUI.Full
538     * @crossplatform
539     * @atomicservice
540     * @since 18
541     */
542    @Param
543    readonly itemBorderRadius?: LengthMetrics;
544
545    /**
546     * Sets the background color for all segmented button selected items.
547     *
548     * @type { ?ColorMetrics }
549     * @readonly
550     * @syscap SystemCapability.ArkUI.ArkUI.Full
551     * @crossplatform
552     * @atomicservice
553     * @since 18
554     */
555    @Param
556    readonly itemSelectedBackgroundColor?: ColorMetrics;
557
558    /**
559     * Sets the size for the icon of all segmented button items.
560     *
561     * @type { ?SizeT<LengthMetrics> }
562     * @readonly
563     * @syscap SystemCapability.ArkUI.ArkUI.Full
564     * @crossplatform
565     * @atomicservice
566     * @since 18
567     */
568    @Param
569    readonly itemIconSize?: SizeT<LengthMetrics>;
570
571    /**
572     * Sets the fill color for the icon of all segmented button items that are not selected.
573     *
574     * @type { ?ColorMetrics }
575     * @readonly
576     * @syscap SystemCapability.ArkUI.ArkUI.Full
577     * @crossplatform
578     * @atomicservice
579     * @since 18
580     */
581    @Param
582    readonly itemIconFillColor?: ColorMetrics;
583
584    /**
585     * Sets the fill color for the icon of all segmented button selected items.
586     *
587     * @type { ?ColorMetrics }
588     * @readonly
589     * @syscap SystemCapability.ArkUI.ArkUI.Full
590     * @crossplatform
591     * @atomicservice
592     * @since 18
593     */
594    @Param
595    readonly itemSelectedIconFillColor?: ColorMetrics;
596
597    /**
598     * Sets the font size for the symbol icon of all segmented button.
599     *
600     * @type { ?LengthMetrics }
601     * @readonly
602     * @syscap SystemCapability.ArkUI.ArkUI.Full
603     * @crossplatform
604     * @atomicservice
605     * @since 18
606     */
607    @Param
608    readonly itemSymbolFontSize?: LengthMetrics;
609
610    /**
611     * Sets the font color for the symbol icon of all segmented button items that are not selected.
612     *
613     * @type { ?ColorMetrics }
614     * @readonly
615     * @syscap SystemCapability.ArkUI.ArkUI.Full
616     * @crossplatform
617     * @atomicservice
618     * @since 18
619     */
620    @Param
621    readonly itemSymbolFontColor?: ColorMetrics;
622
623    /**
624     * Sets the font color for the symbol icon of all segmented button selected items.
625     *
626     * @type { ?ColorMetrics }
627     * @readonly
628     * @syscap SystemCapability.ArkUI.ArkUI.Full
629     * @crossplatform
630     * @atomicservice
631     * @since 18
632     */
633    @Param
634    readonly itemSelectedSymbolFontColor?: ColorMetrics;
635
636    /**
637     * Sets the min height of all segmented button items.
638     *
639     * @type { ?LengthMetrics }
640     * @readonly
641     * @syscap SystemCapability.ArkUI.ArkUI.Full
642     * @crossplatform
643     * @atomicservice
644     * @since 18
645     */
646    @Param
647    readonly itemMinHeight?: LengthMetrics;
648
649    /**
650     * Sets the padding of all segmented button items.
651     *
652     * @type { ?LocalizedPadding }
653     * @readonly
654     * @syscap SystemCapability.ArkUI.ArkUI.Full
655     * @crossplatform
656     * @atomicservice
657     * @since 18
658     */
659    @Param
660    readonly itemPadding?: LocalizedPadding;
661
662    /**
663     * Sets the shadow of all segmented button items.
664     *
665     * @type { ?(ShadowOptions | ShadowStyle) }
666     * @readonly
667     * @syscap SystemCapability.ArkUI.ArkUI.Full
668     * @crossplatform
669     * @atomicservice
670     * @since 18
671     */
672    @Param
673    readonly itemShadow?: ShadowOptions | ShadowStyle;
674
675    /**
676     * Sets the background color of the segmented button.
677     *
678     * @type { ?ColorMetrics }
679     * @readonly
680     * @syscap SystemCapability.ArkUI.ArkUI.Full
681     * @crossplatform
682     * @atomicservice
683     * @since 18
684     */
685    @Param
686    readonly buttonBackgroundColor?: ColorMetrics;
687
688    /**
689     * Sets the background blur style of the segmented button.
690     *
691     * @type { ?BlurStyle }
692     * @readonly
693     * @syscap SystemCapability.ArkUI.ArkUI.Full
694     * @crossplatform
695     * @atomicservice
696     * @since 18
697     */
698    @Param
699    readonly buttonBackgroundBlurStyle?: BlurStyle;
700
701    /**
702     * Sets the background blur style options of the segmented button.
703     *
704     * @type { ?BackgroundBlurStyleOptions }
705     * @readonly
706     * @syscap SystemCapability.ArkUI.ArkUI.Full
707     * @crossplatform
708     * @atomicservice
709     * @since 18
710     */
711    @Param
712    readonly buttonBackgroundBlurStyleOptions?: BackgroundBlurStyleOptions;
713
714    /**
715     * Sets the background effect of the segmented button.
716     *
717     * @type { ?BackgroundEffectOptions }
718     * @readonly
719     * @syscap SystemCapability.ArkUI.ArkUI.Full
720     * @crossplatform
721     * @atomicservice
722     * @since 18
723     */
724    @Param
725    readonly buttonBackgroundEffect?: BackgroundEffectOptions;
726
727    /**
728     * Sets the border radius of the segmented button.
729     *
730     * @type { ?LengthMetrics }
731     * @readonly
732     * @syscap SystemCapability.ArkUI.ArkUI.Full
733     * @crossplatform
734     * @atomicservice
735     * @since 18
736     */
737    @Param
738    readonly buttonBorderRadius?: LengthMetrics;
739
740    /**
741     * Sets the min height of the segmented button.
742     *
743     * @type { ?LengthMetrics }
744     * @readonly
745     * @syscap SystemCapability.ArkUI.ArkUI.Full
746     * @crossplatform
747     * @atomicservice
748     * @since 18
749     */
750    @Param
751    readonly buttonMinHeight?: LengthMetrics;
752
753    /**
754     * Sets the padding of the segmented button.
755     *
756     * @type { ?LengthMetrics }
757     * @readonly
758     * @syscap SystemCapability.ArkUI.ArkUI.Full
759     * @crossplatform
760     * @atomicservice
761     * @since 18
762     */
763    @Param
764    readonly buttonPadding?: LengthMetrics;
765
766    /**
767     * Sets the language direction of the segmented button.
768     *
769     * @type { ?Direction }
770     * @readonly
771     * @syscap SystemCapability.ArkUI.ArkUI.Full
772     * @crossplatform
773     * @atomicservice
774     * @since 18
775     */
776    @Param
777    readonly languageDirection?: Direction;
778
779    /**
780     * Sets the build function of the segmented button.
781     *
782     * @syscap SystemCapability.ArkUI.ArkUI.Full
783     * @crossplatform
784     * @atomicservice
785     * @since 18
786     */
787    build(): void;
788}
789
790/**
791 * Defines the segmented button with capsule style.
792 *
793 * @struct CapsuleSegmentButtonV2
794 * @syscap SystemCapability.ArkUI.ArkUI.Full
795 * @crossplatform
796 * @atomicservice
797 * @since 18
798 */
799@ComponentV2
800export declare struct CapsuleSegmentButtonV2 {
801    /**
802     * Sets the items of the segmented button.
803     *
804     * @type { SegmentButtonV2Items }
805     * @readonly
806     * @syscap SystemCapability.ArkUI.ArkUI.Full
807     * @crossplatform
808     * @atomicservice
809     * @since 18
810     */
811    @Require
812    @Param
813    readonly items: SegmentButtonV2Items;
814
815    /**
816     * Sets the selected index of the segmented button.
817     *
818     * @type { number }
819     * @readonly
820     * @syscap SystemCapability.ArkUI.ArkUI.Full
821     * @crossplatform
822     * @atomicservice
823     * @since 18
824     */
825    @Require
826    @Param
827    readonly selectedIndex: number;
828
829    /**
830     * Sets the callback function which will be invoked when the selected index of the segmented button is changed.
831     *
832     * @type { ?OnSelectedIndexChange }
833     * @readonly
834     * @syscap SystemCapability.ArkUI.ArkUI.Full
835     * @crossplatform
836     * @atomicservice
837     * @since 18
838     */
839    @Event
840    $selectedIndex?: OnSelectedIndexChange;
841
842    /**
843     * Sets the callback function which will be invoked when the item of the segmented button is clicked.
844     *
845     * @type { ?Callback<number> }
846     * @readonly
847     * @syscap SystemCapability.ArkUI.ArkUI.Full
848     * @crossplatform
849     * @atomicservice
850     * @since 18
851     */
852    @Event
853    onItemClicked?: Callback<number>;
854
855    /**
856     * Sets the min font scale for all items of the segmented button.
857     *
858     * @type { ?(number | Resource) }
859     * @readonly
860     * @syscap SystemCapability.ArkUI.ArkUI.Full
861     * @crossplatform
862     * @atomicservice
863     * @since 18
864     */
865    @Param
866    readonly itemMinFontScale?: number | Resource;
867
868    /**
869     * Sets the max font scale for all items of the segmented button.
870     *
871     * @type { ?(number | Resource) }
872     * @readonly
873     * @syscap SystemCapability.ArkUI.ArkUI.Full
874     * @crossplatform
875     * @atomicservice
876     * @since 18
877     */
878    @Param
879    readonly itemMaxFontScale?: number | Resource;
880
881    /**
882     * Sets the space for all item of the segmented button.
883     *
884     * @type { ?LengthMetrics }
885     * @readonly
886     * @syscap SystemCapability.ArkUI.ArkUI.Full
887     * @crossplatform
888     * @atomicservice
889     * @since 18
890     */
891    @Param
892    readonly itemSpace?: LengthMetrics;
893
894    /**
895     * Sets the font color for the text of all segmented button selected items.
896     *
897     * @type { ?ColorMetrics }
898     * @readonly
899     * @syscap SystemCapability.ArkUI.ArkUI.Full
900     * @crossplatform
901     * @atomicservice
902     * @since 18
903     */
904    @Param
905    readonly itemFontColor?: ColorMetrics;
906
907    /**
908     * Sets the font color for the text of all segmented button selected items.
909     *
910     * @type { ?ColorMetrics }
911     * @readonly
912     * @syscap SystemCapability.ArkUI.ArkUI.Full
913     * @crossplatform
914     * @atomicservice
915     * @since 18
916     */
917    @Param
918    readonly itemSelectedFontColor?: ColorMetrics;
919
920    /**
921     * Sets the font size for the text of all segmented button items that are not selected.
922     *
923     * @type { ?LengthMetrics }
924     * @readonly
925     * @syscap SystemCapability.ArkUI.ArkUI.Full
926     * @crossplatform
927     * @atomicservice
928     * @since 18
929     */
930    @Param
931    readonly itemFontSize?: LengthMetrics;
932
933    /**
934     * Sets the font size for the text of all segmented button selected items.
935     *
936     * @type { ?LengthMetrics }
937     * @readonly
938     * @syscap SystemCapability.ArkUI.ArkUI.Full
939     * @crossplatform
940     * @atomicservice
941     * @since 18
942     */
943    @Param
944    readonly itemSelectedFontSize?: LengthMetrics;
945
946    /**
947     * Sets the font weight for the text of all segmented button items that are not selected.
948     *
949     * @type { ?FontWeight }
950     * @readonly
951     * @syscap SystemCapability.ArkUI.ArkUI.Full
952     * @crossplatform
953     * @atomicservice
954     * @since 18
955     */
956    @Param
957    readonly itemFontWeight?: FontWeight;
958
959    /**
960     * Sets the font weight for the text of all segmented button selected items.
961     *
962     * @type { ?FontWeight }
963     * @readonly
964     * @syscap SystemCapability.ArkUI.ArkUI.Full
965     * @crossplatform
966     * @atomicservice
967     * @since 18
968     */
969    @Param
970    readonly itemSelectedFontWeight?: FontWeight;
971
972    /**
973     * Sets the border radius for all segmented button items.
974     *
975     * @type { ?LengthMetrics }
976     * @readonly
977     * @syscap SystemCapability.ArkUI.ArkUI.Full
978     * @crossplatform
979     * @atomicservice
980     * @since 18
981     */
982    @Param
983    readonly itemBorderRadius?: LengthMetrics;
984
985    /**
986     * Sets the background color for all segmented button selected items.
987     *
988     * @type { ?ColorMetrics }
989     * @readonly
990     * @syscap SystemCapability.ArkUI.ArkUI.Full
991     * @crossplatform
992     * @atomicservice
993     * @since 18
994     */
995    @Param
996    readonly itemSelectedBackgroundColor?: ColorMetrics;
997
998    /**
999     * Sets the size for the icon of all segmented button items.
1000     *
1001     * @type { ?SizeT<LengthMetrics> }
1002     * @readonly
1003     * @syscap SystemCapability.ArkUI.ArkUI.Full
1004     * @crossplatform
1005     * @atomicservice
1006     * @since 18
1007     */
1008    @Param
1009    readonly itemIconSize?: SizeT<LengthMetrics>;
1010
1011    /**
1012     * Sets the fill color for the icon of all segmented button items that are not selected.
1013     *
1014     * @type { ?ColorMetrics }
1015     * @readonly
1016     * @syscap SystemCapability.ArkUI.ArkUI.Full
1017     * @crossplatform
1018     * @atomicservice
1019     * @since 18
1020     */
1021    @Param
1022    readonly itemIconFillColor?: ColorMetrics;
1023
1024    /**
1025     * Sets the fill color for the icon of all segmented button selected items.
1026     *
1027     * @type { ?ColorMetrics }
1028     * @readonly
1029     * @syscap SystemCapability.ArkUI.ArkUI.Full
1030     * @crossplatform
1031     * @atomicservice
1032     * @since 18
1033     */
1034    @Param
1035    readonly itemSelectedIconFillColor?: ColorMetrics;
1036
1037    /**
1038     * Sets the font size for the symbol icon of all segmented button.
1039     *
1040     * @type { ?LengthMetrics }
1041     * @readonly
1042     * @syscap SystemCapability.ArkUI.ArkUI.Full
1043     * @crossplatform
1044     * @atomicservice
1045     * @since 18
1046     */
1047    @Param
1048    readonly itemSymbolFontSize?: LengthMetrics;
1049
1050    /**
1051     * Sets the font color for the symbol icon of all segmented button items that are not selected.
1052     *
1053     * @type { ?ColorMetrics }
1054     * @readonly
1055     * @syscap SystemCapability.ArkUI.ArkUI.Full
1056     * @crossplatform
1057     * @atomicservice
1058     * @since 18
1059     */
1060    @Param
1061    readonly itemSymbolFontColor?: ColorMetrics;
1062
1063    /**
1064     * Sets the font color for the symbol icon of all segmented button selected items.
1065     *
1066     * @type { ?ColorMetrics }
1067     * @readonly
1068     * @syscap SystemCapability.ArkUI.ArkUI.Full
1069     * @crossplatform
1070     * @atomicservice
1071     * @since 18
1072     */
1073    @Param
1074    readonly itemSelectedSymbolFontColor?: ColorMetrics;
1075
1076    /**
1077     * Sets the min height of all segmented button items.
1078     *
1079     * @type { ?LengthMetrics }
1080     * @readonly
1081     * @syscap SystemCapability.ArkUI.ArkUI.Full
1082     * @crossplatform
1083     * @atomicservice
1084     * @since 18
1085     */
1086    @Param
1087    readonly itemMinHeight?: LengthMetrics;
1088
1089    /**
1090     * Sets the padding of all segmented button items.
1091     *
1092     * @type { ?LocalizedPadding }
1093     * @readonly
1094     * @syscap SystemCapability.ArkUI.ArkUI.Full
1095     * @crossplatform
1096     * @atomicservice
1097     * @since 18
1098     */
1099    @Param
1100    readonly itemPadding?: LocalizedPadding;
1101
1102    /**
1103     * Sets the shadow of all segmented button items.
1104     *
1105     * @type { ?(ShadowOptions | ShadowStyle) }
1106     * @readonly
1107     * @syscap SystemCapability.ArkUI.ArkUI.Full
1108     * @crossplatform
1109     * @atomicservice
1110     * @since 18
1111     */
1112    @Param
1113    readonly itemShadow?: ShadowOptions | ShadowStyle;
1114
1115    /**
1116     * Sets the background color of the segmented button.
1117     *
1118     * @type { ?ColorMetrics }
1119     * @readonly
1120     * @syscap SystemCapability.ArkUI.ArkUI.Full
1121     * @crossplatform
1122     * @atomicservice
1123     * @since 18
1124     */
1125    @Param
1126    readonly buttonBackgroundColor?: ColorMetrics;
1127
1128    /**
1129     * Sets the background blur style of the segmented button.
1130     *
1131     * @type { ?BlurStyle }
1132     * @readonly
1133     * @syscap SystemCapability.ArkUI.ArkUI.Full
1134     * @crossplatform
1135     * @atomicservice
1136     * @since 18
1137     */
1138    @Param
1139    readonly buttonBackgroundBlurStyle?: BlurStyle;
1140
1141    /**
1142     * Sets the background blur style options of the segmented button.
1143     *
1144     * @type { ?BackgroundBlurStyleOptions }
1145     * @readonly
1146     * @syscap SystemCapability.ArkUI.ArkUI.Full
1147     * @crossplatform
1148     * @atomicservice
1149     * @since 18
1150     */
1151    @Param
1152    readonly buttonBackgroundBlurStyleOptions?: BackgroundBlurStyleOptions;
1153
1154    /**
1155     * Sets the background effect of the segmented button.
1156     *
1157     * @type { ?BackgroundEffectOptions }
1158     * @readonly
1159     * @syscap SystemCapability.ArkUI.ArkUI.Full
1160     * @crossplatform
1161     * @atomicservice
1162     * @since 18
1163     */
1164    @Param
1165    readonly buttonBackgroundEffect?: BackgroundEffectOptions;
1166
1167    /**
1168     * Sets the border radius of the segmented button.
1169     *
1170     * @type { ?LengthMetrics }
1171     * @readonly
1172     * @syscap SystemCapability.ArkUI.ArkUI.Full
1173     * @crossplatform
1174     * @atomicservice
1175     * @since 18
1176     */
1177    @Param
1178    readonly buttonBorderRadius?: LengthMetrics;
1179
1180    /**
1181     * Sets the min height of the segmented button.
1182     *
1183     * @type { ?LengthMetrics }
1184     * @readonly
1185     * @syscap SystemCapability.ArkUI.ArkUI.Full
1186     * @crossplatform
1187     * @atomicservice
1188     * @since 18
1189     */
1190    @Param
1191    readonly buttonMinHeight?: LengthMetrics;
1192
1193    /**
1194     * Sets the padding of the segmented button.
1195     *
1196     * @type { ?LengthMetrics }
1197     * @readonly
1198     * @syscap SystemCapability.ArkUI.ArkUI.Full
1199     * @crossplatform
1200     * @atomicservice
1201     * @since 18
1202     */
1203    @Param
1204    readonly buttonPadding?: LengthMetrics;
1205
1206    /**
1207     * Sets the language direction of the segmented button.
1208     *
1209     * @type { ?Direction }
1210     * @readonly
1211     * @syscap SystemCapability.ArkUI.ArkUI.Full
1212     * @crossplatform
1213     * @atomicservice
1214     * @since 18
1215     */
1216    @Param
1217    readonly languageDirection?: Direction;
1218
1219    /**
1220     * Sets the build function of the segmented button.
1221     *
1222     * @syscap SystemCapability.ArkUI.ArkUI.Full
1223     * @crossplatform
1224     * @atomicservice
1225     * @since 18
1226     */
1227    build(): void;
1228}
1229
1230/**
1231 * Defines the segmented button with capsule style.
1232 *
1233 * @struct CapsuleSegmentButtonV2
1234 * @syscap SystemCapability.ArkUI.ArkUI.Full
1235 * @crossplatform
1236 * @atomicservice
1237 * @since 18
1238 */
1239@ComponentV2
1240export declare struct MultiCapsuleSegmentButtonV2 {
1241    /**
1242     * Sets the items of the segmented button.
1243     *
1244     * @type { SegmentButtonV2Items }
1245     * @readonly
1246     * @syscap SystemCapability.ArkUI.ArkUI.Full
1247     * @crossplatform
1248     * @atomicservice
1249     * @since 18
1250     */
1251    @Require
1252    @Param
1253    readonly items: SegmentButtonV2Items;
1254
1255    /**
1256     * Sets the selection of the segmented button.
1257     *
1258     * @type { number[] }
1259     * @readonly
1260     * @syscap SystemCapability.ArkUI.ArkUI.Full
1261     * @crossplatform
1262     * @atomicservice
1263     * @since 18
1264     */
1265    @Require
1266    @Param
1267    readonly selectedIndexes: number[];
1268
1269    /**
1270     * Sets the callback function will be invoked when the selectedInexes field of the segmented button is changed.
1271     *
1272     * @type { ?OnSelectedIndexesChange } OnSelectedIndexesChange
1273     * @readonly
1274     * @syscap SystemCapability.ArkUI.ArkUI.Full
1275     * @crossplatform
1276     * @atomicservice
1277     * @since 18
1278     */
1279    @Event
1280    $selectedIndexes: OnSelectedIndexesChange;
1281
1282    /**
1283     * Sets the callback function will be invoked when the item of the segmented button is clicked.
1284     *
1285     * @type { ?Callback<number> }
1286     * @readonly
1287     * @syscap SystemCapability.ArkUI.ArkUI.Full
1288     * @crossplatform
1289     * @atomicservice
1290     * @since 18
1291     */
1292    @Event
1293    onItemClicked?: Callback<number>;
1294
1295    /**
1296     * Sets the min font scale for all items of the segmented button.
1297     *
1298     * @type { ?(number | Resource) }
1299     * @readonly
1300     * @syscap SystemCapability.ArkUI.ArkUI.Full
1301     * @crossplatform
1302     * @atomicservice
1303     * @since 18
1304     */
1305    @Param
1306    readonly itemMinFontScale?: number | Resource;
1307
1308    /**
1309     * Sets the max font scale for all items of the segmented button.
1310     *
1311     * @type { ?(number | Resource) }
1312     * @readonly
1313     * @syscap SystemCapability.ArkUI.ArkUI.Full
1314     * @crossplatform
1315     * @atomicservice
1316     * @since 18
1317     */
1318    @Param
1319    readonly itemMaxFontScale?: number | Resource;
1320
1321    /**
1322     * Sets the space for each item of the segmented button.
1323     *
1324     * @type { ?LengthMetrics }
1325     * @readonly
1326     * @syscap SystemCapability.ArkUI.ArkUI.Full
1327     * @crossplatform
1328     * @atomicservice
1329     * @since 18
1330     */
1331    @Param
1332    readonly itemSpace?: LengthMetrics;
1333
1334    /**
1335     * Sets the font color for the text of all segmented button items that are not selected.
1336     *
1337     * @type { ?ColorMetrics }
1338     * @readonly
1339     * @syscap SystemCapability.ArkUI.ArkUI.Full
1340     * @crossplatform
1341     * @atomicservice
1342     * @since 18
1343     */
1344    @Param
1345    readonly itemFontColor?: ColorMetrics;
1346
1347    /**
1348     * Sets the font color for the text of all segmented button selected items.
1349     *
1350     * @type { ?ColorMetrics }
1351     * @readonly
1352     * @syscap SystemCapability.ArkUI.ArkUI.Full
1353     * @crossplatform
1354     * @atomicservice
1355     * @since 18
1356     */
1357    @Param
1358    readonly itemSelectedFontColor?: ColorMetrics;
1359
1360    /**
1361     * Sets the font size for the text of all segmented button items that are not selected.
1362     *
1363     * @type { ?LengthMetrics }
1364     * @readonly
1365     * @syscap SystemCapability.ArkUI.ArkUI.Full
1366     * @crossplatform
1367     * @atomicservice
1368     * @since 18
1369     */
1370    @Param
1371    readonly itemFontSize?: LengthMetrics;
1372
1373    /**
1374     * Sets the font size for the text of all segmented button selected items.
1375     *
1376     * @type { ?LengthMetrics }
1377     * @readonly
1378     * @syscap SystemCapability.ArkUI.ArkUI.Full
1379     * @crossplatform
1380     * @atomicservice
1381     * @since 18
1382     */
1383    @Param
1384    readonly itemSelectedFontSize?: LengthMetrics;
1385
1386    /**
1387     * Sets the font weight for the text of all segmented button items that are not selected.
1388     *
1389     * @type { ?FontWeight }
1390     * @readonly
1391     * @syscap SystemCapability.ArkUI.ArkUI.Full
1392     * @crossplatform
1393     * @atomicservice
1394     * @since 18
1395     */
1396    @Param
1397    readonly itemFontWeight?: FontWeight;
1398
1399    /**
1400     * Sets the font weight for the text of all segmented button selected items.
1401     *
1402     * @type { ?FontWeight }
1403     * @readonly
1404     * @syscap SystemCapability.ArkUI.ArkUI.Full
1405     * @crossplatform
1406     * @atomicservice
1407     * @since 18
1408     */
1409    @Param
1410    readonly itemSelectedFontWeight?: FontWeight;
1411
1412    /**
1413     * Sets the border radius for all segmented button items.
1414     *
1415     * @type { ?LengthMetrics }
1416     * @readonly
1417     * @syscap SystemCapability.ArkUI.ArkUI.Full
1418     * @crossplatform
1419     * @atomicservice
1420     * @since 18
1421     */
1422    @Param
1423    readonly itemBorderRadius?: LengthMetrics;
1424
1425    /**
1426     * Sets the background color for all segmented button items that are not selected.
1427     *
1428     * @type { ?ColorMetrics }
1429     * @readonly
1430     * @syscap SystemCapability.ArkUI.ArkUI.Full
1431     * @crossplatform
1432     * @atomicservice
1433     * @since 18
1434     */
1435    @Param
1436    readonly itemBackgroundColor?: ColorMetrics;
1437
1438    /**
1439     * Sets the background effect of all segmented button items that are not selected.
1440     *
1441     * @type { ?BackgroundEffectOptions }
1442     * @readonly
1443     * @syscap SystemCapability.ArkUI.ArkUI.Full
1444     * @crossplatform
1445     * @atomicservice
1446     * @since 18
1447     */
1448    @Param
1449    readonly itemBackgroundEffect?: BackgroundEffectOptions;
1450
1451    /**
1452     * Sets the background blur style of all segmented button items that are not selected.
1453     *
1454     * @type { ?BlurStyle }
1455     * @readonly
1456     * @syscap SystemCapability.ArkUI.ArkUI.Full
1457     * @crossplatform
1458     * @atomicservice
1459     * @since 18
1460     */
1461    @Param
1462    readonly itemBackgroundBlurStyle?: BlurStyle;
1463
1464    /**
1465     * Sets the background blur style options of all segmented button items that are not selected.
1466     *
1467     * @type { ?BackgroundBlurStyleOptions }
1468     * @readonly
1469     * @syscap SystemCapability.ArkUI.ArkUI.Full
1470     * @crossplatform
1471     * @atomicservice
1472     * @since 18
1473     */
1474    @Param
1475    readonly itemBackgroundBlurStyleOptions?: BackgroundBlurStyleOptions;
1476
1477    /**
1478     * Sets the background color for all segmented button selected items.
1479     *
1480     * @type { ?ColorMetrics }
1481     * @readonly
1482     * @syscap SystemCapability.ArkUI.ArkUI.Full
1483     * @crossplatform
1484     * @atomicservice
1485     * @since 18
1486     */
1487    @Param
1488    readonly itemSelectedBackgroundColor?: ColorMetrics;
1489
1490    /**
1491     * Sets the size for the icon of all segmented button items.
1492     *
1493     * @type { ?SizeT<LengthMetrics> }
1494     * @readonly
1495     * @syscap SystemCapability.ArkUI.ArkUI.Full
1496     * @crossplatform
1497     * @atomicservice
1498     * @since 18
1499     */
1500    @Param
1501    readonly itemIconSize?: SizeT<LengthMetrics>;
1502
1503    /**
1504     * Sets the fill color for the icon of all segmented button items that are not selected.
1505     *
1506     * @type { ?ColorMetrics }
1507     * @readonly
1508     * @syscap SystemCapability.ArkUI.ArkUI.Full
1509     * @crossplatform
1510     * @atomicservice
1511     * @since 18
1512     */
1513    @Param
1514    readonly itemIconFillColor?: ColorMetrics;
1515
1516    /**
1517     * Sets the fill color for the icon of all segmented button selected items.
1518     *
1519     * @type { ?ColorMetrics }
1520     * @readonly
1521     * @syscap SystemCapability.ArkUI.ArkUI.Full
1522     * @crossplatform
1523     * @atomicservice
1524     * @since 18
1525     */
1526    @Param
1527    readonly itemSelectedIconFillColor?: ColorMetrics;
1528
1529    /**
1530     * Sets the font size for the symbol icon of all segmented button.
1531     *
1532     * @type { ?LengthMetrics }
1533     * @readonly
1534     * @syscap SystemCapability.ArkUI.ArkUI.Full
1535     * @crossplatform
1536     * @atomicservice
1537     * @since 18
1538     */
1539    @Param
1540    readonly itemSymbolFontSize?: LengthMetrics;
1541
1542    /**
1543     * Sets the font color for the symbol icon of all segmented button items that are not selected.
1544     *
1545     * @type { ?ColorMetrics }
1546     * @readonly
1547     * @syscap SystemCapability.ArkUI.ArkUI.Full
1548     * @crossplatform
1549     * @atomicservice
1550     * @since 18
1551     */
1552    @Param
1553    readonly itemSymbolFontColor?: ColorMetrics;
1554
1555    /**
1556     * Sets the font color for the symbol icon of all segmented button selected items.
1557     *
1558     * @type { ?ColorMetrics }
1559     * @readonly
1560     * @syscap SystemCapability.ArkUI.ArkUI.Full
1561     * @crossplatform
1562     * @atomicservice
1563     * @since 18
1564     */
1565    @Param
1566    readonly itemSelectedSymbolFontColor?: ColorMetrics;
1567
1568     /**
1569     * Sets the min height of all segmented button items.
1570     *
1571     * @type { ?LengthMetrics }
1572     * @readonly
1573     * @syscap SystemCapability.ArkUI.ArkUI.Full
1574     * @crossplatform
1575     * @atomicservice
1576     * @since 18
1577     */
1578    @Param
1579    readonly itemMinHeight?: LengthMetrics;
1580
1581    /**
1582     * Sets the padding of all segmented button items.
1583     *
1584     * @type { ?LocalizedPadding }
1585     * @readonly
1586     * @syscap SystemCapability.ArkUI.ArkUI.Full
1587     * @crossplatform
1588     * @atomicservice
1589     * @since 18
1590     */
1591    @Param
1592    readonly itemPadding?: LocalizedPadding;
1593
1594    /**
1595     * Sets the language direction of the segmented button.
1596     *
1597     * @type { ?Direction }
1598     * @readonly
1599     * @syscap SystemCapability.ArkUI.ArkUI.Full
1600     * @crossplatform
1601     * @atomicservice
1602     * @since 18
1603     */
1604    @Param
1605    readonly languageDirection?: Direction;
1606
1607    /**
1608     * Sets the build function of the segmented button.
1609     *
1610     * @syscap SystemCapability.ArkUI.ArkUI.Full
1611     * @crossplatform
1612     * @atomicservice
1613     * @since 18
1614     */
1615    build(): void;
1616}
1617