• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef MDNS_SERVICE_PROXY_H
17 #define MDNS_SERVICE_PROXY_H
18 
19 #include "iremote_proxy.h"
20 
21 #include "i_mdns_event.h"
22 
23 namespace OHOS {
24 namespace NetManagerStandard {
25 class RegistrationCallbackProxy : public IRemoteProxy<IRegistrationCallback> {
26 public:
27     explicit RegistrationCallbackProxy(const sptr<IRemoteObject> &impl);
28     virtual ~RegistrationCallbackProxy() = default;
29 
30     void HandleRegister(const MDnsServiceInfo &serviceInfo, int32_t retCode) override;
31     void HandleUnRegister(const MDnsServiceInfo &serviceInfo, int32_t retCode) override;
32     void HandleRegisterResult(const MDnsServiceInfo &serviceInfo, int32_t retCode) override;
33 
34 private:
35     static inline BrokerDelegator<RegistrationCallbackProxy> delegator_;
36 };
37 
38 class DiscoveryCallbackProxy : public IRemoteProxy<IDiscoveryCallback> {
39 public:
40     explicit DiscoveryCallbackProxy(const sptr<IRemoteObject> &impl);
41     virtual ~DiscoveryCallbackProxy() = default;
42 
43     void HandleStartDiscover(const MDnsServiceInfo &serviceInfo, int32_t retCode) override;
44     void HandleStopDiscover(const MDnsServiceInfo &serviceInfo, int32_t retCode) override;
45     void HandleServiceFound(const MDnsServiceInfo &serviceInfo, int32_t retCode) override;
46     void HandleServiceLost(const MDnsServiceInfo &serviceInfo, int32_t retCode) override;
47 
48 private:
49     static inline BrokerDelegator<DiscoveryCallbackProxy> delegator_;
50 };
51 
52 class ResolveCallbackProxy : public IRemoteProxy<IResolveCallback> {
53 public:
54     explicit ResolveCallbackProxy(const sptr<IRemoteObject> &impl);
55     virtual ~ResolveCallbackProxy() = default;
56 
57     void HandleResolveResult(const MDnsServiceInfo &serviceInfo, int32_t retCode) override;
58 
59 private:
60     static inline BrokerDelegator<ResolveCallbackProxy> delegator_;
61 };
62 } // namespace NetManagerStandard
63 } // namespace OHOS
64 
65 #endif // MDNS_SERVICE_PROXY_H