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