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_CT_OBSERVER_INTERFACE_H
17 #define OHOS_BLUETOOTH_STANDARD_AVRCP_CT_OBSERVER_INTERFACE_H
18 
19 #include <cstdint>
20 #include <vector>
21 #include "bluetooth_service_ipc_interface_code.h"
22 #include "iremote_broker.h"
23 #include "../parcel/bluetooth_avrcp_meItem.h"
24 #include "../parcel/bluetooth_avrcp_mpItem.h"
25 #include "../common/raw_address.h"
26 #include "../common/avrcp_media.h"
27 
28 namespace OHOS {
29 namespace Bluetooth {
30 using namespace OHOS::bluetooth;
31 class IBluetoothAvrcpCtObserver : public OHOS::IRemoteBroker {
32 public:
33     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothAvrcpCtObserver");
34 
35     virtual void OnConnectionStateChanged(const RawAddress &rawAddr, int state, int cause) = 0;
36     virtual void OnPressButton(const RawAddress &rawAddr, uint8_t button, int result) = 0;
37     virtual void OnReleaseButton(const RawAddress &rawAddr, uint8_t button,  int result) = 0;
38     virtual void OnSetBrowsedPlayer(const RawAddress &rawAddr, uint16_t uidCounter,
39         uint32_t numberOfItems, const std::vector<std::string> &folderNames, int result, int detail) = 0;
40     virtual void OnGetCapabilities(const RawAddress &rawAddr, const std::vector<uint32_t> &companies,
41         const std::vector<uint8_t> &events, int result) = 0;
42     virtual void OnGetPlayerAppSettingAttributes(
43         const RawAddress &rawAddr, std::vector<uint8_t> attributes, int result) = 0;
44     virtual void OnGetPlayerAppSettingValues(const RawAddress &rawAddr,
45         int attribute, const std::vector<uint8_t> &values, int result) = 0;
46     virtual void OnGetPlayerAppSettingCurrentValue(const RawAddress &rawAddr, const std::vector<uint8_t> attributes,
47         const std::vector<uint8_t> &values, int result) = 0;
48     virtual void OnSetPlayerAppSettingCurrentValue(const RawAddress &rawAddr, int result) = 0;
49     virtual void OnGetPlayerAppSettingAttributeText(const RawAddress &rawAddr,
50         const std::vector<uint8_t> attribtues, const std::vector<std::string> &attributeName, int result) = 0;
51     virtual void OnGetPlayerAppSettingValueText(const RawAddress &rawAddr,
52         const std::vector<uint8_t> &values, const std::vector<std::string> &valueName, int result) = 0;
53     virtual void OnGetElementAttributes(const RawAddress &rawAddr,
54         const std::vector<uint32_t> &attribtues, const std::vector<std::string> &valueName, int result) = 0;
55     virtual void OnGetPlayStatus(const RawAddress &rawAddr,
56         uint32_t songLength, uint32_t songPosition, uint8_t playStatus, int result) = 0;
57     virtual void OnPlayItem(const RawAddress &rawAddr, int status, int result) = 0;
58     virtual void OnGetTotalNumberOfItems(const RawAddress &rawAddr, uint16_t uidCounter, uint32_t numOfItems,
59         int result, int detail) = 0;
60     virtual void OnGetItemAttributes(const RawAddress &rawAddr,
61         const std::vector<uint32_t> &attribtues, const std::vector<std::string> &values, int result, int detail) = 0;
62     virtual void OnSetAbsoluteVolume(const RawAddress &rawAddr, uint8_t volume, int result) = 0;
63     virtual void OnPlaybackStatusChanged(const RawAddress &rawAddr, uint8_t playStatus, int result) = 0;
64     virtual void OnTrackChanged(const RawAddress &rawAddr, uint64_t uid, int result) = 0;
65     virtual void OnTrackReachedEnd(const RawAddress &rawAddr, int result) = 0;
66     virtual void OnTrackReachedStart(const RawAddress &rawAddr, int result) = 0;
67     virtual void OnPlaybackPosChanged(const RawAddress &rawAddr, uint32_t playbackPos, int result) = 0;
68     virtual void OnPlayerAppSettingChanged(const RawAddress &rawAddr, const std::vector<uint8_t> &attributes,
69         const std::vector<uint8_t> &values, int result) = 0;
70     virtual void OnNowPlayingContentChanged(const RawAddress &rawAddr, int result) = 0;
71     virtual void OnAvailablePlayersChanged(const RawAddress &rawAddr, int result) = 0;
72     virtual void OnAddressedPlayerChanged(
73         const RawAddress &rawAddr, uint16_t playerId, uint16_t uidCounter, int result) = 0;
74     virtual void OnUidChanged(const RawAddress &rawAddr, uint16_t uidCounter, int result) = 0;
75     virtual void OnVolumeChanged(const RawAddress &rawAddr, uint8_t volume, int result) = 0;
76     virtual void OnGetMediaPlayers(const RawAddress &rawAddr, uint16_t uidCounter,
77         std::vector<BluetoothAvrcpMpItem> &items, int result, int detail) = 0;
78     virtual void OnGetFolderItems(const RawAddress &rawAddr, uint16_t uidCounter,
79         std::vector<BluetoothAvrcpMeItem> &items, int result, int detail) = 0;
80 };
81 }  // namespace Bluetooth
82 }  // namespace OHOS
83 #endif  // OHOS_BLUETOOTH_STANDARD_AVRCP_CT_OBSERVER_INTERFACE_H