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_IMS_H 17 #define CELLULAR_CALL_CONNECTION_IMS_H 18 19 #include "base_connection.h" 20 #include "module_service_utils.h" 21 #include "ims_call_interface.h" 22 23 namespace OHOS { 24 namespace Telephony { 25 class CellularCallConnectionIMS : public BaseConnection { 26 public: 27 /** 28 * Constructor 29 */ 30 CellularCallConnectionIMS() = default; 31 32 /** 33 * Destructor 34 */ 35 ~CellularCallConnectionIMS() = default; 36 37 /** 38 * Dial Request 39 * 40 * @param slotId 41 * @param ImsDialInfoStruct 42 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 43 */ 44 int32_t DialRequest(int32_t slotId, const ImsDialInfoStruct &dialRequest); 45 46 /** 47 * HangUp Request 48 * 49 * @param slotId 50 * @param phoneNum 51 * @param index 52 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 53 */ 54 int32_t HangUpRequest(int32_t slotId, const std::string &phoneNum, int32_t index); 55 56 /** 57 * Answer Request 58 * 59 * @param slotId 60 * @param phoneNum 61 * @param videoState 62 * @param index 63 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 64 */ 65 int32_t AnswerRequest(int32_t slotId, const std::string &phoneNum, int32_t videoState, int32_t index); 66 67 /** 68 * Reject Request 69 * 70 * @param slotId 71 * @param phoneNum 72 * @param index 73 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 74 */ 75 int32_t RejectRequest(int32_t slotId, const std::string &phoneNum, int32_t index); 76 77 /** 78 * HoldCall Request 79 * 80 * @param slotId 81 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 82 */ 83 int32_t HoldCallRequest(int32_t slotId); 84 85 /** 86 * UnHoldCall Request 87 * 88 * @param slotId 89 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 90 */ 91 int32_t UnHoldCallRequest(int32_t slotId); 92 93 /** 94 * SwitchCall Request 95 * 96 * @param slotId 97 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 98 */ 99 int32_t SwitchCallRequest(int32_t slotId); 100 101 /** 102 * CombineConference Request 103 * 104 * @param slotId 105 * @param voiceCall 106 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 107 */ 108 int32_t CombineConferenceRequest(int32_t slotId, int32_t voiceCall); 109 110 /** 111 * InviteToConference Request 112 * 113 * @param slotId 114 * @param numberList 115 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 116 */ 117 int32_t InviteToConferenceRequest(int32_t slotId, const std::vector<std::string> &numberList); 118 119 /** 120 * KickOutFromConference Request 121 * 122 * @param slotId 123 * @param index 124 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 125 */ 126 int32_t KickOutFromConferenceRequest(int32_t slotId, int32_t index); 127 128 /** 129 * CallSupplement Request 130 * 131 * @param slotId 132 * @param CallSupplementType 133 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 134 */ 135 int32_t CallSupplementRequest(int32_t slotId, CallSupplementType type); 136 137 /** 138 * UpdateImsCallMode Request 139 * 140 * @param CellularCallInfo 141 * @param ImsCallMode 142 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 143 */ 144 int32_t UpdateCallMediaModeRequest(const CellularCallInfo &callInfo, ImsCallMode mode); 145 146 /** 147 * StartRtt Request 148 * 149 * @param slotId 150 * @param msg 151 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 152 */ 153 int32_t StartRttRequest(int32_t slotId, const std::string &msg); 154 155 /** 156 * StopRtt Request 157 * 158 * @param slotId 159 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 160 */ 161 int32_t StopRttRequest(int32_t slotId); 162 163 /** 164 * GetImsCallsData Request 165 * 166 * @param slotId 167 * @param lastCallsDataFlag 168 * @return Error Code: Returns TELEPHONY_NO_ERROR on success, others on failure. 169 */ 170 int32_t GetImsCallsDataRequest(int32_t slotId, int64_t lastCallsDataFlag); 171 172 /** 173 * Send Dtmf Request 174 * 175 * @param slotId 176 * @param char cDtmfCode 177 * @param index 178 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 179 */ 180 int32_t SendDtmfRequest(int32_t slotId, char cDtmfCode, int32_t index) const; 181 182 /** 183 * Start Dtmf Request 184 * 185 * @param slotId 186 * @param char cDtmfCode 187 * @param index 188 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 189 */ 190 int32_t StartDtmfRequest(int32_t slotId, char cDtmfCode, int32_t index) const; 191 192 /** 193 * Stop Dtmf Request 194 * 195 * @param slotId 196 * @param index 197 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 198 */ 199 int32_t StopDtmfRequest(int32_t slotId, int32_t index) const; 200 201 /** 202 * Get Call Fail Reason Request 203 * 204 * @param slotId 205 * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. 206 */ 207 int32_t GetCallFailReasonRequest(int32_t slotId) const; 208 209 private: 210 virtual int32_t ProcessPostDialCallChar(int32_t slotId, char c) override; 211 212 private: 213 ModuleServiceUtils moduleUtils_; 214 }; 215 } // namespace Telephony 216 } // namespace OHOS 217 218 #endif // CELLULAR_CALL_CONNECTION_IMS_H