1 /*
2  * Copyright (C) 2022-2023 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_CALLBACK_INTERFACE_H
17 #define TELEPHONY_IMS_CALL_CALLBACK_INTERFACE_H
18 
19 #include "call_manager_inner_type.h"
20 #include "tel_ril_call_parcel.h"
21 #include "ims_call_types.h"
22 #include "iremote_broker.h"
23 #include "telephony_types.h"
24 
25 namespace OHOS {
26 namespace Telephony {
27 class ImsCallCallbackInterface : public IRemoteBroker {
28 public:
29     virtual ~ImsCallCallbackInterface() = default;
30 
31     /**
32      * @brief DialResponse the result of dial by ims.
33      *
34      * @param slotId Indicates the card slot index number,
35      * ranging from {@code 0} to the maximum card slot index number supported by the device.
36      * @param info Indicates dial action was success or failure.
37      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
38      */
39     virtual int32_t DialResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
40 
41     /**
42      * @brief HangUpResponse the result of hang up by ims.
43      *
44      * @param slotId Indicates the card slot index number,
45      * ranging from {@code 0} to the maximum card slot index number supported by the device.
46      * @param info Indicates hang up action was success or failure.
47      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
48      */
49     virtual int32_t HangUpResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
50 
51     /**
52      * @brief RejectWithReasonResponse the result of reject with reason by ims.
53      *
54      * @param slotId Indicates the card slot index number,
55      * ranging from {@code 0} to the maximum card slot index number supported by the device.
56      * @param info Indicates reject action was success or failure.
57      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
58      */
59     virtual int32_t RejectWithReasonResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
60 
61     /**
62      * @brief AnswerResponse the result of answer by ims.
63      *
64      * @param slotId Indicates the card slot index number,
65      * ranging from {@code 0} to the maximum card slot index number supported by the device.
66      * @param info Indicates answer action was success or failure.
67      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
68      */
69     virtual int32_t AnswerResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
70 
71     /**
72      * @brief HoldCallResponse the result of hold call by ims.
73      *
74      * @param slotId Indicates the card slot index number,
75      * ranging from {@code 0} to the maximum card slot index number supported by the device.
76      * @param info Indicates hold action was success or failure.
77      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
78      */
79     virtual int32_t HoldCallResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
80 
81     /**
82      * @brief UnHoldCallResponse the result of unhold call by ims.
83      *
84      * @param slotId Indicates the card slot index number,
85      * ranging from {@code 0} to the maximum card slot index number supported by the device.
86      * @param info Indicates unhold action was success or failure.
87      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
88      */
89     virtual int32_t UnHoldCallResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
90 
91     /**
92      * @brief SwitchCallResponse the result of switch call by ims.
93      *
94      * @param slotId Indicates the card slot index number,
95      * ranging from {@code 0} to the maximum card slot index number supported by the device.
96      * @param info Indicates switch action was success or failure.
97      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
98      */
99     virtual int32_t SwitchCallResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
100 
101     /**
102      * @brief StartDtmfResponse the result of start dtmf by ims.
103      *
104      * @param slotId Indicates the card slot index number,
105      * ranging from {@code 0} to the maximum card slot index number supported by the device.
106      * @param info Indicates start action was success or failure.
107      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
108      */
109     virtual int32_t StartDtmfResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
110     /**
111      * @brief SendDtmfResponse the result of send dtmf by ims.
112      *
113      * @param slotId Indicates the card slot index number,
114      * ranging from {@code 0} to the maximum card slot index number supported by the device.
115      * @param info Indicates send action was success or failure.
116      * @param callIndex Indicates the call index number.
117      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
118      */
119     virtual int32_t SendDtmfResponse(int32_t slotId, const RadioResponseInfo &info, int32_t callIndex) = 0;
120 
121     /**
122      * @brief StopDtmfResponse the result of stop dtmf by ims.
123      *
124      * @param slotId Indicates the card slot index number,
125      * ranging from {@code 0} to the maximum card slot index number supported by the device.
126      * @param info Indicates stop action was success or failure.
127      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
128      */
129     virtual int32_t StopDtmfResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
130 
131     /**
132      * @brief CallStateChangeReport receive call state changed notification with slotId by ims.
133      *
134      * @param slotId Indicates the card slot index number,
135      * ranging from {@code 0} to the maximum card slot index number supported by the device.
136      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
137      */
138     virtual int32_t CallStateChangeReport(int32_t slotId) = 0;
139 
140     /**
141      * @brief GetImsCallsDataResponse the result of get ims calls data by ims.
142      *
143      * @param slotId Indicates the card slot index number,
144      * ranging from {@code 0} to the maximum card slot index number supported by the device.
145      * @param info Indicates get action was success or failure.
146      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
147      */
148     virtual int32_t GetImsCallsDataResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
149 
150     /**
151      * @brief GetImsCallsDataResponse the result of get ims calls data by ims.
152      *
153      * @param slotId Indicates the card slot index number,
154      * ranging from {@code 0} to the maximum card slot index number supported by the device.
155      * @param callList Indicates the result of get ims current call list.
156      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
157      */
158     virtual int32_t GetImsCallsDataResponse(int32_t slotId, const ImsCurrentCallList &callList) = 0;
159 
160     /**
161      * @brief SetImsSwitchResponse the result of set ims switch by ims.
162      *
163      * @param slotId Indicates the card slot index number,
164      * ranging from {@code 0} to the maximum card slot index number supported by the device.
165      * @param info Indicates set action was success or failure.
166      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
167      */
168     virtual int32_t SetImsSwitchResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
169 
170     /**
171      * @brief GetImsSwitchResponse the result of get ims switch by ims.
172      *
173      * @param slotId Indicates the card slot index number,
174      * ranging from {@code 0} to the maximum card slot index number supported by the device.
175      * @param info Indicates get action was success or failure.
176      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
177      */
178     virtual int32_t GetImsSwitchResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
179 
180     /**
181      * @brief GetImsSwitchResponse the result of get ims switch by ims.
182      *
183      * @param slotId Indicates the card slot index number,
184      * ranging from {@code 0} to the maximum card slot index number supported by the device.
185      * @param active 1: ims is enabled, 0: ims is disabled.
186      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
187      */
188     virtual int32_t GetImsSwitchResponse(int32_t slotId, int32_t active) = 0;
189 
190     /**
191      * @brief CallRingBackReport receive call ring back notification by ims.
192      *
193      * @param slotId Indicates the card slot index number,
194      * ranging from {@code 0} to the maximum card slot index number supported by the device.
195      * @param info Indicates the ring back voice status the status was,
196      * ranging from {@code NETWORK_ALERTING} to {@code LOCAL_ALERTING} which define at {@code RBTPlayInfo}.
197      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
198      */
199     virtual int32_t CallRingBackReport(int32_t slotId, const RingbackVoice &info) = 0;
200 
201     /**
202      * @brief SetMuteResponse the result of set mute by ims.
203      *
204      * @param slotId Indicates the card slot index number,
205      * ranging from {@code 0} to the maximum card slot index number supported by the device.
206      * @param response Indicates the result of set action.
207      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
208      */
209     virtual int32_t SetMuteResponse(int32_t slotId, const MuteControlResponse &response) = 0;
210 
211     /**
212      * @brief LastCallFailReasonResponse the result of last call fail reason by ims.
213      *
214      * @param slotId Indicates the card slot index number,
215      * ranging from {@code 0} to the maximum card slot index number supported by the device.
216      * @param details Indicates the call fail reason and the remaind message,
217      * reason ranging from {@code UNASSIGNED_NUMBER} to {@code UNKNOWN} which define at {@code DisconnectedReason}
218      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
219      */
220     virtual int32_t LastCallFailReasonResponse(int32_t slotId, const DisconnectedDetails &details) = 0;
221 
222     /**
223      * @brief SetClipResponse the result of set the clip by IMS.
224      *
225      * @param slotId Indicates the card slot index number,
226      * ranging from {@code 0} to the maximum card slot index number supported by the device.
227      * @param resultInfo Indicates the result info of ss command.
228      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
229      */
230     virtual int32_t SetClipResponse(int32_t slotId, const SsBaseResult &resultInfo) = 0;
231 
232     /**
233      * @brief GetClipResponse the result of get the clip by IMS.
234      *
235      * @param slotId Indicates the card slot index number,
236      * ranging from {@code 0} to the maximum card slot index number supported by the device.
237      * @param result Indicates the result of get action.
238      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
239      */
240     virtual int32_t GetClipResponse(int32_t slotId, const GetClipResult &result) = 0;
241 
242     /**
243      * @brief GetClirResponse the result of get the clir by IMS.
244      *
245      * @param slotId Indicates the card slot index number,
246      * ranging from {@code 0} to the maximum card slot index number supported by the device.
247      * @param result Indicates the result of get action.
248      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
249      */
250     virtual int32_t GetClirResponse(int32_t slotId, const GetClirResult &result) = 0;
251 
252     /**
253      * @brief SetClirResponse the result of set the clir by IMS.
254      *
255      * @param slotId Indicates the card slot index number,
256      * ranging from {@code 0} to the maximum card slot index number supported by the device.
257      * @param resultInfo Indicates the result info of ss command.
258      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
259      */
260     virtual int32_t SetClirResponse(int32_t slotId, const SsBaseResult &resultInfo) = 0;
261 
262     /**
263      * @brief GetCallTransferResponse the result of get the call transfer by IMS.
264      *
265      * @param slotId Indicates the card slot index number,
266      * ranging from {@code 0} to the maximum card slot index number supported by the device.
267      * @param cFQueryList Indicates the call forwarding list of get action.
268      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
269      */
270     virtual int32_t GetCallTransferResponse(int32_t slotId, const CallForwardQueryInfoList &cFQueryList) = 0;
271 
272     /**
273      * @brief
274      *
275      * @param slotId Indicates the card slot index number,
276      * ranging from {@code 0} to the maximum card slot index number supported by the device.
277      * @param resultInfo Indicates the result info of ss command.
278      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
279      */
280     virtual int32_t SetCallTransferResponse(int32_t slotId, const SsBaseResult &resultInfo) = 0;
281 
282     /**
283      * @brief GetCallRestrictionResponse the result of get the call restriction by IMS.
284      *
285      * @param slotId Indicates the card slot index number,
286      * ranging from {@code 0} to the maximum card slot index number supported by the device.
287      * @param result Indicates the result of get action.
288      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
289      */
290     virtual int32_t GetCallRestrictionResponse(int32_t slotId, const CallRestrictionResult &result) = 0;
291 
292     /**
293      * @brief SetCallRestrictionResponse the result of set the call restriction by IMS.
294      *
295      * @param slotId Indicates the card slot index number,
296      * ranging from {@code 0} to the maximum card slot index number supported by the device.
297      * @param resultInfo Indicates the result info of ss command.
298      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
299      */
300     virtual int32_t SetCallRestrictionResponse(int32_t slotId, const SsBaseResult &resultInfo) = 0;
301 
302     /**
303      * @brief GetCallWaitingResponse the result of get the call waiting by IMS.
304      *
305      * @param slotId Indicates the card slot index number,
306      * ranging from {@code 0} to the maximum card slot index number supported by the device.
307      * @param result Indicates the result of get action.
308      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
309      */
310     virtual int32_t GetCallWaitingResponse(int32_t slotId, const CallWaitResult &result) = 0;
311 
312     /**
313      * @brief SetCallWaitingResponse the result of set the call waiting by IMS.
314      *
315      * @param slotId Indicates the card slot index number,
316      * ranging from {@code 0} to the maximum card slot index number supported by the device.
317      * @param resultInfo Indicates the result info of ss command.
318      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
319      */
320     virtual int32_t SetCallWaitingResponse(int32_t slotId, const SsBaseResult &resultInfo) = 0;
321 
322     /**
323      * @brief SetColrResponse the result of set the colr by IMS.
324      *
325      * @param slotId Indicates the card slot index number,
326      * ranging from {@code 0} to the maximum card slot index number supported by the device.
327      * @param resultInfo Indicates the result info of ss command.
328      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
329      */
330     virtual int32_t SetColrResponse(int32_t slotId, const SsBaseResult &resultInfo) = 0;
331 
332     /**
333      * @brief GetColrResponse the result of get the colr by IMS.
334      *
335      * @param slotId Indicates the card slot index number,
336      * ranging from {@code 0} to the maximum card slot index number supported by the device.
337      * @param result Indicates the result of get action.
338      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
339      */
340     virtual int32_t GetColrResponse(int32_t slotId, const GetColrResult &result) = 0;
341 
342     /**
343      * @brief SetColpResponse the result of set the colp by IMS.
344      *
345      * @param slotId Indicates the card slot index number,
346      * ranging from {@code 0} to the maximum card slot index number supported by the device.
347      * @param resultInfo Indicates the result info of ss command.
348      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
349      */
350     virtual int32_t SetColpResponse(int32_t slotId, const SsBaseResult &resultInfo) = 0;
351 
352     /**
353      * @brief GetColpResponse the result of get the colp by IMS.
354      *
355      * @param slotId Indicates the card slot index number,
356      * ranging from {@code 0} to the maximum card slot index number supported by the device.
357      * @param result Indicates the result of get action.
358      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
359      */
360     virtual int32_t GetColpResponse(int32_t slotId, const GetColpResult &result) = 0;
361 
362     /**
363      * @brief CombineConferenceResponse the result of get combine conference by ims.
364      *
365      * @param slotId Indicates the card slot index number,
366      * ranging from {@code 0} to the maximum card slot index number supported by the device.
367      * @param info Indicates get action was success or failure.
368      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
369      */
370     virtual int32_t CombineConferenceResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
371 
372     /**
373      * @brief InviteToConferenceResponse the result of get invite to conference by ims.
374      *
375      * @param slotId Indicates the card slot index number,
376      * ranging from {@code 0} to the maximum card slot index number supported by the device.
377      * @param info Indicates get action was success or failure.
378      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
379      */
380     virtual int32_t InviteToConferenceResponse(int32_t slotId, const RadioResponseInfo &info) = 0;
381 
382     /**
383      * @brief ReceiveUpdateCallMediaModeRequest the result of receive update call media mode by ims.
384      *
385      * @param slotId Indicates the card slot index number,
386      * ranging from {@code 0} to the maximum card slot index number supported by the device.
387      * @param callModeResponse Indicates info of received.
388      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
389      */
390     virtual int32_t ReceiveUpdateCallMediaModeRequest(
391         int32_t slotId, const ImsCallModeReceiveInfo &callModeRequest) = 0;
392 
393     /**
394      * @brief ReceiveUpdateCallMediaModeResponse the result of send update call media mode by ims.
395      *
396      * @param slotId Indicates the card slot index number,
397      * ranging from {@code 0} to the maximum card slot index number supported by the device.
398      * @param callModeResponse Indicates info of received.
399      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
400      */
401     virtual int32_t ReceiveUpdateCallMediaModeResponse(
402         int32_t slotId, const ImsCallModeReceiveInfo &callModeResponse) = 0;
403 
404     /**
405      * CallSessionEventChanged report call session event change to up layer
406      * @param slotId Indicates the card slot index number,
407      * ranging from {@code 0} to the maximum card slot index number supported by the device.
408      * @param callSessionEventInfo Indicates info of call session info.
409      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
410      */
411     virtual int32_t CallSessionEventChanged(int32_t slotId, const ImsCallSessionEventInfo &callSessionEventInfo) = 0;
412 
413     /**
414      * PeerDimensionsChanged report ims video call peer dimensions changed to up layer
415      * @param slotId Indicates the card slot index number,
416      * ranging from {@code 0} to the maximum card slot index number supported by the device.
417      * @param callPeerDimensionsInfo include video window width and height info.
418      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
419      */
420     virtual int32_t PeerDimensionsChanged(int32_t slotId, const ImsCallPeerDimensionsInfo &callPeerDimensionsInfo) = 0;
421 
422     /**
423      * CallDataUsageChanged report ims call data usage changed to up layer
424      * @param slotId Indicates the card slot index number,
425      * ranging from {@code 0} to the maximum card slot index number supported by the device.
426      * @param callDataUsageInfo Indicates ims call data usage info.
427      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
428      */
429     virtual int32_t CallDataUsageChanged(int32_t slotId, const ImsCallDataUsageInfo &callDataUsageInfo) = 0;
430 
431     /**
432      * CameraCapabilitiesChanged report camera capabilities changed to up layer
433      * @param slotId Indicates the card slot index number,
434      * ranging from {@code 0} to the maximum card slot index number supported by the device.
435      * @param cameraCapabilitiesInfo Indicates ims video call camera capabilities info
436      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
437      */
438     virtual int32_t CameraCapabilitiesChanged(int32_t slotId, const CameraCapabilitiesInfo &cameraCapabilitiesInfo) = 0;
439 
440     /**
441      * CallNvCfgFinishedIndication report NV config changed notification by ims.
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 TELEPHONY_SUCCESS on success, others on failure.
445      */
446     virtual int32_t CallNvCfgFinishedIndication(int32_t slotId) = 0;
447 
448 public:
449     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ImsCallCallback");
450 };
451 }  // namespace Telephony
452 }  // namespace OHOS
453 
454 #endif  // TELEPHONY_IMS_CALL_CALLBACK_INTERFACE_H
455