• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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 TELEPHONY_IMS_CALL_INTERFACE_H
17 #define TELEPHONY_IMS_CALL_INTERFACE_H
18 
19 #include "cellular_call_data_struct.h"
20 #include "ims_call_callback_interface.h"
21 #include "ims_call_types.h"
22 #include "ims_feature.h"
23 #include "iremote_broker.h"
24 
25 namespace OHOS {
26 namespace Telephony {
27 class ImsCallInterface : public IRemoteBroker {
28 public:
29     enum {
30         /****************** basic ******************/
31         IMS_DIAL = 5000,
32         IMS_HANG_UP,
33         IMS_REJECT_WITH_REASON,
34         IMS_ANSWER,
35         IMS_HOLD,
36         IMS_UN_HOLD,
37         IMS_SWITCH,
38         IMS_COMBINE_CONFERENCE,
39         IMS_INVITE_TO_CONFERENCE,
40         IMS_KICK_OUT_CONFERENCE,
41         IMS_UPDATE_CALL_MEDIA_MODE,
42         IMS_CALL_STATE_CHANGE,
43         IMS_GET_CALL_DATA,
44         IMS_GET_LAST_CALL_FAIL_REASON,
45 
46         /****************** dtmf rtt ******************/
47         IMS_START_DTMF = 5100,
48         IMS_SEND_DTMF,
49         IMS_STOP_DTMF,
50         IMS_START_RTT,
51         IMS_STOP_RTT,
52 
53         /****************** ims config ******************/
54         IMS_SET_DOMAIN_PREFERENCE_MODE = 5200,
55         IMS_GET_DOMAIN_PREFERENCE_MODE,
56         IMS_SET_SWITCH_STATUS,
57         IMS_GET_SWITCH_STATUS,
58         IMS_SET_IMS_CONFIG_STRING,
59         IMS_SET_IMS_CONFIG_INT,
60         IMS_GET_IMS_CONFIG,
61         IMS_SET_IMS_FEATURE,
62         IMS_GET_IMS_FEATURE,
63         IMS_SET_MUTE,
64         IMS_GET_MUTE,
65         IMS_SET_IMS_REG_ERROR_REPORT,
66         IMS_UPDATE_CAPABILITY,
67 
68         /****************** video settings ******************/
69         IMS_CTRL_CAMERA = 5300,
70         IMS_SET_PREVIEW_WINDOW,
71         IMS_SET_DISPLAY_WINDOW,
72         IMS_SET_CAMERA_ZOOM,
73         IMS_SET_PAUSE_IMAGE,
74         IMS_SET_DEVICE_DIRECTION,
75 
76         /****************** Supplement ******************/
77         IMS_GET_CLIP = 5400,
78         IMS_SET_CLIP,
79         IMS_SET_CLIR,
80         IMS_GET_CLIR,
81         IMS_SET_CALL_TRANSFER,
82         IMS_GET_CALL_TRANSFER,
83         IMS_SET_CALL_RESTRICTION,
84         IMS_GET_CALL_RESTRICTION,
85         IMS_SET_CALL_WAITING,
86         IMS_GET_CALL_WAITING,
87         IMS_SET_COLR,
88         IMS_GET_COLR,
89         IMS_SET_COLP,
90         IMS_GET_COLP,
91 
92         /****************** callback ******************/
93         IMS_CALL_REGISTER_CALLBACK = 5500,
94     };
95 
96     /**
97      * IMS dial interface
98      *
99      * @param ImsCallInfo
100      * @param CLIRMode
101      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
102      */
103     virtual int32_t Dial(const ImsCallInfo &callInfo, CLIRMode mode) = 0;
104 
105     /**
106      * IMS HangUp interface
107      *
108      * @param ImsCallInfo
109      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
110      */
111     virtual int32_t HangUp(const ImsCallInfo &callInfo) = 0;
112 
113     /**
114      * IMS Reject with reason interface
115      *
116      * @param ImsCallInfo
117      * @param ImsRejectReason
118      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
119      */
120     virtual int32_t RejectWithReason(const ImsCallInfo &callInfo, const ImsRejectReason &reason) = 0;
121 
122     /**
123      * IMS Answer interface
124      *
125      * @param ImsCallInfo
126      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
127      */
128     virtual int32_t Answer(const ImsCallInfo &callInfo) = 0;
129 
130     /**
131      * IMS HoldCall interface
132      *
133      * @param slotId
134      * @param callType
135      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
136      */
137     virtual int32_t HoldCall(int32_t slotId, int32_t callType) = 0;
138 
139     /**
140      * IMS UnHoldCall interface
141      *
142      * @param slotId
143      * @param callType
144      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
145      */
146     virtual int32_t UnHoldCall(int32_t slotId, int32_t callType) = 0;
147 
148     /**
149      * IMS SwitchCall interface
150      *
151      * @param slotId
152      * @param callType
153      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
154      */
155     virtual int32_t SwitchCall(int32_t slotId, int32_t callType) = 0;
156 
157     /**
158      * IMS CombineConference interface
159      *
160      * @param slotId
161      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
162      */
163     virtual int32_t CombineConference(int32_t slotId) = 0;
164 
165     /**
166      * IMS InviteToConference interface
167      *
168      * @param slotId
169      * @param numberList
170      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
171      */
172     virtual int32_t InviteToConference(int32_t slotId, const std::vector<std::string> &numberList) = 0;
173 
174     /**
175      * IMS KickOutFromConference interface
176      *
177      * @param slotId
178      * @param numberList
179      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
180      */
181     virtual int32_t KickOutFromConference(int32_t slotId, const std::vector<std::string> &numberList) = 0;
182 
183     /**
184      * IMS UpdateImsCallMode interface
185      *
186      * @param ImsCallInfo
187      * @param ImsCallMode
188      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
189      */
190     virtual int32_t UpdateImsCallMode(const ImsCallInfo &callInfo, ImsCallMode mode) = 0;
191 
192     /**
193      * Get Ims Calls Data Request
194      *
195      * @param slotId
196      * @param lastCallsDataFlag
197      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
198      */
199     virtual int32_t GetImsCallsDataRequest(int32_t slotId, int64_t lastCallsDataFlag) = 0;
200 
201     /**
202      * Get Last Call Fail Reason
203      *
204      * @param slotId
205      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
206      */
207     virtual int32_t GetLastCallFailReason(int32_t slotId) = 0;
208 
209     /**
210      * IMS StartDtmf interface
211      *
212      * @param slotId
213      * @param cDTMFCode
214      * @param index
215      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
216      */
217     virtual int32_t StartDtmf(int32_t slotId, char cDtmfCode, int32_t index) = 0;
218 
219     /**
220      * IMS SendDtmf interface
221      *
222      * @param slotId
223      * @param cDtmfCode
224      * @param index
225      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
226      */
227     virtual int32_t SendDtmf(int32_t slotId, char cDtmfCode, int32_t index) = 0;
228 
229     /**
230      * IMS StopDtmf interface
231      *
232      * @param slotId
233      * @param index
234      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
235      */
236     virtual int32_t StopDtmf(int32_t slotId, int32_t index) = 0;
237 
238     /**
239      * IMS StartRtt interface
240      *
241      * @param slotId
242      * @param msg
243      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
244      */
245     virtual int32_t StartRtt(int32_t slotId, const std::string &msg) = 0;
246 
247     /**
248      * IMS StopRtt interface
249      *
250      * @param slotId
251      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
252      */
253     virtual int32_t StopRtt(int32_t slotId) = 0;
254 
255     /**
256      * IMS SetDomainPreferenceMode interface
257      *
258      * @param slotId
259      * @param mode
260      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
261      */
262     virtual int32_t SetDomainPreferenceMode(int32_t slotId, int32_t mode) = 0;
263 
264     /**
265      * IMS GetDomainPreferenceMode interface
266      *
267      * @param slotId
268      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
269      */
270     virtual int32_t GetDomainPreferenceMode(int32_t slotId) = 0;
271 
272     /**
273      * IMS SetImsSwitchStatus interface
274      *
275      * @param slotId
276      * @param active 1: enable ims, 0: disable ims
277      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
278      */
279     virtual int32_t SetImsSwitchStatus(int32_t slotId, int32_t active) = 0;
280 
281     /**
282      * IMS GetImsSwitchStatus interface
283      *
284      * @param slotId
285      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
286      */
287     virtual int32_t GetImsSwitchStatus(int32_t slotId) = 0;
288 
289     /**
290      * IMS SetImsConfig interface
291      *
292      * @param ImsConfigItem
293      * @param value
294      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
295      */
296     virtual int32_t SetImsConfig(ImsConfigItem item, const std::string &value) = 0;
297 
298     /**
299      * IMS SetImsConfig interface
300      *
301      * @param ImsConfigItem
302      * @param value
303      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
304      */
305     virtual int32_t SetImsConfig(ImsConfigItem item, int32_t value) = 0;
306 
307     /**
308      * IMS GetImsConfig interface
309      *
310      * @param ImsConfigItem
311      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
312      */
313     virtual int32_t GetImsConfig(ImsConfigItem item) = 0;
314 
315     /**
316      * IMS SetImsFeatureValue interface
317      *
318      * @param FeatureType
319      * @param value
320      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
321      */
322     virtual int32_t SetImsFeatureValue(FeatureType type, int32_t value) = 0;
323 
324     /**
325      * IMS GetImsFeatureValue interface
326      *
327      * @param FeatureType Indicate which feature type to query.
328      * @param value Indicate the return value of the query feature type.
329      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
330      */
331     virtual int32_t GetImsFeatureValue(FeatureType type, int32_t &value) = 0;
332 
333     /**
334      * IMS SetMute interface
335      *
336      * @param mute 0: not mute, 1:mute
337      * @param slotId
338      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
339      */
340     virtual int32_t SetMute(int32_t slotId, int32_t mute) = 0;
341 
342     /**
343      * IMS GetMute interface
344      *
345      * @param slotId
346      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
347      */
348     virtual int32_t GetMute(int32_t slotId) = 0;
349 
350     /**
351      * IMS CtrlCamera interface
352      *
353      * @param cameraId
354      * @param callingUid
355      * @param callingPid
356      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
357      */
358     virtual int32_t CtrlCamera(const std::u16string &cameraId, int32_t callingUid, int32_t callingPid) = 0;
359 
360     /**
361      * IMS SetPreviewWindow interface
362      *
363      * @param x
364      * @param y
365      * @param z
366      * @param width
367      * @param height
368      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
369      */
370     virtual int32_t SetPreviewWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) = 0;
371 
372     /**
373      * IMS SetDisplayWindow interface
374      *
375      * @param x
376      * @param y
377      * @param z
378      * @param width
379      * @param height
380      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
381      */
382     virtual int32_t SetDisplayWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) = 0;
383 
384     /**
385      * IMS SetCameraZoom interface
386      *
387      * @param zoomRatio
388      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
389      */
390     virtual int32_t SetCameraZoom(float zoomRatio) = 0;
391 
392     /**
393      * IMS SetPauseImage interface
394      *
395      * @param path
396      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
397      */
398     virtual int32_t SetPauseImage(const std::u16string &path) = 0;
399 
400     /**
401      * IMS SetDeviceDirection interface
402      *
403      * @param rotation
404      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
405      */
406     virtual int32_t SetDeviceDirection(int32_t rotation) = 0;
407 
408     /**
409      * @brief SetClip IMS SetClip interface
410      *
411      * @param slotId Indicates the card slot index number,
412      * ranging from {@code 0} to the maximum card slot index number supported by the device.
413      * @param action Indicates the action for SetClip,
414      * 1, means turn on clip; 0, means turn off clip.
415      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
416      */
417     virtual int32_t SetClip(int32_t slotId, int32_t action) = 0;
418 
419     /**
420      * @brief GetClip IMS GetClip interface
421      *
422      * @param slotId Indicates the card slot index number,
423      * ranging from {@code 0} to the maximum card slot index number supported by the device.
424      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
425      */
426     virtual int32_t GetClip(int32_t slotId) = 0;
427 
428     /**
429      * @brief SetClir IMS SetClir interface
430      *
431      * @param slotId Indicates the card slot index number,
432      * ranging from {@code 0} to the maximum card slot index number supported by the device.
433      * @param action Indicates the action for SetClir,
434      * 1, means turn on clir; 0, means turn off clir.
435      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
436      */
437     virtual int32_t SetClir(int32_t slotId, int32_t action) = 0;
438 
439     /**
440      * @brief GetClir IMS GetClir interface
441      *
442      * @param slotId Indicates the card slot index number,
443      * ranging from {@code 0} to the maximum card slot index number supported by the device.
444      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
445      */
446     virtual int32_t GetClir(int32_t slotId) = 0;
447 
448     /**
449      * @brief SetCallTransfer IMS SetCallTransfer interface
450      *
451      * @param slotId Indicates the card slot index number,
452      * ranging from {@code 0} to the maximum card slot index number supported by the device.
453      * @param reason Indicates the reason of the set call transfer.
454      * @param mode Indicates the mode of the set call transfer.
455      * @param transferNum Indicates the target phone number to transfer calls to.
456      * @param classType Indicates a sum of service class for setting call transfer.
457      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
458      */
459     virtual int32_t SetCallTransfer(
460         int32_t slotId, int32_t reason, int32_t mode, const std::string &transferNum, int32_t classType) = 0;
461 
462     /**
463      * @brief GetCallTransfer IMS GetCallTransfer interface
464      *
465      * @param slotId Indicates the card slot index number,
466      * ranging from {@code 0} to the maximum card slot index number supported by the device.
467      * @param reason Indicates the reason of the get call transfer.
468      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
469      */
470     virtual int32_t GetCallTransfer(int32_t slotId, int32_t reason) = 0;
471 
472     /**
473      * @brief SetCallRestriction IMS SetCallRestriction interface
474      *
475      * @param slotId Indicates the card slot index number,
476      * ranging from {@code 0} to the maximum card slot index number supported by the device.
477      * @param fac Indicates the facility of the set call restriction.
478      * @param mode Indicates the mode of the set call restriction.
479      * @param pw Indicates password or "" if not required.
480      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
481      */
482     virtual int32_t SetCallRestriction(
483         int32_t slotId, const std::string &fac, int32_t mode, const std::string &pw) = 0;
484 
485     /**
486      * @brief GetCallRestriction IMS GetCallRestriction interface
487      *
488      * @param slotId Indicates the card slot index number,
489      * ranging from {@code 0} to the maximum card slot index number supported by the device.
490      * @param fac Indicates the facility of the get call restriction.
491      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
492      */
493     virtual int32_t GetCallRestriction(int32_t slotId, const std::string &fac) = 0;
494 
495     /**
496      * @brief SetCallWaiting IMS SetCallWaiting interface
497      *
498      * @param slotId Indicates the card slot index number,
499      * ranging from {@code 0} to the maximum card slot index number supported by the device.
500      * @param activate Indicates the action for SetCallWaiting,
501      * true, means turn on CallWaiting; false, means turn off CallWaiting.
502      * @param classType Call waiting and conditions +CCWA,
503      * the value was {@code ServiceClassType}, See 3GPP TS 22.083.
504      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
505      */
506     virtual int32_t SetCallWaiting(int32_t slotId, bool activate, int32_t classType) = 0;
507 
508     /**
509      * @brief GetCallWaiting IMS GetCallWaiting interface
510      *
511      * @param slotId Indicates the card slot index number,
512      * ranging from {@code 0} to the maximum card slot index number supported by the device.
513      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
514      */
515     virtual int32_t GetCallWaiting(int32_t slotId) = 0;
516 
517     /**
518      * @brief SetColr IMS SetColr interface
519      *
520      * @param slotId Indicates the card slot index number,
521      * ranging from {@code 0} to the maximum card slot index number supported by the device.
522      * @param presentation Indicates the action for SetColr,
523      * 1, means turn on colr; 0, means turn off colr.
524      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
525      */
526     virtual int32_t SetColr(int32_t slotId, int32_t presentation) = 0;
527 
528     /**
529      * @brief GetColr IMS GetColr interface
530      *
531      * @param slotId Indicates the card slot index number,
532      * ranging from {@code 0} to the maximum card slot index number supported by the device.
533      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
534      */
535     virtual int32_t GetColr(int32_t slotId) = 0;
536 
537     /**
538      * @brief SetColp IMS SetColp interface
539      *
540      * @param slotId Indicates the card slot index number,
541      * ranging from {@code 0} to the maximum card slot index number supported by the device.
542      * @param action Indicates the action for SetColp,
543      * 1, means turn on colp; 0, means turn off colp.
544      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
545      */
546     virtual int32_t SetColp(int32_t slotId, int32_t action) = 0;
547 
548     /**
549      * @brief GetColp IMS GetColp interface
550      *
551      * @param slotId Indicates the card slot index number,
552      * ranging from {@code 0} to the maximum card slot index number supported by the device.
553      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
554      */
555     virtual int32_t GetColp(int32_t slotId) = 0;
556 
557     /**
558      * Register CallBack
559      *
560      * @param sptr<ImsCallback>
561      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
562      */
563     virtual int32_t RegisterImsCallCallback(const sptr<ImsCallCallbackInterface> &callback) = 0;
564 
565     /**
566      * Update Ims Capabilities
567      *
568      * @param slotId Indicates the card slot index number,
569      * ranging from {@code 0} to the maximum card slot index number supported by the device.
570      * @param imsCapabilityList Indicates the related ims capability
571      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
572      */
573     virtual int32_t UpdateImsCapabilities(int32_t slotId, const ImsCapabilityList &imsCapabilityList) = 0;
574 
575 public:
576     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ImsCallInterface");
577 };
578 } // namespace Telephony
579 } // namespace OHOS
580 
581 #endif // TELEPHONY_IMS_CALL_INTERFACE_H
582