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