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_PROXY_H 17 #define TELEPHONY_IMS_CALL_PROXY_H 18 19 #include "ims_call_interface.h" 20 #include "ims_call_ipc_interface_code.h" 21 #include "ims_feature.h" 22 #include "iremote_proxy.h" 23 #include "telephony_log_wrapper.h" 24 25 namespace OHOS { 26 namespace Telephony { 27 class ImsCallProxy : public IRemoteProxy<ImsCallInterface> { 28 public: ImsCallProxy(const sptr<IRemoteObject> & impl)29 explicit ImsCallProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<ImsCallInterface>(impl) {} 30 ~ImsCallProxy() = default; 31 int32_t Dial(const ImsCallInfo &callInfo, CLIRMode mode) override; 32 int32_t HangUp(const ImsCallInfo &callInfo) override; 33 int32_t RejectWithReason(const ImsCallInfo &callInfo, const ImsRejectReason &reason) override; 34 int32_t Answer(const ImsCallInfo &callInfo) override; 35 int32_t HoldCall(int32_t slotId, int32_t callType) override; 36 int32_t UnHoldCall(int32_t slotId, int32_t callType) override; 37 int32_t SwitchCall(int32_t slotId, int32_t callType) override; 38 int32_t CombineConference(int32_t slotId) override; 39 int32_t InviteToConference(int32_t slotId, const std::vector<std::string> &numberList) override; 40 int32_t KickOutFromConference(int32_t slotId, int32_t index) override; 41 int32_t UpdateImsCallMode(const ImsCallInfo &callInfo, ImsCallMode mode) override; 42 int32_t GetImsCallsDataRequest(int32_t slotId, int64_t lastCallsDataFlag) override; 43 int32_t GetLastCallFailReason(int32_t slotId) override; 44 45 int32_t StartDtmf(int32_t slotId, char cDtmfCode, int32_t index) override; 46 int32_t SendDtmf(int32_t slotId, char cDtmfCode, int32_t index) override; 47 int32_t StopDtmf(int32_t slotId, int32_t index) override; 48 int32_t StartRtt(int32_t slotId, const std::string &msg) override; 49 int32_t StopRtt(int32_t slotId) override; 50 51 int32_t SetDomainPreferenceMode(int32_t slotId, int32_t mode) override; 52 int32_t GetDomainPreferenceMode(int32_t slotId) override; 53 int32_t SetImsSwitchStatus(int32_t slotId, int32_t active) override; 54 int32_t GetImsSwitchStatus(int32_t slotId) override; 55 int32_t SetImsConfig(ImsConfigItem item, const std::string &value) override; 56 int32_t SetImsConfig(ImsConfigItem item, int32_t value) override; 57 int32_t GetImsConfig(ImsConfigItem item) override; 58 int32_t SetImsFeatureValue(FeatureType type, int32_t value) override; 59 int32_t GetImsFeatureValue(FeatureType type, int32_t &value) override; 60 int32_t SetMute(int32_t slotId, int32_t mute) override; 61 int32_t GetMute(int32_t slotId) override; 62 63 int32_t CtrlCamera(const std::u16string &cameraId, int32_t callingUid, int32_t callingPid) override; 64 int32_t SetPreviewWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) override; 65 int32_t SetDisplayWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) override; 66 int32_t SetCameraZoom(float zoomRatio) override; 67 int32_t SetPauseImage(const std::u16string &path) override; 68 int32_t SetDeviceDirection(int32_t rotation) override; 69 70 int32_t SetClip(int32_t slotId, int32_t action, int32_t index) override; 71 int32_t GetClip(int32_t slotId, int32_t index) override; 72 int32_t SetClir(int32_t slotId, int32_t action, int32_t index) override; 73 int32_t GetClir(int32_t slotId, int32_t index) override; 74 int32_t SetCallTransfer(int32_t slotId, const CallTransferInfo &cfInfo, int32_t classType, int32_t index) override; 75 int32_t CanSetCallTransferTime(int32_t slotId, bool &result) override; 76 int32_t GetCallTransfer(int32_t slotId, int32_t reason, int32_t index) override; 77 int32_t SetCallRestriction( 78 int32_t slotId, const std::string &fac, int32_t mode, const std::string &pw, int32_t index) override; 79 int32_t GetCallRestriction(int32_t slotId, const std::string &fac, int32_t index) override; 80 int32_t SetCallWaiting(int32_t slotId, bool activate, int32_t classType, int32_t index) override; 81 int32_t GetCallWaiting(int32_t slotId, int32_t index) override; 82 int32_t SetColr(int32_t slotId, int32_t presentation, int32_t index) override; 83 int32_t GetColr(int32_t slotId, int32_t index) override; 84 int32_t SetColp(int32_t slotId, int32_t action, int32_t index) override; 85 int32_t GetColp(int32_t slotId, int32_t index) override; 86 87 int32_t RegisterImsCallCallback(const sptr<ImsCallCallbackInterface> &callback) override; 88 int32_t UpdateImsCapabilities(int32_t slotId, const ImsCapabilityList &imsCapabilityList) override; 89 int32_t GetUtImpuFromNetwork(int32_t slotId, std::string &impu) override; 90 91 private: 92 int32_t WriteCommonInfo(int32_t slotId, std::string funcName, MessageParcel &in); 93 int32_t WriteCommonInfo(int32_t slotId, std::string funcName, MessageParcel &in, int32_t callType); 94 int32_t SendRequest(MessageParcel &in, int32_t eventId); 95 int32_t SendRequest(int32_t slotId, MessageParcel &in, int32_t eventId); 96 97 private: 98 static inline BrokerDelegator<ImsCallProxy> delegator_; 99 }; 100 } // namespace Telephony 101 } // namespace OHOS 102 103 #endif // TELEPHONY_IMS_CALL_PROXY_H 104