| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_AMPLIFIER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_AMPLIFIER_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_AMPLIFIER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_AMPLIFIER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 9 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
| 10 #include "chromeos/dbus/dbus_client.h" | 12 #include "chromeos/dbus/dbus_client.h" |
| 11 #include "chromeos/dbus/dbus_method_call_status.h" | 13 #include "chromeos/dbus/dbus_method_call_status.h" |
| 12 | 14 |
| 13 namespace chromeos { | 15 namespace chromeos { |
| 14 | 16 |
| 15 // A DBus client class for the org.chromium.Amplifier service. | 17 // A DBus client class for the org.chromium.Amplifier service. |
| 16 class CHROMEOS_EXPORT AmplifierClient : public DBusClient { | 18 class CHROMEOS_EXPORT AmplifierClient : public DBusClient { |
| 17 public: | 19 public: |
| 18 // Interface for observing amplifier events from an amplifier client. | 20 // Interface for observing amplifier events from an amplifier client. |
| 19 class Observer { | 21 class Observer { |
| 20 public: | 22 public: |
| 21 virtual ~Observer() {} | 23 virtual ~Observer() {} |
| 22 // Called when the Error signal is received. | 24 // Called when the Error signal is received. |
| 23 virtual void OnError(int32 error_code) = 0; | 25 virtual void OnError(int32_t error_code) = 0; |
| 24 }; | 26 }; |
| 25 | 27 |
| 26 ~AmplifierClient() override; | 28 ~AmplifierClient() override; |
| 27 | 29 |
| 28 // Adds and removes observers for amplifier events. | 30 // Adds and removes observers for amplifier events. |
| 29 virtual void AddObserver(Observer* observer) = 0; | 31 virtual void AddObserver(Observer* observer) = 0; |
| 30 virtual void RemoveObserver(Observer* observer) = 0; | 32 virtual void RemoveObserver(Observer* observer) = 0; |
| 31 | 33 |
| 32 // Factory function; creates a new instance which is owned by the caller. | 34 // Factory function; creates a new instance which is owned by the caller. |
| 33 // For normal usage, access the singleton via DBusThreadManager::Get(). | 35 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| (...skipping 21 matching lines...) Expand all Loading... |
| 55 // Create() should be used instead. | 57 // Create() should be used instead. |
| 56 AmplifierClient(); | 58 AmplifierClient(); |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 DISALLOW_COPY_AND_ASSIGN(AmplifierClient); | 61 DISALLOW_COPY_AND_ASSIGN(AmplifierClient); |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 } // namespace chromeos | 64 } // namespace chromeos |
| 63 | 65 |
| 64 #endif // CHROMEOS_DBUS_AMPLIFIER_CLIENT_H_ | 66 #endif // CHROMEOS_DBUS_AMPLIFIER_CLIENT_H_ |
| OLD | NEW |