1/* 2 * Copyright (c) 2023-2025 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 */ 36/** 37 * Declaration of the menu item on the right side. 38 * @syscap SystemCapability.ArkUI.ArkUI.Full 39 * @crossplatform 40 * @atomicservice 41 * @since 20 42 */ 43export declare class SelectTitleBarMenuItem { 44 /** 45 * Icon resource for this menu item. 46 * @type { ResourceStr }. 47 * @syscap SystemCapability.ArkUI.ArkUI.Full 48 * @since 10 49 */ 50 /** 51 * Icon resource for this menu item. 52 * @type { ResourceStr }. 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @atomicservice 55 * @since 11 56 */ 57 /** 58 * Icon resource for this menu item. 59 * @type { ResourceStr }. 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @atomicservice 63 * @since 20 64 */ 65 value: ResourceStr; 66 67 /** 68 * Symbol resource for this menu item. 69 * @type { ?SymbolGlyphModifier }. 70 * @syscap SystemCapability.ArkUI.ArkUI.Full 71 * @atomicservice 72 * @since 18 73 */ 74 /** 75 * Symbol resource for this menu item. 76 * @type { ?SymbolGlyphModifier }. 77 * @syscap SystemCapability.ArkUI.ArkUI.Full 78 * @crossplatform 79 * @atomicservice 80 * @since 20 81 */ 82 symbolStyle?: SymbolGlyphModifier; 83 84 /** 85 * Icon label for this menu item. 86 * @type { ?ResourceStr }. 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @atomicservice 89 * @since 13 90 */ 91 /** 92 * Icon label for this menu item. 93 * @type { ?ResourceStr }. 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @crossplatform 96 * @atomicservice 97 * @since 20 98 */ 99 label?: ResourceStr; 100 101 /** 102 * Whether to enable this menu item. 103 * @type { ?boolean }. 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @since 10 106 */ 107 /** 108 * Whether to enable this menu item. 109 * @type { ?boolean }. 110 * @syscap SystemCapability.ArkUI.ArkUI.Full 111 * @atomicservice 112 * @since 11 113 */ 114 /** 115 * Whether to enable this menu item. 116 * @type { ?boolean }. 117 * @syscap SystemCapability.ArkUI.ArkUI.Full 118 * @crossplatform 119 * @atomicservice 120 * @since 20 121 */ 122 isEnabled?: boolean; 123 124 /** 125 * Callback function when click on this menu item. 126 * @type { ?() => void }. 127 * @syscap SystemCapability.ArkUI.ArkUI.Full 128 * @since 10 129 */ 130 /** 131 * Callback function when click on this menu item. 132 * @type { ?() => void }. 133 * @syscap SystemCapability.ArkUI.ArkUI.Full 134 * @atomicservice 135 * @since 11 136 */ 137 /** 138 * Callback function when click on this menu item. 139 * @type { ?() => void }. 140 * @syscap SystemCapability.ArkUI.ArkUI.Full 141 * @crossplatform 142 * @atomicservice 143 * @since 20 144 */ 145 action?: () => void; 146 147 /** 148 * The accessibilityText of this menu item. 149 * @type { ?ResourceStr } 150 * @syscap SystemCapability.ArkUI.ArkUI.Full 151 * @atomicservice 152 * @since 18 153 */ 154 /** 155 * The accessibilityText of this menu item. 156 * @type { ?ResourceStr } 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @crossplatform 159 * @atomicservice 160 * @since 20 161 */ 162 accessibilityText?: ResourceStr; 163 164 /** 165 * The accessibilityDescription of this menu item. 166 * @type { ?ResourceStr } 167 * @syscap SystemCapability.ArkUI.ArkUI.Full 168 * @atomicservice 169 * @since 18 170 */ 171 /** 172 * The accessibilityDescription of this menu item. 173 * @type { ?ResourceStr } 174 * @syscap SystemCapability.ArkUI.ArkUI.Full 175 * @crossplatform 176 * @atomicservice 177 * @since 20 178 */ 179 accessibilityDescription?: ResourceStr; 180 181 /** 182 * The accessibilityLevel of this menu item. 183 * @type { ?string } 184 * @default "auto" 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @atomicservice 187 * @since 18 188 */ 189 /** 190 * The accessibilityLevel of this menu item. 191 * @type { ?string } 192 * @default "auto" 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @crossplatform 195 * @atomicservice 196 * @since 20 197 */ 198 accessibilityLevel?: string; 199} 200 201/** 202 * Declaration of the selectable title bar. 203 * @syscap SystemCapability.ArkUI.ArkUI.Full 204 * @since 10 205 */ 206/** 207 * Declaration of the selectable title bar. 208 * @syscap SystemCapability.ArkUI.ArkUI.Full 209 * @atomicservice 210 * @since 11 211 */ 212/** 213 * Declaration of the selectable title bar. 214 * @syscap SystemCapability.ArkUI.ArkUI.Full 215 * @crossplatform 216 * @atomicservice 217 * @since 20 218 */ 219@Component 220export declare struct SelectTitleBar { 221 /** 222 * Selected index of the initial options in the drop-down menu. The index of the first item is 0. 223 * If this attribute is not set, the default value is -1. Which means, no menu item is selected. 224 * @type { number }. 225 * @syscap SystemCapability.ArkUI.ArkUI.Full 226 * @since 10 227 */ 228 /** 229 * Selected index of the initial options in the drop-down menu. The index of the first item is 0. 230 * If this attribute is not set, the default value is -1. Which means, no menu item is selected. 231 * @type { number }. 232 * @syscap SystemCapability.ArkUI.ArkUI.Full 233 * @atomicservice 234 * @since 11 235 */ 236 /** 237 * Selected index of the initial options in the drop-down menu. The index of the first item is 0. 238 * If this attribute is not set, the default value is -1. Which means, no menu item is selected. 239 * @type { number }. 240 * @syscap SystemCapability.ArkUI.ArkUI.Full 241 * @crossplatform 242 * @atomicservice 243 * @since 20 244 */ 245 @Prop selected: number; 246 247 /** 248 * Options inside the drop-down list. 249 * @type { Array<SelectOption> }. 250 * @syscap SystemCapability.ArkUI.ArkUI.Full 251 * @since 10 252 */ 253 /** 254 * Options inside the drop-down list. 255 * @type { Array<SelectOption> }. 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @atomicservice 258 * @since 11 259 */ 260 /** 261 * Options inside the drop-down list. 262 * @type { Array<SelectOption> }. 263 * @syscap SystemCapability.ArkUI.ArkUI.Full 264 * @crossplatform 265 * @atomicservice 266 * @since 20 267 */ 268 options: Array<SelectOption>; 269 270 /** 271 * Menu items on the right side. 272 * @type { ?Array<SelectTitleBarMenuItem> }. 273 * @syscap SystemCapability.ArkUI.ArkUI.Full 274 * @since 10 275 */ 276 /** 277 * Menu items on the right side. 278 * @type { ?Array<SelectTitleBarMenuItem> }. 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @atomicservice 281 * @since 11 282 */ 283 /** 284 * Menu items on the right side. 285 * @type { ?Array<SelectTitleBarMenuItem> }. 286 * @syscap SystemCapability.ArkUI.ArkUI.Full 287 * @crossplatform 288 * @atomicservice 289 * @since 20 290 */ 291 menuItems?: Array<SelectTitleBarMenuItem>; 292 293 /** 294 * Sub-title of this title bar. 295 * @type { ?ResourceStr }. 296 * @syscap SystemCapability.ArkUI.ArkUI.Full 297 * @since 10 298 */ 299 /** 300 * Sub-title of this title bar. 301 * @type { ?ResourceStr }. 302 * @syscap SystemCapability.ArkUI.ArkUI.Full 303 * @atomicservice 304 * @since 11 305 */ 306 /** 307 * Sub-title of this title bar. 308 * @type { ?ResourceStr }. 309 * @syscap SystemCapability.ArkUI.ArkUI.Full 310 * @crossplatform 311 * @atomicservice 312 * @since 20 313 */ 314 subtitle?: ResourceStr; 315 316 /** 317 * The number displayed in a badge. 318 * @type { ?number }. 319 * @syscap SystemCapability.ArkUI.ArkUI.Full 320 * @since 10 321 */ 322 /** 323 * The number displayed in a badge. 324 * @type { ?number }. 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @atomicservice 327 * @since 11 328 */ 329 /** 330 * The number displayed in a badge. 331 * @type { ?number }. 332 * @syscap SystemCapability.ArkUI.ArkUI.Full 333 * @crossplatform 334 * @atomicservice 335 * @since 20 336 */ 337 badgeValue?: number; 338 339 /** 340 * Whether to hide the back arrow at the left side. 341 * @type { ?boolean }. 342 * @syscap SystemCapability.ArkUI.ArkUI.Full 343 * @since 10 344 */ 345 /** 346 * Whether to hide the back arrow at the left side. 347 * @type { ?boolean }. 348 * @syscap SystemCapability.ArkUI.ArkUI.Full 349 * @atomicservice 350 * @since 11 351 */ 352 /** 353 * Whether to hide the back arrow at the left side. 354 * @type { ?boolean }. 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @crossplatform 357 * @atomicservice 358 * @since 20 359 */ 360 hidesBackButton?: boolean; 361 362 /** 363 * Callback function when an option is selected 364 * @type { ?(index: number) => void }. 365 * @syscap SystemCapability.ArkUI.ArkUI.Full 366 * @since 10 367 */ 368 /** 369 * Callback function when an option is selected 370 * @type { ?(index: number) => void }. 371 * @syscap SystemCapability.ArkUI.ArkUI.Full 372 * @atomicservice 373 * @since 11 374 */ 375 /** 376 * Callback function when an option is selected 377 * @type { ?(index: number) => void }. 378 * @syscap SystemCapability.ArkUI.ArkUI.Full 379 * @crossplatform 380 * @atomicservice 381 * @since 20 382 */ 383 onSelected?: ((index: number) => void); 384} 385