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