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 #ifndef OHOS_I_MDNS_EVENT_H 16 #define OHOS_I_MDNS_EVENT_H 17 18 #include <cstdint> 19 20 #include "iremote_broker.h" 21 22 #include "mdns_service_info.h" 23 24 namespace OHOS { 25 namespace NetManagerStandard { 26 class IRegistrationCallback : public IRemoteBroker { 27 public: 28 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.IRegistrationCallback"); 29 virtual void HandleRegister(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0; 30 virtual void HandleUnRegister(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0; 31 virtual void HandleRegisterResult(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0; 32 enum class Message { 33 REGISTERED, 34 UNREGISTERED, 35 RESULT, 36 }; 37 }; 38 39 class IDiscoveryCallback : public IRemoteBroker { 40 public: 41 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.IDiscoveryCallback"); 42 virtual void HandleStartDiscover(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0; 43 virtual void HandleStopDiscover(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0; 44 virtual void HandleServiceFound(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0; 45 virtual void HandleServiceLost(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0; 46 enum class Message { 47 STARTED, 48 STOPPED, 49 FOUND, 50 LOST, 51 }; 52 }; 53 54 class IResolveCallback : public IRemoteBroker { 55 public: 56 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.IResolveCallback"); 57 virtual void HandleResolveResult(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0; 58 enum class Message { 59 RESULT, 60 }; 61 }; 62 } // namespace NetManagerStandard 63 } // namespace OHOS 64 #endif // OHOS_I_MDNS_EVENT_H