• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-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
18 * @kit ArkUI
19 */
20
21import { TextModifier } from './@ohos.arkui.modifier';
22
23
24/**
25 * Control style of operation element
26 * @enum { OperationStyle }
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @since 10
29 */
30/**
31 * Control style of operation element
32 * @enum { OperationStyle }
33 * @syscap SystemCapability.ArkUI.ArkUI.Full
34 * @atomicservice
35 * @since 11
36 */
37/**
38 * Control style of operation element
39 * @enum { OperationStyle }
40 * @syscap SystemCapability.ArkUI.ArkUI.Full
41 * @crossplatform
42 * @atomicservice
43 * @since 18
44 */
45export declare enum OperationType {
46  /**
47   * The TextArrow style.
48   * @syscap SystemCapability.ArkUI.ArkUI.Full
49   * @since 10
50   */
51  /**
52   * The TextArrow style.
53   * @syscap SystemCapability.ArkUI.ArkUI.Full
54   * @atomicservice
55   * @since 11
56   */
57  /**
58   * The TextArrow style.
59   * @syscap SystemCapability.ArkUI.ArkUI.Full
60   * @crossplatform
61   * @atomicservice
62   * @since 18
63   */
64  TEXT_ARROW = 0,
65
66  /**
67   * The Button style.
68   * @syscap SystemCapability.ArkUI.ArkUI.Full
69   * @since 10
70   */
71  /**
72   * The Button style.
73   * @syscap SystemCapability.ArkUI.ArkUI.Full
74   * @atomicservice
75   * @since 11
76   */
77  /**
78   * The Button style.
79   * @syscap SystemCapability.ArkUI.ArkUI.Full
80   * @crossplatform
81   * @atomicservice
82   * @since 18
83   */
84  BUTTON = 1,
85
86  /**
87   * The IconGroup style.
88   * @syscap SystemCapability.ArkUI.ArkUI.Full
89   * @since 10
90   */
91  /**
92   * The IconGroup style.
93   * @syscap SystemCapability.ArkUI.ArkUI.Full
94   * @atomicservice
95   * @since 11
96   */
97  /**
98   * The IconGroup style.
99   * @syscap SystemCapability.ArkUI.ArkUI.Full
100   * @crossplatform
101   * @atomicservice
102   * @since 18
103   */
104  ICON_GROUP = 2,
105
106  /**
107   * The LoadingProgress style.
108   * @syscap SystemCapability.ArkUI.ArkUI.Full
109   * @since 10
110   */
111  /**
112   * The LoadingProgress style.
113   * @syscap SystemCapability.ArkUI.ArkUI.Full
114   * @atomicservice
115   * @since 11
116   */
117  /**
118   * The LoadingProgress style.
119   * @syscap SystemCapability.ArkUI.ArkUI.Full
120   * @crossplatform
121   * @atomicservice
122   * @since 18
123   */
124  LOADING = 3
125}
126
127/**
128 * Declare type OperationOption
129 * @syscap SystemCapability.ArkUI.ArkUI.Full
130 * @since 10
131 */
132/**
133 * Declare type OperationOption
134 * @syscap SystemCapability.ArkUI.ArkUI.Full
135 * @atomicservice
136 * @since 11
137 */
138/**
139 * Declare type OperationOption
140 * @syscap SystemCapability.ArkUI.ArkUI.Full
141 * @crossplatform
142 * @atomicservice
143 * @since 18
144 */
145export declare class OperationOption {
146  /**
147   * The content of text or the address of icon.
148   * @type { ResourceStr }.
149   * @syscap SystemCapability.ArkUI.ArkUI.Full
150   * @since 10
151   */
152  /**
153   * The content of text or the address of icon.
154   * @type { ResourceStr }.
155   * @syscap SystemCapability.ArkUI.ArkUI.Full
156   * @atomicservice
157   * @since 11
158   */
159  /**
160   * The content of text or the address of icon.
161   * @type { ResourceStr }.
162   * @syscap SystemCapability.ArkUI.ArkUI.Full
163   * @crossplatform
164   * @atomicservice
165   * @since 18
166   */
167  value: ResourceStr;
168
169  /**
170   * callback function when operate the text or icon.
171   * @type { () => void }.
172   * @syscap SystemCapability.ArkUI.ArkUI.Full
173   * @since 10
174   */
175  /**
176   * callback function when operate the text or icon.
177   * @type { () => void }.
178   * @syscap SystemCapability.ArkUI.ArkUI.Full
179   * @atomicservice
180   * @since 11
181   */
182  /**
183   * callback function when operate the text or icon.
184   * @type { () => void }.
185   * @syscap SystemCapability.ArkUI.ArkUI.Full
186   * @crossplatform
187   * @atomicservice
188   * @since 18
189   */
190  action?: () => void;
191
192  /**
193   * The accessibilityText of this text or icon.
194   * @type { ?ResourceStr }.
195   * @syscap SystemCapability.ArkUI.ArkUI.Full
196   * @atomicservice
197   * @since 18
198   */
199  accessibilityText?: ResourceStr;
200
201  /**
202   * The accessibilityDescription of this text or icon.
203   * @type { ?ResourceStr }
204   * @syscap SystemCapability.ArkUI.ArkUI.Full
205   * @atomicservice
206   * @since 18
207   */
208  accessibilityDescription?: ResourceStr;
209
210  /**
211   * The accessibilityLevel of this text or icon.
212   * @type { ?string }
213   * @default "auto"
214   * @syscap SystemCapability.ArkUI.ArkUI.Full
215   * @atomicservice
216   * @since 18
217   */
218  accessibilityLevel?: string;
219
220  /**
221   * Sets the default focus state of the text or icon.
222   * @type { ?boolean }.
223   * @default { false }
224   * @syscap SystemCapability.ArkUI.ArkUI.Full
225   * @atomicservice
226   * @since 18
227   */
228  defaultFocus?: boolean;
229}
230
231/**
232 * Declare type SelectOption
233 * @syscap SystemCapability.ArkUI.ArkUI.Full
234 * @since 10
235 */
236/**
237 * Declare type SelectOption
238 * @syscap SystemCapability.ArkUI.ArkUI.Full
239 * @atomicservice
240 * @since 11
241 */
242/**
243 * Declare type SelectOption
244 * @syscap SystemCapability.ArkUI.ArkUI.Full
245 * @crossplatform
246 * @atomicservice
247 * @since 18
248 */
249export declare class SelectOptions {
250  /**
251   * SubOption array of the select.
252   * @type { Array<SelectSubOption> }.
253   * @syscap SystemCapability.ArkUI.ArkUI.Full
254   * @since 10
255   */
256  /**
257   * SubOption array of the select.
258   * @type { Array<SelectSubOption> }.
259   * @syscap SystemCapability.ArkUI.ArkUI.Full
260   * @atomicservice
261   * @since 11
262   */
263  /**
264   * SubOption array of the select.
265   * @type { Array<SelectSubOption> }.
266   * @syscap SystemCapability.ArkUI.ArkUI.Full
267   * @crossplatform
268   * @atomicservice
269   * @since 18
270   */
271  options: Array<SelectOption>;
272
273  /**
274   * The default selected index.
275   * @type { number }.
276   * @syscap SystemCapability.ArkUI.ArkUI.Full
277   * @since 10
278   */
279  /**
280   * The default selected index.
281   * @type { number }.
282   * @syscap SystemCapability.ArkUI.ArkUI.Full
283   * @atomicservice
284   * @since 11
285   */
286  /**
287   * The default selected index.
288   * @type { number }.
289   * @syscap SystemCapability.ArkUI.ArkUI.Full
290   * @crossplatform
291   * @atomicservice
292   * @since 18
293   */
294  selected?: number;
295
296  /**
297   * The default text value.
298   * @type { string }.
299   * @syscap SystemCapability.ArkUI.ArkUI.Full
300   * @since 10
301   */
302  /**
303   * The default text value.
304   * @type { string }.
305   * @syscap SystemCapability.ArkUI.ArkUI.Full
306   * @atomicservice
307   * @since 11
308   */
309  /**
310   * The default text value.
311   * @type { string }.
312   * @syscap SystemCapability.ArkUI.ArkUI.Full
313   * @crossplatform
314   * @atomicservice
315   * @since 18
316   */
317  value?: string;
318
319 /**
320  * Callback when the select is selected.
321  * @type { (index: number, value?: string) => void }.
322  * @syscap SystemCapability.ArkUI.ArkUI.Full
323  * @since 10
324  */
325 /**
326  * Callback when the select is selected.
327  * @type { (index: number, value?: string) => void }.
328  * @syscap SystemCapability.ArkUI.ArkUI.Full
329  * @atomicservice
330  * @since 11
331  */
332 /**
333  * Callback when the select is selected.
334  * @type { (index: number, value?: string) => void }.
335  * @syscap SystemCapability.ArkUI.ArkUI.Full
336  * @crossplatform
337  * @atomicservice
338  * @since 18
339  */
340  onSelect?: (index: number, value?: string) => void;
341
342  /**
343   * Sets the default focus state of select.
344   * @type { ?boolean }.
345   * @default { false }
346   * @syscap SystemCapability.ArkUI.ArkUI.Full
347   * @atomicservice
348   * @since 18
349   */
350  defaultFocus?: boolean;
351}
352
353/**
354 * Declare type SymbolOptions
355 * @syscap SystemCapability.ArkUI.ArkUI.Full
356 * @atomicservice
357 * @since 12
358 */
359 /**
360 * Declare type SymbolOptions
361 * @syscap SystemCapability.ArkUI.ArkUI.Full
362 * @crossplatform
363 * @atomicservice
364 * @since 18
365 */
366export declare class SymbolOptions {
367  /**
368   * The size of symbol icon.
369   * @type { ?(number | string | Resource) }.
370   * @syscap SystemCapability.ArkUI.ArkUI.Full
371   * @atomicservice
372   * @since 12
373   */
374  /**
375   * The size of symbol icon.
376   * @type { ?(number | string | Resource) }.
377   * @syscap SystemCapability.ArkUI.ArkUI.Full
378   * @crossplatform
379   * @atomicservice
380   * @since 18
381   */
382  fontSize?: number | string | Resource;
383
384  /**
385   * The color of symbol icon.
386   * @type { ?(Array<ResourceColor>) }.
387   * @syscap SystemCapability.ArkUI.ArkUI.Full
388   * @atomicservice
389   * @since 12
390   */
391  /**
392   * The color of symbol icon.
393   * @type { ?(Array<ResourceColor>) }.
394   * @syscap SystemCapability.ArkUI.ArkUI.Full
395   * @crossplatform
396   * @atomicservice
397   * @since 18
398   */
399  fontColor?: Array<ResourceColor>;
400
401  /**
402   * The fontWeight of symbol icon.
403   * @type { ?(number | FontWeight | string) }.
404   * @syscap SystemCapability.ArkUI.ArkUI.Full
405   * @atomicservice
406   * @since 12
407   */
408  /**
409   * The fontWeight of symbol icon.
410   * @type { ?(number | FontWeight | string) }.
411   * @syscap SystemCapability.ArkUI.ArkUI.Full
412   * @crossplatform
413   * @atomicservice
414   * @since 18
415   */
416  fontWeight?: number | FontWeight | string;
417
418  /**
419   * The effect strategy of symbol icon.
420   * @type { ?(SymbolEffectStrategy) }.
421   * @syscap SystemCapability.ArkUI.ArkUI.Full
422   * @atomicservice
423   * @since 12
424   */
425  /**
426   * The effect strategy of symbol icon.
427   * @type { ?(SymbolEffectStrategy) }.
428   * @syscap SystemCapability.ArkUI.ArkUI.Full
429   * @crossplatform
430   * @atomicservice
431   * @since 18
432   */
433  effectStrategy?: SymbolEffectStrategy;
434
435  /**
436   * The rendering strategy of symbol icon.
437   * @type { ?(SymbolRenderingStrategy) }.
438   * @syscap SystemCapability.ArkUI.ArkUI.Full
439   * @atomicservice
440   * @since 12
441   */
442  /**
443   * The rendering strategy of symbol icon.
444   * @type { ?(SymbolRenderingStrategy) }.
445   * @syscap SystemCapability.ArkUI.ArkUI.Full
446   * @crossplatform
447   * @atomicservice
448   * @since 18
449   */
450  renderingStrategy?: SymbolRenderingStrategy;
451}
452
453/**
454 * Declare struct SubHeader
455 * @syscap SystemCapability.ArkUI.ArkUI.Full
456 * @since 10
457 */
458/**
459 * Declare struct SubHeader
460 * @syscap SystemCapability.ArkUI.ArkUI.Full
461 * @atomicservice
462 * @since 11
463 */
464/**
465 * Declare struct SubHeader
466 * @syscap SystemCapability.ArkUI.ArkUI.Full
467 * @crossplatform
468 * @atomicservice
469 * @since 18
470 */
471@Component
472export declare struct SubHeader {
473
474  /**
475   * Icon resource of content area.
476   * @type { ResourceStr }.
477   * @syscap SystemCapability.ArkUI.ArkUI.Full
478   * @since 10
479   */
480  /**
481   * Icon resource of content area.
482   * @type { ResourceStr }.
483   * @syscap SystemCapability.ArkUI.ArkUI.Full
484   * @atomicservice
485   * @since 11
486   */
487  /**
488   * Icon resource of content area.
489   * @type { ResourceStr }.
490   * @syscap SystemCapability.ArkUI.ArkUI.Full
491   * @crossplatform
492   * @atomicservice
493   * @since 18
494   */
495  @Prop icon?: ResourceStr;
496
497  /**
498   * Attributes of Symbol icon.
499   * @type { SymbolOptions}.
500   * @syscap SystemCapability.ArkUI.ArkUI.Full
501   * @atomicservice
502   * @since 12
503   */
504  /**
505   * Attributes of Symbol icon.
506   * @type { SymbolOptions}.
507   * @syscap SystemCapability.ArkUI.ArkUI.Full
508   * @atomicservice
509   * @since 18
510   */
511  iconSymbolOptions?: SymbolOptions;
512
513  /**
514   * The first line text of content area.
515   * @type { ResourceStr }.
516   * @syscap SystemCapability.ArkUI.ArkUI.Full
517   * @since 10
518   */
519  /**
520   * The first line text of content area.
521   * @type { ResourceStr }.
522   * @syscap SystemCapability.ArkUI.ArkUI.Full
523   * @atomicservice
524   * @since 11
525   */
526  /**
527   * The first line text of content area.
528   * @type { ResourceStr }.
529   * @syscap SystemCapability.ArkUI.ArkUI.Full
530   * @crossplatform
531   * @atomicservice
532   * @since 18
533   */
534  @Prop primaryTitle?: ResourceStr;
535
536  /**
537   * The secondary line text of content area.
538   * @type { ResourceStr }.
539   * @syscap SystemCapability.ArkUI.ArkUI.Full
540   * @since 10
541   */
542  /**
543   * The secondary line text of content area.
544   * @type { ResourceStr }.
545   * @syscap SystemCapability.ArkUI.ArkUI.Full
546   * @atomicservice
547   * @since 11
548   */
549  /**
550   * The secondary line text of content area.
551   * @type { ResourceStr }.
552   * @syscap SystemCapability.ArkUI.ArkUI.Full
553   * @crossplatform
554   * @atomicservice
555   * @since 18
556   */
557  @Prop secondaryTitle?: ResourceStr;
558
559  /**
560   * Select option of content area.
561   * @type { SelectOptions }.
562   * @syscap SystemCapability.ArkUI.ArkUI.Full
563   * @since 10
564   */
565  /**
566   * Select option of content area.
567   * @type { SelectOptions }.
568   * @syscap SystemCapability.ArkUI.ArkUI.Full
569   * @atomicservice
570   * @since 11
571   */
572  /**
573   * Select option of content area.
574   * @type { SelectOptions }.
575   * @syscap SystemCapability.ArkUI.ArkUI.Full
576   * @crossplatform
577   * @atomicservice
578   * @since 18
579   */
580  select?: SelectOptions;
581
582  /**
583   * Operation style of SubHeader.
584   * @type { OperationStyle }.
585   * @syscap SystemCapability.ArkUI.ArkUI.Full
586   * @since 10
587   */
588  /**
589   * Operation style of SubHeader.
590   * @type { OperationStyle }.
591   * @syscap SystemCapability.ArkUI.ArkUI.Full
592   * @atomicservice
593   * @since 11
594   */
595  /**
596   * Operation style of SubHeader.
597   * @type { OperationStyle }.
598   * @syscap SystemCapability.ArkUI.ArkUI.Full
599   * @crossplatform
600   * @atomicservice
601   * @since 18
602   */
603  @Prop operationType?: OperationType;
604
605  /**
606   * operation item.
607   * @type { Array<OperationOption> }.
608   * @syscap SystemCapability.ArkUI.ArkUI.Full
609   * @since 10
610   */
611  /**
612   * operation item.
613   * @type { Array<OperationOption> }.
614   * @syscap SystemCapability.ArkUI.ArkUI.Full
615   * @atomicservice
616   * @since 11
617   */
618  /**
619   * operation item.
620   * @type { Array<OperationOption> }.
621   * @syscap SystemCapability.ArkUI.ArkUI.Full
622   * @crossplatform
623   * @atomicservice
624   * @since 18
625   */
626  operationItem?: Array<OperationOption>;
627
628  /**
629   * Attributes of Symbol icons in operation area.
630   * @type { Array<SymbolOptions> }.
631   * @syscap SystemCapability.ArkUI.ArkUI.Full
632   * @atomicservice
633   * @since 12
634   */
635  /**
636   * Attributes of Symbol icons in operation area.
637   * @type { Array<SymbolOptions> }.
638   * @syscap SystemCapability.ArkUI.ArkUI.Full
639   * @atomicservice
640   * @since 18
641   */
642  operationSymbolOptions?: Array<SymbolOptions>;
643
644  /**
645   * Text modifier for primary title.
646   * @type { TextModifier }.
647   * @syscap SystemCapability.ArkUI.ArkUI.Full
648   * @atomicservice
649   * @since 12
650   */
651  /**
652   * Text modifier for primary title.
653   * @type { TextModifier }.
654   * @syscap SystemCapability.ArkUI.ArkUI.Full
655   * @crossplatform
656   * @atomicservice
657   * @since 18
658   */
659  primaryTitleModifier?: TextModifier;
660
661  /**
662   * Text modifier for secondary title.
663   * @type { TextModifier }.
664   * @syscap SystemCapability.ArkUI.ArkUI.Full
665   * @atomicservice
666   * @since 12
667   */
668  /**
669   * Text modifier for secondary title.
670   * @type { TextModifier }.
671   * @syscap SystemCapability.ArkUI.ArkUI.Full
672   * @crossplatform
673   * @atomicservice
674   * @since 18
675   */
676  secondaryTitleModifier?: TextModifier;
677
678  /**
679   * Set the title content.
680   * @type { () => void }
681   * @syscap SystemCapability.ArkUI.ArkUI.Full
682   * @atomicservice
683   * @since 12
684   */
685  /**
686   * Set the title content.
687   * @type { () => void }
688   * @syscap SystemCapability.ArkUI.ArkUI.Full
689   * @crossplatform
690   * @atomicservice
691   * @since 18
692   */
693  @BuilderParam titleBuilder?: () => void;
694
695  /**
696   * Set the content margin.
697   * @type { ?LocalizedMargin }
698   * @default {start: LengthMetrics.resource($r('sys.float.margin_left')),
699   * <br> end: LengthMetrics.resource($r('sys.float.margin_right'))}
700   * @syscap SystemCapability.ArkUI.ArkUI.Full
701   * @atomicservice
702   * @since 12
703   */
704  /**
705   * Set the content margin.
706   * @type { ?LocalizedMargin }
707   * @default {start: LengthMetrics.resource($r('sys.float.margin_left')),
708   * <br> end: LengthMetrics.resource($r('sys.float.margin_right'))}
709   * @syscap SystemCapability.ArkUI.ArkUI.Full
710   * @crossplatform
711   * @atomicservice
712   * @since 18
713   */
714  @Prop contentMargin?: LocalizedMargin;
715
716  /**
717   * Set the content padding.
718   * @type { ?LocalizedPadding }
719   * @default set different default values according to the width of the subHeader:
720   * <br> When the left area is secondaryTitle or the group of secondaryTitle and icon,
721   * <br> the default value is {start: LengthMetrics.vp(12), end: LengthMetrics.vp(12)};
722   * @syscap SystemCapability.ArkUI.ArkUI.Full
723   * @atomicservice
724   * @since 12
725   */
726  /**
727   * Set the content padding.
728   * @type { ?LocalizedPadding }
729   * @default set different default values according to the width of the subHeader:
730   * <br> When the left area is secondaryTitle or the group of secondaryTitle and icon,
731   * <br> the default value is {start: LengthMetrics.vp(12), end: LengthMetrics.vp(12)};
732   * @syscap SystemCapability.ArkUI.ArkUI.Full
733   * @crossplatform
734   * @atomicservice
735   * @since 18
736   */
737  @Prop contentPadding?: LocalizedPadding;
738}