• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (C) 2024 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 Defines the form menu
18  * @kit ArkUI
19  */
20 
21 import formBindingData from './@ohos.app.form.formBindingData';
22 import Want from './@ohos.app.ability.Want';
23 import { AsyncCallback } from './@ohos.base';
24 
25 /**
26  * Defines the form menu item style.
27  *
28  * @interface FormMenuItemStyle
29  * @syscap SystemCapability.ArkUI.ArkUI.Full
30  * @since 12
31  */
32 export interface FormMenuItemStyle {
33   /**
34    * Defines options of the form menu.
35    *
36    * @type { ?MenuItemOptions }
37    * @syscap SystemCapability.ArkUI.ArkUI.Full
38    * @since 12
39    */
40   options?: MenuItemOptions;
41 }
42 
43 /**
44  * Defines the add form options.
45  *
46  * @interface AddFormOptions
47  * @syscap SystemCapability.ArkUI.ArkUI.Full
48  * @since 12
49  */
50 export interface AddFormOptions {
51   /**
52    * Indicates the form data.
53    *
54    * @type { ?formBindingData.FormBindingData }
55    * @syscap SystemCapability.ArkUI.ArkUI.Full
56    * @since 12
57    */
58   formBindingData?: formBindingData.FormBindingData;
59 
60   /**
61    * The callback is used to return the form id.
62    *
63    * @type { ?AsyncCallback<string> }
64    * @syscap SystemCapability.ArkUI.ArkUI.Full
65    * @since 12
66    */
67   callback?: AsyncCallback<string>;
68 
69   /**
70    * The style of the menu item.
71    *
72    * @type { ?FormMenuItemStyle }
73    * @syscap SystemCapability.ArkUI.ArkUI.Full
74    * @since 12
75    */
76   style?: FormMenuItemStyle;
77 }
78 
79 /**
80  * Build function of AddFormMenuItem.
81  *
82  * @param { Want } want - The want of the form to publish.
83  * @param { string } componentId - The id of the component used to get form snapshot.
84  * @param { AddFormOptions } [options] - Add form options.
85  * @syscap SystemCapability.ArkUI.ArkUI.Full
86  * @since 12
87  */
88 @Builder
89 export declare function AddFormMenuItem(
90   want: Want,
91   componentId: string,
92   options?: AddFormOptions
93 ): void;