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_STUB_H 17 #define OHOS_BLUETOOTH_STANDARD_AVRCP_CT_OBSERVER_STUB_H 18 19 #include <map> 20 21 #include "iremote_stub.h" 22 #include "i_bluetooth_host.h" 23 #include "i_bluetooth_avrcp_ct_observer.h" 24 25 namespace OHOS { 26 namespace Bluetooth { 27 class BluetoothAvrcpCtObserverStub : public IRemoteStub<IBluetoothAvrcpCtObserver> { 28 public: 29 BluetoothAvrcpCtObserverStub(); 30 virtual ~BluetoothAvrcpCtObserverStub(); 31 32 int OnRemoteRequest( 33 uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 34 35 private: 36 static ErrCode OnConnectionStateChangedInner( 37 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 38 static ErrCode OnPressButtonInner( 39 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 40 static ErrCode OnReleaseButtonInner( 41 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 42 static ErrCode OnSetBrowsedPlayerInner( 43 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 44 static ErrCode OnGetCapabilitiesInner( 45 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 46 static ErrCode OnGetPlayerAppSettingAttributesInner( 47 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 48 static ErrCode OnGetPlayerAppSettingValuesInner( 49 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 50 static ErrCode OnGetPlayerAppSettingCurrentValueInner( 51 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 52 static ErrCode OnSetPlayerAppSettingCurrentValueInner( 53 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 54 static ErrCode OnGetPlayerAppSettingAttributeTextInner( 55 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 56 static ErrCode OnGetPlayerAppSettingValueTextInner( 57 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 58 static ErrCode OnGetElementAttributesInner( 59 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 60 static ErrCode OnGetPlayStatusInner( 61 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 62 static ErrCode OnPlayItemInner( 63 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 64 static ErrCode OnGetTotalNumberOfItemsInner( 65 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 66 static ErrCode OnGetItemAttributesInner( 67 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 68 static ErrCode OnSetAbsoluteVolumeInner( 69 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 70 static ErrCode OnPlaybackStatusChangedInner( 71 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 72 static ErrCode OnTrackChangedInner( 73 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 74 static ErrCode OnTrackReachedEndInner( 75 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 76 static ErrCode OnTrackReachedStartInner( 77 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 78 static ErrCode OnPlaybackPosChangedInner( 79 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 80 static ErrCode OnPlayerAppSettingChangedInner( 81 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 82 static ErrCode OnNowPlayingContentChangedInner( 83 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 84 static ErrCode OnAvailablePlayersChangedInner( 85 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 86 static ErrCode OnAddressedPlayerChangedInner( 87 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 88 static ErrCode OnUidChangedInner( 89 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 90 static ErrCode OnVolumeChangedInner( 91 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 92 static ErrCode OnGetMediaPlayersInner( 93 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 94 static ErrCode OnGetFolderItemsInner( 95 BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 96 97 using BluetoothAvrcpCtObserverStubFunc = 98 ErrCode (*)(BluetoothAvrcpCtObserverStub *stub, MessageParcel &data, MessageParcel &reply); 99 std::map<uint32_t, BluetoothAvrcpCtObserverStubFunc> memberFuncMap_; 100 101 DISALLOW_COPY_AND_MOVE(BluetoothAvrcpCtObserverStub); 102 }; 103 } // namespace Bluetooth 104 } // namespace OHOS 105 #endif // OHOS_BLUETOOTH_STANDARD_AVRCP_CT_OBSERVER_STUB_H