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 
16 #ifndef OHOS_ACE_UI_SERVICE_MANAGER_PROXY_H
17 #define OHOS_ACE_UI_SERVICE_MANAGER_PROXY_H
18 
19 #include "iremote_proxy.h"
20 #include "ui_service_mgr_interface.h"
21 
22 namespace OHOS {
23 namespace Ace {
24 /**
25  * @class UIServiceMgrProxy
26  * UIServiceMgrProxy.
27  */
28 class UIServiceMgrProxy : public IRemoteProxy<IUIServiceMgr> {
29 public:
UIServiceMgrProxy(const sptr<IRemoteObject> & impl)30     explicit UIServiceMgrProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy<IUIServiceMgr>(impl)
31     {}
32     ~UIServiceMgrProxy() override = default;
33 
34     int32_t RegisterCallBack(const AAFwk::Want& want, const sptr<IUIService>& uiService) override;
35 
36     int32_t UnregisterCallBack(const AAFwk::Want& want) override;
37 
38     int32_t Push(const AAFwk::Want& want, const std::string& name, const std::string& jsonPath,
39         const std::string& data, const std::string& extraData) override;
40 
41     int32_t Request(const AAFwk::Want& want, const std::string& name, const std::string& data) override;
42 
43     int32_t ReturnRequest(const AAFwk::Want& want, const std::string& source, const std::string& data,
44         const std::string& extraData) override;
45 private:
46     static bool WriteInterfaceToken(MessageParcel& data);
47 
48     static inline BrokerDelegator<UIServiceMgrProxy> delegator_;
49 };
50 }  // namespace Ace
51 }  // namespace OHOS
52 #endif  // OHOS_AAFWK_UI_SERVICE_MANAGER_PROXY_H
53