• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 I_NET_CONN_CALLBACK_H
17 #define I_NET_CONN_CALLBACK_H
18 
19 #include "iremote_broker.h"
20 
21 #include "net_specifier.h"
22 #include "net_link_info.h"
23 #include "net_handle.h"
24 
25 namespace OHOS {
26 namespace NetManagerStandard {
27 class INetConnCallback : public IRemoteBroker {
28 public:
29     virtual ~INetConnCallback() = default;
30 public:
31     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.INetConnCallback");
32     enum {
33         NET_AVAILABLE,
34         NET_CAPABILITIES_CHANGE,
35         NET_CONNECTION_PROPERTIES_CHANGE,
36         NET_LOST,
37         NET_UNAVAILABLE,
38         NET_BLOCK_STATUS_CHANGE,
39     };
40 
41 public:
42     virtual int32_t NetAvailable(sptr<NetHandle> &netHandle) = 0;
43     virtual int32_t NetCapabilitiesChange(sptr<NetHandle> &netHandle, const sptr<NetAllCapabilities> &netAllCap) = 0;
44     virtual int32_t NetConnectionPropertiesChange(sptr<NetHandle> &netHandle, const sptr<NetLinkInfo> &info) = 0;
45     virtual int32_t NetLost(sptr<NetHandle> &netHandle) = 0;
46     virtual int32_t NetUnavailable() = 0;
47     virtual int32_t NetBlockStatusChange(sptr<NetHandle> &netHandle, bool blocked) = 0;
48 };
49 } // namespace NetManagerStandard
50 } // namespace OHOS
51 #endif // I_NET_CONN_CALLBACK_H
52