• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-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 * interface of formError.
18 *
19 * @namespace formError
20 * @syscap SystemCapability.Ability.Form
21 * @since 8
22 */
23declare namespace formError {
24  /**
25   * Error of form.
26   *
27   * @enum { number }
28   * @syscap SystemCapability.Ability.Form
29   * @since 8
30   */
31  enum FormError {
32    /**
33     * A common internal error occurs during form processing.
34     *
35     * @syscap SystemCapability.Ability.Form
36     * @since 8
37     */
38    ERR_COMMON = 1,
39
40    /**
41     * The application does not have permission to use forms.
42     * Ensure that the application is granted with the ohos.permission.REQUIRE_FORM
43     * and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED permissions.
44     *
45     * @syscap SystemCapability.Ability.Form
46     * @since 8
47     */
48    ERR_PERMISSION_DENY = 2,
49
50    /**
51     * Failed to obtain the configuration information about the form specified by the
52     * request parameters. Ensure that the parameters of the form to be added are
53     * consistent with those provided by the form provider.
54     *
55     * @syscap SystemCapability.Ability.Form
56     * @since 8
57     */
58    ERR_GET_INFO_FAILED = 4,
59
60    /**
61     * Failed to obtain the bundle to which the form belongs based on the request parameters.
62     * Ensure that the bundle to which the form to be added belongs is available.
63     *
64     * @syscap SystemCapability.Ability.Form
65     * @since 8
66     */
67    ERR_GET_BUNDLE_FAILED = 5,
68
69    /**
70     * Failed to initialize the form layout based on the request parameters.
71     * Ensure that the grid style of the form is supported by the form provider.
72     *
73     * @syscap SystemCapability.Ability.Form
74     * @since 8
75     */
76    ERR_GET_LAYOUT_FAILED = 6,
77
78    /**
79     * Invalid input parameter during form operation. Ensure that all input
80     * parameters are valid.
81     *
82     * @syscap SystemCapability.Ability.Form
83     * @since 8
84     */
85    ERR_ADD_INVALID_PARAM = 7,
86
87    /**
88     * The form configuration to be obtained using an existing form ID is
89     * different from that obtained for the first time.
90     *
91     * @syscap SystemCapability.Ability.Form
92     * @since 8
93     */
94    ERR_CFG_NOT_MATCH_ID = 8,
95
96    /**
97     * The ID of the form to be operated does not exist in the Form Manager Service.
98     *
99     * @syscap SystemCapability.Ability.Form
100     * @since 8
101     */
102    ERR_NOT_EXIST_ID = 9,
103
104    /**
105     * Failed to bind the Form Manager Service to the provider service.
106     *
107     * @syscap SystemCapability.Ability.Form
108     * @since 8
109     */
110    ERR_BIND_PROVIDER_FAILED = 10,
111
112    /**
113     * The total number of added forms exceeds the maximum allowed by the system.
114     *
115     * @syscap SystemCapability.Ability.Form
116     * @since 8
117     */
118    ERR_MAX_SYSTEM_FORMS = 11,
119
120    /**
121     * The number of form instances generated using the same form configuration
122     * exceeds the maximum allowed by the system.
123     *
124     * @syscap SystemCapability.Ability.Form
125     * @since 8
126     */
127    ERR_MAX_INSTANCES_PER_FORM = 12,
128
129    /**
130     * The form being requested was added by other applications and cannot be
131     * operated by the current application.
132     *
133     * @syscap SystemCapability.Ability.Form
134     * @since 8
135     */
136    ERR_OPERATION_FORM_NOT_SELF = 13,
137
138    /**
139     * The Form Manager Service failed to instruct the form provider to delete the form.
140     *
141     * @syscap SystemCapability.Ability.Form
142     * @since 8
143     */
144    ERR_PROVIDER_DEL_FAIL = 14,
145
146    /**
147     * The total number of added forms exceeds the maximum per client.
148     *
149     * @syscap SystemCapability.Ability.Form
150     * @since 8
151     */
152    ERR_MAX_FORMS_PER_CLIENT = 15,
153
154    /**
155     * The total number of added temp forms exceeds the maximum in system.
156     *
157     * @syscap SystemCapability.Ability.Form
158     * @since 8
159     */
160    ERR_MAX_SYSTEM_TEMP_FORMS = 16,
161
162    /**
163     * The module can not be find in system.
164     *
165     * @syscap SystemCapability.Ability.Form
166     * @since 8
167     */
168    ERR_FORM_NO_SUCH_MODULE = 17,
169
170    /**
171     * The ability can not be find in system.
172     *
173     * @syscap SystemCapability.Ability.Form
174     * @since 8
175     */
176    ERR_FORM_NO_SUCH_ABILITY = 18,
177
178    /**
179     * The dimension is not exist in the form.
180     *
181     * @syscap SystemCapability.Ability.Form
182     * @since 8
183     */
184    ERR_FORM_NO_SUCH_DIMENSION = 19,
185
186    /**
187     * The ability is not installed.
188     *
189     * @syscap SystemCapability.Ability.Form
190     * @since 8
191     */
192    ERR_FORM_FA_NOT_INSTALLED = 20,
193
194    /**
195     * Failed to obtain the RPC object of the Form Manager Service because
196     * the service is not started.Please try again after the service is started.
197     *
198     * @syscap SystemCapability.Ability.Form
199     * @since 8
200     */
201    ERR_SYSTEM_RESPONSES_FAILED = 30,
202
203    /**
204     * Failed to obtain the form requested by the client because another form
205     * with the same form ID is in use. Forms in use cannot have the same ID.
206     * To obtain and display a form that has the same configuration as an in-use
207     * form in the same application, you are advised to set the form ID to 0 in
208     * the request parameters.
209     *
210     * @syscap SystemCapability.Ability.Form
211     * @since 8
212     */
213    ERR_FORM_DUPLICATE_ADDED = 31,
214
215    /**
216     * The form is being restored. Perform operations on the form only after
217     * the restoration is complete.
218     *
219     * @syscap SystemCapability.Ability.Form
220     * @since 8
221     */
222    ERR_IN_RECOVERY = 36,
223
224    /**
225     * Distributed scheduling failed
226     *
227     * @syscap SystemCapability.Ability.Form
228     * @systemapi
229     * @since 9
230     */
231    ERR_DISTRIBUTED_SCHEDULE_FAILED = 37
232  }
233}
234export default formError;
235