• 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 UPDATE_INFOS_H
17 #define UPDATE_INFOS_H
18 
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 #include "cell_information.h"
24 #include "network_state.h"
25 #include "refbase.h"
26 #include "signal_information.h"
27 #include "sim_state_type.h"
28 
29 namespace OHOS {
30 namespace Telephony {
31 struct UpdateInfo {
32     int32_t slotId_ = 0;
UpdateInfoUpdateInfo33     explicit UpdateInfo(int32_t slotId) : slotId_(slotId) {}
34 };
35 
36 struct CallStateUpdateInfo : public UpdateInfo {
37     int32_t callState_;
38     std::u16string phoneNumber_;
CallStateUpdateInfoCallStateUpdateInfo39     CallStateUpdateInfo(int32_t slotId, int32_t callStateParam, std::u16string phoneNumberParam)
40         : UpdateInfo(slotId), callState_(callStateParam), phoneNumber_(phoneNumberParam)
41     {}
42 };
43 
44 struct SignalUpdateInfo : public UpdateInfo {
45     std::vector<sptr<SignalInformation>> signalInfoList_;
SignalUpdateInfoSignalUpdateInfo46     SignalUpdateInfo(int32_t slotId, std::vector<sptr<SignalInformation>> infoList)
47         : UpdateInfo(slotId), signalInfoList_(infoList)
48     {}
49 };
50 
51 struct NetworkStateUpdateInfo : public UpdateInfo {
52     sptr<NetworkState> networkState_;
NetworkStateUpdateInfoNetworkStateUpdateInfo53     NetworkStateUpdateInfo(int32_t slotId, sptr<NetworkState> state) : UpdateInfo(slotId), networkState_(state) {}
54 };
55 
56 struct SimStateUpdateInfo : public UpdateInfo {
57     CardType type_;
58     SimState state_;
59     LockReason reason_;
SimStateUpdateInfoSimStateUpdateInfo60     SimStateUpdateInfo(int32_t slotId, CardType type, SimState simState, LockReason theReason)
61         : UpdateInfo(slotId), type_(type), state_(simState), reason_(theReason)
62     {}
63 };
64 
65 struct CellInfomationUpdate : public UpdateInfo {
66     std::vector<sptr<CellInformation>> cellInfoVec_;
CellInfomationUpdateCellInfomationUpdate67     CellInfomationUpdate(int32_t slotId, const std::vector<sptr<CellInformation>> &cellInfo)
68         : UpdateInfo(slotId), cellInfoVec_(cellInfo)
69     {}
70 };
71 
72 struct CellularDataConnectState : public UpdateInfo {
73     int32_t dataState_;
74     int32_t networkType_;
CellularDataConnectStateCellularDataConnectState75     CellularDataConnectState(int32_t slotId, int32_t dataState, int32_t networkType)
76         : UpdateInfo(slotId), dataState_(dataState), networkType_(networkType)
77     {}
78 };
79 
80 struct CellularDataFlowUpdate : public UpdateInfo {
81     int32_t flowType_;
CellularDataFlowUpdateCellularDataFlowUpdate82     CellularDataFlowUpdate(int32_t slotId, int32_t flowType) : UpdateInfo(slotId), flowType_(flowType) {}
83 };
84 } // namespace Telephony
85 } // namespace OHOS
86 #endif // UPDATE_INFOS_H
87