• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_INTERFACE_H
17 #define CELLULAR_CALL_INTERFACE_H
18 #include "telephony_types.h"
19 
20 #include "i_call_status_callback.h"
21 
22 namespace OHOS {
23 namespace Telephony {
24 class CellularCallInterface : public IRemoteBroker {
25 public:
26     // operation type
27     enum class OperationType : uint32_t {
28         /****************** basic ******************/
29         DIAL = 1,
30         HANG_UP,
31         REJECT,
32         ANSWER,
33         HOLD_CALL,
34         UN_HOLD_CALL,
35         SWITCH_CALL,
36         EMERGENCY_CALL,
37         SET_EMERGENCY_CALL_LIST,
38         COMBINE_CONFERENCE,
39         SEPARATE_CONFERENCE,
40         INVITE_TO_CONFERENCE,
41         KICK_OUT_CONFERENCE,
42         HANG_UP_ALL_CONNECTION,
43         UPDATE_CALL_MEDIA_MODE,
44         REGISTER_CALLBACK,
45         UNREGISTER_CALLBACK,
46 
47         /****************** dtmf rtt ******************/
48         START_DTMF = 100,
49         STOP_DTMF,
50         SEND_DTMF,
51         START_RTT,
52         STOP_RTT,
53 
54         /****************** supplement ******************/
55         SET_CALL_TRANSFER = 200,
56         GET_CALL_TRANSFER,
57         SET_CALL_WAITING,
58         GET_CALL_WAITING,
59         SET_CALL_RESTRICTION,
60         GET_CALL_RESTRICTION,
61 
62         /****************** config ******************/
63         SET_DOMAIN_PREFERENCE_MODE = 300,
64         GET_DOMAIN_PREFERENCE_MODE,
65         SET_IMS_SWITCH_STATUS,
66         GET_IMS_SWITCH_STATUS,
67         SET_IMS_CONFIG_STRING,
68         SET_IMS_CONFIG_INT,
69         GET_IMS_CONFIG,
70         SET_IMS_FEATURE,
71         GET_IMS_FEATURE,
72         SET_MUTE,
73         GET_MUTE,
74 
75         /****************** video settings ******************/
76         CTRL_CAMERA = 400,
77         SET_PREVIEW_WINDOW,
78         SET_DISPLAY_WINDOW,
79         SET_CAMERA_ZOOM,
80         SET_PAUSE_IMAGE,
81         SET_DEVICE_DIRECTION,
82     };
83 
84     /**
85      * Call management dial interface
86      *
87      * @param CellularCallInfo, dial param.
88      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
89      */
90     virtual int32_t Dial(const CellularCallInfo &callInfo) = 0;
91 
92     /**
93      * HangUp.
94      *
95      * @param CellularCallInfo, HangUp param.
96      * @param CallSupplementType
97      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
98      */
99     virtual int32_t HangUp(const CellularCallInfo &callInfo, CallSupplementType type) = 0;
100 
101     /**
102      * Answer.
103      *
104      * @param CellularCallInfo, Answer param.
105      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
106      */
107     virtual int32_t Answer(const CellularCallInfo &callInfo) = 0;
108 
109     /**
110      * Reject.
111      *
112      * @param CellularCallInfo, Reject param.
113      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
114      */
115     virtual int32_t Reject(const CellularCallInfo &callInfo) = 0;
116 
117     /**
118      * HoldCall.
119      *
120      * @param CellularCallInfo, Hold param.
121      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
122      */
123     virtual int32_t HoldCall(const CellularCallInfo &callInfo) = 0;
124 
125     /**
126      * UnHoldCall.
127      *
128      * @param CellularCallInfo, UnHold param.
129      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
130      */
131     virtual int32_t UnHoldCall(const CellularCallInfo &callInfo) = 0;
132 
133     /**
134      * SwitchCall.
135      *
136      * @param CellularCallInfo, SwitchCall param.
137      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
138      */
139     virtual int32_t SwitchCall(const CellularCallInfo &callInfo) = 0;
140 
141     /**
142      * IsEmergencyPhoneNumber.
143      *
144      * @param slotId.
145      * @param phone number.
146      * @param enabled
147      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
148      */
149     virtual int32_t IsEmergencyPhoneNumber(int32_t slotId, const std::string &phoneNum, bool &enabled) = 0;
150 
151     /**
152      * Merge into multiple calls
153      *
154      * @param CellularCallInfo, SwitchCall param.
155      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
156      */
157     virtual int32_t CombineConference(const CellularCallInfo &callInfo) = 0;
158 
159     /**
160      * Separate Conference.
161      *
162      * @param CellularCallInfo, SwitchCall param.
163      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
164      */
165     virtual int32_t SeparateConference(const CellularCallInfo &callInfo) = 0;
166 
167     /**
168      * InviteToConference interface
169      *
170      * @param numberList
171      * @param slotId
172      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
173      */
174     virtual int32_t InviteToConference(int32_t slotId, const std::vector<std::string> &numberList) = 0;
175 
176     /**
177      * KickOutFromConference interface
178      *
179      * @param numberList
180      * @param slotId
181      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
182      */
183     virtual int32_t KickOutFromConference(int32_t slotId, const std::vector<std::string> &numberList) = 0;
184 
185     /**
186      * Hang Up All Connection.
187      *
188      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
189      */
190     virtual int32_t HangUpAllConnection() = 0;
191 
192     /**
193      * Hang Up All Connection.
194      *
195      *@param slotId
196      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
197      */
198     virtual int32_t HangUpAllConnection(int32_t slotId) = 0;
199 
200     /**
201      * IMS Update Call Media Mode
202      *
203      * @param CellularCallInfo
204      * @param ImsCallMode
205      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
206      */
207     virtual int32_t UpdateImsCallMode(const CellularCallInfo &callInfo, ImsCallMode mode) = 0;
208 
209     /**
210      * Start Dtmf.
211      *
212      * @param Dtmf Code.
213      * @param CellularCallInfo.
214      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
215      */
216     virtual int32_t StartDtmf(char cDtmfCode, const CellularCallInfo &callInfo) = 0;
217 
218     /**
219      * Stop Dtmf.
220      *
221      * @param CellularCallInfo.
222      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
223      */
224     virtual int32_t StopDtmf(const CellularCallInfo &callInfo) = 0;
225 
226     /**
227      * Send Dtmf.
228      *
229      * @param Dtmf Code.
230      * @param CellularCallInfo.
231      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
232      */
233     virtual int32_t SendDtmf(char cDtmfCode, const CellularCallInfo &callInfo) = 0;
234 
235     /**
236      * Start Rtt interface
237      *
238      * @param msg
239      * @param slotId
240      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
241      */
242     virtual int32_t StartRtt(int32_t slotId, const std::string &msg) = 0;
243 
244     /**
245      * Stop Rtt interface
246      *
247      * @param slotId
248      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
249      */
250     virtual int32_t StopRtt(int32_t slotId) = 0;
251 
252     /**
253      * Set Call Transfer
254      *
255      * @param CallTransferInfo
256      * @param slotId
257      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
258      */
259     virtual int32_t SetCallTransferInfo(int32_t slotId, const CallTransferInfo &ctInfo) = 0;
260 
261     /**
262      * Get Call Transfer
263      *
264      * @param CallTransferType
265      * @param slotId
266      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
267      */
268     virtual int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type) = 0;
269 
270     /**
271      * Set Call Waiting
272      *
273      * @param activate
274      * @param slotId
275      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
276      */
277     virtual int32_t SetCallWaiting(int32_t slotId, bool activate) = 0;
278 
279     /**
280      * Get Call Waiting
281      *
282      * @param slotId
283      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
284      */
285     virtual int32_t GetCallWaiting(int32_t slotId) = 0;
286 
287     /**
288      * Set Call Restriction
289      *
290      * @param CallRestrictionInfo
291      * @param slotId
292      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
293      */
294     virtual int32_t SetCallRestriction(int32_t slotId, const CallRestrictionInfo &cRInfo) = 0;
295 
296     /**
297      * Get Call Restriction
298      *
299      * @param CallRestrictionType
300      * @param slotId
301      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
302      */
303     virtual int32_t GetCallRestriction(int32_t slotId, CallRestrictionType facType) = 0;
304 
305     /**
306      * Register CallBack
307      *
308      * @param sptr<ICallStatusCallback>
309      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
310      */
311     virtual int32_t RegisterCallManagerCallBack(const sptr<ICallStatusCallback> &callback) = 0;
312 
313     /**
314      * UnRegister CallBack
315      *
316      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
317      */
318     virtual int32_t UnRegisterCallManagerCallBack() = 0;
319 
320     /**
321      * Set Domain Preference Mode
322      *
323      * @param mode
324      * @param slotId
325      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
326      */
327     virtual int32_t SetDomainPreferenceMode(int32_t slotId, int32_t mode) = 0;
328 
329     /**
330      * Get Domain Preference Mode
331      *
332      * @param slotId
333      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
334      */
335     virtual int32_t GetDomainPreferenceMode(int32_t slotId) = 0;
336 
337     /**
338      * Set Ims Switch Status
339      *
340      * @param active
341      * @param slotId
342      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
343      */
344     virtual int32_t SetImsSwitchStatus(int32_t slotId, bool active) = 0;
345 
346     /**
347      * Get Ims Switch Status
348      *
349      * @param slotId
350      * @param enabled
351      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
352      */
353     virtual int32_t GetImsSwitchStatus(int32_t slotId, bool &enabled) = 0;
354 
355     /**
356      * Set Ims Config
357      *
358      * @param ImsConfigItem
359      * @param value
360      * @param slotId
361      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
362      */
363     virtual int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, const std::string &value) = 0;
364 
365     /**
366      * Set Ims Config
367      *
368      * @param ImsConfigItem
369      * @param value
370      * @param slotId
371      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
372      */
373     virtual int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, int32_t value) = 0;
374 
375     /**
376      * Get Ims Config
377      *
378      * @param ImsConfigItem
379      * @param slotId
380      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
381      */
382     virtual int32_t GetImsConfig(int32_t slotId, ImsConfigItem item) = 0;
383 
384     /**
385      * Set Ims Feature Value
386      *
387      * @param FeatureType
388      * @param value
389      * @param slotId
390      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
391      */
392     virtual int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value) = 0;
393 
394     /**
395      * Get Ims Feature Value
396      *
397      * @param FeatureType
398      * @param slotId
399      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
400      */
401     virtual int32_t GetImsFeatureValue(int32_t slotId, FeatureType type) = 0;
402 
403     /**
404      * CtrlCamera
405      *
406      * @param cameraId
407      * @param callingUid
408      * @param callingPid
409      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
410      */
411     virtual int32_t CtrlCamera(const std::u16string &cameraId, int32_t callingUid, int32_t callingPid) = 0;
412 
413     /**
414      * SetPreviewWindow
415      *
416      * @param x
417      * @param y
418      * @param z
419      * @param width
420      * @param height
421      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
422      */
423     virtual int32_t SetPreviewWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) = 0;
424 
425     /**
426      * SetDisplayWindow
427      *
428      * @param x
429      * @param y
430      * @param z
431      * @param width
432      * @param height
433      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
434      */
435     virtual int32_t SetDisplayWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) = 0;
436 
437     /**
438      * SetCameraZoom
439      *
440      * @param zoomRatio
441      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
442      */
443     virtual int32_t SetCameraZoom(float zoomRatio) = 0;
444 
445     /**
446      * SetPauseImage
447      *
448      * @param path
449      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
450      */
451     virtual int32_t SetPauseImage(const std::u16string &path) = 0;
452 
453     /**
454      * SetDeviceDirection
455      *
456      * @param rotation
457      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
458      */
459     virtual int32_t SetDeviceDirection(int32_t rotation) = 0;
460 
461     /**
462      * SetMute
463      *
464      * @param mute
465      * @param slotId
466      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
467      */
468     virtual int32_t SetMute(int32_t slotId, int32_t mute) = 0;
469 
470     /**
471      * GetMute
472      *
473      * @param slotId
474      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
475      */
476     virtual int32_t GetMute(int32_t slotId) = 0;
477 
478     /**
479      * SetEmergencyCallList
480      *
481      * @brief Is it an emergency call
482      * @param eccVecr[in], Phone number to be formatted
483      * @param slotId[in], The slot id
484      * @return Returns 0 on true, others on false.
485      */
486     virtual int32_t SetEmergencyCallList(int32_t slotId, std::vector<EmergencyCall>  &eccVec) = 0;
487 
488 public:
489     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.CellularCallInterface");
490 };
491 } // namespace Telephony
492 } // namespace OHOS
493 #endif // CELLULAR_CALL_INTERFACE_H
494