1 /* 2 * Copyright (c) 2021 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 FOUNDATION_APPEXECFWK_OHOS_FORM_ABILITY_INTERFACE_H 16 #define FOUNDATION_APPEXECFWK_OHOS_FORM_ABILITY_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 class FormStateCallbackInterface { 47 public: 48 /** 49 * @brief acquire form state. 50 * 51 * @param state Indicates the form state. 52 */ 53 virtual void ProcessAcquireState(FormState state) = 0; 54 }; 55 } // namespace AppExecFwk 56 } // namespace OHOS 57 #endif // FOUNDATION_APPEXECFWK_OHOS_FORM_ABILITY_INTERFACE_H 58