• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-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/// <reference path="../component/units.d.ts" />
17
18import { ResourceStr } from 'GlobalResource';
19
20/**
21 * Declare enum ItemState
22 * @enum { ItemState }
23 * @syscap SystemCapability.ArkUI.ArkUI.Full
24 * @since 10
25 */
26export declare enum ItemState {
27  /**
28   * Enable type.
29   * @syscap SystemCapability.ArkUI.ArkUI.Full
30   * @since 10
31   */
32  ENABLE = 1,
33  /**
34   * Disable type.
35   * @syscap SystemCapability.ArkUI.ArkUI.Full
36   * @since 10
37   */
38  DISABLE = 2,
39  /**
40   * Activate type.
41   * @syscap SystemCapability.ArkUI.ArkUI.Full
42   * @since 10
43   */
44  ACTIVATE = 3
45}
46
47/**
48 * Declare type ToolBarOption
49 * @syscap SystemCapability.ArkUI.ArkUI.Full
50 * @since 10
51 */
52@Observed
53export declare class ToolBarOption {
54  /**
55  * Define text content.
56  * @type { ResourceStr }.
57  * @since 10
58  */
59  content: ResourceStr;
60  /**
61   * Define the action event.
62   * @since 10
63   */
64  action?: () => void;
65  /**
66   * Define icon resource.
67   * @type { Resource }.
68   * @since 10
69   */
70  icon?: Resource;
71  /**
72   * Define item type.
73   * @type { Resource }.
74   * @since 10
75   */
76  state?: ItemState;
77}
78
79/**
80 * Declare ToolBarOptions use in ToolBar
81 * @syscap SystemCapability.ArkUI.ArkUI.Full
82 * @since 10
83 */
84@Observed
85export declare class ToolBarOptions extends Array<ToolBarOption> {
86}
87
88/**
89 * Declare Component ToolBar
90 * @syscap SystemCapability.ArkUI.ArkUI.Full
91 * @since 10
92 */
93@Component
94export declare struct ToolBar {
95  /**
96   * Define toolbar list array.
97   * @type { ToolBarOptions }.
98   * @syscap SystemCapability.ArkUI.ArkUI.Full
99   * @since 10
100   */
101  @ObjectLink toolBarList: ToolBarOptions;
102  /**
103   * Define toolbar activate item index, default is -1.
104   * @type { number }.
105   * @syscap SystemCapability.ArkUI.ArkUI.Full
106   * @since 10
107   */
108  @Prop activateIndex?: number;
109  /**
110   * Define toolbar controller.
111   * @type { TabsController }.
112   * @syscap SystemCapability.ArkUI.ArkUI.Full
113   * @since 10
114   */
115  controller: TabsController;
116}