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 CELLULAR_CALL_CONNECTION_CS_H 17 #define CELLULAR_CALL_CONNECTION_CS_H 18 19 #include "tel_ril_call_parcel.h" 20 #include "base_connection.h" 21 22 namespace OHOS { 23 namespace Telephony { 24 class CellularCallConnectionCS : public BaseConnection { 25 public: 26 /** 27 * Constructor 28 */ 29 CellularCallConnectionCS() = default; 30 31 /** 32 * Destructor 33 */ 34 ~CellularCallConnectionCS() = default; 35 36 /** 37 * DialRequest 38 * 39 * @param slotId 40 * @param DialRequestStruct 41 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 42 */ 43 int32_t DialRequest(int32_t slotId, const DialRequestStruct &dialRequest); 44 45 /** 46 * HangUpRequest 47 * 48 * @param slotId 49 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 50 */ 51 int32_t HangUpRequest(int32_t slotId); 52 53 /** 54 * AnswerRequest 55 * 56 * @param slotId 57 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 58 */ 59 int32_t AnswerRequest(int32_t slotId); 60 61 /** 62 * RejectRequest 63 * 64 * @param slotId 65 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 66 */ 67 int32_t RejectRequest(int32_t slotId); 68 69 /** 70 * SwitchCallRequest 71 * 72 * @param slotId 73 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 74 */ 75 int32_t SwitchCallRequest(int32_t slotId); 76 77 /** 78 * HoldRequest 79 * 80 * @param slotId 81 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 82 */ 83 int32_t HoldRequest(int32_t slotId); 84 85 /** 86 * UnHoldCallRequest 87 * 88 * @param slotId 89 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 90 */ 91 int32_t UnHoldCallRequest(int32_t slotId); 92 93 /** 94 * CombineConferenceRequest 95 * 96 * @param slotId 97 * @param voiceCall 98 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 99 */ 100 int32_t CombineConferenceRequest(int32_t slotId, int32_t voiceCall); 101 102 /** 103 * SeparateConferenceRequest 104 * 105 * @param slotId 106 * @param index 107 * @param voiceCall 108 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 109 */ 110 int32_t SeparateConferenceRequest(int32_t slotId, int32_t index, int32_t voiceCall); 111 112 /** 113 * CallSupplement Request 114 * 115 * 22083-400_2001 2 Call hold 116 * 3GPP TS 22.030 [3] 117 * 118 * @param slotId 119 * @param CallSupplementType 120 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 121 */ 122 int32_t CallSupplementRequest(int32_t slotId, CallSupplementType type); 123 124 /** 125 * CSControl GetCsCallsDataRequest 126 * 127 * 27007-430_2001 7.18 List current calls +CLCC 128 * 3GPP TS 22.030 [19] 129 * 130 * Returns list of current calls of ME. 131 * 132 * @param slotId 133 * @param lastCallsDataFlag 134 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 135 */ 136 int32_t GetCsCallsDataRequest(int32_t slotId, int64_t lastCallsDataFlag); 137 138 /** 139 * SendCDMAThreeWayDialRequest 140 * 141 * @param slotId 142 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 143 */ 144 int32_t SendCDMAThreeWayDialRequest(int32_t slotId); 145 146 /** 147 * SendDtmfRequest 148 * 149 * @param slotId 150 * @param char cDtmfCode 151 * @param index 152 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 153 */ 154 int32_t SendDtmfRequest(int32_t slotId, char cDtmfCode, int32_t index) const; 155 156 /** 157 * StartDtmfRequest 158 * 159 * @param slotId 160 * @param char cDtmfCode 161 * @param index 162 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 163 */ 164 int32_t StartDtmfRequest(int32_t slotId, char cDtmfCode, int32_t index) const; 165 166 /** 167 * StopDtmfRequest 168 * 169 * @param slotId 170 * @param index 171 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 172 */ 173 int32_t StopDtmfRequest(int32_t slotId, int32_t index) const; 174 175 /** 176 * GetCallFailReasonRequest 177 * 178 * @param slotId 179 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 180 */ 181 int32_t GetCallFailReasonRequest(int32_t slotId) const; 182 183 /** 184 * RegisterHandler 185 */ 186 void RegisterHandler(); 187 188 private: 189 virtual int32_t ProcessPostDialCallChar(int32_t slotId, char c) override; 190 }; 191 } // namespace Telephony 192 } // namespace OHOS 193 194 #endif // CELLULAR_CALL_CONNECTION_CS_H