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 * Construct parameter types for EditorMenuOptions. 23 * 24 * @syscap SystemCapability.ArkUI.ArkUI.Full 25 * @crossplatform 26 * @since 11 27 */ 28 /** 29 * Construct parameter types for EditorMenuOptions. 30 * 31 * @syscap SystemCapability.ArkUI.ArkUI.Full 32 * @crossplatform 33 * @atomicservice 34 * @since 12 35 */ 36 37 38export interface EditorMenuOptions { 39 /** 40 * The icon of icon and text item. 41 * 42 * @type { ResourceStr } 43 * @syscap SystemCapability.ArkUI.ArkUI.Full 44 * @crossplatform 45 * @since 11 46 */ 47 /** 48 * The icon of icon and text item. 49 * 50 * @type { ResourceStr } 51 * @syscap SystemCapability.ArkUI.ArkUI.Full 52 * @crossplatform 53 * @atomicservice 54 * @since 12 55 */ 56 icon: ResourceStr; 57 58 /** 59 * Symbol style of menu icon. 60 * @type { ?SymbolGlyphModifier }. 61 * @syscap SystemCapability.ArkUI.ArkUI.Full 62 * @atomicservice 63 * @since 18 64 */ 65 /** 66 * Symbol style of menu icon. 67 * @type { ?SymbolGlyphModifier }. 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @crossplatform 70 * @atomicservice 71 * @since 20 72 */ 73 symbolStyle?: SymbolGlyphModifier; 74 75 /** 76 * Callback function when click the icon. 77 * 78 * @type { ?function } 79 * @syscap SystemCapability.ArkUI.ArkUI.Full 80 * @crossplatform 81 * @since 11 82 */ 83 /** 84 * Callback function when click the icon. 85 * 86 * @type { ?function } 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @crossplatform 89 * @atomicservice 90 * @since 12 91 */ 92 action?: () => void; 93 94 /** 95 * Callback builder when click the icon. 96 * 97 * @type { ?function } 98 * @syscap SystemCapability.ArkUI.ArkUI.Full 99 * @crossplatform 100 * @since 11 101 */ 102 /** 103 * Callback builder when click the icon. 104 * 105 * @type { ?function } 106 * @syscap SystemCapability.ArkUI.ArkUI.Full 107 * @crossplatform 108 * @atomicservice 109 * @since 12 110 */ 111 builder?: () => void; 112} 113 114/** 115 * Construct parameter types for ExpandedMenuOptions. 116 * 117 * @extends MenuItemOptions 118 * @syscap SystemCapability.ArkUI.ArkUI.Full 119 * @crossplatform 120 * @since 11 121 */ 122 /** 123 * Construct parameter types for ExpandedMenuOptions. 124 * 125 * @extends MenuItemOptions 126 * @syscap SystemCapability.ArkUI.ArkUI.Full 127 * @crossplatform 128 * @atomicservice 129 * @since 12 130 */ 131export interface ExpandedMenuOptions extends MenuItemOptions { 132 /** 133 * Callback function when click the option. 134 * 135 * @type { ?function } 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @crossplatform 138 * @since 11 139 */ 140 /** 141 * Callback function when click the option. 142 * 143 * @type { ?function } 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @crossplatform 146 * @atomicservice 147 * @since 12 148 */ 149 action?: () => void; 150} 151 152/** 153 * Defines the editor event info. 154 * 155 * @interface EditorEventInfo 156 * @syscap SystemCapability.ArkUI.ArkUI.Full 157 * @crossplatform 158 * @since 11 159 */ 160 /** 161 * Defines the editor event info. 162 * 163 * @interface EditorEventInfo 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @crossplatform 166 * @atomicservice 167 * @since 12 168 */ 169export interface EditorEventInfo { 170 /** 171 * Edit information. 172 * 173 * @type { ?RichEditorSelection } 174 * @syscap SystemCapability.ArkUI.ArkUI.Full 175 * @crossplatform 176 * @since 11 177 */ 178 /** 179 * Edit information. 180 * 181 * @type { ?RichEditorSelection } 182 * @syscap SystemCapability.ArkUI.ArkUI.Full 183 * @crossplatform 184 * @atomicservice 185 * @since 12 186 */ 187 content?: RichEditorSelection; 188} 189 190/** 191 * Construct parameter types for SelectionMenuOptions. 192 * 193 * @extends MenuItemOptions 194 * @syscap SystemCapability.ArkUI.ArkUI.Full 195 * @crossplatform 196 * @since 11 197 */ 198 /** 199 * Construct parameter types for SelectionMenuOptions. 200 * 201 * @extends MenuItemOptions 202 * @syscap SystemCapability.ArkUI.ArkUI.Full 203 * @crossplatform 204 * @atomicservice 205 * @since 12 206 */ 207export interface SelectionMenuOptions { 208 /** 209 * The options of EditorMenu. 210 * 211 * @type { ?Array<EditorMenuOptions> } 212 * @syscap SystemCapability.ArkUI.ArkUI.Full 213 * @crossplatform 214 * @since 11 215 */ 216 /** 217 * The options of EditorMenu. 218 * 219 * @type { ?Array<EditorMenuOptions> } 220 * @syscap SystemCapability.ArkUI.ArkUI.Full 221 * @crossplatform 222 * @atomicservice 223 * @since 12 224 */ 225 editorMenuOptions?: Array<EditorMenuOptions>; 226 227 /** 228 * Expansion of SelectionMenu. 229 * 230 * @type { ?Array<ExpendMenuOptions> } 231 * @syscap SystemCapability.ArkUI.ArkUI.Full 232 * @crossplatform 233 * @since 11 234 */ 235 /** 236 * Expansion of SelectionMenu. 237 * 238 * @type { ?Array<ExpendMenuOptions> } 239 * @syscap SystemCapability.ArkUI.ArkUI.Full 240 * @crossplatform 241 * @atomicservice 242 * @since 12 243 */ 244 expandedMenuOptions?: Array<ExpandedMenuOptions>; 245 246 /** 247 * Expansion of SelectionMenu. 248 * 249 * @type { ?RichEditorController } 250 * @syscap SystemCapability.ArkUI.ArkUI.Full 251 * @crossplatform 252 * @since 11 253 */ 254 /** 255 * Expansion of SelectionMenu. 256 * 257 * @type { ?RichEditorController } 258 * @syscap SystemCapability.ArkUI.ArkUI.Full 259 * @crossplatform 260 * @atomicservice 261 * @since 12 262 */ 263 controller?: RichEditorController; 264 /** 265 * Replace the built-in paste function. 266 * 267 * @type { ?function } 268 * @syscap SystemCapability.ArkUI.ArkUI.Full 269 * @crossplatform 270 * @since 11 271 */ 272 /** 273 * Replace the built-in paste function. 274 * 275 * @type { ?function } 276 * @syscap SystemCapability.ArkUI.ArkUI.Full 277 * @crossplatform 278 * @atomicservice 279 * @since 12 280 */ 281 onPaste?: (event?: EditorEventInfo) => void; 282 283 /** 284 * Replace the built-in replication feature. 285 * 286 * @type { ?function } 287 * @syscap SystemCapability.ArkUI.ArkUI.Full 288 * @crossplatform 289 * @since 11 290 */ 291 /** 292 * Replace the built-in replication feature. 293 * 294 * @type { ?function } 295 * @syscap SystemCapability.ArkUI.ArkUI.Full 296 * @crossplatform 297 * @atomicservice 298 * @since 12 299 */ 300 onCopy?: (event?: EditorEventInfo) => void; 301 302 /** 303 * Replace the built-in cut function. 304 * 305 * @type { ?function } 306 * @syscap SystemCapability.ArkUI.ArkUI.Full 307 * @crossplatform 308 * @since 11 309 */ 310 /** 311 * Replace the built-in cut function. 312 * 313 * @type { ?function } 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @crossplatform 316 * @atomicservice 317 * @since 12 318 */ 319 onCut?: (event?: EditorEventInfo) => void; 320 321 /** 322 * Replace the built-in select all function. 323 * 324 * @type { ?function } 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @crossplatform 327 * @since 11 328 */ 329 /** 330 * Replace the built-in select all function. 331 * 332 * @type { ?function } 333 * @syscap SystemCapability.ArkUI.ArkUI.Full 334 * @crossplatform 335 * @atomicservice 336 * @since 12 337 */ 338 onSelectAll?: (event?: EditorEventInfo) => void; 339} 340 341/** 342 * Declare Builder SelectionMenu. 343 * 344 * @param { SelectionMenuOptions } options - Selection menu options. 345 * @syscap SystemCapability.ArkUI.ArkUI.Full 346 * @crossplatform 347 * @since 11 348 */ 349 /** 350 * Declare Builder SelectionMenu. 351 * 352 * @param { SelectionMenuOptions } options - Selection menu options. 353 * @syscap SystemCapability.ArkUI.ArkUI.Full 354 * @crossplatform 355 * @atomicservice 356 * @since 12 357 */ 358@Builder 359export declare function SelectionMenu(options: SelectionMenuOptions): void; 360