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

Side by Side Diff: chromeos/dbus/experimental_bluetooth_input_client.h

Issue 14048007: Bluetooth: D-Bus client interface for org.bluez.Input1 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: interface deletion order fixed. Created 7 years, 8 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) 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.
4
5 #ifndef CHROMEOS_DBUS_EXPERIMENTAL_BLUETOOTH_INPUT_CLIENT_H_
6 #define CHROMEOS_DBUS_EXPERIMENTAL_BLUETOOTH_INPUT_CLIENT_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/callback.h"
12 #include "base/observer_list.h"
13 #include "chromeos/chromeos_export.h"
14 #include "chromeos/dbus/dbus_client_implementation_type.h"
15 #include "dbus/object_path.h"
16 #include "dbus/property.h"
17
18 namespace dbus {
19 class Bus;
20 } // namespace dbus
21
22 namespace chromeos {
23
24 // ExperimentalBluetoothInputClient is used to communicate with Bluetooth
25 // Input objects.
26 class CHROMEOS_EXPORT ExperimentalBluetoothInputClient {
27 public:
28 // Structure of properties associated with bluetooth input devices.
29 struct Properties : public dbus::PropertySet {
30 // The Bluetooth input device reconnect mode. Read-only.
31 dbus::Property<std::string> reconnect_mode;
32
33 Properties(dbus::ObjectProxy* object_proxy,
34 const std::string& interface_name,
35 const PropertyChangedCallback& callback);
36 virtual ~Properties();
37 };
38
39 // Interface for observing changes from a remote bluetooth input device.
40 class Observer {
41 public:
42 virtual ~Observer() {}
43
44 // Called when the remote device with object path |object_path| implementing
45 // the Input interface is added to the set of known devices or an already
46 // known device implements the Input interface.
47 virtual void InputAdded(const dbus::ObjectPath& object_path) {}
48
49 // Called when the remote device with object path |object_path| is removed
50 // from the set of known devices or does not implement the Input interface
51 // anymore.
52 virtual void InputRemoved(const dbus::ObjectPath& object_path) {}
53
54 // Called when the device with object path |object_path| has a
55 // change in value of the property named |property_name| of its Input
56 // interface.
57 virtual void InputPropertyChanged(const dbus::ObjectPath& object_path,
58 const std::string& property_name) {}
59 };
60
61 virtual ~ExperimentalBluetoothInputClient();
62
63 // Adds and removes observers for events on all remote bluetooth input
64 // devices. Check the |object_path| parameter of observer methods to
65 // determine which device is issuing the event.
66 virtual void AddObserver(Observer* observer) = 0;
67 virtual void RemoveObserver(Observer* observer) = 0;
68
69 // Obtain the properties for the device with object path |object_path|,
70 // any values should be copied if needed.
71 virtual Properties* GetProperties(const dbus::ObjectPath& object_path) = 0;
72
73 // Creates the instance.
74 static ExperimentalBluetoothInputClient* Create(
75 DBusClientImplementationType type,
76 dbus::Bus* bus);
77
78 protected:
79 ExperimentalBluetoothInputClient();
80
81 private:
82 DISALLOW_COPY_AND_ASSIGN(ExperimentalBluetoothInputClient);
83 };
84
85 } // namespace chromeos
86
87 #endif // CHROMEOS_DBUS_EXPERIMENTAL_BLUETOOTH_INPUT_CLIENT_H_
OLDNEW
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.cc ('k') | chromeos/dbus/experimental_bluetooth_input_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698