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 I_CALL_MANAGER_SERVICE_H 17 #define I_CALL_MANAGER_SERVICE_H 18 19 #include <cstdio> 20 #include <string> 21 #include <vector> 22 23 #include "iremote_broker.h" 24 #include "pac_map.h" 25 26 #include "call_manager_inner_type.h" 27 #include "i_call_ability_callback.h" 28 29 namespace OHOS { 30 namespace Telephony { 31 extern "C" { 32 enum CallManagerSurfaceCode { 33 INTERFACE_REGISTER_CALLBACK = 0, 34 INTERFACE_UNREGISTER_CALLBACK, 35 INTERFACE_DIAL_CALL, 36 INTERFACE_ANSWER_CALL, 37 INTERFACE_REJECT_CALL, 38 INTERFACE_HOLD_CALL, 39 INTERFACE_UNHOLD_CALL, 40 INTERFACE_DISCONNECT_CALL, 41 INTERFACE_GET_CALL_STATE, 42 INTERFACE_SWAP_CALL, 43 INTERFACE_HAS_CALL, 44 INTERFACE_IS_NEW_CALL_ALLOWED, 45 INTERFACE_IS_RINGING, 46 INTERFACE_IS_EMERGENCY_CALL, 47 INTERFACE_IS_EMERGENCY_NUMBER, 48 INTERFACE_IS_FORMAT_NUMBER, 49 INTERFACE_IS_FORMAT_NUMBER_E164, 50 INTERFACE_COMBINE_CONFERENCE, 51 INTERFACE_SEPARATE_CONFERENCE, 52 INTERFACE_START_DTMF, 53 INTERFACE_STOP_DTMF, 54 INTERFACE_GET_CALL_WAITING, 55 INTERFACE_SET_CALL_WAITING, 56 INTERFACE_GET_CALL_RESTRICTION, 57 INTERFACE_SET_CALL_RESTRICTION, 58 INTERFACE_GET_CALL_TRANSFER, 59 INTERFACE_SET_CALL_TRANSFER, 60 INTERFACE_GET_MAINID, 61 INTERFACE_GET_SUBCALL_LIST_ID, 62 INTERFACE_GET_CALL_LIST_ID_FOR_CONFERENCE, 63 INTERFACE_SET_MUTE, 64 INTERFACE_MUTE_RINGER, 65 INTERFACE_SET_AUDIO_DEVICE, 66 INTERFACE_CTRL_CAMERA, 67 INTERFACE_SET_PREVIEW_WINDOW, 68 INTERFACE_SET_DISPLAY_WINDOW, 69 INTERFACE_SET_CAMERA_ZOOM, 70 INTERFACE_SET_PAUSE_IMAGE, 71 INTERFACE_SET_DEVICE_DIRECTION, 72 INTERFACE_SETCALL_PREFERENCEMODE, 73 INTERFACE_GET_IMS_CONFIG, 74 INTERFACE_SET_IMS_CONFIG, 75 INTERFACE_GET_IMS_FEATURE_VALUE, 76 INTERFACE_SET_IMS_FEATURE_VALUE, 77 INTERFACE_UPDATE_CALL_MEDIA_MODE, 78 INTERFACE_ENABLE_VOLTE, 79 INTERFACE_DISABLE_VOLTE, 80 INTERFACE_IS_VOLTE_ENABLED, 81 INTERFACE_ENABLE_LTE_ENHANCE_MODE, 82 INTERFACE_DISABLE_LTE_ENHANCE_MODE, 83 INTERFACE_IS_LTE_ENHANCE_MODE_ENABLED, 84 INTERFACE_START_RTT, 85 INTERFACE_STOP_RTT, 86 INTERFACE_JOIN_CONFERENCE, 87 INTERFACE_REPORT_OTT_CALL_DETAIL_INFO, 88 INTERFACE_REPORT_OTT_CALL_EVENT_INFO, 89 INTERFACE_GET_PROXY_OBJECT_PTR, 90 }; 91 92 enum CallManagerProxyType { 93 PROXY_BLUETOOTH_CALL = 0, 94 }; 95 } // end extern 96 97 class ICallManagerService : public IRemoteBroker { 98 public: 99 virtual ~ICallManagerService() = default; 100 virtual int32_t RegisterCallBack(const sptr<ICallAbilityCallback> &callback) = 0; 101 virtual int32_t UnRegisterCallBack() = 0; 102 virtual int32_t DialCall(std::u16string number, AppExecFwk::PacMap &extras) = 0; 103 virtual int32_t AnswerCall(int32_t callId, int32_t videoState) = 0; 104 virtual int32_t RejectCall(int32_t callId, bool rejectWithMessage, std::u16string textMessage) = 0; 105 virtual int32_t HangUpCall(int32_t callId) = 0; 106 virtual int32_t GetCallState() = 0; 107 virtual int32_t HoldCall(int32_t callId) = 0; 108 virtual int32_t UnHoldCall(int32_t callId) = 0; 109 virtual int32_t SwitchCall(int32_t callId) = 0; 110 virtual bool HasCall() = 0; 111 virtual bool IsNewCallAllowed() = 0; 112 virtual int32_t SetMuted(bool isMute) = 0; 113 virtual int32_t MuteRinger() = 0; 114 virtual int32_t SetAudioDevice(AudioDevice deviceType) = 0; 115 virtual bool IsRinging() = 0; 116 virtual bool IsInEmergencyCall() = 0; 117 virtual int32_t StartDtmf(int32_t callId, char str) = 0; 118 virtual int32_t StopDtmf(int32_t callId) = 0; 119 virtual int32_t GetCallWaiting(int32_t slotId) = 0; 120 virtual int32_t SetCallWaiting(int32_t slotId, bool activate) = 0; 121 virtual int32_t GetCallRestriction(int32_t slotId, CallRestrictionType type) = 0; 122 virtual int32_t SetCallRestriction(int32_t slotId, CallRestrictionInfo &info) = 0; 123 virtual int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type) = 0; 124 virtual int32_t SetCallTransferInfo(int32_t slotId, CallTransferInfo &info) = 0; 125 virtual int32_t CombineConference(int32_t mainCallId) = 0; 126 virtual int32_t SeparateConference(int32_t callId) = 0; 127 virtual bool IsEmergencyPhoneNumber(std::u16string &number, int32_t slotId, int32_t &errorCode) = 0; 128 virtual int32_t FormatPhoneNumber( 129 std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber) = 0; 130 virtual int32_t FormatPhoneNumberToE164( 131 std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber) = 0; 132 virtual int32_t GetMainCallId(int32_t callId) = 0; 133 virtual std::vector<std::u16string> GetSubCallIdList(int32_t callId) = 0; 134 virtual std::vector<std::u16string> GetCallIdListForConference(int32_t callId) = 0; 135 virtual int32_t ControlCamera(std::u16string cameraId) = 0; 136 virtual int32_t SetPreviewWindow(VideoWindow &window) = 0; 137 virtual int32_t SetDisplayWindow(VideoWindow &window) = 0; 138 virtual int32_t SetCameraZoom(float zoomRatio) = 0; 139 virtual int32_t SetPausePicture(std::u16string path) = 0; 140 virtual int32_t SetDeviceDirection(int32_t rotation) = 0; 141 virtual int32_t SetCallPreferenceMode(int32_t slotId, int32_t mode) = 0; 142 virtual int32_t GetImsConfig(int32_t slotId, ImsConfigItem item) = 0; 143 virtual int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, std::u16string &value) = 0; 144 virtual int32_t GetImsFeatureValue(int32_t slotId, FeatureType type) = 0; 145 virtual int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value) = 0; 146 virtual int32_t UpdateImsCallMode(int32_t callId, ImsCallMode mode) = 0; 147 virtual int32_t EnableImsSwitch(int32_t slotId) = 0; 148 virtual int32_t DisableImsSwitch(int32_t slotId) = 0; 149 virtual int32_t IsImsSwitchEnabled(int32_t slotId) = 0; 150 virtual int32_t EnableLteEnhanceMode(int32_t slotId) = 0; 151 virtual int32_t DisableLteEnhanceMode(int32_t slotId) = 0; 152 virtual int32_t IsLteEnhanceModeEnabled(int32_t slotId) = 0; 153 virtual int32_t StartRtt(int32_t callId, std::u16string &msg) = 0; 154 virtual int32_t StopRtt(int32_t callId) = 0; 155 virtual int32_t JoinConference(int32_t callId, std::vector<std::u16string> &numberList) = 0; 156 virtual int32_t ReportOttCallDetailsInfo(std::vector<OttCallDetailsInfo> &ottVec) = 0; 157 virtual int32_t ReportOttCallEventInfo(OttCallEventInfo &eventInfo) = 0; 158 virtual sptr<IRemoteObject> GetProxyObjectPtr(CallManagerProxyType proxyType) = 0; 159 160 public: 161 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ICallManagerService"); 162 }; 163 } // namespace Telephony 164 } // namespace OHOS 165 166 #endif // I_CALL_MANAGER_SERVICE_H 167