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_OBSERVER_STUB_H
16 #define OHOS_BLUETOOTH_STANDARD_HFP_HF_OBSERVER_STUB_H
17 
18 #include <map>
19 #include "iremote_stub.h"
20 #include "i_bluetooth_hfp_hf_observer.h"
21 
22 namespace OHOS {
23 namespace Bluetooth {
24 class BluetoothHfpHfObserverStub : public IRemoteStub<IBluetoothHfpHfObserver> {
25 
26 public:
27     BluetoothHfpHfObserverStub();
28     virtual ~BluetoothHfpHfObserverStub();
29 
30     int OnRemoteRequest(
31         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
32 
33 private:
34 
35     static ErrCode OnConnectionStateChangedInner(
36         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
37     static ErrCode OnScoStateChangedInner(
38         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
39     static ErrCode OnCallChangedInner(
40         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
41     static ErrCode OnSignalStrengthChangedInner(
42         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
43     static ErrCode OnRegistrationStatusChangedInner(
44         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
45     static ErrCode OnRoamingStatusChangedInner(
46         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
47     static ErrCode OnOperatorSelectionChangedInner(
48         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
49     static ErrCode OnSubscriberNumberChangedInner(
50         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
51     static ErrCode OnVoiceRecognitionStatusChangedInner(
52         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
53     static ErrCode OnInBandRingToneChangedInner(
54         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
55 
56     using BluetoothHfpHfObserverFunc = ErrCode (*)(
57         BluetoothHfpHfObserverStub *stub, MessageParcel &data, MessageParcel &reply);
58     std::map<uint32_t, BluetoothHfpHfObserverFunc> memberFuncMap_;
59 
60     DISALLOW_COPY_AND_MOVE(BluetoothHfpHfObserverStub);
61 };
62 
63 }  // namespace Bluetooth
64 }  // namespace OHOS
65 
66 #endif  // OHOS_BLUETOOTH_STANDARD_HFP_HF_OBSERVER_STUB_H