• 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 CALL_MANAGER_CALLBACK_H
17 #define CALL_MANAGER_CALLBACK_H
18 
19 #include <cstdio>
20 
21 #include "call_manager_inner_type.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 class CallManagerCallback {
26 public:
27     /**
28      * @brief Construct a new Call Manager Callback object
29      */
CallManagerCallback()30     CallManagerCallback() {}
31 
32     /**
33      * @brief Destroy the Call Manager Callback object
34      */
~CallManagerCallback()35     virtual ~CallManagerCallback() {}
36 
37     /**
38      * @brief indicate the call detail informaion while the call state is changed
39      *
40      * @param info[in] call detail infomation, contains call type, account number, call state,
41      * call start or end time .etc
42      * @return Returns 0 on success, others on failure.
43      */
44     virtual int32_t OnCallDetailsChange(const CallAttributeInfo &info) = 0;
45 
46     /**
47      * @brief indicate the meeTime detail informaion while the call state is changed
48      *
49      * @param info[in] meeTime detail infomation, contains call type, account number, call state,
50      * call start or end time .etc
51      * @return Returns 0 on success, others on failure.
52      */
OnMeeTimeDetailsChange(const CallAttributeInfo & info)53     virtual int32_t OnMeeTimeDetailsChange(const CallAttributeInfo &info)
54     {
55         return -1;
56     }
57 
58     /**
59      * @brief indicate the call event informaion while the call event is changed
60      *
61      * @param info[in] call event information, contains event id, phone number, bundle name.
62      * @return Returns 0 on success, others on failure.
63      */
64     virtual int32_t OnCallEventChange(const CallEventInfo &info) = 0;
65 
66     /**
67      * @brief indicate the call disconnected detail information while the call disconnected
68      *
69      * @param details[in], call disconnected information, contains disconnected reason and message.
70      * @return Returns 0 on success, others on failure.
71      */
72     virtual int32_t OnCallDisconnectedCause(const DisconnectedDetails &details) = 0;
73 
74     /**
75      * @brief report the result infomation for the specific call event
76      *
77      * @param reportId[in] the event id, indicate the specific event that the report information about
78      * @param resultInfo[in] the detail information corresponding specific event
79      * @return Returns 0 on success, others on failure.
80      */
81     virtual int32_t OnReportAsyncResults(CallResultReportId reportId, AppExecFwk::PacMap &resultInfo) = 0;
82 
83     /**
84      * @brief report the result infomation for the specific ott call event
85      *
86      * @param requestId[in] the event id, indicate the specific ott call event that the report information about
87      * @param info[in] the detail information corresponding specific event
88      * @return Returns 0 on success, others on failure.
89      */
90     virtual int32_t OnOttCallRequest(OttCallRequestId requestId, AppExecFwk::PacMap &info) = 0;
91 
92     /**
93      * @brief report the mmi code result
94      *
95      * @param info[out] the mmi code result, contains result(success or fail) and the corresponding message.
96      * @return Returns 0 on success, others on failure.
97      */
98     virtual int32_t OnReportMmiCodeResult(const MmiCodeInfo &info) = 0;
99 
100     /**
101      * @brief report the audio device detail information
102      *
103      * @param info[out] the audio information, contains the audio device list, current audio device and ismuted.
104      * @return Returns 0 on success, others on failure.
105      */
106     virtual int32_t OnReportAudioDeviceChange(const AudioDeviceInfo &info) = 0;
107 
108     virtual int32_t OnReportPostDialDelay(const std::string &str) = 0;
109 
110     virtual int32_t OnUpdateImsCallModeChange(const CallMediaModeInfo &imsCallModeInfo) = 0;
111     virtual int32_t OnCallSessionEventChange(const CallSessionEvent &callSessionEventOptions) = 0;
112     virtual int32_t OnPeerDimensionsChange(const PeerDimensionsDetail &peerDimensionsDetail) = 0;
113     virtual int32_t OnCallDataUsageChange(const int64_t dataUsage) = 0;
114     virtual int32_t OnUpdateCameraCapabilities(const CameraCapabilities &cameraCapabilities) = 0;
115 
116     /**
117      * @brief report phone state change
118      *
119      * @param numActive[in] number of active calls
120      * @param numHeld[in] number of hold calls
121      * @param callState[in] call state
122      * @param number[in] phone number
123      * @return Returns 0 on success, others on failure.
124      */
OnPhoneStateChange(int32_t numActive,int32_t numHeld,int32_t callState,const std::string & number)125     virtual int32_t OnPhoneStateChange(int32_t numActive, int32_t numHeld, int32_t callState,
126         const std::string &number)
127     {
128         return 0;
129     }
130 };
131 } // namespace Telephony
132 } // namespace OHOS
133 #endif // CALL_MANAGER_CALLBACK_H
134