1/*
2 * Copyright (C) 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 CALL_BASE_VOIP_CALL_OBJECT_H
17#define CALL_BASE_VOIP_CALL_OBJECT_H
18
19#include "carrier_call.h"
20#include "voip_call_manager_info.h"
21
22namespace OHOS {
23namespace Telephony {
24class VoIPCall : public CarrierCall {
25public:
26    VoIPCall(DialParaInfo &info);
27    ~VoIPCall();
28    int32_t DialingProcess() override;
29    int32_t AnswerCall(int32_t videoState) override;
30    int32_t RejectCall() override;
31    int32_t HangUpCall() override;
32    int32_t HoldCall() override;
33    int32_t UnHoldCall() override;
34    int32_t SwitchCall() override;
35    void GetCallAttributeInfo(CallAttributeInfo &info) override;
36    int32_t CombineConference() override;
37    void HandleCombineConferenceFailEvent() override;
38    int32_t SeparateConference() override;
39    int32_t KickOutFromConference() override;
40    int32_t CanCombineConference() override;
41    int32_t CanSeparateConference() override;
42    int32_t CanKickOutFromConference() override;
43    int32_t LaunchConference() override;
44    int32_t ExitConference() override;
45    int32_t HoldConference() override;
46    int32_t GetMainCallId(int32_t &mainCallId) override;
47    int32_t GetSubCallIdList(std::vector<std::u16string> &callIdList) override;
48    int32_t GetCallIdListForConference(std::vector<std::u16string> &callIdList) override;
49    int32_t IsSupportConferenceable() override;
50    int32_t SetMute(int32_t mute, int32_t slotId) override;
51    int32_t HangUpCall(const ErrorReason &status);
52    std::string GetVoipCallId();
53    std::string GetVoipBundleName();
54    int32_t GetVoipUid();
55
56protected:
57    int32_t PackVoipCallInfo(VoipCallEventInfo &voipcallInfo);
58
59private:
60    std::string voipCallId_ = "";
61    std::string userName_ = "";
62    std::string extensionId_ = "";
63    std::string voipBundleName_ = "";
64    std::string abilityName_ = "";
65    std::vector<uint8_t> userProfile_ = {};
66    bool showBannerForIncomingCall_ = true;
67    bool isConferenceCall_ = false;
68    bool isVoiceAnswerSupported_ = true;
69    bool hasMicPermission_ = true;
70    int32_t uid_ = 0;
71};
72} // namespace Telephony
73} // namespace OHOS
74
75#endif // CALL_BASE_VOIP_CALL_OBJECT_H
76