OLD | NEW |
(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_AGENT_MANAGER_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_EXPERIMENTAL_BLUETOOTH_AGENT_MANAGER_CLIENT_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/callback.h" |
| 12 #include "base/values.h" |
| 13 #include "chromeos/chromeos_export.h" |
| 14 #include "chromeos/dbus/dbus_client_implementation_type.h" |
| 15 #include "dbus/object_path.h" |
| 16 |
| 17 namespace dbus { |
| 18 class Bus; |
| 19 } // namespace dbus |
| 20 |
| 21 namespace chromeos { |
| 22 |
| 23 // ExperimentalBluetoothAgentManagerClient is used to communicate with the |
| 24 // agent manager component of the Bluetooth daemon. |
| 25 class CHROMEOS_EXPORT ExperimentalBluetoothAgentManagerClient { |
| 26 public: |
| 27 virtual ~ExperimentalBluetoothAgentManagerClient(); |
| 28 |
| 29 // The ErrorCallback is used by agent manager methods to indicate failure. |
| 30 // It receives two arguments: the name of the error in |error_name| and |
| 31 // an optional message in |error_message|. |
| 32 typedef base::Callback<void(const std::string& error_name, |
| 33 const std::string& error_message)> ErrorCallback; |
| 34 |
| 35 // Registers an agent within the local process at the D-bus object path |
| 36 // |agent_path| with the remote agent manager. The agent is used for pairing |
| 37 // and for authorization of incoming connection requests. |capability| |
| 38 // specifies the input and display capabilities of the agent and should be |
| 39 // one of the constants declared in the bluetooth_agent_manager:: namespace. |
| 40 virtual void RegisterAgent(const dbus::ObjectPath& agent_path, |
| 41 const std::string& capability, |
| 42 const base::Closure& callback, |
| 43 const ErrorCallback& error_callback) = 0; |
| 44 |
| 45 // Unregisters the agent with the D-Bus object path |agent_path| from the |
| 46 // remote agent manager. |
| 47 virtual void UnregisterAgent(const dbus::ObjectPath& agent_path, |
| 48 const base::Closure& callback, |
| 49 const ErrorCallback& error_callback) = 0; |
| 50 |
| 51 // Requests that the agent with the D-Bus object path |agent_path| be made |
| 52 // the default. |
| 53 virtual void RequestDefaultAgent(const dbus::ObjectPath& agent_path, |
| 54 const base::Closure& callback, |
| 55 const ErrorCallback& error_callback) = 0; |
| 56 |
| 57 // Creates the instance. |
| 58 static ExperimentalBluetoothAgentManagerClient* Create( |
| 59 DBusClientImplementationType type, |
| 60 dbus::Bus* bus); |
| 61 |
| 62 // Constants used to indicate exceptional error conditions. |
| 63 static const char kNoResponseError[]; |
| 64 |
| 65 protected: |
| 66 ExperimentalBluetoothAgentManagerClient(); |
| 67 |
| 68 private: |
| 69 DISALLOW_COPY_AND_ASSIGN(ExperimentalBluetoothAgentManagerClient); |
| 70 }; |
| 71 |
| 72 } // namespace chromeos |
| 73 |
| 74 #endif // CHROMEOS_DBUS_EXPERIMENTAL_BLUETOOTH_AGENT_MANAGER_CLIENT_H_ |
OLD | NEW |