• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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 * @file
17 * @kit ArkData
18 */
19import uniformDataStruct from '@ohos.data.uniformDataStruct';
20
21/**
22 * Enumerates the form card types.
23 *
24 * @enum { number }
25 * @syscap SystemCapability.DistributedDataManager.UDMF.Core
26 * @since 20
27 */
28declare enum FormType {
29  /**
30   * Big form card, with fixed size of 4 x 4.
31   *
32   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
33   * @since 20
34   */
35  TYPE_BIG = 0,
36
37  /**
38   * Medium-sized form card, with fixed size of 4 x 2.
39   *
40   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
41   * @since 20
42   */
43  TYPE_MID = 1,
44
45  /**
46   * Small form card, with fixed size of 2 x 1.
47   *
48   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
49   * @since 20
50   */
51  TYPE_SMALL = 2
52}
53
54/**
55 * Defines a content form card.
56 *
57 * @struct { ContentFormCard }
58 * @syscap SystemCapability.DistributedDataManager.UDMF.Core
59 * @since 20
60 */
61@Component
62declare struct ContentFormCard {
63  /**
64   * Data of the form card.
65   *
66   * @type { uniformDataStruct.ContentForm }
67   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
68   * @since 20
69   */
70  contentFormData: uniformDataStruct.ContentForm;
71
72  /**
73   * Type of the form card.
74   *
75   * @type { FormType }
76   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
77   * @since 20
78   */
79  @Prop
80  formType: FormType;
81
82  /**
83   * Width of the form card.
84   *
85   * @type { ?number }
86   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
87   * @since 20
88   */
89  @Prop
90  formWidth?: number;
91
92  /**
93   * Height of the form card.
94   *
95   * @type { ?number }
96   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
97   * @since 20
98   */
99  @Prop
100  formHeight?: number;
101
102  /**
103   * Callback to be invoked when the form card is tapped.
104   *
105   * @type { ?Function }
106   * @syscap SystemCapability.DistributedDataManager.UDMF.Core
107   * @since 20
108   */
109  handleOnClick?: Function;
110}
111
112export { ContentFormCard, FormType };