Files.app: Provide detailed change information on onDirectoryChanged event
[chromium-blink-merge.git] / device / bluetooth / bluetooth_device_mac.h
blob462cd35c3440d5319f9a9c68ebc1c1c3b7722c73
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_
8 #import <IOBluetooth/IOBluetooth.h>
10 #include <string>
12 #include "base/basictypes.h"
13 #include "base/mac/scoped_nsobject.h"
14 #include "base/observer_list.h"
15 #include "device/bluetooth/bluetooth_device.h"
17 @class IOBluetoothDevice;
19 namespace device {
21 class BluetoothDeviceMac : public BluetoothDevice {
22 public:
23 explicit BluetoothDeviceMac(IOBluetoothDevice* device);
24 virtual ~BluetoothDeviceMac();
26 // BluetoothDevice override
27 virtual void AddObserver(
28 device::BluetoothDevice::Observer* observer) OVERRIDE;
29 virtual void RemoveObserver(
30 device::BluetoothDevice::Observer* observer) OVERRIDE;
31 virtual uint32 GetBluetoothClass() const OVERRIDE;
32 virtual std::string GetAddress() const OVERRIDE;
33 virtual VendorIDSource GetVendorIDSource() const OVERRIDE;
34 virtual uint16 GetVendorID() const OVERRIDE;
35 virtual uint16 GetProductID() const OVERRIDE;
36 virtual uint16 GetDeviceID() const OVERRIDE;
37 virtual int GetRSSI() const OVERRIDE;
38 virtual int GetCurrentHostTransmitPower() const OVERRIDE;
39 virtual int GetMaximumHostTransmitPower() const OVERRIDE;
40 virtual bool IsPaired() const OVERRIDE;
41 virtual bool IsConnected() const OVERRIDE;
42 virtual bool IsConnectable() const OVERRIDE;
43 virtual bool IsConnecting() const OVERRIDE;
44 virtual UUIDList GetUUIDs() const OVERRIDE;
45 virtual bool ExpectingPinCode() const OVERRIDE;
46 virtual bool ExpectingPasskey() const OVERRIDE;
47 virtual bool ExpectingConfirmation() const OVERRIDE;
48 virtual void Connect(
49 PairingDelegate* pairing_delegate,
50 const base::Closure& callback,
51 const ConnectErrorCallback& error_callback) OVERRIDE;
52 virtual void SetPinCode(const std::string& pincode) OVERRIDE;
53 virtual void SetPasskey(uint32 passkey) OVERRIDE;
54 virtual void ConfirmPairing() OVERRIDE;
55 virtual void RejectPairing() OVERRIDE;
56 virtual void CancelPairing() OVERRIDE;
57 virtual void Disconnect(
58 const base::Closure& callback,
59 const ErrorCallback& error_callback) OVERRIDE;
60 virtual void Forget(const ErrorCallback& error_callback) OVERRIDE;
61 virtual void ConnectToService(
62 const BluetoothUUID& uuid,
63 const ConnectToServiceCallback& callback,
64 const ConnectToServiceErrorCallback& error_callback) OVERRIDE;
65 virtual void CreateGattConnection(
66 const GattConnectionCallback& callback,
67 const ConnectErrorCallback& error_callback) OVERRIDE;
68 virtual void StartConnectionMonitor(
69 const base::Closure& callback,
70 const ErrorCallback& error_callback) OVERRIDE;
72 // Returns the Bluetooth address for the |device|. The returned address has a
73 // normalized format (see below).
74 static std::string GetDeviceAddress(IOBluetoothDevice* device);
76 protected:
77 // BluetoothDevice override
78 virtual std::string GetDeviceName() const OVERRIDE;
80 private:
81 friend class BluetoothAdapterMac;
83 // Implementation to read the host's transmit power level of type
84 // |power_level_type|.
85 int GetHostTransmitPower(
86 BluetoothHCITransmitPowerLevelType power_level_type) const;
88 // List of observers interested in event notifications from us.
89 ObserverList<Observer> observers_;
91 base::scoped_nsobject<IOBluetoothDevice> device_;
93 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac);
96 } // namespace device
98 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_