1 /* 2 * Copyright (c) 2021-2022 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 NET_CONN_CALLBACK_PROXY_H 17 #define NET_CONN_CALLBACK_PROXY_H 18 19 #include "iremote_proxy.h" 20 21 #include "i_net_conn_callback.h" 22 23 namespace OHOS { 24 namespace NetManagerStandard { 25 class NetConnCallbackProxy : public IRemoteProxy<INetConnCallback> { 26 public: 27 explicit NetConnCallbackProxy(const sptr<IRemoteObject> &impl); 28 virtual ~NetConnCallbackProxy(); 29 30 public: 31 int32_t NetAvailable(sptr<NetHandle> &netHandle) override; 32 int32_t NetCapabilitiesChange(sptr<NetHandle> &netHandle, const sptr<NetAllCapabilities> &netAllCap) override; 33 int32_t NetConnectionPropertiesChange(sptr<NetHandle> &netHandle, const sptr<NetLinkInfo> &info) override; 34 int32_t NetLost(sptr<NetHandle> &netHandle) override; 35 int32_t NetUnavailable() override; 36 int32_t NetBlockStatusChange(sptr<NetHandle> &netHandle, bool blocked) override; 37 38 private: 39 bool WriteInterfaceToken(MessageParcel &data); 40 41 private: 42 static inline BrokerDelegator<NetConnCallbackProxy> delegator_; 43 }; 44 45 class PreAirplaneCallbackProxy : public IRemoteProxy<IPreAirplaneCallback> { 46 public: 47 explicit PreAirplaneCallbackProxy(const sptr<IRemoteObject> &impl); 48 virtual ~PreAirplaneCallbackProxy() = default; 49 50 int32_t PreAirplaneStart() override; 51 52 private: 53 bool WriteInterfaceToken(MessageParcel &data); 54 55 static inline BrokerDelegator<PreAirplaneCallbackProxy> delegator_; 56 }; 57 } // namespace NetManagerStandard 58 } // namespace OHOS 59 #endif // NET_CONN_CALLBACK_PROXY_H 60