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