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 OTT_CALL_CONNECTION_H
17#define OTT_CALL_CONNECTION_H
18
19#include "pac_map.h"
20
21#include "call_manager_inner_type.h"
22
23namespace OHOS {
24namespace Telephony {
25class OTTCallConnection {
26public:
27    OTTCallConnection() = default;
28    ~OTTCallConnection() = default;
29
30    /**
31     * Answer
32     *
33     * @brief Answer a phone call
34     * @param requestInfo[in], Call request information.
35     * @return Returns 0 on success, others on failure.
36     */
37    int32_t Answer(const OttCallRequestInfo &requestInfo);
38
39    /**
40     * HangUp
41     *
42     * @brief Hang up the phone
43     * @param requestInfo[in], Call request information.
44     * @return Returns 0 on success, others on failure.
45     */
46    int32_t HangUp(const OttCallRequestInfo &requestInfo);
47
48    /**
49     * Reject
50     *
51     * @brief Reject a phone call
52     * @param requestInfo[in], Call request information.
53     * @return Returns 0 on success, others on failure.
54     */
55    int32_t Reject(const OttCallRequestInfo &requestInfo);
56
57    /**
58     * HoldCall
59     *
60     * @brief Park a phone call
61     * @param requestInfo[in], Call request information.
62     * @return Returns 0 on success, others on failure.
63     */
64    int32_t HoldCall(const OttCallRequestInfo &requestInfo);
65
66    /**
67     * UnHoldCall
68     *
69     * @brief Activate a phone call
70     * @param requestInfo[in], Call request information.
71     * @return Returns 0 on success, others on failure.
72     */
73    int32_t UnHoldCall(const OttCallRequestInfo &requestInfo);
74
75    /**
76     * SwitchCall
77     *
78     * @brief Switch the phone
79     * @return Returns 0 on success, others on failure.
80     */
81    int32_t SwitchCall(const OttCallRequestInfo &requestInfo);
82
83    /**
84     * CombineConference
85     *
86     * @brief Merge calls to form a conference
87     * @param requestInfo[in], Call request information.
88     * @return Returns 0 on success, others on failure.
89     */
90    int32_t CombineConference(const OttCallRequestInfo &requestInfo);
91
92    /**
93     * SeparateConference
94     *
95     * @brief Separates a specified call from a conference call
96     * @param requestInfo[in], Call request information.
97     * @return Returns 0 on success, others on failure.
98     */
99    int32_t SeparateConference(const OttCallRequestInfo &requestInfo);
100
101    /**
102     * KickOutFromConference
103     *
104     * @brief Hangup a specified call from a conference call
105     * @param requestInfo[in], Call request information.
106     * @return Returns 0 on success, others on failure.
107     */
108    int32_t KickOutFromConference(const OttCallRequestInfo &requestInfo);
109
110    /**
111     * InviteToConference interface
112     *
113     * @param numberList
114     * @param slotId
115     * @return Returns TELEPHONY_SUCCESS on success, others on failure.
116     */
117    int32_t InviteToConference(const OttCallRequestInfo &requestInfo, const std::vector<std::string> &numberList);
118
119    /**
120     * UpdateImsCallMode
121     *
122     * @brief send update call media request
123     * @param requestInfo[in], Call request information.
124     * @param mode[in], Calling patterns
125     * @return Returns 0 on success, others on failure.
126     */
127    int32_t UpdateImsCallMode(const OttCallRequestInfo &requestInfo, ImsCallMode mode);
128
129private:
130    void PackCellularCallInfo(const OttCallRequestInfo &requestInfo, AppExecFwk::PacMap &info);
131};
132} // namespace Telephony
133} // namespace OHOS
134#endif // OTT_CALL_CONNECTION_H
135