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 CELLULAR_CALL_PROXY_H 17 #define CELLULAR_CALL_PROXY_H 18 19 #include "cellular_call_interface.h" 20 #include "iremote_proxy.h" 21 22 namespace OHOS { 23 namespace Telephony { 24 class CellularCallProxy : public IRemoteProxy<CellularCallInterface> { 25 public: 26 /** 27 * CellularCallProxy 28 * 29 * @param impl 30 */ CellularCallProxy(const sptr<IRemoteObject> & impl)31 explicit CellularCallProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<CellularCallInterface>(impl) {} 32 33 /** 34 * ~CellularCallProxy 35 * 36 */ 37 ~CellularCallProxy() = default; 38 39 /** 40 * Call management dial interface 41 * 42 * @param CellularCallInfo, dial param. 43 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 44 */ 45 int32_t Dial(const CellularCallInfo &callInfo) override; 46 47 /** 48 * HangUp. 49 * 50 * @param CellularCallInfo, HangUp param. 51 * @param CallSupplementType 52 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 53 */ 54 int32_t HangUp(const CellularCallInfo &callInfo, CallSupplementType type) override; 55 56 /** 57 * Reject. 58 * 59 * @param CellularCallInfo, Reject param. 60 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 61 */ 62 int32_t Reject(const CellularCallInfo &callInfo) override; 63 64 /** 65 * Answer. 66 * 67 * @param CellularCallInfo, Answer param. 68 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 69 */ 70 int32_t Answer(const CellularCallInfo &callInfo) override; 71 72 /** 73 * HoldCall. 74 * 75 * @param CellularCallInfo, Hold param. 76 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 77 */ 78 int32_t HoldCall(const CellularCallInfo &callInfo) override; 79 80 /** 81 * UnHoldCall. 82 * 83 * @param CellularCallInfo, UnHold param. 84 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 85 */ 86 int32_t UnHoldCall(const CellularCallInfo &callInfo) override; 87 88 /** 89 * SwitchCall. 90 * 91 * @param CellularCallInfo, SwitchCall param. 92 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 93 */ 94 int32_t SwitchCall(const CellularCallInfo &callInfo) override; 95 96 /** 97 * IsEmergencyPhoneNumber. 98 * 99 * @param phone number. 100 * @param slotId. 101 * @param enabled. 102 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 103 */ 104 int32_t IsEmergencyPhoneNumber(int32_t slotId, const std::string &phoneNum, bool &enabled) override; 105 106 /** 107 * Merge into multiple calls 108 * 109 * @param CellularCallInfo. 110 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 111 */ 112 int32_t CombineConference(const CellularCallInfo &callInfo) override; 113 114 /** 115 * SeparateConference. 116 * 117 * @param std::string splitString 118 * @param CellularCallInfo. 119 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 120 */ 121 int32_t SeparateConference(const CellularCallInfo &callInfo) override; 122 123 /** 124 * InviteToConference interface 125 * 126 * @param numberList 127 * @param slotId 128 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 129 */ 130 int32_t InviteToConference(int32_t slotId, const std::vector<std::string> &numberList) override; 131 132 /** 133 * KickOutFromConference interface 134 * 135 * @param numberList 136 * @param slotId 137 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 138 */ 139 int32_t KickOutFromConference(int32_t slotId, const std::vector<std::string> &numberList) override; 140 141 /** 142 * Hang Up All Connection. 143 * 144 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 145 */ 146 int32_t HangUpAllConnection() override; 147 148 /** 149 * Hang Up All Connection. 150 * 151 * @param slotId 152 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 153 */ 154 int32_t HangUpAllConnection(int32_t slotId) override; 155 156 /** 157 * IMS Update Call Media Mode 158 * 159 * @param CellularCallInfo 160 * @param ImsCallMode 161 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 162 */ 163 int32_t UpdateImsCallMode(const CellularCallInfo &callInfo, ImsCallMode mode) override; 164 165 /** 166 * StartDtmf. 167 * 168 * @param Dtmf Code. 169 * @param CellularCallInfo. 170 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 171 */ 172 int32_t StartDtmf(char cDtmfCode, const CellularCallInfo &callInfo) override; 173 174 /** 175 * StopDtmf. 176 * 177 * @param CellularCallInfo. 178 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 179 */ 180 int32_t StopDtmf(const CellularCallInfo &callInfo) override; 181 182 /** 183 * SendDtmf. 184 * 185 * @param Dtmf Code. 186 * @param CellularCallInfo. 187 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 188 */ 189 int32_t SendDtmf(char cDtmfCode, const CellularCallInfo &callInfo) override; 190 191 /** 192 * Start Rtt 193 * 194 * @param msg 195 * @param slotId 196 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 197 */ 198 int32_t StartRtt(int32_t slotId, const std::string &msg) override; 199 200 /** 201 * Stop Rtt 202 * 203 * @param slotId 204 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 205 */ 206 int32_t StopRtt(int32_t slotId) override; 207 208 /** 209 * Set Call Transfer 210 * 211 * @param CallTransferInfo 212 * @param slot Id 213 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 214 */ 215 int32_t SetCallTransferInfo(int32_t slotId, const CallTransferInfo &cfInfo) override; 216 217 /** 218 * Inquire Call Transfer 219 * 220 * @param CallTransferType 221 * @param slot Id 222 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 223 */ 224 int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type) override; 225 226 /** 227 * Set Call Waiting 228 * 229 * @param activate 230 * @param slot Id 231 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 232 */ 233 int32_t SetCallWaiting(int32_t slotId, bool activate) override; 234 235 /** 236 * Inquire Call Waiting 237 * 238 * @param slot Id 239 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 240 */ 241 int32_t GetCallWaiting(int32_t slotId) override; 242 243 /** 244 * Set Call Restriction 245 * 246 * @param CallRestrictionInfo 247 * @param slot Id 248 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 249 */ 250 int32_t SetCallRestriction(int32_t slotId, const CallRestrictionInfo &crInfo) override; 251 252 /** 253 * Inquire Call Restriction 254 * 255 * @param CallRestrictionType 256 * @param slot Id 257 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 258 */ 259 int32_t GetCallRestriction(int32_t slotId, CallRestrictionType facType) override; 260 261 /** 262 * RegisterCallManagerCallBack 263 * 264 * @param sptr<ICallStatusCallback> 265 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 266 */ 267 int32_t RegisterCallManagerCallBack(const sptr<ICallStatusCallback> &callback) override; 268 269 /** 270 * UnRegister CallManager CallBack 271 * 272 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 273 */ 274 int32_t UnRegisterCallManagerCallBack() override; 275 276 /** 277 * Set Domain Preference Mode 278 * 279 * @param mode 280 * @param slot Id 281 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 282 */ 283 int32_t SetDomainPreferenceMode(int32_t slotId, int32_t mode) override; 284 285 /** 286 * Get Domain Preference Mode 287 * 288 * @param slot Id 289 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 290 */ 291 int32_t GetDomainPreferenceMode(int32_t slotId) override; 292 293 /** 294 * Set Ims Switch Status 295 * 296 * @param active 297 * @param slot Id 298 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 299 */ 300 int32_t SetImsSwitchStatus(int32_t slotId, bool active) override; 301 302 /** 303 * Get Ims Switch Status 304 * 305 * @param slot Id 306 * @param enabled 307 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 308 */ 309 int32_t GetImsSwitchStatus(int32_t slotId, bool &enabled) override; 310 311 /** 312 * Set Ims Config 313 * 314 * @param ImsConfigItem 315 * @param value 316 * @param slot Id 317 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 318 */ 319 int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, const std::string &value) override; 320 321 /** 322 * Set Ims Config 323 * 324 * @param ImsConfigItem 325 * @param value 326 * @param slot Id 327 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 328 */ 329 int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, int32_t value) override; 330 331 /** 332 * Get Ims Config 333 * 334 * @param ImsConfigItem 335 * @param slot Id 336 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 337 */ 338 int32_t GetImsConfig(int32_t slotId, ImsConfigItem item) override; 339 340 /** 341 * Set Ims Feature Value 342 * 343 * @param FeatureType 344 * @param value 345 * @param slot Id 346 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 347 */ 348 int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value) override; 349 350 /** 351 * Get Ims Feature Value 352 * 353 * @param FeatureType 354 * @param slot Id 355 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 356 */ 357 int32_t GetImsFeatureValue(int32_t slotId, FeatureType type) override; 358 359 /** 360 * CtrlCamera 361 * 362 * @param cameraId 363 * @param callingUid 364 * @param callingPid 365 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 366 */ 367 int32_t CtrlCamera(const std::u16string &cameraId, int32_t callingUid, int32_t callingPid) override; 368 369 /** 370 * SetPreviewWindow 371 * 372 * @param x 373 * @param y 374 * @param z 375 * @param width 376 * @param height 377 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 378 */ 379 int32_t SetPreviewWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) override; 380 381 /** 382 * SetDisplayWindow 383 * 384 * @param x 385 * @param y 386 * @param z 387 * @param width 388 * @param height 389 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 390 */ 391 int32_t SetDisplayWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) override; 392 393 /** 394 * SetCameraZoom 395 * 396 * @param zoomRatio 397 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 398 */ 399 int32_t SetCameraZoom(float zoomRatio) override; 400 401 /** 402 * SetPauseImage 403 * 404 * @param path 405 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 406 */ 407 int32_t SetPauseImage(const std::u16string &path) override; 408 409 /** 410 * SetDeviceDirection 411 * 412 * @param rotation 413 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 414 */ 415 int32_t SetDeviceDirection(int32_t rotation) override; 416 417 /** 418 * SetMute 419 * 420 * @param mute 421 * @param slotId 422 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 423 */ 424 int32_t SetMute(int32_t mute, int32_t slotId) override; 425 426 /** 427 * GetMute 428 * 429 * @param slotId 430 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 431 */ 432 int32_t GetMute(int32_t slotId) override; 433 434 int32_t SetEmergencyCallList(int32_t slotId, std::vector<EmergencyCall> &eccVec) override; 435 436 private: 437 /** 438 * SetCommonParamForMessageParcel, set common param for MessageParcel 439 * 440 * @param slotId 441 * @param in 442 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 443 */ 444 int32_t SetCommonParamForMessageParcel(int32_t slotId, MessageParcel &in); 445 446 private: 447 static inline BrokerDelegator<CellularCallProxy> delegator_; 448 }; 449 } // namespace Telephony 450 } // namespace OHOS 451 #endif // CELLULAR_CALL_PROXY_H 452