• 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 #ifndef OHOS_FORM_FWK_FORM_EVENT_REPORT_DEFINE_H
17 #define OHOS_FORM_FWK_FORM_EVENT_REPORT_DEFINE_H
18 
19 #include <string>
20 #include "hisysevent.h"
21 
22 namespace OHOS {
23 namespace AppExecFwk {
24 struct FormEventInfo {
25     int64_t formId = -1;
26     std::string bundleName;
27     std::string moduleName;
28     std::string abilityName;
29     std::string hostBundleName = "";
30     int32_t formAppPid = -1;
31     int64_t timeStamp = 0;
32     int64_t formDimension = 0;
33     bool distributedForm = false;
34 };
35 
36 enum class CallDbFiledErrorType : int64_t {
37     LOAD_DATABASE_FAILED = 1,
38     DATABASE_RESET_CONNECT_FAILED,
39     DATABASE_SAVE_FORMID_FAILED,
40     DATABASE_DELETE_FORMID_FAILED,
41     DATABASE_QUERY_FORMID_FAILED,
42     DATABASE_EXIT_ABNORMAL,
43 };
44 
45 enum class InitFmsFiledErrorType : int64_t {
46     LOAD_FORM_DB_FAILED = 1,
47     PUBLISH_SER_FAILED,
48 };
49 
50 enum class AddFormFiledErrorType : int64_t {
51     NUMBER_EXCEEDING_LIMIT = 1,
52     CONNECT_FORM_RENDER_FAILED,
53     CONNECT_FORM_PROVIDER_FAILED,
54     SUBSCRIBE_DATA_SHARE_FAILED,
55 };
56 
57 enum class UpdateFormErrorType : int64_t {
58     REQUEST_FORM_FAILED = 1,
59     UPDATE_FORM_FAILED,
60     PROXY_UPDATE_FORM_FAILED,
61     TIMER_UPDATE_FORM_FAILED,
62     FORM_VISIBLE_UPDATE_FAILED,
63 };
64 
65 enum class DeleteFormErrorType : int64_t {
66     DELETE_THEME_FORM_FAILED = 1,
67     DELETE_TEMP_FORM_FAILED,
68     DELETE_NORMAL_FORM_FAILED,
69 };
70 
71 enum class RecycleRecoverFormErrorType : int64_t {
72     RECYCLE_FORM_FAILED = 1,
73     RECOVER_FORM_FAILED,
74     CHECK_FORM_STATUS_FAILED
75 };
76 
77 enum class ConnectFormAbilityErrorType : int64_t {
78     ACQUIRE_FORM_FAILED = 1,
79     UPDATE_FORM_FAILED,
80 };
81 
82 enum class ReloadFormErrorType : int64_t {
83     RELOAD_FORM_FRS_DEAD = 1,
84     RELOAD_FORM_IPC_ERROR,
85     RELOAD_FORM_RELOAD_FORM_ERROR,
86     RELOAD_FORM_UPDATE_FORM_ERROR,
87 };
88 
89 struct NewFormEventInfo {
90     int64_t formId = -1;
91     std::string bundleName;
92     std::string moduleName;
93     std::string abilityName;
94     std::string hostBundleName = "";
95     int64_t sessionId;
96     int64_t bindDuration;
97     int64_t getDuration;
98     std::string formName;
99     int64_t formDimension;
100     int64_t acquireDuration;
101     int64_t duration;
102     int64_t durationType;
103     int32_t dailyRefreshTimes;
104     int32_t invisibleRefreshTimes;
105     int32_t hfRefreshBlockTimes;
106     int32_t invisibleRefreshBlockTimes;
107     int32_t highLoadRefreshBlockTimes;
108     int32_t activeRecoverRefreshTimes;
109     int32_t passiveRecoverRefreshTimes;
110     int32_t hfRecoverRefreshTimes;
111     int32_t offloadRecoverRefreshTimes;
112     int32_t disableFormRefreshTimes;
113     std::string clientBundleName = "";
114     std::string formBundleName = "";
115     int32_t conditionType;
116     int32_t renderingMode;
117     std::string bundleAndFormName;
118     bool distributedForm = false;
119 };
120 
121 enum class FormEventName {
122     // form behavior event
123     ADD_FORM,
124     REQUEST_FORM,
125     DELETE_FORM,
126     CASTTEMP_FORM,
127     ACQUIREFORMSTATE_FORM,
128     MESSAGE_EVENT_FORM,
129     ROUTE_EVENT_FORM,
130     BACKGROUND_EVENT_FORM,
131     RELEASE_FORM,
132     DELETE_INVALID_FORM,
133     SET_NEXT_REFRESH_TIME_FORM,
134     FORM_RENDER_BLOCK,
135     INIT_FMS_FAILED,
136     CALLEN_DB_FAILED,
137     ADD_FORM_FAILED,
138     FIRST_ADD_FORM_DURATION,
139     FIRST_UPDATE_FORM_DURATION,
140     UPDATE_FORM_REFRESH_TIMES,
141     PROXY_UPDATE_FORM,
142     INVALID_PUBLISH_FORM_TO_HOST,
143     LAUNCH_FORM_APP,
144     CONDITION_UPDATE_FORM,
145     UNBIND_FORM_APP,
146     LOAD_STAGE_FORM_CONFIG_INFO,
147     DELETE_FORM_FAILED,
148     UPDATE_FORM_FAILED,
149     RECYCLE_RECOVER_FORM_FAILED,
150     REQUEST_PUBLIC_FORM,
151     CONNECT_FORM_ABILITY_FAILED,
152     RELOAD_FORM_FAILED,
153 };
154 
155 enum class RequestFormType : int8_t {
156     REQUEST_PUBLISH_FORM = 1,
157     REQUEST_PUBLISH_FORM_WITH_SNAPSHOT,
158     OPEN_FORM_MANAGER
159 };
160 } // namespace AppExecFwk
161 } // namespace OHOS
162 #endif // OHOS_FORM_FWK_FORM_EVENT_REPORT_DEFINE_H