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 
16 #ifndef OHOS_BLUETOOTH_STANDARD_AVRCP_TG_INTERFACE_H
17 #define OHOS_BLUETOOTH_STANDARD_AVRCP_TG_INTERFACE_H
18 
19 #include "bluetooth_service_ipc_interface_code.h"
20 #include "iremote_broker.h"
21 #include "i_bluetooth_avrcp_tg_observer.h"
22 
23 namespace OHOS {
24 namespace Bluetooth {
25 class IBluetoothAvrcpTg : public OHOS::IRemoteBroker {
26 public:
27     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothAvrcpTg");
28 
29     virtual void RegisterObserver(const sptr<IBluetoothAvrcpTgObserver> &observer) = 0;
30     virtual void UnregisterObserver(const sptr<IBluetoothAvrcpTgObserver> &observer) = 0;
31     virtual void SetActiveDevice(const BluetoothRawAddress &addr) = 0;
32     virtual int32_t Connect(const BluetoothRawAddress &addr) = 0;
33     virtual int32_t Disconnect(const BluetoothRawAddress &addr) = 0;
34     virtual std::vector<BluetoothRawAddress> GetConnectedDevices() = 0;
35     virtual std::vector<BluetoothRawAddress> GetDevicesByStates(const std::vector<int32_t> &states) = 0;
36     virtual int32_t GetDeviceState(const BluetoothRawAddress &addr) = 0;
37     virtual void NotifyPlaybackStatusChanged(int32_t playStatus, int32_t playbackPos) = 0;
38     virtual void NotifyTrackChanged(int64_t uid, int32_t playbackPos) = 0;
39     virtual void NotifyTrackReachedEnd(int32_t playbackPos) = 0;
40     virtual void NotifyTrackReachedStart(int32_t playbackPos) = 0;
41     virtual void NotifyPlaybackPosChanged(int32_t playbackPos) = 0;
42     virtual void NotifyPlayerAppSettingChanged(const std::vector<int32_t> &attributes,
43                                                const std::vector<int32_t> &values) = 0;
44     virtual void NotifyNowPlayingContentChanged() = 0;
45     virtual void NotifyAvailablePlayersChanged() = 0;
46     virtual void NotifyAddressedPlayerChanged(int32_t playerId, int32_t uidCounter) = 0;
47     virtual void NotifyUidChanged(int32_t uidCounter) = 0;
48     virtual void NotifyVolumeChanged(int32_t volume) = 0;
49     virtual int32_t SetDeviceAbsoluteVolume(const BluetoothRawAddress &addr, int32_t volumeLevel) = 0;
50     virtual int32_t SetDeviceAbsVolumeAbility(const BluetoothRawAddress &addr, int32_t ability) = 0;
51     virtual int32_t GetDeviceAbsVolumeAbility(const BluetoothRawAddress &addr, int32_t &ability) = 0;
52 };
53 }  // namespace Bluetooth
54 }  // namespace OHOS
55 #endif  // OHOS_BLUETOOTH_STANDARD_AVRCP_TG_INTERFACE_H