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_OPP_SERVER_H 17 #define OHOS_BLUETOOTH_STANDARD_OPP_SERVER_H 18 19 #include <map> 20 21 #include "bt_def.h" 22 #include "bluetooth_opp_stub.h" 23 #include "bluetooth_types.h" 24 #include "i_bluetooth_opp.h" 25 #include "if_system_ability_manager.h" 26 #include "iservice_registry.h" 27 #include "system_ability.h" 28 #include "interface_adapter_manager.h" 29 #include "interface_profile_manager.h" 30 31 namespace OHOS { 32 namespace Bluetooth { 33 class BluetoothOppServer : public BluetoothOppStub { 34 public: 35 BluetoothOppServer(); 36 ~BluetoothOppServer() override; 37 38 ErrCode SendFile( 39 std::string &device, 40 std::vector<std::string> &filePaths, 41 std::vector<std::string> &mimeTypes, 42 bool& result) override; 43 44 ErrCode SetIncomingFileConfirmation( 45 bool &accept, 46 bool &result) override; 47 48 ErrCode GetCurrentTransferInformation( 49 BluetoothIOppTransferInformation &transferInformation) override; 50 51 ErrCode CancelTransfer( 52 bool &result) override; 53 54 ErrCode RegisterObserver( 55 const sptr<IBluetoothOppObserver> observer) override; 56 57 ErrCode DeregisterObserver( 58 const sptr<IBluetoothOppObserver> observer) override; 59 60 ErrCode GetDeviceState( 61 const BluetoothRawAddress &device, 62 int& result) override; 63 64 ErrCode GetDevicesByStates( 65 const std::vector<int32_t> &states, 66 std::vector<BluetoothRawAddress>& result) override; 67 68 private: 69 BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(BluetoothOppServer); 70 BLUETOOTH_DECLARE_IMPL(); 71 }; 72 } // namespace Bluetooth 73 } // namespace OHOS 74 #endif // OHOS_BLUETOOTH_STANDARD_OPP_SERVER_H