| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/values.h" | 13 #include "base/values.h" |
| 13 #include "chromeos/chromeos_export.h" | 14 #include "chromeos/chromeos_export.h" |
| 14 #include "chromeos/dbus/dbus_client.h" | 15 #include "chromeos/dbus/dbus_client.h" |
| 15 #include "dbus/object_path.h" | 16 #include "dbus/object_path.h" |
| 16 | 17 |
| 17 namespace chromeos { | 18 namespace chromeos { |
| 18 | 19 |
| 19 // BluetoothProfileManagerClient is used to communicate with the profile | 20 // BluetoothProfileManagerClient is used to communicate with the profile |
| 20 // manager object of the Bluetooth daemon. | 21 // manager object of the Bluetooth daemon. |
| 21 class CHROMEOS_EXPORT BluetoothProfileManagerClient : public DBusClient { | 22 class CHROMEOS_EXPORT BluetoothProfileManagerClient : public DBusClient { |
| 22 public: | 23 public: |
| 23 // Species the role of the object within the profile. SYMMETRIC should be | 24 // 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 // usually used unless the profile requires you specify as a CLIENT or as a |
| 25 // SERVER. | 26 // SERVER. |
| 26 enum ProfileRole { | 27 enum ProfileRole { |
| 27 SYMMETRIC, | 28 SYMMETRIC, |
| 28 CLIENT, | 29 CLIENT, |
| 29 SERVER | 30 SERVER |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 // Options used to register a Profile object. | 33 // Options used to register a Profile object. |
| 33 struct CHROMEOS_EXPORT Options { | 34 struct CHROMEOS_EXPORT Options { |
| 34 Options(); | 35 Options(); |
| 35 ~Options(); | 36 ~Options(); |
| 36 | 37 |
| 37 // Human readable name for the profile. | 38 // Human readable name for the profile. |
| 38 std::string name; | 39 scoped_ptr<std::string> name; |
| 39 | 40 |
| 40 // Primary service class UUID (if different from the actual UUID) | 41 // Primary service class UUID (if different from the actual UUID) |
| 41 std::string service; | 42 scoped_ptr<std::string> service; |
| 42 | 43 |
| 43 // Role. | 44 // Role. |
| 44 enum ProfileRole role; | 45 enum ProfileRole role; |
| 45 | 46 |
| 46 // RFCOMM channel number. | 47 // RFCOMM channel number. |
| 47 uint16 channel; | 48 scoped_ptr<uint16> channel; |
| 48 | 49 |
| 49 // PSM number. | 50 // PSM number. |
| 50 uint16 psm; | 51 scoped_ptr<uint16> psm; |
| 51 | 52 |
| 52 // Pairing is required before connections will be established. | 53 // Pairing is required before connections will be established. |
| 53 bool require_authentication; | 54 scoped_ptr<bool> require_authentication; |
| 54 | 55 |
| 55 // Request authorization before connections will be established. | 56 // Request authorization before connections will be established. |
| 56 bool require_authorization; | 57 scoped_ptr<bool> require_authorization; |
| 57 | 58 |
| 58 // Force connections when a remote device is connected. | 59 // Force connections when a remote device is connected. |
| 59 bool auto_connect; | 60 scoped_ptr<bool> auto_connect; |
| 60 | 61 |
| 61 // Manual SDP record. | 62 // Manual SDP record. |
| 62 std::string service_record; | 63 scoped_ptr<std::string> service_record; |
| 63 | 64 |
| 64 // Profile version. | 65 // Profile version. |
| 65 uint16 version; | 66 scoped_ptr<uint16> version; |
| 66 | 67 |
| 67 // Profile features. | 68 // Profile features. |
| 68 uint16 features; | 69 scoped_ptr<uint16> features; |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 virtual ~BluetoothProfileManagerClient(); | 72 virtual ~BluetoothProfileManagerClient(); |
| 72 | 73 |
| 73 // The ErrorCallback is used by adapter methods to indicate failure. | 74 // 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 // It receives two arguments: the name of the error in |error_name| and |
| 75 // an optional message in |error_message|. | 76 // an optional message in |error_message|. |
| 76 typedef base::Callback<void(const std::string& error_name, | 77 typedef base::Callback<void(const std::string& error_name, |
| 77 const std::string& error_message)> ErrorCallback; | 78 const std::string& error_message)> ErrorCallback; |
| 78 | 79 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 102 protected: | 103 protected: |
| 103 BluetoothProfileManagerClient(); | 104 BluetoothProfileManagerClient(); |
| 104 | 105 |
| 105 private: | 106 private: |
| 106 DISALLOW_COPY_AND_ASSIGN(BluetoothProfileManagerClient); | 107 DISALLOW_COPY_AND_ASSIGN(BluetoothProfileManagerClient); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace chromeos | 110 } // namespace chromeos |
| 110 | 111 |
| 111 #endif // CHROMEOS_DBUS_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_ | 112 #endif // CHROMEOS_DBUS_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_ |
| OLD | NEW |