1 /*
2  * Copyright (c) 2021-2024 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 INTERFACES_INNERKITS_BUS_CENTER_CLIENT_PROXY_STANDARD_H_
17 #define INTERFACES_INNERKITS_BUS_CENTER_CLIENT_PROXY_STANDARD_H_
18 
19 #include "if_softbus_client.h"
20 
21 namespace OHOS {
22 class BusCenterClientProxy : public IRemoteProxy<ISoftBusClient> {
23 public:
BusCenterClientProxy(const sptr<IRemoteObject> & impl)24     explicit BusCenterClientProxy(const sptr<IRemoteObject> &impl)
25         : IRemoteProxy<ISoftBusClient>(impl) {}
26     virtual ~BusCenterClientProxy() = default;
27 
28     int32_t OnChannelOpened(const char *sessionName, const ChannelInfo *channel) override;
29     int32_t OnChannelOpenFailed(int32_t channelId, int32_t channelType, int32_t errCode) override;
30     int32_t OnChannelLinkDown(const char *NetworkId, int32_t routeType) override;
31     int32_t OnChannelClosed(int32_t channelId, int32_t channelType, int32_t messageType) override;
32     int32_t OnChannelMsgReceived(int32_t channelId, int32_t channelType, const void *data,
33         uint32_t len, int32_t type) override;
34     virtual int32_t OnChannelQosEvent(int32_t channelId, int32_t channelType, int32_t eventId, int32_t tvCount,
35         const QosTv *tvList) override;
36 
37     int32_t OnJoinLNNResult(void *addr, uint32_t addrTypeLen, const char *networkId, int retCode) override;
38     int32_t OnJoinMetaNodeResult(void *addr, uint32_t addrTypeLen, void *metaInfo, uint32_t infoLen,
39         int retCode) override;
40     int32_t OnLeaveLNNResult(const char *networkId, int retCode) override;
41     int32_t OnLeaveMetaNodeResult(const char *networkId, int retCode) override;
42     int32_t OnNodeOnlineStateChanged(const char *pkgName, bool isOnline, void *info, uint32_t infoTypeLen) override;
43     int32_t OnNodeBasicInfoChanged(const char *pkgName, void *info, uint32_t infoTypeLen, int32_t type) override;
44     int32_t OnNodeStatusChanged(const char *pkgName, void *info, uint32_t infoTypeLen, int32_t type) override;
45     int32_t OnLocalNetworkIdChanged(const char *pkgName) override;
46     int32_t OnNodeDeviceNotTrusted(const char *pkgName, const char *msg) override;
47     int32_t OnHichainProofException(const char *pkgName, const char *proofInfo, uint32_t proofLen,
48         uint16_t deviceTypeId, int32_t errCode) override;
49     int32_t OnTimeSyncResult(const void *info, uint32_t infoTypeLen, int32_t retCode) override;
50     void OnPublishLNNResult(int32_t publishId, int32_t reason) override;
51     void OnRefreshLNNResult(int32_t refreshId, int32_t reason) override;
52     void OnRefreshDeviceFound(const void *device, uint32_t deviceLen) override;
53     void OnDataLevelChanged(const char *networkId, const DataLevelInfo *dataLevelInfo) override;
54 
55 private:
56     static inline BrokerDelegator<BusCenterClientProxy> delegator_;
57 };
58 } // namespace OHOS
59 
60 #endif // !defined(INTERFACES_INNERKITS_BUS_CENTER_CLIENT_PROXY_STANDARD_H_)
61