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 ComposeTitleBarMenuItem { 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 composable title bar. 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @since 10 96 */ 97/** 98 * Declaration of the composable title bar. 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @atomicservice 101 * @since 11 102 */ 103@Component 104export declare struct ComposeTitleBar { 105 /** 106 * Avatar resource and event callback of this title bar. 107 * @type { ?ComposeTitleBarMenuItem }. 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @since 10 110 */ 111 /** 112 * Avatar resource and event callback of this title bar. 113 * @type { ?ComposeTitleBarMenuItem }. 114 * @syscap SystemCapability.ArkUI.ArkUI.Full 115 * @atomicservice 116 * @since 11 117 */ 118 item?: ComposeTitleBarMenuItem; 119 120 /** 121 * Title of this title bar. 122 * @type { ResourceStr }. 123 * @syscap SystemCapability.ArkUI.ArkUI.Full 124 * @since 10 125 */ 126 /** 127 * Title of this title bar. 128 * @type { ResourceStr }. 129 * @syscap SystemCapability.ArkUI.ArkUI.Full 130 * @atomicservice 131 * @since 11 132 */ 133 title: ResourceStr; 134 135 /** 136 * Sub-title of this title bar. 137 * @type { ?ResourceStr }. 138 * @syscap SystemCapability.ArkUI.ArkUI.Full 139 * @since 10 140 */ 141 /** 142 * Sub-title of this title bar. 143 * @type { ?ResourceStr }. 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @atomicservice 146 * @since 11 147 */ 148 subtitle?: ResourceStr; 149 150 /** 151 * Menu items on the right side. 152 * @type { ?Array<ComposeTitleBarMenuItem> }. 153 * @syscap SystemCapability.ArkUI.ArkUI.Full 154 * @since 10 155 */ 156 /** 157 * Menu items on the right side. 158 * @type { ?Array<ComposeTitleBarMenuItem> }. 159 * @syscap SystemCapability.ArkUI.ArkUI.Full 160 * @atomicservice 161 * @since 11 162 */ 163 menuItems?: Array<ComposeTitleBarMenuItem>; 164} 165