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_BLUETOOTH_BLUETOOTH_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_MANAGER_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 namespace chromeos { |
| 14 |
| 15 class BluetoothAdapter; |
| 16 |
| 17 // BluetoothManager provides the Chrome OS bluetooth API. |
| 18 // This API is simplified relative to what's available via D-Bus. |
| 19 // We'll export additional functionality as needed. |
| 20 class BluetoothManager { |
| 21 public: |
| 22 // Interface for observing changes from the bluetooth manager. |
| 23 class Observer { |
| 24 public: |
| 25 // Notification that the default adapter has changed. If |adapter| is NULL, |
| 26 // it means that there are no longer any adapters. |
| 27 // Clients should not cache this pointer. |
| 28 virtual void DefaultAdapterChanged(BluetoothAdapter* adapter) = 0; |
| 29 virtual ~Observer() {} |
| 30 }; |
| 31 |
| 32 // Adds and removes the observer. |
| 33 virtual void AddObserver(Observer* observer) = 0; |
| 34 virtual void RemoveObserver(Observer* observer) = 0; |
| 35 |
| 36 // Returns the default local bluetooth adapter or NULL if there is none. |
| 37 // Clients should not cache this pointer. |
| 38 virtual BluetoothAdapter* DefaultAdapter() = 0; |
| 39 |
| 40 static void Initialize(); |
| 41 static void Shutdown(); |
| 42 static BluetoothManager* GetInstance(); |
| 43 |
| 44 protected: |
| 45 BluetoothManager(); |
| 46 virtual ~BluetoothManager(); |
| 47 |
| 48 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(BluetoothManager); |
| 50 }; |
| 51 |
| 52 } // namespace chromeos |
| 53 |
| 54 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_MANAGER_H_ |
OLD | NEW |