1 /* 2 * Copyright (c) 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 #ifndef OHOS_FORM_FWK_FORM_PUBLISH_INTERCEPTOR_INTERFACE_H 17 #define OHOS_FORM_FWK_FORM_PUBLISH_INTERCEPTOR_INTERFACE_H 18 19 #include "iremote_broker.h" 20 #include "want.h" 21 22 namespace OHOS { 23 namespace AppExecFwk { 24 using OHOS::AAFwk::Want; 25 26 /** 27 * @class IFormPublishInterceptor 28 * IFormPublishInterceptor interface is used to declare the interceptor for publish form 29 * when the system handler is not found. 30 */ 31 class IFormPublishInterceptor : public OHOS::IRemoteBroker { 32 public: 33 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.FormPublishInterceptor") 34 35 /** 36 * @brief Process the publish form request when the system handler is not found. 37 * @param want Indicates the {@link Want} structure containing form info. 38 * @return Returns ERR_OK on success, others on failure. 39 */ 40 virtual int32_t ProcessPublishForm(const Want &want) 41 { 42 return 0; 43 } 44 45 enum class Message { 46 // ipc id 1-1000 for kit 47 // ipc id 1001-2000 for DMS 48 // ipc id 2001-3000 for tools 49 FORM_PROCESS_PUBLISH_FORM = 3301, 50 }; 51 }; 52 } // namespace AppExecFwk 53 } // namespace OHOS 54 #endif // OHOS_FORM_FWK_FORM_PUBLISH_INTERCEPTOR_INTERFACE_H 55