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 I_CALL_MANAGER_SERVICE_H
17 #define I_CALL_MANAGER_SERVICE_H
18 
19 #include <cstdio>
20 #include <string>
21 #include <vector>
22 
23 #include "iremote_broker.h"
24 #include "surface.h"
25 #include "pac_map.h"
26 
27 #include "call_manager_inner_type.h"
28 #include "i_call_ability_callback.h"
29 
30 namespace OHOS {
31 namespace Telephony {
32 extern "C" {
33 enum CallManagerProxyType {
34     PROXY_BLUETOOTH_CALL = 0,
35 };
36 } // end extern
37 
38 class ICallManagerService : public IRemoteBroker {
39 public:
40     virtual ~ICallManagerService() = default;
41     virtual int32_t RegisterCallBack(const sptr<ICallAbilityCallback> &callback) = 0;
42     virtual int32_t UnRegisterCallBack() = 0;
43     virtual int32_t ObserverOnCallDetailsChange() = 0;
44     virtual int32_t DialCall(std::u16string number, AppExecFwk::PacMap &extras) = 0;
45     virtual int32_t MakeCall(std::string number) = 0;
46     virtual int32_t AnswerCall(int32_t callId, int32_t videoState) = 0;
47     virtual int32_t RejectCall(int32_t callId, bool rejectWithMessage, std::u16string textMessage) = 0;
48     virtual int32_t HangUpCall(int32_t callId) = 0;
49     virtual int32_t GetCallState() = 0;
50     virtual int32_t HoldCall(int32_t callId) = 0;
51     virtual int32_t UnHoldCall(int32_t callId) = 0;
52     virtual int32_t SwitchCall(int32_t callId) = 0;
53     virtual bool HasCall() = 0;
54     virtual int32_t IsNewCallAllowed(bool &enabled) = 0;
55     virtual int32_t SetMuted(bool isMute) = 0;
56     virtual int32_t MuteRinger() = 0;
57     virtual int32_t SetAudioDevice(const AudioDevice &audioDevice) = 0;
58     virtual int32_t IsRinging(bool &enabled) = 0;
59     virtual int32_t IsInEmergencyCall(bool &enabled) = 0;
60     virtual int32_t StartDtmf(int32_t callId, char str) = 0;
61     virtual int32_t StopDtmf(int32_t callId) = 0;
62     virtual int32_t PostDialProceed(int32_t callId, bool proceed) = 0;
63     virtual int32_t GetCallWaiting(int32_t slotId) = 0;
64     virtual int32_t SetCallWaiting(int32_t slotId, bool activate) = 0;
65     virtual int32_t GetCallRestriction(int32_t slotId, CallRestrictionType type) = 0;
66     virtual int32_t SetCallRestriction(int32_t slotId, CallRestrictionInfo &info) = 0;
67     virtual int32_t SetCallRestrictionPassword(
68         int32_t slotId, CallRestrictionType fac, const char *oldPassword, const char *newPassword) = 0;
69     virtual int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type) = 0;
70     virtual int32_t SetCallTransferInfo(int32_t slotId, CallTransferInfo &info) = 0;
71     virtual int32_t CanSetCallTransferTime(int32_t slotId, bool &result) = 0;
72     virtual int32_t CombineConference(int32_t mainCallId) = 0;
73     virtual int32_t SeparateConference(int32_t callId) = 0;
74     virtual int32_t KickOutFromConference(int32_t callId) = 0;
75     virtual int32_t IsEmergencyPhoneNumber(std::u16string &number, int32_t slotId, bool &enabled) = 0;
76     virtual int32_t FormatPhoneNumber(
77         std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber) = 0;
78     virtual int32_t FormatPhoneNumberToE164(
79         std::u16string &number, std::u16string &countryCode, std::u16string &formatNumber) = 0;
80     virtual int32_t GetMainCallId(int32_t callId, int32_t &mainCallId) = 0;
81     virtual int32_t GetSubCallIdList(int32_t callId, std::vector<std::u16string> &callIdList) = 0;
82     virtual int32_t GetCallIdListForConference(int32_t callId, std::vector<std::u16string> &callIdList) = 0;
83     virtual int32_t ControlCamera(int32_t callId, std::u16string &cameraId) = 0;
84     virtual int32_t SetPreviewWindow(int32_t callId, std::string &surfaceId, sptr<Surface> surface) = 0;
85     virtual int32_t SetDisplayWindow(int32_t callId, std::string &surfaceId, sptr<Surface> surface) = 0;
86     virtual int32_t SetCameraZoom(float zoomRatio) = 0;
87     virtual int32_t SetPausePicture(int32_t callId, std::u16string &path) = 0;
88     virtual int32_t SetDeviceDirection(int32_t callId, int32_t rotation) = 0;
89     virtual int32_t SetCallPreferenceMode(int32_t slotId, int32_t mode) = 0;
90     virtual int32_t GetImsConfig(int32_t slotId, ImsConfigItem item) = 0;
91     virtual int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, std::u16string &value) = 0;
92     virtual int32_t GetImsFeatureValue(int32_t slotId, FeatureType type) = 0;
93     virtual int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value) = 0;
94     virtual int32_t UpdateImsCallMode(int32_t callId, ImsCallMode mode) = 0;
95     virtual int32_t EnableImsSwitch(int32_t slotId) = 0;
96     virtual int32_t DisableImsSwitch(int32_t slotId) = 0;
97     virtual int32_t IsImsSwitchEnabled(int32_t slotId, bool &enabled) = 0;
98     virtual int32_t SetVoNRState(int32_t slotId, int32_t state) = 0;
99     virtual int32_t GetVoNRState(int32_t slotId, int32_t &state) = 0;
100     virtual int32_t StartRtt(int32_t callId, std::u16string &msg) = 0;
101     virtual int32_t StopRtt(int32_t callId) = 0;
102     virtual int32_t JoinConference(int32_t callId, std::vector<std::u16string> &numberList) = 0;
103     virtual int32_t ReportOttCallDetailsInfo(std::vector<OttCallDetailsInfo> &ottVec) = 0;
104     virtual int32_t ReportOttCallEventInfo(OttCallEventInfo &eventInfo) = 0;
105     virtual int32_t CloseUnFinishedUssd(int32_t slotId) = 0;
106     virtual int32_t InputDialerSpecialCode(const std::string &specialCode) = 0;
107     virtual int32_t RemoveMissedIncomingCallNotification() = 0;
108     virtual int32_t SetVoIPCallState(int32_t state) = 0;
109     virtual int32_t GetVoIPCallState(int32_t &state) = 0;
110     virtual sptr<IRemoteObject> GetProxyObjectPtr(CallManagerProxyType proxyType) = 0;
111     virtual int32_t ReportAudioDeviceInfo() = 0;
112     virtual int32_t CancelCallUpgrade(int32_t callId) = 0;
113     virtual int32_t RequestCameraCapabilities(int32_t callId) = 0;
114     virtual int32_t RegisterVoipCallManagerCallback() = 0;
115     virtual int32_t UnRegisterVoipCallManagerCallback() = 0;
116     virtual int32_t SendCallUiEvent(int32_t callId, std::string &eventName) = 0;
117 
118 public:
119     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ICallManagerService");
120 };
121 } // namespace Telephony
122 } // namespace OHOS
123 
124 #endif // I_CALL_MANAGER_SERVICE_H
125