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 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 AnswerCall(int32_t callId, int32_t videoState); 35 int32_t RejectCall(int32_t callId, bool isSendSms, std::u16string content); 36 int32_t HangUpCall(int32_t callId); 37 int32_t GetCallState(); 38 int32_t HoldCall(int32_t callId); 39 int32_t UnHoldCall(int32_t callId); 40 int32_t SwitchCall(int32_t callId); 41 int32_t CombineConference(int32_t callId); 42 int32_t SeparateConference(int32_t callId); 43 int32_t GetMainCallId(int32_t &callId, int32_t &mainCallId); 44 int32_t GetSubCallIdList(int32_t callId, std::vector<std::u16string> &callIdList); 45 int32_t GetCallIdListForConference(int32_t callId, std::vector<std::u16string> &callIdList); 46 int32_t GetCallWaiting(int32_t slotId); 47 int32_t SetCallWaiting(int32_t slotId, bool activate); 48 int32_t GetCallRestriction(int32_t slotId, CallRestrictionType type); 49 int32_t SetCallRestriction(int32_t slotId, CallRestrictionInfo &info); 50 int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type); 51 int32_t SetCallTransferInfo(int32_t slotId, CallTransferInfo &info); 52 int32_t SetCallPreferenceMode(int32_t slotId, int32_t mode); 53 int32_t StartDtmf(int32_t callId, char str); 54 int32_t StopDtmf(int32_t callId); 55 int32_t IsRinging(bool &enabled); 56 bool HasCall(); 57 int32_t IsNewCallAllowed(bool &enabled); 58 int32_t IsInEmergencyCall(bool &enabled); 59 int32_t IsEmergencyPhoneNumber(std::u16string &number, int32_t slotId, bool &enabled); 60 int32_t FormatPhoneNumber(std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber); 61 int32_t FormatPhoneNumberToE164( 62 std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber); 63 int32_t SetMuted(bool isMute); 64 int32_t MuteRinger(); 65 int32_t SetAudioDevice(AudioDevice deviceType, const std::string &bluetoothAddress); 66 int32_t ControlCamera(std::u16string cameraId); 67 int32_t SetPreviewWindow(VideoWindow &window); 68 int32_t SetDisplayWindow(VideoWindow &window); 69 int32_t SetCameraZoom(float zoomRatio); 70 int32_t SetPausePicture(std::u16string path); 71 int32_t SetDeviceDirection(int32_t rotation); 72 int32_t GetImsConfig(int32_t slotId, ImsConfigItem item); 73 int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, std::u16string &value); 74 int32_t GetImsFeatureValue(int32_t slotId, FeatureType type); 75 int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value); 76 int32_t UpdateImsCallMode(int32_t callId, ImsCallMode mode); 77 int32_t EnableImsSwitch(int32_t slotId); 78 int32_t DisableImsSwitch(int32_t slotId); 79 int32_t IsImsSwitchEnabled(int32_t slotId, bool &enabled); 80 int32_t StartRtt(int32_t callId, std::u16string &msg); 81 int32_t StopRtt(int32_t callId); 82 int32_t JoinConference(int32_t callId, std::vector<std::u16string> &numberList); 83 int32_t ReportOttCallDetailsInfo(std::vector<OttCallDetailsInfo> &ottVec); 84 int32_t ReportOttCallEventInfo(OttCallEventInfo &eventInfo); 85 bool HasVoiceCapability(); 86 }; 87 } // namespace Telephony 88 } // namespace OHOS 89 90 #endif 91