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_NETWORK_SEARCH_CALLBACK_STUB_H
17 #define I_NETWORK_SEARCH_CALLBACK_STUB_H
18 
19 #include <cstdint>
20 #include "i_network_search_callback.h"
21 #include "iremote_stub.h"
22 #include "network_search_result.h"
23 
24 namespace OHOS {
25 namespace Telephony {
26 class INetworkSearchCallbackStub : public IRemoteStub<INetworkSearchCallback> {
27 public:
28     static const int32_t DEFAULT_ERROR = -1;
29     static const int32_t DEFAULT_RESULT = 0;
30     INetworkSearchCallbackStub() = default;
31     virtual ~INetworkSearchCallbackStub() = default;
32     int32_t OnNetworkSearchCallback(NetworkSearchCallback requestId, MessageParcel &data) override;
33     int OnRemoteRequest(
34         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override final;
35     virtual void OnSetNetworkModeCallback(const bool setResult, const int32_t errorCode);
36     virtual void OnGetNetworkModeCallback(const int32_t searchModel, const int32_t errorCode);
37     virtual void OnSetRadioStateCallback(const bool setResult, const int32_t errorCode);
38     virtual void OnGetRadioStateCallback(const bool setResult, const int32_t errorCode);
39     virtual void OnGetNetworkSearchInformation(
40         const sptr<NetworkSearchResult> &networkSearchResult, const int32_t errorCode);
41     virtual void OnSetPreferredNetworkCallback(const bool result, const int32_t errorCode);
42     virtual void OnGetPreferredNetworkCallback(const int32_t networkMode, const int32_t errorCode);
43     virtual void OnSetNrOptionModeCallback(const bool setResult, const int32_t errorCode);
44     virtual void OnGetNrOptionModeCallback(const int32_t mode, const int32_t errorCode);
45 
46 private:
47     void OnSetNetworkModeCallback(MessageParcel &data);
48     void OnGetNetworkModeCallback(MessageParcel &data);
49     void OnSetRadioStateCallback(MessageParcel &data);
50     void OnGetRadioStateCallback(MessageParcel &data);
51     void OnGetNetworkSearchInformation(MessageParcel &data);
52     void OnSetPreferredNetworkCallback(MessageParcel &data);
53     void OnGetPreferredNetworkCallback(MessageParcel &data);
54     void OnSetNrOptionModeCallback(MessageParcel &data);
55     void OnGetNrOptionModeCallback(MessageParcel &data);
56 };
57 } // namespace Telephony
58 } // namespace OHOS
59 #endif // I_NETWORK_SEARCH_CALLBACK_STUB_H