Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MEDIA_TRANSPORT_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ | 6 #define CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 // from the system. | 66 // from the system. |
| 67 virtual void MediaTransportRemoved(const dbus::ObjectPath& object_path) {} | 67 virtual void MediaTransportRemoved(const dbus::ObjectPath& object_path) {} |
| 68 | 68 |
| 69 // Called when the Media Transport with object path |object_path| has | 69 // Called when the Media Transport with object path |object_path| has |
| 70 // a change in the value of the property with name |property_name|. | 70 // a change in the value of the property with name |property_name|. |
| 71 virtual void MediaTransportPropertyChanged( | 71 virtual void MediaTransportPropertyChanged( |
| 72 const dbus::ObjectPath& object_path, | 72 const dbus::ObjectPath& object_path, |
| 73 const std::string& property_name) {} | 73 const std::string& property_name) {} |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 // Constants used to indicate exceptional error conditions. | |
|
armansito
2015/02/10 00:17:01
All of these should go to service_constants.h. tho
Miao
2015/02/10 22:15:21
Comment added! Right, these will go to service_con
| |
| 77 static const char kNoResponseError[]; | |
| 78 static const char kUnexpectedResponse[]; | |
| 79 | |
| 80 // Constants used for the names of Media Transport's properties. | |
| 81 static const char kDeviceProperty[]; | |
| 82 static const char kUUIDProperty[]; | |
| 83 static const char kCodecProperty[]; | |
| 84 static const char kConfigurationProperty[]; | |
| 85 static const char kStateProperty[]; | |
| 86 static const char kDelayProperty[]; | |
| 87 static const char kVolumeProperty[]; | |
| 88 | |
| 89 // All possible states of a valid media transport object. | |
| 90 static const char kStateIdle[]; | |
| 91 static const char kStatePending[]; | |
| 92 static const char kStateActive[]; | |
| 93 | |
| 76 ~BluetoothMediaTransportClient() override; | 94 ~BluetoothMediaTransportClient() override; |
| 77 | 95 |
| 78 // The ErrorCallback is used by media transport API methods to indicate | 96 // The ErrorCallback is used by media transport API methods to indicate |
| 79 // failure. It receives two arguments: the name of the error in |error_name| | 97 // failure. It receives two arguments: the name of the error in |error_name| |
| 80 // and an optional message in |error_message|. | 98 // and an optional message in |error_message|. |
| 81 typedef base::Callback<void(const std::string& error_name, | 99 typedef base::Callback<void(const std::string& error_name, |
| 82 const std::string& error_message)> ErrorCallback; | 100 const std::string& error_message)> ErrorCallback; |
| 83 | 101 |
| 84 // The AcquireCallback is used by |Acquire| method of media tansport API tp | 102 // The AcquireCallback is used by |Acquire| method of media tansport API tp |
| 85 // indicate the success of the method. | 103 // indicate the success of the method. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 108 const AcquireCallback& callback, | 126 const AcquireCallback& callback, |
| 109 const ErrorCallback& error_callback) = 0; | 127 const ErrorCallback& error_callback) = 0; |
| 110 | 128 |
| 111 // Releases the file descriptor of the transport. | 129 // Releases the file descriptor of the transport. |
| 112 virtual void Release(const dbus::ObjectPath& object_path, | 130 virtual void Release(const dbus::ObjectPath& object_path, |
| 113 const base::Closure& callback, | 131 const base::Closure& callback, |
| 114 const ErrorCallback& error_callback) = 0; | 132 const ErrorCallback& error_callback) = 0; |
| 115 | 133 |
| 116 static BluetoothMediaTransportClient* Create(); | 134 static BluetoothMediaTransportClient* Create(); |
| 117 | 135 |
| 118 // Constants used to indicate exceptional error conditions. | |
| 119 static const char kNoResponseError[]; | |
| 120 static const char kUnexpectedResponse[]; | |
| 121 | |
| 122 protected: | 136 protected: |
| 123 BluetoothMediaTransportClient(); | 137 BluetoothMediaTransportClient(); |
| 124 | 138 |
| 125 private: | 139 private: |
| 126 DISALLOW_COPY_AND_ASSIGN(BluetoothMediaTransportClient); | 140 DISALLOW_COPY_AND_ASSIGN(BluetoothMediaTransportClient); |
| 127 }; | 141 }; |
| 128 | 142 |
| 129 } // namespace chromeos | 143 } // namespace chromeos |
| 130 | 144 |
| 131 #endif // CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ | 145 #endif // CHROMEOS_DBUS_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ |
| OLD | NEW |