1 /* 2 * Copyright (C) 2022-2023 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_PROXY_H 17 #define TELEPHONY_IMS_CALL_CALLBACK_PROXY_H 18 19 #include "iremote_proxy.h" 20 #include "ims_call_callback_interface.h" 21 #include "ims_call_callback_ipc_interface_code.h" 22 #include "telephony_errors.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 class ImsCallCallbackProxy : public IRemoteProxy<ImsCallCallbackInterface> { 27 public: 28 explicit ImsCallCallbackProxy(const sptr<IRemoteObject> &impl); 29 virtual ~ImsCallCallbackProxy() = default; 30 31 /****************** call basic ******************/ 32 int32_t DialResponse(int32_t slotId, const RadioResponseInfo &info) override; 33 int32_t HangUpResponse(int32_t slotId, const RadioResponseInfo &info) override; 34 int32_t RejectWithReasonResponse(int32_t slotId, const RadioResponseInfo &info) override; 35 int32_t AnswerResponse(int32_t slotId, const RadioResponseInfo &info) override; 36 int32_t HoldCallResponse(int32_t slotId, const RadioResponseInfo &info) override; 37 int32_t UnHoldCallResponse(int32_t slotId, const RadioResponseInfo &info) override; 38 int32_t SwitchCallResponse(int32_t slotId, const RadioResponseInfo &info) override; 39 int32_t CallStateChangeReport(int32_t slotId) override; 40 int32_t GetImsCallsDataResponse(int32_t slotId, const RadioResponseInfo &info) override; 41 int32_t GetImsCallsDataResponse(int32_t slotId, const ImsCurrentCallList &callList) override; 42 int32_t LastCallFailReasonResponse(int32_t slotId, const DisconnectedDetails &details) override; 43 int32_t CallRingBackReport(int32_t slotId, const RingbackVoice &info) override; 44 int32_t CallNvCfgFinishedIndication(int32_t slotId) override; 45 46 /****************** dtmf rtt ******************/ 47 int32_t StartDtmfResponse(int32_t slotId, const RadioResponseInfo &info) override; 48 int32_t SendDtmfResponse(int32_t slotId, const RadioResponseInfo &info, int32_t callIndex) override; 49 int32_t StopDtmfResponse(int32_t slotId, const RadioResponseInfo &info) override; 50 51 /****************** ims config ******************/ 52 int32_t SetImsSwitchResponse(int32_t slotId, const RadioResponseInfo &info) override; 53 int32_t GetImsSwitchResponse(int32_t slotId, const RadioResponseInfo &info) override; 54 int32_t GetImsSwitchResponse(int32_t slotId, int32_t active) override; 55 int32_t SetMuteResponse(int32_t slotId, const MuteControlResponse &response) override; 56 57 /****************** supplement ******************/ 58 int32_t SetClipResponse(int32_t slotId, const SsBaseResult &resultInfo) override; 59 int32_t GetClipResponse(int32_t slotId, const GetClipResult &result) override; 60 int32_t GetClirResponse(int32_t slotId, const GetClirResult &result) override; 61 int32_t SetClirResponse(int32_t slotId, const SsBaseResult &resultInfo) override; 62 int32_t GetCallTransferResponse(int32_t slotId, const CallForwardQueryInfoList &cFQueryList) override; 63 int32_t SetCallTransferResponse(int32_t slotId, const SsBaseResult &resultInfo) override; 64 int32_t GetCallRestrictionResponse(int32_t slotId, const CallRestrictionResult &result) override; 65 int32_t SetCallRestrictionResponse(int32_t slotId, const SsBaseResult &resultInfo) override; 66 int32_t GetCallWaitingResponse(int32_t slotId, const CallWaitResult &result) override; 67 int32_t SetCallWaitingResponse(int32_t slotId, const SsBaseResult &resultInfo) override; 68 int32_t SetColrResponse(int32_t slotId, const SsBaseResult &resultInfo) override; 69 int32_t GetColrResponse(int32_t slotId, const GetColrResult &result) override; 70 int32_t SetColpResponse(int32_t slotId, const SsBaseResult &resultInfo) override; 71 int32_t GetColpResponse(int32_t slotId, const GetColpResult &result) override; 72 /****************** conference ******************/ 73 int32_t CombineConferenceResponse(int32_t slotId, const RadioResponseInfo &info) override; 74 int32_t InviteToConferenceResponse(int32_t slotId, const RadioResponseInfo &info) override; 75 /****************** call modify ******************/ 76 int32_t ReceiveUpdateCallMediaModeResponse( 77 int32_t slotId, const ImsCallModeReceiveInfo &callModeResponse) override; 78 int32_t ReceiveUpdateCallMediaModeRequest(int32_t slotId, const ImsCallModeReceiveInfo &callModeRequest) override; 79 int32_t CallSessionEventChanged(int32_t slotId, const ImsCallSessionEventInfo &callSessionEventInfo) override; 80 int32_t PeerDimensionsChanged(int32_t slotId, const ImsCallPeerDimensionsInfo &callPeerDimensionsInfo) override; 81 int32_t CallDataUsageChanged(int32_t slotId, const ImsCallDataUsageInfo &callDataUsageInfo) override; 82 int32_t CameraCapabilitiesChanged(int32_t slotId, const CameraCapabilitiesInfo &cameraCapabilitiesInfo) override; 83 84 private: 85 int32_t SendResponseInfo(int32_t eventId, MessageParcel &in); 86 int32_t WriteCommonInfo(int32_t slotId, const std::string &funcName, MessageParcel &in); 87 int32_t WriteCommonInfo( 88 int32_t slotId, const std::string &funcName, MessageParcel &in, const RadioResponseInfo &info); 89 int32_t WriteSsBaseResultCommonInfo( 90 int32_t slotId, const std::string &funcName, MessageParcel &in, const SsBaseResult &ssResult); 91 92 private: 93 static inline BrokerDelegator<ImsCallCallbackProxy> delegator_; 94 }; 95 } // namespace Telephony 96 } // namespace OHOS 97 98 #endif // TELEPHONY_IMS_CALL_CALLBACK_PROXY_H 99