1 /* 2 * Copyright (C) 2022 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 TELEPHONY_IMS_CALL_CALLBACK_INTERFACE_H 17 #define TELEPHONY_IMS_CALL_CALLBACK_INTERFACE_H 18 19 #include "call_manager_inner_type.h" 20 #include "hril_call_parcel.h" 21 #include "ims_call_types.h" 22 #include "iremote_broker.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 class ImsCallCallbackInterface : public IRemoteBroker { 27 public: 28 virtual ~ImsCallCallbackInterface() = default; 29 30 enum { 31 /****************** call basic ******************/ 32 IMS_DIAL = 0, 33 IMS_HANG_UP, 34 IMS_REJECT, 35 IMS_ANSWER, 36 IMS_HOLD, 37 IMS_UN_HOLD, 38 IMS_SWITCH, 39 IMS_COMBINE_CONFERENCE, 40 IMS_INVITE_TO_CONFERENCE, 41 IMS_KICK_OUT_CONFERENCE, 42 IMS_UPDATE_CALL_MEDIA_MODE, 43 IMS_EMERGENCY_CALL, 44 IMS_CALL_STATE_CHANGE, 45 IMS_SERVICE_STATUS, 46 IMS_LAST_CALL_FAIL_REASON, 47 IMS_GET_CALLS_DATA, 48 IMS_SRVCC_STATE, 49 IMS_VT_OR_WFC, 50 IMS_CALL_CRING, 51 52 /****************** dtmf rtt ******************/ 53 IMS_START_DTMF, 54 IMS_SEND_DTMF, 55 IMS_STOP_DTMF, 56 IMS_START_RTT, 57 IMS_STOP_RTT, 58 59 /****************** ims config ******************/ 60 IMS_SET_PRE_MODE, 61 IMS_GET_PRE_MODE, 62 IMS_SET_SWITCH_STATUS, 63 IMS_GET_SWITCH_STATUS, 64 IMS_SET_CONFIG, 65 IMS_GET_CONFIG, 66 IMS_SET_FEATURE, 67 IMS_GET_FEATURE, 68 IMS_SET_MUTE, 69 IMS_GET_MUTE, 70 IMS_GET_EMERGENCY_CALL_LIST, 71 72 /****************** video settings ******************/ 73 IMS_CONTROL_CAMERA, 74 IMS_SET_PREVIEW_WINDOW, 75 IMS_SET_DISPLAY_WINDOW, 76 IMS_SET_CAMERA_ZOOM, 77 IMS_SET_PAUSE_IMAGE, 78 IMS_SET_DEVICE_DIRECTION, 79 80 /****************** supplement ******************/ 81 IMS_GET_CALL_CLIP, 82 IMS_SET_CALL_CLIP, 83 IMS_GET_CALL_CLIR, 84 IMS_SET_CALL_CLIR, 85 IMS_GET_CALL_FORWARD, 86 IMS_SET_CALL_FORWARD, 87 IMS_GET_CALL_RESTRICTION, 88 IMS_SET_CALL_RESTRICTION, 89 IMS_GET_CALL_WAIT, 90 IMS_SET_CALL_WAIT, 91 IMS_GET_CALL_COLR, 92 IMS_SET_CALL_COLR, 93 IMS_SET_CALL_COLP, 94 IMS_GET_CALL_COLP, 95 }; 96 97 /** 98 * @brief DialResponse the result of dial by ims. 99 * 100 * @param slotId Indicates the card slot index number, 101 * ranging from {@code 0} to the maximum card slot index number supported by the device. 102 * @param info Indicates dial action was success or failure. 103 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 104 */ 105 virtual int32_t DialResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 106 107 /** 108 * @brief HangUpResponse the result of hang up by ims. 109 * 110 * @param slotId Indicates the card slot index number, 111 * ranging from {@code 0} to the maximum card slot index number supported by the device. 112 * @param info Indicates hang up action was success or failure. 113 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 114 */ 115 virtual int32_t HangUpResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 116 117 /** 118 * @brief RejectWithReasonResponse the result of reject with reason by ims. 119 * 120 * @param slotId Indicates the card slot index number, 121 * ranging from {@code 0} to the maximum card slot index number supported by the device. 122 * @param info Indicates reject action was success or failure. 123 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 124 */ 125 virtual int32_t RejectWithReasonResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 126 127 /** 128 * @brief AnswerResponse the result of answer by ims. 129 * 130 * @param slotId Indicates the card slot index number, 131 * ranging from {@code 0} to the maximum card slot index number supported by the device. 132 * @param info Indicates answer action was success or failure. 133 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 134 */ 135 virtual int32_t AnswerResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 136 137 /** 138 * @brief HoldCallResponse the result of hold call by ims. 139 * 140 * @param slotId Indicates the card slot index number, 141 * ranging from {@code 0} to the maximum card slot index number supported by the device. 142 * @param info Indicates hold action was success or failure. 143 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 144 */ 145 virtual int32_t HoldCallResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 146 147 /** 148 * @brief UnHoldCallResponse the result of unhold call by ims. 149 * 150 * @param slotId Indicates the card slot index number, 151 * ranging from {@code 0} to the maximum card slot index number supported by the device. 152 * @param info Indicates unhold action was success or failure. 153 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 154 */ 155 virtual int32_t UnHoldCallResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 156 157 /** 158 * @brief SwitchCallResponse the result of switch call by ims. 159 * 160 * @param slotId Indicates the card slot index number, 161 * ranging from {@code 0} to the maximum card slot index number supported by the device. 162 * @param info Indicates switch action was success or failure. 163 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 164 */ 165 virtual int32_t SwitchCallResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 166 167 /** 168 * @brief StartDtmfResponse the result of start dtmf by ims. 169 * 170 * @param slotId Indicates the card slot index number, 171 * ranging from {@code 0} to the maximum card slot index number supported by the device. 172 * @param info Indicates start action was success or failure. 173 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 174 */ 175 virtual int32_t StartDtmfResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 176 /** 177 * @brief SendDtmfResponse the result of send dtmf by ims. 178 * 179 * @param slotId Indicates the card slot index number, 180 * ranging from {@code 0} to the maximum card slot index number supported by the device. 181 * @param info Indicates send action was success or failure. 182 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 183 */ 184 virtual int32_t SendDtmfResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 185 186 /** 187 * @brief StopDtmfResponse the result of stop dtmf by ims. 188 * 189 * @param slotId Indicates the card slot index number, 190 * ranging from {@code 0} to the maximum card slot index number supported by the device. 191 * @param info Indicates stop action was success or failure. 192 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 193 */ 194 virtual int32_t StopDtmfResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 195 196 /** 197 * @brief CallStateChangeReport receive call state changed notification with slotId by ims. 198 * 199 * @param slotId Indicates the card slot index number, 200 * ranging from {@code 0} to the maximum card slot index number supported by the device. 201 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 202 */ 203 virtual int32_t CallStateChangeReport(int32_t slotId) = 0; 204 205 /** 206 * @brief GetImsCallsDataResponse the result of get ims calls data by ims. 207 * 208 * @param slotId Indicates the card slot index number, 209 * ranging from {@code 0} to the maximum card slot index number supported by the device. 210 * @param info Indicates get action was success or failure. 211 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 212 */ 213 virtual int32_t GetImsCallsDataResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 214 215 /** 216 * @brief GetImsCallsDataResponse the result of get ims calls data by ims. 217 * 218 * @param slotId Indicates the card slot index number, 219 * ranging from {@code 0} to the maximum card slot index number supported by the device. 220 * @param callList Indicates the result of get ims current call list. 221 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 222 */ 223 virtual int32_t GetImsCallsDataResponse(int32_t slotId, const ImsCurrentCallList &callList) = 0; 224 225 /** 226 * @brief SetImsSwitchResponse the result of set ims switch by ims. 227 * 228 * @param slotId Indicates the card slot index number, 229 * ranging from {@code 0} to the maximum card slot index number supported by the device. 230 * @param info Indicates set action was success or failure. 231 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 232 */ 233 virtual int32_t SetImsSwitchResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 234 235 /** 236 * @brief GetImsSwitchResponse the result of get ims switch by ims. 237 * 238 * @param slotId Indicates the card slot index number, 239 * ranging from {@code 0} to the maximum card slot index number supported by the device. 240 * @param info Indicates get action was success or failure. 241 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 242 */ 243 virtual int32_t GetImsSwitchResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 244 245 /** 246 * @brief GetImsSwitchResponse the result of get ims switch by ims. 247 * 248 * @param slotId Indicates the card slot index number, 249 * ranging from {@code 0} to the maximum card slot index number supported by the device. 250 * @param active 1: ims is enabled, 0: ims is disabled. 251 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 252 */ 253 virtual int32_t GetImsSwitchResponse(int32_t slotId, int32_t active) = 0; 254 255 /** 256 * @brief CallRingBackReport receive call ring back notification by ims. 257 * 258 * @param slotId Indicates the card slot index number, 259 * ranging from {@code 0} to the maximum card slot index number supported by the device. 260 * @param info Indicates the ring back voice status the status was, 261 * ranging from {@code NETWORK_ALERTING} to {@code LOCAL_ALERTING} which define at {@code RBTPlayInfo}. 262 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 263 */ 264 virtual int32_t CallRingBackReport(int32_t slotId, const RingbackVoice &info) = 0; 265 266 /** 267 * @brief SetMuteResponse the result of set mute by ims. 268 * 269 * @param slotId Indicates the card slot index number, 270 * ranging from {@code 0} to the maximum card slot index number supported by the device. 271 * @param response Indicates the result of set action. 272 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 273 */ 274 virtual int32_t SetMuteResponse(int32_t slotId, const MuteControlResponse &response) = 0; 275 276 /** 277 * @brief LastCallFailReasonResponse the result of last call fail reason by ims. 278 * 279 * @param slotId Indicates the card slot index number, 280 * ranging from {@code 0} to the maximum card slot index number supported by the device. 281 * @param details Indicates the call fail reason and the remaind message, 282 * reason ranging from {@code UNASSIGNED_NUMBER} to {@code UNKNOWN} which define at {@code DisconnectedReason} 283 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 284 */ 285 virtual int32_t LastCallFailReasonResponse(int32_t slotId, const DisconnectedDetails &details) = 0; 286 287 /** 288 * @brief SetClipResponse the result of set the clip by IMS. 289 * 290 * @param slotId Indicates the card slot index number, 291 * ranging from {@code 0} to the maximum card slot index number supported by the device. 292 * @param info Indicates set action was success or failure. 293 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 294 */ 295 virtual int32_t SetClipResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 296 297 /** 298 * @brief GetClipResponse the result of get the clip by IMS. 299 * 300 * @param slotId Indicates the card slot index number, 301 * ranging from {@code 0} to the maximum card slot index number supported by the device. 302 * @param response Indicates the result of get action. 303 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 304 */ 305 virtual int32_t GetClipResponse(int32_t slotId, const ClipResponse &response) = 0; 306 307 /** 308 * @brief GetClirResponse the result of get the clir by IMS. 309 * 310 * @param slotId Indicates the card slot index number, 311 * ranging from {@code 0} to the maximum card slot index number supported by the device. 312 * @param response Indicates the result of get action. 313 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 314 */ 315 virtual int32_t GetClirResponse(int32_t slotId, const ClirResponse &response) = 0; 316 317 /** 318 * @brief SetClirResponse the result of set the clir by IMS. 319 * 320 * @param slotId Indicates the card slot index number, 321 * ranging from {@code 0} to the maximum card slot index number supported by the device. 322 * @param info Indicates set action was success or failure. 323 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 324 */ 325 virtual int32_t SetClirResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 326 327 /** 328 * @brief GetCallTransferResponse the result of get the call transfer by IMS. 329 * 330 * @param slotId Indicates the card slot index number, 331 * ranging from {@code 0} to the maximum card slot index number supported by the device. 332 * @param response Indicates the result of get action. 333 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 334 */ 335 virtual int32_t GetCallTransferResponse(int32_t slotId, const CallTransferResponse &response) = 0; 336 337 /** 338 * @brief SetCallTransferResponse the result of set the call transfer by IMS. 339 * 340 * @param slotId Indicates the card slot index number, 341 * ranging from {@code 0} to the maximum card slot index number supported by the device. 342 * @param info Indicates set action was success or failure. 343 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 344 */ 345 virtual int32_t SetCallTransferResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 346 347 /** 348 * @brief GetCallRestrictionResponse the result of get the call restriction by IMS. 349 * 350 * @param slotId Indicates the card slot index number, 351 * ranging from {@code 0} to the maximum card slot index number supported by the device. 352 * @param response Indicates the result of get action. 353 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 354 */ 355 virtual int32_t GetCallRestrictionResponse(int32_t slotId, const CallRestrictionResponse &response) = 0; 356 357 /** 358 * @brief SetCallRestrictionResponse the result of set the call restriction by IMS. 359 * 360 * @param slotId Indicates the card slot index number, 361 * ranging from {@code 0} to the maximum card slot index number supported by the device. 362 * @param info Indicates set action was success or failure. 363 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 364 */ 365 virtual int32_t SetCallRestrictionResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 366 367 /** 368 * @brief GetCallWaitingResponse the result of get the call waiting by IMS. 369 * 370 * @param slotId Indicates the card slot index number, 371 * ranging from {@code 0} to the maximum card slot index number supported by the device. 372 * @param response Indicates the result of get action. 373 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 374 */ 375 virtual int32_t GetCallWaitingResponse(int32_t slotId, const CallWaitResponse &response) = 0; 376 377 /** 378 * @brief SetCallWaitingResponse the result of set the call waiting by IMS. 379 * 380 * @param slotId Indicates the card slot index number, 381 * ranging from {@code 0} to the maximum card slot index number supported by the device. 382 * @param info Indicates set action was success or failure. 383 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 384 */ 385 virtual int32_t SetCallWaitingResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 386 387 /** 388 * @brief SetColrResponse the result of set the colr by IMS. 389 * 390 * @param slotId Indicates the card slot index number, 391 * ranging from {@code 0} to the maximum card slot index number supported by the device. 392 * @param info Indicates set action was success or failure. 393 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 394 */ 395 virtual int32_t SetColrResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 396 397 /** 398 * @brief GetColrResponse the result of get the colr by IMS. 399 * 400 * @param slotId Indicates the card slot index number, 401 * ranging from {@code 0} to the maximum card slot index number supported by the device. 402 * @param response Indicates the result of get action. 403 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 404 */ 405 virtual int32_t GetColrResponse(int32_t slotId, const ColrResponse &response) = 0; 406 407 /** 408 * @brief SetColpResponse the result of set the colp by IMS. 409 * 410 * @param slotId Indicates the card slot index number, 411 * ranging from {@code 0} to the maximum card slot index number supported by the device. 412 * @param info Indicates set action was success or failure. 413 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 414 */ 415 virtual int32_t SetColpResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 416 417 /** 418 * @brief GetColpResponse the result of get the colp by IMS. 419 * 420 * @param slotId Indicates the card slot index number, 421 * ranging from {@code 0} to the maximum card slot index number supported by the device. 422 * @param response Indicates the result of get action. 423 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 424 */ 425 virtual int32_t GetColpResponse(int32_t slotId, const ColpResponse &response) = 0; 426 427 public: 428 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ImsCallCallback"); 429 }; 430 } // namespace Telephony 431 } // namespace OHOS 432 433 #endif // TELEPHONY_IMS_CALL_CALLBACK_INTERFACE_H 434