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