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_ipc_interface_code.h"
23 #include "mdns_service_info.h"
24 
25 namespace OHOS {
26 namespace NetManagerStandard {
27 class IRegistrationCallback : public IRemoteBroker {
28 public:
29     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.IRegistrationCallback");
30     virtual void HandleRegister(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0;
31     virtual void HandleUnRegister(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0;
32     virtual void HandleRegisterResult(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0;
33 };
34 
35 class IDiscoveryCallback : public IRemoteBroker {
36 public:
37     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.IDiscoveryCallback");
38     virtual void HandleStartDiscover(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0;
39     virtual void HandleStopDiscover(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0;
40     virtual void HandleServiceFound(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0;
41     virtual void HandleServiceLost(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0;
42 };
43 
44 class IResolveCallback : public IRemoteBroker {
45 public:
46     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.IResolveCallback");
47     virtual void HandleResolveResult(const MDnsServiceInfo &serviceInfo, int32_t retCode) = 0;
48 };
49 } // namespace NetManagerStandard
50 } // namespace OHOS
51 #endif // OHOS_I_MDNS_EVENT_H