• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 BLUETOOTH_CALL_CLIENT_H
17 #define BLUETOOTH_CALL_CLIENT_H
18 
19 #include "singleton.h"
20 #include "pac_map.h"
21 
22 #include "call_manager_callback.h"
23 
24 namespace OHOS {
25 namespace Telephony {
26 class BluetoothCallClient : public std::enable_shared_from_this<BluetoothCallClient> {
27     DECLARE_DELAYED_SINGLETON(BluetoothCallClient)
28 public:
29     void Init();
30     void UnInit();
31     int32_t RegisterCallBack(std::unique_ptr<CallManagerCallback> callback);
32     int32_t UnRegisterCallBack();
33     int32_t DialCall(std::u16string number, AppExecFwk::PacMap &extras);
34     int32_t AnswerCall();
35     int32_t RejectCall();
36     int32_t HangUpCall();
37     int32_t GetCallState();
38     int32_t HoldCall();
39     int32_t UnHoldCall();
40     int32_t SwitchCall();
41     int32_t CombineConference();
42     int32_t SeparateConference();
43     int32_t StartDtmf(char str);
44     int32_t StopDtmf();
45     int32_t IsRinging(bool &enabled);
46     bool HasCall();
47     int32_t IsNewCallAllowed(bool &enabled);
48     int32_t IsInEmergencyCall(bool &enabled);
49     int32_t SetMuted(bool isMute);
50     int32_t MuteRinger();
51     int32_t SetAudioDevice(AudioDevice deviceType, const std::string &bluetoothAddress);
52     std::vector<CallAttributeInfo> GetCurrentCallList(int32_t slotId);
53 };
54 } // namespace Telephony
55 } // namespace OHOS
56 
57 #endif