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/** 17 * @file 18 * @kit ArkUI 19 */ 20 21 22 23 24 25/** 26 * Declaration of the menu item on the right side. 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @since 10 29 */ 30/** 31 * Declaration of the menu item on the right side. 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @atomicservice 34 * @since 11 35 */ 36export declare class SelectTitleBarMenuItem { 37 /** 38 * Icon resource for this menu item. 39 * @type { ResourceStr }. 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @since 10 42 */ 43 /** 44 * Icon resource for this menu item. 45 * @type { ResourceStr }. 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @atomicservice 48 * @since 11 49 */ 50 value: ResourceStr; 51 52 /** 53 * Icon label for this menu item. 54 * @type { ?ResourceStr }. 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @atomicservice 57 * @since 13 58 */ 59 label?: ResourceStr; 60 61 /** 62 * Whether to enable this menu item. 63 * @type { ?boolean }. 64 * @syscap SystemCapability.ArkUI.ArkUI.Full 65 * @since 10 66 */ 67 /** 68 * Whether to enable this menu item. 69 * @type { ?boolean }. 70 * @syscap SystemCapability.ArkUI.ArkUI.Full 71 * @atomicservice 72 * @since 11 73 */ 74 isEnabled?: boolean; 75 76 /** 77 * Callback function when click on this menu item. 78 * @type { ?() => void }. 79 * @syscap SystemCapability.ArkUI.ArkUI.Full 80 * @since 10 81 */ 82 /** 83 * Callback function when click on this menu item. 84 * @type { ?() => void }. 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @atomicservice 87 * @since 11 88 */ 89 action?: () => void; 90} 91 92/** 93 * Declaration of the selectable title bar. 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @since 10 96 */ 97/** 98 * Declaration of the selectable title bar. 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @atomicservice 101 * @since 11 102 */ 103@Component 104export declare struct SelectTitleBar { 105 /** 106 * Selected index of the initial options in the drop-down menu. The index of the first item is 0. 107 * If this attribute is not set, the default value is -1. Which means, no menu item is selected. 108 * @type { number }. 109 * @syscap SystemCapability.ArkUI.ArkUI.Full 110 * @since 10 111 */ 112 /** 113 * Selected index of the initial options in the drop-down menu. The index of the first item is 0. 114 * If this attribute is not set, the default value is -1. Which means, no menu item is selected. 115 * @type { number }. 116 * @syscap SystemCapability.ArkUI.ArkUI.Full 117 * @atomicservice 118 * @since 11 119 */ 120 @Prop selected: number; 121 122 /** 123 * Options inside the drop-down list. 124 * @type { Array<SelectOption> }. 125 * @syscap SystemCapability.ArkUI.ArkUI.Full 126 * @since 10 127 */ 128 /** 129 * Options inside the drop-down list. 130 * @type { Array<SelectOption> }. 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @atomicservice 133 * @since 11 134 */ 135 options: Array<SelectOption>; 136 137 /** 138 * Menu items on the right side. 139 * @type { ?Array<SelectTitleBarMenuItem> }. 140 * @syscap SystemCapability.ArkUI.ArkUI.Full 141 * @since 10 142 */ 143 /** 144 * Menu items on the right side. 145 * @type { ?Array<SelectTitleBarMenuItem> }. 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @atomicservice 148 * @since 11 149 */ 150 menuItems?: Array<SelectTitleBarMenuItem>; 151 152 /** 153 * Sub-title of this title bar. 154 * @type { ?ResourceStr }. 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @since 10 157 */ 158 /** 159 * Sub-title of this title bar. 160 * @type { ?ResourceStr }. 161 * @syscap SystemCapability.ArkUI.ArkUI.Full 162 * @atomicservice 163 * @since 11 164 */ 165 subtitle?: ResourceStr; 166 167 /** 168 * The number displayed in a badge. 169 * @type { ?number }. 170 * @syscap SystemCapability.ArkUI.ArkUI.Full 171 * @since 10 172 */ 173 /** 174 * The number displayed in a badge. 175 * @type { ?number }. 176 * @syscap SystemCapability.ArkUI.ArkUI.Full 177 * @atomicservice 178 * @since 11 179 */ 180 badgeValue?: number; 181 182 /** 183 * Whether to hide the back arrow at the left side. 184 * @type { ?boolean }. 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @since 10 187 */ 188 /** 189 * Whether to hide the back arrow at the left side. 190 * @type { ?boolean }. 191 * @syscap SystemCapability.ArkUI.ArkUI.Full 192 * @atomicservice 193 * @since 11 194 */ 195 hidesBackButton?: boolean; 196 197 /** 198 * Callback function when an option is selected 199 * @type { ?(index: number) => void }. 200 * @syscap SystemCapability.ArkUI.ArkUI.Full 201 * @since 10 202 */ 203 /** 204 * Callback function when an option is selected 205 * @type { ?(index: number) => void }. 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @atomicservice 208 * @since 11 209 */ 210 onSelected?: ((index: number) => void); 211} 212