OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 5 #ifndef CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
6 #define CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 6 #define CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class Thread; | 14 class Thread; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
17 namespace dbus { | 17 namespace dbus { |
18 class Bus; | 18 class Bus; |
19 class ObjectPath; | 19 class ObjectPath; |
20 } // namespace dbus | 20 } // namespace dbus |
21 | 21 |
22 namespace chromeos { | 22 namespace chromeos { |
23 | 23 |
24 class DBusThreadManagerObserver; | |
25 | |
26 // Style Note: Clients are sorted by names. | 24 // Style Note: Clients are sorted by names. |
27 class BluetoothAdapterClient; | 25 class BluetoothAdapterClient; |
28 class BluetoothAgentManagerClient; | 26 class BluetoothAgentManagerClient; |
29 class BluetoothDeviceClient; | 27 class BluetoothDeviceClient; |
30 class BluetoothGattCharacteristicClient; | 28 class BluetoothGattCharacteristicClient; |
31 class BluetoothGattDescriptorClient; | 29 class BluetoothGattDescriptorClient; |
32 class BluetoothGattManagerClient; | 30 class BluetoothGattManagerClient; |
33 class BluetoothGattServiceClient; | 31 class BluetoothGattServiceClient; |
34 class BluetoothInputClient; | 32 class BluetoothInputClient; |
35 class BluetoothProfileManagerClient; | 33 class BluetoothProfileManagerClient; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // Returns true if DBusThreadManager has been initialized. Call this to | 107 // Returns true if DBusThreadManager has been initialized. Call this to |
110 // avoid initializing + shutting down DBusThreadManager more than once. | 108 // avoid initializing + shutting down DBusThreadManager more than once. |
111 static bool IsInitialized(); | 109 static bool IsInitialized(); |
112 | 110 |
113 // Destroys the global instance. | 111 // Destroys the global instance. |
114 static void Shutdown(); | 112 static void Shutdown(); |
115 | 113 |
116 // Gets the global instance. Initialize() must be called first. | 114 // Gets the global instance. Initialize() must be called first. |
117 static DBusThreadManager* Get(); | 115 static DBusThreadManager* Get(); |
118 | 116 |
119 // Adds or removes an observer. | |
120 virtual void AddObserver(DBusThreadManagerObserver* observer) = 0; | |
121 virtual void RemoveObserver(DBusThreadManagerObserver* observer) = 0; | |
122 | |
123 // Returns various D-Bus bus instances, owned by DBusThreadManager. | 117 // Returns various D-Bus bus instances, owned by DBusThreadManager. |
124 virtual dbus::Bus* GetSystemBus() = 0; | 118 virtual dbus::Bus* GetSystemBus() = 0; |
125 | 119 |
126 // All returned objects are owned by DBusThreadManager. Do not cache these | 120 // All returned objects are owned by DBusThreadManager. Do not cache these |
127 // pointers and use them after DBusThreadManager has been shut down. | 121 // pointers and use them after DBusThreadManager has been shut down. |
128 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; | 122 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; |
129 virtual BluetoothAgentManagerClient* GetBluetoothAgentManagerClient() = 0; | 123 virtual BluetoothAgentManagerClient* GetBluetoothAgentManagerClient() = 0; |
130 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; | 124 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; |
131 virtual BluetoothGattCharacteristicClient* | 125 virtual BluetoothGattCharacteristicClient* |
132 GetBluetoothGattCharacteristicClient() = 0; | 126 GetBluetoothGattCharacteristicClient() = 0; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 170 |
177 // Initializes |client| with the |system_bus_|. | 171 // Initializes |client| with the |system_bus_|. |
178 static void InitClient(DBusClient* client); | 172 static void InitClient(DBusClient* client); |
179 | 173 |
180 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); | 174 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); |
181 }; | 175 }; |
182 | 176 |
183 } // namespace chromeos | 177 } // namespace chromeos |
184 | 178 |
185 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 179 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
OLD | NEW |