• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 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 error Code.
102      * @return Is Urgent Call.
103      */
104     int32_t IsEmergencyPhoneNumber(int32_t slotId, const std::string &phoneNum, int32_t &errorCode) 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      * IMS Update Call Media Mode
150      *
151      * @param CellularCallInfo
152      * @param ImsCallMode
153      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
154      */
155     int32_t UpdateImsCallMode(const CellularCallInfo &callInfo, ImsCallMode mode) override;
156 
157     /**
158      * StartDtmf.
159      *
160      * @param Dtmf Code.
161      * @param CellularCallInfo.
162      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
163      */
164     int32_t StartDtmf(char cDtmfCode, const CellularCallInfo &callInfo) override;
165 
166     /**
167      * StopDtmf.
168      *
169      * @param CellularCallInfo.
170      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
171      */
172     int32_t StopDtmf(const CellularCallInfo &callInfo) override;
173 
174     /**
175      * SendDtmf.
176      *
177      * @param Dtmf Code.
178      * @param CellularCallInfo.
179      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
180      */
181     int32_t SendDtmf(char cDtmfCode, const CellularCallInfo &callInfo) override;
182 
183     /**
184      * Start Rtt
185      *
186      * @param msg
187      * @param slotId
188      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
189      */
190     int32_t StartRtt(int32_t slotId, const std::string &msg) override;
191 
192     /**
193      * Stop Rtt
194      *
195      * @param slotId
196      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
197      */
198     int32_t StopRtt(int32_t slotId) override;
199 
200     /**
201      * Set Call Transfer
202      *
203      * @param CallTransferInfo
204      * @param slot Id
205      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
206      */
207     int32_t SetCallTransferInfo(int32_t slotId, const CallTransferInfo &cfInfo) override;
208 
209     /**
210      * Inquire Call Transfer
211      *
212      * @param CallTransferType
213      * @param slot Id
214      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
215      */
216     int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type) override;
217 
218     /**
219      * Set Call Waiting
220      *
221      * @param activate
222      * @param slot Id
223      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
224      */
225     int32_t SetCallWaiting(int32_t slotId, bool activate) override;
226 
227     /**
228      * Inquire Call Waiting
229      *
230      * @param slot Id
231      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
232      */
233     int32_t GetCallWaiting(int32_t slotId) override;
234 
235     /**
236      * Set Call Restriction
237      *
238      * @param CallRestrictionInfo
239      * @param slot Id
240      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
241      */
242     int32_t SetCallRestriction(int32_t slotId, const CallRestrictionInfo &crInfo) override;
243 
244     /**
245      * Inquire Call Restriction
246      *
247      * @param CallRestrictionType
248      * @param slot Id
249      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
250      */
251     int32_t GetCallRestriction(int32_t slotId, CallRestrictionType facType) override;
252 
253     /**
254      * RegisterCallManagerCallBack
255      *
256      * @param sptr<ICallStatusCallback>
257      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
258      */
259     int32_t RegisterCallManagerCallBack(const sptr<ICallStatusCallback> &callback) override;
260 
261     /**
262      * UnRegister CallManager CallBack
263      *
264      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
265      */
266     int32_t UnRegisterCallManagerCallBack() override;
267 
268     /**
269      * Set Domain Preference Mode
270      *
271      * @param mode
272      * @param slot Id
273      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
274      */
275     int32_t SetDomainPreferenceMode(int32_t slotId, int32_t mode) override;
276 
277     /**
278      * Get Domain Preference Mode
279      *
280      * @param slot Id
281      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
282      */
283     int32_t GetDomainPreferenceMode(int32_t slotId) override;
284 
285     /**
286      * Set Lte Ims Switch Status
287      *
288      * @param active
289      * @param slot Id
290      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
291      */
292     int32_t SetLteImsSwitchStatus(int32_t slotId, bool active) override;
293 
294     /**
295      * Get Lte Ims Switch Status
296      *
297      * @param slot Id
298      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
299      */
300     int32_t GetLteImsSwitchStatus(int32_t slotId) override;
301 
302     /**
303      * Set Ims Config
304      *
305      * @param ImsConfigItem
306      * @param value
307      * @param slot Id
308      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
309      */
310     int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, const std::string &value) override;
311 
312     /**
313      * Set Ims Config
314      *
315      * @param ImsConfigItem
316      * @param value
317      * @param slot Id
318      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
319      */
320     int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, int32_t value) override;
321 
322     /**
323      * Get Ims Config
324      *
325      * @param ImsConfigItem
326      * @param slot Id
327      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
328      */
329     int32_t GetImsConfig(int32_t slotId, ImsConfigItem item) override;
330 
331     /**
332      * Set Ims Feature Value
333      *
334      * @param FeatureType
335      * @param value
336      * @param slot Id
337      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
338      */
339     int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value) override;
340 
341     /**
342      * Get Ims Feature Value
343      *
344      * @param FeatureType
345      * @param slot Id
346      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
347      */
348     int32_t GetImsFeatureValue(int32_t slotId, FeatureType type) override;
349 
350     /**
351      * Set Ims Switch Enhance Mode
352      *
353      * @param value
354      * @param slot Id
355      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
356      */
357     int32_t SetImsSwitchEnhanceMode(int32_t slotId, bool value) override;
358 
359     /**
360      * Get Ims Switch Enhance Mode
361      * @param slot Id
362      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
363      */
364     int32_t GetImsSwitchEnhanceMode(int32_t slotId) override;
365 
366     /**
367      * CtrlCamera
368      *
369      * @param cameraId
370      * @param callingUid
371      * @param callingPid
372      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
373      */
374     int32_t CtrlCamera(const std::u16string &cameraId, int32_t callingUid, int32_t callingPid) override;
375 
376     /**
377      * SetPreviewWindow
378      *
379      * @param x
380      * @param y
381      * @param z
382      * @param width
383      * @param height
384      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
385      */
386     int32_t SetPreviewWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) override;
387 
388     /**
389      * SetDisplayWindow
390      *
391      * @param x
392      * @param y
393      * @param z
394      * @param width
395      * @param height
396      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
397      */
398     int32_t SetDisplayWindow(int32_t x, int32_t y, int32_t z, int32_t width, int32_t height) override;
399 
400     /**
401      * SetCameraZoom
402      *
403      * @param zoomRatio
404      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
405      */
406     int32_t SetCameraZoom(float zoomRatio) override;
407 
408     /**
409      * SetPauseImage
410      *
411      * @param path
412      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
413      */
414     int32_t SetPauseImage(const std::u16string &path) override;
415 
416     /**
417      * SetDeviceDirection
418      *
419      * @param rotation
420      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
421      */
422     int32_t SetDeviceDirection(int32_t rotation) override;
423 
424     /**
425      * SetMute
426      *
427      * @param mute
428      * @param slotId
429      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
430      */
431     int32_t SetMute(int32_t mute, int32_t slotId) override;
432 
433     /**
434      * GetMute
435      *
436      * @param slotId
437      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
438      */
439     int32_t GetMute(int32_t slotId) override;
440 
441 private:
442     const int32_t MAX_SIZE = 10;
443     static inline BrokerDelegator<CellularCallProxy> delegator_;
444 };
445 } // namespace Telephony
446 } // namespace OHOS
447 #endif // CELLULAR_CALL_PROXY_H
448