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