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_AAFWK_UI_SERVICE_MANAGER_INTERFACE_H 17 #define OHOS_AAFWK_UI_SERVICE_MANAGER_INTERFACE_H 18 19 #include <vector> 20 21 #include <ipc_types.h> 22 #include <iremote_broker.h> 23 24 #include "ui_service_interface.h" 25 26 #include "base/utils/macros.h" 27 28 namespace OHOS { 29 namespace Ace { 30 /** 31 * @class IUIServiceMgr 32 * IUIServiceMgr interface is used to access UIService manager services. 33 */ 34 class ACE_FORCE_EXPORT IUIServiceMgr : public OHOS::IRemoteBroker { 35 public: 36 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ace.UIServiceMgr") 37 38 IUIServiceMgr() = default; 39 ~IUIServiceMgr() override = default; 40 41 virtual int32_t RegisterCallBack(const AAFwk::Want& want, const sptr<IUIService>& uiService) = 0; 42 43 virtual int32_t UnregisterCallBack(const AAFwk::Want& want) = 0; 44 45 virtual int32_t Push(const AAFwk::Want& want, const std::string& name, const std::string& jsonPath, 46 const std::string& data, const std::string& extraData) = 0; 47 48 virtual int32_t Request(const AAFwk::Want& want, const std::string& name, const std::string& data) = 0; 49 50 virtual int32_t ReturnRequest(const AAFwk::Want& want, const std::string& source, const std::string& data, 51 const std::string& extraData) = 0; 52 53 enum { 54 // ipc id 1-1000 for kit 55 // ipc id for RegisterCallBack (1) 56 REGISTER_CALLBACK = 1, 57 // ipc id for UnregisterCallBack (2) 58 UNREGISTER_CALLBACK, 59 PUSH, 60 REQUEST, 61 RETURN_REQUEST, 62 }; 63 }; 64 } // namespace Ace 65 } // namespace OHOS 66 #endif // OHOS_AAFWK_UI_SERVICE_MANAGER_INTERFACE_H 67