[Password Generation] Enable new UI
[chromium-blink-merge.git] / chromeos / dbus / bluetooth_profile_manager_client.h
blob4301ce91656cbfa75ef976ce9c7d79378e8ff36d
1 // Copyright 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.
5 #ifndef CHROMEOS_DBUS_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_
6 #define CHROMEOS_DBUS_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_
8 #include <string>
9 #include <vector>
11 #include "base/callback.h"
12 #include "base/values.h"
13 #include "chromeos/chromeos_export.h"
14 #include "chromeos/dbus/dbus_client.h"
15 #include "dbus/object_path.h"
17 namespace chromeos {
19 // BluetoothProfileManagerClient is used to communicate with the profile
20 // manager object of the Bluetooth daemon.
21 class CHROMEOS_EXPORT BluetoothProfileManagerClient : public DBusClient {
22 public:
23 // Species the role of the object within the profile. SYMMETRIC should be
24 // usually used unless the profile requires you specify as a CLIENT or as a
25 // SERVER.
26 enum ProfileRole {
27 SYMMETRIC,
28 CLIENT,
29 SERVER
32 // Options used to register a Profile object.
33 struct CHROMEOS_EXPORT Options {
34 Options();
35 ~Options();
37 // Human readable name for the profile.
38 std::string name;
40 // Primary service class UUID (if different from the actual UUID)
41 std::string service;
43 // Role.
44 enum ProfileRole role;
46 // RFCOMM channel number.
47 uint16 channel;
49 // PSM number.
50 uint16 psm;
52 // Pairing is required before connections will be established.
53 bool require_authentication;
55 // Request authorization before connections will be established.
56 bool require_authorization;
58 // Force connections when a remote device is connected.
59 bool auto_connect;
61 // Manual SDP record.
62 std::string service_record;
64 // Profile version.
65 uint16 version;
67 // Profile features.
68 uint16 features;
71 virtual ~BluetoothProfileManagerClient();
73 // The ErrorCallback is used by adapter methods to indicate failure.
74 // It receives two arguments: the name of the error in |error_name| and
75 // an optional message in |error_message|.
76 typedef base::Callback<void(const std::string& error_name,
77 const std::string& error_message)> ErrorCallback;
79 // Registers a profile implementation within the local process at the
80 // D-bus object path |profile_path| with the remote profile manager.
81 // |uuid| specifies the identifier of the profile and |options| the way in
82 // which the profile is implemented.
83 virtual void RegisterProfile(const dbus::ObjectPath& profile_path,
84 const std::string& uuid,
85 const Options& options,
86 const base::Closure& callback,
87 const ErrorCallback& error_callback) = 0;
89 // Unregisters the profile with the D-Bus object path |agent_path| from the
90 // remote profile manager.
91 virtual void UnregisterProfile(const dbus::ObjectPath& profile_path,
92 const base::Closure& callback,
93 const ErrorCallback& error_callback) = 0;
96 // Creates the instance.
97 static BluetoothProfileManagerClient* Create();
99 // Constants used to indicate exceptional error conditions.
100 static const char kNoResponseError[];
102 protected:
103 BluetoothProfileManagerClient();
105 private:
106 DISALLOW_COPY_AND_ASSIGN(BluetoothProfileManagerClient);
109 } // namespace chromeos
111 #endif // CHROMEOS_DBUS_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_