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 #ifndef HDI_ISERVICE_MANAGER_INF_H 16 #define HDI_ISERVICE_MANAGER_INF_H 17 18 #include <vector> 19 #include <hdi_base.h> 20 #include <iremote_broker.h> 21 #include <refbase.h> 22 23 #include "iservstat_listener_hdi.h" 24 25 namespace OHOS { 26 namespace HDI { 27 namespace ServiceManager { 28 namespace V1_0 { 29 struct HdiServiceInfo { 30 std::string serviceName; 31 uint16_t devClass; 32 uint32_t devId; 33 }; 34 35 class IServiceManager : public HdiBase { 36 public: 37 DECLARE_HDI_DESCRIPTOR(u"HDI.IServiceManager.V1_0"); 38 static ::OHOS::sptr<IServiceManager> Get(); 39 virtual ::OHOS::sptr<IRemoteObject> GetService(const char *serviceName) = 0; 40 virtual int32_t ListAllService(std::vector<HdiServiceInfo> &serviceInfos) = 0; 41 virtual int32_t RegisterServiceStatusListener(::OHOS::sptr<IServStatListener> listener, uint16_t deviceClass) = 0; 42 virtual int32_t UnregisterServiceStatusListener(::OHOS::sptr<IServStatListener> listener) = 0; 43 }; 44 } // namespace V1_0 45 } // namespace ServiceManager 46 } // namespace HDI 47 } // namespace OHOS 48 49 #endif /* HDI_ISERVICE_MANAGER_INF_H */