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_ = 0;
38     std::u16string phoneNumber_ = u"";
CallStateUpdateInfoCallStateUpdateInfo39     CallStateUpdateInfo(int32_t slotId, int32_t callStateParam, std::u16string phoneNumberParam)
40         : UpdateInfo(slotId), callState_(callStateParam), phoneNumber_(phoneNumberParam) {}
41 };
42 
43 struct SignalUpdateInfo : public UpdateInfo {
44     std::vector<sptr<SignalInformation>> signalInfoList_ {};
SignalUpdateInfoSignalUpdateInfo45     SignalUpdateInfo(int32_t slotId, std::vector<sptr<SignalInformation>> infoList)
46         : UpdateInfo(slotId), signalInfoList_(infoList) {}
47 };
48 
49 struct NetworkStateUpdateInfo : public UpdateInfo {
50     sptr<NetworkState> networkState_ = nullptr;
NetworkStateUpdateInfoNetworkStateUpdateInfo51     NetworkStateUpdateInfo(int32_t slotId, sptr<NetworkState> state) : UpdateInfo(slotId), networkState_(state) {}
52 };
53 
54 struct SimStateUpdateInfo : public UpdateInfo {
55     CardType type_;
56     SimState state_;
57     LockReason reason_;
SimStateUpdateInfoSimStateUpdateInfo58     SimStateUpdateInfo(int32_t slotId, CardType type, SimState simState, LockReason theReason)
59         : UpdateInfo(slotId), type_(type), state_(simState), reason_(theReason) {}
60 };
61 
62 struct CellInfomationUpdate : public UpdateInfo {
63     std::vector<sptr<CellInformation>> cellInfoVec_ {};
CellInfomationUpdateCellInfomationUpdate64     CellInfomationUpdate(int32_t slotId, const std::vector<sptr<CellInformation>> &cellInfo)
65         : UpdateInfo(slotId), cellInfoVec_(cellInfo) {}
66 };
67 
68 struct CellularDataConnectState : public UpdateInfo {
69     int32_t dataState_ = 0;
70     int32_t networkType_ = 0;
CellularDataConnectStateCellularDataConnectState71     CellularDataConnectState(int32_t slotId, int32_t dataState, int32_t networkType)
72         : UpdateInfo(slotId), dataState_(dataState), networkType_(networkType) {}
73 };
74 
75 struct CellularDataFlowUpdate : public UpdateInfo {
76     int32_t flowType_ = 0;
CellularDataFlowUpdateCellularDataFlowUpdate77     CellularDataFlowUpdate(int32_t slotId, int32_t flowType) : UpdateInfo(slotId), flowType_(flowType) {}
78 };
79 
80 struct CfuIndicatorUpdate : public UpdateInfo {
81     bool cfuResult_ = false;
CfuIndicatorUpdateCfuIndicatorUpdate82     CfuIndicatorUpdate(int32_t slotId, bool cfuResult) : UpdateInfo(slotId), cfuResult_(cfuResult) {}
83 };
84 
85 struct VoiceMailMsgIndicatorUpdate : public UpdateInfo {
86     bool voiceMailMsgResult_ = false;
VoiceMailMsgIndicatorUpdateVoiceMailMsgIndicatorUpdate87     VoiceMailMsgIndicatorUpdate(int32_t slotId, bool voiceMailMsgResult)
88         : UpdateInfo(slotId), voiceMailMsgResult_(voiceMailMsgResult) {}
89 };
90 } // namespace Telephony
91 } // namespace OHOS
92 #endif // UPDATE_INFOS_H
93