1e1c44949Sopenharmony_ci/*
2e1c44949Sopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd.
3e1c44949Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4e1c44949Sopenharmony_ci * you may not use this file except in compliance with the License.
5e1c44949Sopenharmony_ci * You may obtain a copy of the License at
6e1c44949Sopenharmony_ci *
7e1c44949Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8e1c44949Sopenharmony_ci *
9e1c44949Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10e1c44949Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11e1c44949Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12e1c44949Sopenharmony_ci * See the License for the specific language governing permissions and
13e1c44949Sopenharmony_ci * limitations under the License.
14e1c44949Sopenharmony_ci */
15e1c44949Sopenharmony_ci
16e1c44949Sopenharmony_ci#ifndef CALL_REQUEST_PROCESS_H
17e1c44949Sopenharmony_ci#define CALL_REQUEST_PROCESS_H
18e1c44949Sopenharmony_ci
19e1c44949Sopenharmony_ci#include <mutex>
20e1c44949Sopenharmony_ci
21e1c44949Sopenharmony_ci#include "call_object_manager.h"
22e1c44949Sopenharmony_ci
23e1c44949Sopenharmony_cinamespace OHOS {
24e1c44949Sopenharmony_cinamespace Telephony {
25e1c44949Sopenharmony_ciclass CallRequestProcess : public CallObjectManager {
26e1c44949Sopenharmony_cipublic:
27e1c44949Sopenharmony_ci    CallRequestProcess();
28e1c44949Sopenharmony_ci    ~CallRequestProcess();
29e1c44949Sopenharmony_ci
30e1c44949Sopenharmony_ci    int32_t DialRequest();
31e1c44949Sopenharmony_ci    void AnswerRequest(int32_t callId, int32_t videoState);
32e1c44949Sopenharmony_ci    void AnswerRequestForDsda(sptr<CallBase> call, int32_t callId, int32_t videoState);
33e1c44949Sopenharmony_ci    void RejectRequest(int32_t callId, bool isSendSms, std::string &content);
34e1c44949Sopenharmony_ci    void HangUpRequest(int32_t callId);
35e1c44949Sopenharmony_ci    bool HangUpForDsdaRequest(sptr<CallBase> call);
36e1c44949Sopenharmony_ci    void HandleHoldAfterHangUp(TelCallState state, int32_t waitingCallNum);
37e1c44949Sopenharmony_ci    void HoldRequest(int32_t callId);
38e1c44949Sopenharmony_ci    void UnHoldRequest(int32_t callId);
39e1c44949Sopenharmony_ci    void SwitchRequest(int32_t callId);
40e1c44949Sopenharmony_ci    void CombineConferenceRequest(int32_t mainCallId);
41e1c44949Sopenharmony_ci    void SeparateConferenceRequest(int32_t callId);
42e1c44949Sopenharmony_ci    void KickOutFromConferenceRequest(int32_t callId);
43e1c44949Sopenharmony_ci    void StartRttRequest(int32_t callId, std::u16string &msg);
44e1c44949Sopenharmony_ci    void StopRttRequest(int32_t callId);
45e1c44949Sopenharmony_ci    void JoinConference(int32_t callId, std::vector<std::string> &numberList);
46e1c44949Sopenharmony_ci    bool IsDsdsMode3();
47e1c44949Sopenharmony_ci    bool IsDsdsMode5();
48e1c44949Sopenharmony_ci    bool HasActiveCall();
49e1c44949Sopenharmony_ci    bool HasDialingCall();
50e1c44949Sopenharmony_ci    bool NeedAnswerVTAndEndActiveVO(int32_t callId, int32_t videoState);
51e1c44949Sopenharmony_ci    bool NeedAnswerVOAndEndActiveVT(int32_t callId, int32_t videoState);
52e1c44949Sopenharmony_ci    void DisconnectOtherSubIdCall(int32_t callId, int32_t slotId, int32_t videoState);
53e1c44949Sopenharmony_ci    void DisconnectOtherCallForVideoCall(int32_t callId);
54e1c44949Sopenharmony_ci    void HandleCallWaitingNumTwo(sptr<CallBase> incomingCall, sptr<CallBase> call, int32_t slotId,
55e1c44949Sopenharmony_ci        int32_t activeCallNum, bool &flagForConference);
56e1c44949Sopenharmony_ci    void HandleCallWaitingNumOne(sptr<CallBase> incomingCall, sptr<CallBase> call, int32_t slotId,
57e1c44949Sopenharmony_ci        int32_t activeCallNum, bool &flagForConference);
58e1c44949Sopenharmony_ci    void HandleCallWaitingNumOneNext(sptr<CallBase> incomingCall, sptr<CallBase> call, sptr<CallBase> holdCall,
59e1c44949Sopenharmony_ci        int32_t slotId, bool &flagForConference);
60e1c44949Sopenharmony_ci    void HandleCallWaitingNumZero(sptr<CallBase> incomingCall, sptr<CallBase> call, int32_t slotId,
61e1c44949Sopenharmony_ci        int32_t activeCallNum, bool &flagForConference);
62e1c44949Sopenharmony_ci    void HoldOrDisconnectedCall(int32_t callId, int32_t slotId, int32_t videoState);
63e1c44949Sopenharmony_ci    bool HandleDsdaIncomingCall(
64e1c44949Sopenharmony_ci        sptr<CallBase> call, int32_t activeCallNum, int32_t slotId, int32_t videoState, sptr<CallBase> incomingCall);
65e1c44949Sopenharmony_ci    void IsExistCallOtherSlot(std::list<int32_t> &list, int32_t slotId, bool &noOtherCall);
66e1c44949Sopenharmony_ci    int32_t HandleDialingInfo(std::string newPhoneNum, DialParaInfo &info);
67e1c44949Sopenharmony_ci
68e1c44949Sopenharmony_ciprivate:
69e1c44949Sopenharmony_ci    int32_t CarrierDialProcess(DialParaInfo &info);
70e1c44949Sopenharmony_ci    int32_t IsDialCallForDsda(DialParaInfo &info);
71e1c44949Sopenharmony_ci    int32_t HandleEccCallForDsda(std::string newPhoneNum, DialParaInfo &info, bool &isEcc);
72e1c44949Sopenharmony_ci    int32_t VoiceMailDialProcess(DialParaInfo &info);
73e1c44949Sopenharmony_ci    int32_t OttDialProcess(DialParaInfo &info);
74e1c44949Sopenharmony_ci    int32_t PackCellularCallInfo(DialParaInfo &info, CellularCallInfo &callInfo);
75e1c44949Sopenharmony_ci    bool IsFdnNumber(std::vector<std::u16string> fdnNumberList, std::string phoneNumber);
76e1c44949Sopenharmony_ci    int32_t UpdateCallReportInfo(const DialParaInfo &info, TelCallState state);
77e1c44949Sopenharmony_ci    int32_t HandleStartDial(bool isMMiCode, CellularCallInfo callInfo);
78e1c44949Sopenharmony_ci    int32_t HandleDialFail();
79e1c44949Sopenharmony_ci    int32_t GetOtherRingingCall(int32_t currentCallId);
80e1c44949Sopenharmony_ci    int32_t EccDialPolicy();
81e1c44949Sopenharmony_ci
82e1c44949Sopenharmony_ciprivate:
83e1c44949Sopenharmony_ci    std::mutex mutex_;
84e1c44949Sopenharmony_ci};
85e1c44949Sopenharmony_ci} // namespace Telephony
86e1c44949Sopenharmony_ci} // namespace OHOS
87e1c44949Sopenharmony_ci
88e1c44949Sopenharmony_ci#endif // CALL_REQUEST_PROCESS_H
89