1 /*
2  * Copyright (C) 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 #ifndef OHOS_BLUETOOTH_STANDARD_HFP_HF_PROXY_H
16 #define OHOS_BLUETOOTH_STANDARD_HFP_HF_PROXY_H
17 
18 #include "iremote_proxy.h"
19 #include "i_bluetooth_hfp_hf.h"
20 
21 namespace OHOS {
22 namespace Bluetooth {
23 class BluetoothHfpHfProxy : public IRemoteProxy<IBluetoothHfpHf> {
24 public:
BluetoothHfpHfProxy(const sptr<IRemoteObject> & impl)25     explicit BluetoothHfpHfProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IBluetoothHfpHf>(impl) {};
~BluetoothHfpHfProxy()26     ~BluetoothHfpHfProxy() {};
27 
28     bool ConnectSco(const BluetoothRawAddress &device) override;
29     bool DisconnectSco(const BluetoothRawAddress &device) override;
30     int GetDevicesByStates(const std::vector<int> &states, std::vector<BluetoothRawAddress> &devices) override;
31     int GetDeviceState(const BluetoothRawAddress &device) override;
32     int GetScoState(const BluetoothRawAddress &device) override;
33     bool SendDTMFTone(const BluetoothRawAddress &device, uint8_t code) override;
34     int Connect(const BluetoothRawAddress &device) override;
35     int Disconnect(const BluetoothRawAddress &device) override;
36     bool OpenVoiceRecognition(const BluetoothRawAddress &device) override;
37     bool CloseVoiceRecognition(const BluetoothRawAddress &device) override;
38     int GetCurrentCallList(const BluetoothRawAddress &device, std::vector<BluetoothHfpHfCall> &calls) override;
39     bool AcceptIncomingCall(const BluetoothRawAddress &device, int flag) override;
40     bool HoldActiveCall(const BluetoothRawAddress &device) override;
41     bool RejectIncomingCall(const BluetoothRawAddress &device) override;
42     bool SendKeyPressed(const BluetoothRawAddress &device) override;
43     bool HandleIncomingCall(const BluetoothRawAddress &device, int flag) override;
44     bool HandleMultiCall(const BluetoothRawAddress &device, int flag, int index) override;
45     bool DialLastNumber(const BluetoothRawAddress &device) override;
46     bool DialMemory(const BluetoothRawAddress &device, int index) override;
47     bool SendVoiceTag(const BluetoothRawAddress &device, int index) override;
48     bool FinishActiveCall(const BluetoothRawAddress &device, const BluetoothHfpHfCall &call) override;
49     int StartDial(const BluetoothRawAddress &device, const std::string &number, BluetoothHfpHfCall &call) override;
50     void RegisterObserver(const sptr<IBluetoothHfpHfObserver> &observer) override;
51     void DeregisterObserver(const sptr<IBluetoothHfpHfObserver> &observer) override;
52 
53 private:
54     static inline BrokerDelegator<BluetoothHfpHfProxy> delegator_;
55 };
56 
57 }  // namespace Bluetooth
58 }  // namespace OHOS
59 
60 #endif  // OHOS_BLUETOOTH_STANDARD_HFP_HF_PROXY_H