1 /* 2 * Copyright (C) 2021-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 CELLULAR_CALL_REGISTER_H 17 #define CELLULAR_CALL_REGISTER_H 18 19 #include <map> 20 #include <mutex> 21 22 #include "cellular_call_connection_cs.h" 23 #include "i_call_status_callback.h" 24 #include "singleton.h" 25 #include "ims_call_interface.h" 26 27 namespace OHOS { 28 namespace Telephony { 29 class CellularCallRegister { 30 DECLARE_DELAYED_SINGLETON(CellularCallRegister); 31 32 public: 33 void ReportCallsInfo(const CallsReportInfo &callsReportInfo); 34 35 void ReportSingleCallInfo(const CallReportInfo &info, TelCallState callState); 36 37 void ReportEventResultInfo(const CellularCallEventInfo &info); 38 39 void ReportGetWaitingResult(const CallWaitResponse &response); 40 41 void ReportSetWaitingResult(int32_t result); 42 43 void ReportGetRestrictionResult(const CallRestrictionResponse &response); 44 45 void ReportSetRestrictionResult(int32_t result); 46 47 void ReportGetTransferResult(const CallTransferResponse &response); 48 49 void ReportSetBarringPasswordResult(int32_t result); 50 51 void ReportSetTransferResult(int32_t result); 52 53 void ReportGetClipResult(const ClipResponse &response); 54 55 void ReportGetClirResult(const ClirResponse &response); 56 57 void ReportSetClirResult(int32_t result); 58 59 void ReportGetImsConfigResult(const GetImsConfigResponse &response); 60 61 void ReportSetImsConfigResult(int32_t result); 62 63 void ReportGetImsFeatureResult(const GetImsFeatureValueResponse &response); 64 65 void ReportSetImsFeatureResult(int32_t result); 66 67 void ReportCallRingBackResult(int32_t status); 68 69 void ReportSetMuteResult(const MuteControlResponse &response); 70 71 void ReportGetMuteResult(const MuteControlResponse &response); 72 73 void ReportCallFailReason(const DisconnectedDetails &details); 74 75 void ReportInviteToConferenceResult(int32_t result); 76 77 void ReportUpdateCallMediaModeResult(int32_t result); 78 79 void ReportGetCallDataResult(int32_t result); 80 81 void ReportStartDtmfResult(int32_t result); 82 83 void ReportStopDtmfResult(int32_t result); 84 85 void ReportStartRttResult(int32_t result); 86 87 void ReportStopRttResult(int32_t result); 88 89 void ReportSendUssdResult(int32_t result); 90 91 void ReportCloseUnFinishedUssdResult(int32_t result); 92 93 int32_t RegisterCallManagerCallBack(const sptr<ICallStatusCallback> &callback); 94 95 int32_t UnRegisterCallManagerCallBack(); 96 97 void ReportMmiCodeResult(const MmiCodeInfo &info); 98 99 void ReportSetEmergencyCallListResponse(const SetEccListResponse &response); 100 101 bool IsCallManagerCallBackRegistered(); 102 103 void ReportPostDialChar(char c); 104 105 void ReportPostDialDelay(std::string str); 106 107 private: 108 sptr<ICallStatusCallback> callManagerCallBack_; 109 std::mutex mutex_; 110 }; 111 } // namespace Telephony 112 } // namespace OHOS 113 114 #endif // CELLULAR_CALL_REGISTER_H 115