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
23namespace OHOS {
24namespace Telephony {
25class CallManagerCallback {
26public:
27    /**
28     * @brief Construct a new Call Manager Callback object
29     */
30    CallManagerCallback() {}
31
32    /**
33     * @brief Destroy the Call Manager Callback object
34     */
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 call event informaion while the call event is changed
48     *
49     * @param info[in] call event information, contains event id, phone number, bundle name.
50     * @return Returns 0 on success, others on failure.
51     */
52    virtual int32_t OnCallEventChange(const CallEventInfo &info) = 0;
53
54    /**
55     * @brief indicate the call disconnected detail information while the call disconnected
56     *
57     * @param details[in], call disconnected information, contains disconnected reason and message.
58     * @return Returns 0 on success, others on failure.
59     */
60    virtual int32_t OnCallDisconnectedCause(const DisconnectedDetails &details) = 0;
61
62    /**
63     * @brief report the result infomation for the specific call event
64     *
65     * @param reportId[in] the event id, indicate the specific event that the report information about
66     * @param resultInfo[in] the detail information corresponding specific event
67     * @return Returns 0 on success, others on failure.
68     */
69    virtual int32_t OnReportAsyncResults(CallResultReportId reportId, AppExecFwk::PacMap &resultInfo) = 0;
70
71    /**
72     * @brief report the result infomation for the specific ott call event
73     *
74     * @param requestId[in] the event id, indicate the specific ott call event that the report information about
75     * @param info[in] the detail information corresponding specific event
76     * @return Returns 0 on success, others on failure.
77     */
78    virtual int32_t OnOttCallRequest(OttCallRequestId requestId, AppExecFwk::PacMap &info) = 0;
79
80    /**
81     * @brief report the mmi code result
82     *
83     * @param info[out] the mmi code result, contains result(success or fail) and the corresponding message.
84     * @return Returns 0 on success, others on failure.
85     */
86    virtual int32_t OnReportMmiCodeResult(const MmiCodeInfo &info) = 0;
87
88    /**
89     * @brief report the audio device detail information
90     *
91     * @param info[out] the audio information, contains the audio device list, current audio device and ismuted.
92     * @return Returns 0 on success, others on failure.
93     */
94    virtual int32_t OnReportAudioDeviceChange(const AudioDeviceInfo &info) = 0;
95
96    virtual int32_t OnReportPostDialDelay(const std::string &str) = 0;
97
98    virtual int32_t OnUpdateImsCallModeChange(const CallMediaModeInfo &imsCallModeInfo) = 0;
99    virtual int32_t OnCallSessionEventChange(const CallSessionEvent &callSessionEventOptions) = 0;
100    virtual int32_t OnPeerDimensionsChange(const PeerDimensionsDetail &peerDimensionsDetail) = 0;
101    virtual int32_t OnCallDataUsageChange(const int64_t dataUsage) = 0;
102    virtual int32_t OnUpdateCameraCapabilities(const CameraCapabilities &cameraCapabilities) = 0;
103};
104} // namespace Telephony
105} // namespace OHOS
106#endif // CALL_MANAGER_CALLBACK_H
107