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_PROXY_H
17 #define OHOS_FORM_FWK_FORM_PUBLISH_INTERCEPTOR_PROXY_H
18 
19 #include "form_publish_interceptor_interface.h"
20 #include "fms_log_wrapper.h"
21 #include "iremote_proxy.h"
22 #include "want.h"
23 
24 namespace OHOS {
25 namespace AppExecFwk {
26 using OHOS::AAFwk::Want;
27 /**
28  * @class FormPublishInterceptorProxy
29  * FormPublishInterceptorProxy is used to process the publish form request.
30  */
31 class FormPublishInterceptorProxy : public IRemoteProxy<IFormPublishInterceptor> {
32 public:
FormPublishInterceptorProxy(const sptr<IRemoteObject> & impl)33     explicit FormPublishInterceptorProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IFormPublishInterceptor>(impl)
34     {}
35 
36     virtual ~FormPublishInterceptorProxy() = default;
37 
38     /**
39      * @brief Process the publish form request when the system handler is not found.
40      * @param want Indicates the {@link Want} structure containing form info.
41      * @return Returns ERR_OK on success, others on failure.
42      */
43     int32_t ProcessPublishForm(const Want &want) override;
44 
45 private:
46     static inline BrokerDelegator<FormPublishInterceptorProxy> delegator_;
47 };
48 }  // namespace AppExecFwk
49 }  // namespace OHOS
50 #endif  // OHOS_FORM_FWK_FORM_PUBLISH_INTERCEPTOR_PROXY_H
51