OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/observer_list.h" |
| 12 #include "base/values.h" |
| 13 |
| 14 namespace dbus { |
| 15 class Bus; |
| 16 } // namespace dbus |
| 17 |
| 18 namespace chromeos { |
| 19 |
| 20 // BluetoothAdapterClient is used to communicate with a bluetooth Adapter |
| 21 // interface. |
| 22 class BluetoothAdapterClient { |
| 23 public: |
| 24 // Interface for observing changes from a local bluetooth adapter. |
| 25 class Observer { |
| 26 public: |
| 27 virtual ~Observer() {} |
| 28 |
| 29 // Called when the adapter's Discovering property changes. |
| 30 virtual void DiscoveringPropertyChanged(const std::string& path, |
| 31 bool discovering) = 0; |
| 32 |
| 33 // Called when a new remote device has been discovered. |
| 34 // |device_properties| should be copied if needed. |
| 35 virtual void DeviceFound(const std::string& path, |
| 36 const std::string& address, |
| 37 const DictionaryValue& device_properties) = 0; |
| 38 |
| 39 // Called when a previously discovered device is no longer visible. |
| 40 virtual void DeviceDisappeared(const std::string& path, |
| 41 const std::string& address) = 0; |
| 42 }; |
| 43 |
| 44 virtual ~BluetoothAdapterClient(); |
| 45 |
| 46 // Adds and removes observers for events on the adapter with path |path|. |
| 47 virtual void AddObserver(Observer* observer, const std::string& path) = 0; |
| 48 virtual void RemoveObserver(Observer* observer, const std::string& path) = 0; |
| 49 |
| 50 // Starts a device discovery on the adapter with path |path|. |
| 51 virtual void StartDiscovery(const std::string& path) = 0; |
| 52 |
| 53 // Cancels any previous device discovery on the adapter with path |path|. |
| 54 virtual void StopDiscovery(const std::string& path) = 0; |
| 55 |
| 56 // Creates the instance. |
| 57 static BluetoothAdapterClient* Create(dbus::Bus* bus); |
| 58 |
| 59 protected: |
| 60 BluetoothAdapterClient(); |
| 61 |
| 62 private: |
| 63 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterClient); |
| 64 }; |
| 65 |
| 66 } // namespace chromeos |
| 67 |
| 68 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_ADAPTER_CLIENT_H_ |
OLD | NEW |