Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: chrome/browser/chromeos/dbus/bluetooth_input_client.h

Issue 9838085: Move files inside chrome/browser/chromeos/dbus to chromeos/dbus (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: _ Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_INPUT_CLIENT_H_
6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_INPUT_CLIENT_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/callback.h"
12 #include "base/observer_list.h"
13 #include "base/values.h"
14 #include "chrome/browser/chromeos/dbus/bluetooth_property.h"
15 #include "dbus/object_path.h"
16
17 namespace dbus {
18 class Bus;
19 } // namespace dbus
20
21 namespace chromeos {
22
23 class BluetoothAdapterClient;
24
25 // BluetoothInputClient is used to communicate with the Input interface
26 // of a bluetooth device, rather than the generic device interface. Input
27 // devices are those conforming to the Bluetooth SIG HID (Human Interface
28 // Device) Profile such as keyboards, mice, trackpads and joysticks.
29 class BluetoothInputClient {
30 public:
31 // Structure of properties associated with bluetooth input devices.
32 struct Properties : public BluetoothPropertySet {
33 // Indicates that the device is currently connected. Read-only.
34 BluetoothProperty<bool> connected;
35
36 Properties(dbus::ObjectProxy* object_proxy,
37 PropertyChangedCallback callback);
38 virtual ~Properties();
39 };
40
41 // Interface for observing changes from a bluetooth input device.
42 class Observer {
43 public:
44 virtual ~Observer() {}
45
46 // Called when the device with object path |object_path| has a
47 // change in value of the input property named |property_name|.
48 virtual void InputPropertyChanged(const dbus::ObjectPath& object_path,
49 const std::string& property_name) {}
50 };
51
52 virtual ~BluetoothInputClient();
53
54 // Adds and removes observers for events on all bluetooth input
55 // devices. Check the |object_path| parameter of observer methods to
56 // determine which device is issuing the event.
57 virtual void AddObserver(Observer* observer) = 0;
58 virtual void RemoveObserver(Observer* observer) = 0;
59
60 // Obtain the input properties for the device with object path |object_path|,
61 // any values should be copied if needed.
62 virtual Properties* GetProperties(const dbus::ObjectPath& object_path) = 0;
63
64 // The InputCallback is used for input device methods that only return to
65 // indicate success. It receives two arguments, the |object_path| of the
66 // input devuce the call was made on and |success| which indicates whether
67 // or not the request succeeded.
68 typedef base::Callback<void(const dbus::ObjectPath&, bool)> InputCallback;
69
70 // Connects the input subsystem to the device with object path
71 // |object_path|, which should already be a known device on the adapter.
72 virtual void Connect(const dbus::ObjectPath& object_path,
73 const InputCallback& callback) = 0;
74
75 // Disconnects the input subsystem from the device with object path
76 // |object_path| without terminating the low-level ACL connection,
77 virtual void Disconnect(const dbus::ObjectPath& object_path,
78 const InputCallback& callback) = 0;
79
80 // Creates the instance.
81 static BluetoothInputClient* Create(dbus::Bus* bus,
82 BluetoothAdapterClient* adapter_client);
83
84 protected:
85 BluetoothInputClient();
86
87 private:
88 DISALLOW_COPY_AND_ASSIGN(BluetoothInputClient);
89 };
90
91 } // namespace chromeos
92
93 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_INPUT_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698