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 * Symbol resource for this menu item. 54 * @type { ?SymbolGlyphModifier }. 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @atomicservice 57 * @since 18 58 */ 59 symbolStyle?: SymbolGlyphModifier; 60 61 /** 62 * Icon label for this menu item. 63 * @type { ?ResourceStr }. 64 * @syscap SystemCapability.ArkUI.ArkUI.Full 65 * @atomicservice 66 * @since 13 67 */ 68 label?: ResourceStr; 69 70 /** 71 * Whether to enable this menu item. 72 * @type { ?boolean }. 73 * @syscap SystemCapability.ArkUI.ArkUI.Full 74 * @since 10 75 */ 76 /** 77 * Whether to enable this menu item. 78 * @type { ?boolean }. 79 * @syscap SystemCapability.ArkUI.ArkUI.Full 80 * @atomicservice 81 * @since 11 82 */ 83 isEnabled?: boolean; 84 85 /** 86 * Callback function when click on this menu item. 87 * @type { ?() => void }. 88 * @syscap SystemCapability.ArkUI.ArkUI.Full 89 * @since 10 90 */ 91 /** 92 * Callback function when click on this menu item. 93 * @type { ?() => void }. 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @atomicservice 96 * @since 11 97 */ 98 action?: () => void; 99 100 /** 101 * The accessibilityText of this menu item. 102 * @type { ?ResourceStr } 103 * @syscap SystemCapability.ArkUI.ArkUI.Full 104 * @atomicservice 105 * @since 18 106 */ 107 accessibilityText?: ResourceStr; 108 109 /** 110 * The accessibilityDescription of this menu item. 111 * @type { ?ResourceStr } 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @atomicservice 114 * @since 18 115 */ 116 accessibilityDescription?: ResourceStr; 117 118 /** 119 * The accessibilityLevel of this menu item. 120 * @type { ?string } 121 * @default "auto" 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @atomicservice 124 * @since 18 125 */ 126 accessibilityLevel?: string; 127} 128 129/** 130 * Declaration of the selectable title bar. 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @since 10 133 */ 134/** 135 * Declaration of the selectable title bar. 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @atomicservice 138 * @since 11 139 */ 140@Component 141export declare struct SelectTitleBar { 142 /** 143 * Selected index of the initial options in the drop-down menu. The index of the first item is 0. 144 * If this attribute is not set, the default value is -1. Which means, no menu item is selected. 145 * @type { number }. 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @since 10 148 */ 149 /** 150 * Selected index of the initial options in the drop-down menu. The index of the first item is 0. 151 * If this attribute is not set, the default value is -1. Which means, no menu item is selected. 152 * @type { number }. 153 * @syscap SystemCapability.ArkUI.ArkUI.Full 154 * @atomicservice 155 * @since 11 156 */ 157 @Prop selected: number; 158 159 /** 160 * Options inside the drop-down list. 161 * @type { Array<SelectOption> }. 162 * @syscap SystemCapability.ArkUI.ArkUI.Full 163 * @since 10 164 */ 165 /** 166 * Options inside the drop-down list. 167 * @type { Array<SelectOption> }. 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @atomicservice 170 * @since 11 171 */ 172 options: Array<SelectOption>; 173 174 /** 175 * Menu items on the right side. 176 * @type { ?Array<SelectTitleBarMenuItem> }. 177 * @syscap SystemCapability.ArkUI.ArkUI.Full 178 * @since 10 179 */ 180 /** 181 * Menu items on the right side. 182 * @type { ?Array<SelectTitleBarMenuItem> }. 183 * @syscap SystemCapability.ArkUI.ArkUI.Full 184 * @atomicservice 185 * @since 11 186 */ 187 menuItems?: Array<SelectTitleBarMenuItem>; 188 189 /** 190 * Sub-title of this title bar. 191 * @type { ?ResourceStr }. 192 * @syscap SystemCapability.ArkUI.ArkUI.Full 193 * @since 10 194 */ 195 /** 196 * Sub-title of this title bar. 197 * @type { ?ResourceStr }. 198 * @syscap SystemCapability.ArkUI.ArkUI.Full 199 * @atomicservice 200 * @since 11 201 */ 202 subtitle?: ResourceStr; 203 204 /** 205 * The number displayed in a badge. 206 * @type { ?number }. 207 * @syscap SystemCapability.ArkUI.ArkUI.Full 208 * @since 10 209 */ 210 /** 211 * The number displayed in a badge. 212 * @type { ?number }. 213 * @syscap SystemCapability.ArkUI.ArkUI.Full 214 * @atomicservice 215 * @since 11 216 */ 217 badgeValue?: number; 218 219 /** 220 * Whether to hide the back arrow at the left side. 221 * @type { ?boolean }. 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @since 10 224 */ 225 /** 226 * Whether to hide the back arrow at the left side. 227 * @type { ?boolean }. 228 * @syscap SystemCapability.ArkUI.ArkUI.Full 229 * @atomicservice 230 * @since 11 231 */ 232 hidesBackButton?: boolean; 233 234 /** 235 * Callback function when an option is selected 236 * @type { ?(index: number) => void }. 237 * @syscap SystemCapability.ArkUI.ArkUI.Full 238 * @since 10 239 */ 240 /** 241 * Callback function when an option is selected 242 * @type { ?(index: number) => void }. 243 * @syscap SystemCapability.ArkUI.ArkUI.Full 244 * @atomicservice 245 * @since 11 246 */ 247 onSelected?: ((index: number) => void); 248} 249