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 CALL_MANAGER_CLIENT_H 17 #define CALL_MANAGER_CLIENT_H 18 19 #include "singleton.h" 20 #include "pac_map.h" 21 22 #include "call_manager_callback.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 class CallManagerClient : public std::enable_shared_from_this<CallManagerClient> { 27 DECLARE_DELAYED_SINGLETON(CallManagerClient) 28 public: 29 void Init(int32_t systemAbilityId); 30 void UnInit(); 31 int32_t RegisterCallBack(std::unique_ptr<CallManagerCallback> callback); 32 int32_t UnRegisterCallBack(); 33 int32_t DialCall(std::u16string number, AppExecFwk::PacMap &extras); 34 int32_t MakeCall(std::string number); 35 int32_t AnswerCall(int32_t callId, int32_t videoState); 36 int32_t RejectCall(int32_t callId, bool isSendSms, std::u16string content); 37 int32_t HangUpCall(int32_t callId); 38 int32_t GetCallState(); 39 int32_t HoldCall(int32_t callId); 40 int32_t UnHoldCall(int32_t callId); 41 int32_t SwitchCall(int32_t callId); 42 int32_t CombineConference(int32_t callId); 43 int32_t SeparateConference(int32_t callId); 44 int32_t GetMainCallId(int32_t &callId); 45 std::vector<std::u16string> GetSubCallIdList(int32_t callId); 46 std::vector<std::u16string> GetCallIdListForConference(int32_t callId); 47 int32_t GetCallWaiting(int32_t slotId); 48 int32_t SetCallWaiting(int32_t slotId, bool activate); 49 int32_t GetCallRestriction(int32_t slotId, CallRestrictionType type); 50 int32_t SetCallRestriction(int32_t slotId, CallRestrictionInfo &info); 51 int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type); 52 int32_t SetCallTransferInfo(int32_t slotId, CallTransferInfo &info); 53 int32_t SetCallPreferenceMode(int32_t slotId, int32_t mode); 54 int32_t StartDtmf(int32_t callId, char str); 55 int32_t StopDtmf(int32_t callId); 56 bool IsRinging(); 57 bool HasCall(); 58 bool IsNewCallAllowed(); 59 bool IsInEmergencyCall(); 60 bool IsEmergencyPhoneNumber(std::u16string &number, int32_t slotId, int32_t &errorCode); 61 int32_t FormatPhoneNumber(std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber); 62 int32_t FormatPhoneNumberToE164( 63 std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber); 64 int32_t SetMuted(bool isMute); 65 int32_t MuteRinger(); 66 int32_t SetAudioDevice(AudioDevice deviceType); 67 int32_t ControlCamera(std::u16string cameraId); 68 int32_t SetPreviewWindow(VideoWindow &window); 69 int32_t SetDisplayWindow(VideoWindow &window); 70 int32_t SetCameraZoom(float zoomRatio); 71 int32_t SetPausePicture(std::u16string path); 72 int32_t SetDeviceDirection(int32_t rotation); 73 int32_t GetImsConfig(int32_t slotId, ImsConfigItem item); 74 int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, std::u16string &value); 75 int32_t GetImsFeatureValue(int32_t slotId, FeatureType type); 76 int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value); 77 int32_t UpdateImsCallMode(int32_t callId, ImsCallMode mode); 78 int32_t EnableImsSwitch(int32_t slotId); 79 int32_t DisableImsSwitch(int32_t slotId); 80 int32_t IsImsSwitchEnabled(int32_t slotId); 81 int32_t EnableLteEnhanceMode(int32_t slotId); 82 int32_t DisableLteEnhanceMode(int32_t slotId); 83 int32_t IsLteEnhanceModeEnabled(int32_t slotId); 84 int32_t StartRtt(int32_t callId, std::u16string &msg); 85 int32_t StopRtt(int32_t callId); 86 int32_t JoinConference(int32_t callId, std::vector<std::u16string> &numberList); 87 int32_t ReportOttCallDetailsInfo(std::vector<OttCallDetailsInfo> &ottVec); 88 int32_t ReportOttCallEventInfo(OttCallEventInfo &eventInfo); 89 bool HasVoiceCapability(); 90 }; 91 } // namespace Telephony 92 } // namespace OHOS 93 94 #endif 95