• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 #ifndef OHOS_FORM_FWK_FORM_CALLBACK_INTERFACE_H
16 #define OHOS_FORM_FWK_FORM_CALLBACK_INTERFACE_H
17 
18 #include "form_js_info.h"
19 #include "form_state_info.h"
20 
21 namespace OHOS {
22 namespace AppExecFwk {
23 class FormCallbackInterface {
24 public:
25     /**
26      * @brief Update form.
27      *
28      * @param formJsInfo Indicates the obtained {@code FormJsInfo} instance.
29      */
30     virtual void ProcessFormUpdate(const FormJsInfo &formJsInfo) = 0;
31 
32     /**
33      * @brief Uninstall form.
34      *
35      * @param formId Indicates the ID of the form to uninstall.
36      */
37     virtual void ProcessFormUninstall(const int64_t formId) = 0;
38 
39     /**
40      * @brief Form service death event.
41      *
42      */
43     virtual void OnDeathReceived() = 0;
44 
45     /**
46      * @brief Return error.
47      *
48      * @param errorCode Indicates error-code of the form.
49      * @param errorMsg Indicates error-message of the form.
50      */
51     virtual void OnError(const int32_t errorCode, const std::string &errorMsg) = 0;
52 };
53 
54 class FormStateCallbackInterface {
55 public:
56 /**
57  * @brief acquire form state.
58  *
59  * @param state Indicates the form state.
60  */
61 virtual void ProcessAcquireState(FormState state) = 0;
62 };
63 
64 class ShareFormCallBack {
65 public:
66     /**
67      * @brief share form callback.
68      *
69      * @param result Indicates the result for ShareForm.
70      */
71     virtual void ProcessShareFormResponse(int32_t result) = 0;
72 };
73 }  // namespace AppExecFwk
74 }  // namespace OHOS
75 #endif  // OHOS_FORM_FWK_FORM_CALLBACK_INTERFACE_H
76