| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FLIMFLAM_DEVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FLIMFLAM_DEVICE_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FLIMFLAM_DEVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FLIMFLAM_DEVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // FlimflamDeviceClient is used to communicate with the Flimflam Device service. | 32 // FlimflamDeviceClient is used to communicate with the Flimflam Device service. |
| 33 // All methods should be called from the origin thread which initializes the | 33 // All methods should be called from the origin thread which initializes the |
| 34 // DBusThreadManager instance. | 34 // DBusThreadManager instance. |
| 35 class CHROMEOS_EXPORT FlimflamDeviceClient { | 35 class CHROMEOS_EXPORT FlimflamDeviceClient { |
| 36 public: | 36 public: |
| 37 typedef FlimflamClientHelper::PropertyChangedHandler PropertyChangedHandler; | 37 typedef FlimflamClientHelper::PropertyChangedHandler PropertyChangedHandler; |
| 38 typedef FlimflamClientHelper::VoidCallback VoidCallback; | 38 typedef FlimflamClientHelper::VoidCallback VoidCallback; |
| 39 typedef FlimflamClientHelper::ObjectPathCallback ObjectPathCallback; | 39 typedef FlimflamClientHelper::ObjectPathCallback ObjectPathCallback; |
| 40 typedef FlimflamClientHelper::DictionaryValueCallback DictionaryValueCallback; | 40 typedef FlimflamClientHelper::DictionaryValueCallback DictionaryValueCallback; |
| 41 typedef FlimflamClientHelper::ErrorCallback ErrorCallback; |
| 41 | 42 |
| 42 virtual ~FlimflamDeviceClient(); | 43 virtual ~FlimflamDeviceClient(); |
| 43 | 44 |
| 44 // Factory function, creates a new instance which is owned by the caller. | 45 // Factory function, creates a new instance which is owned by the caller. |
| 45 // For normal usage, access the singleton via DBusThreadManager::Get(). | 46 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| 46 static FlimflamDeviceClient* Create(DBusClientImplementationType type, | 47 static FlimflamDeviceClient* Create(DBusClientImplementationType type, |
| 47 dbus::Bus* bus); | 48 dbus::Bus* bus); |
| 48 | 49 |
| 49 // Sets PropertyChanged signal handler. | 50 // Sets PropertyChanged signal handler. |
| 50 virtual void SetPropertyChangedHandler( | 51 virtual void SetPropertyChangedHandler( |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // TODO(hashimoto): Refactor CrosAddIPConfig and remove this method. | 100 // TODO(hashimoto): Refactor CrosAddIPConfig and remove this method. |
| 100 virtual dbus::ObjectPath CallAddIPConfigAndBlock( | 101 virtual dbus::ObjectPath CallAddIPConfigAndBlock( |
| 101 const dbus::ObjectPath& device_path, | 102 const dbus::ObjectPath& device_path, |
| 102 const std::string& method) = 0; | 103 const std::string& method) = 0; |
| 103 | 104 |
| 104 // Calls RequirePin method. | 105 // Calls RequirePin method. |
| 105 // |callback| is called after the method call finishes. | 106 // |callback| is called after the method call finishes. |
| 106 virtual void RequirePin(const dbus::ObjectPath& device_path, | 107 virtual void RequirePin(const dbus::ObjectPath& device_path, |
| 107 const std::string& pin, | 108 const std::string& pin, |
| 108 bool require, | 109 bool require, |
| 109 const VoidCallback& callback) = 0; | 110 const base::Closure& callback, |
| 111 const ErrorCallback& error_callback) = 0; |
| 110 | 112 |
| 111 // Calls EnterPin method. | 113 // Calls EnterPin method. |
| 112 // |callback| is called after the method call finishes. | 114 // |callback| is called after the method call finishes. |
| 113 virtual void EnterPin(const dbus::ObjectPath& device_path, | 115 virtual void EnterPin(const dbus::ObjectPath& device_path, |
| 114 const std::string& pin, | 116 const std::string& pin, |
| 115 const VoidCallback& callback) = 0; | 117 const base::Closure& callback, |
| 118 const ErrorCallback& error_callback) = 0; |
| 116 | 119 |
| 117 // Calls UnblockPin method. | 120 // Calls UnblockPin method. |
| 118 // |callback| is called after the method call finishes. | 121 // |callback| is called after the method call finishes. |
| 119 virtual void UnblockPin(const dbus::ObjectPath& device_path, | 122 virtual void UnblockPin(const dbus::ObjectPath& device_path, |
| 120 const std::string& puk, | 123 const std::string& puk, |
| 121 const std::string& pin, | 124 const std::string& pin, |
| 122 const VoidCallback& callback) = 0; | 125 const base::Closure& callback, |
| 126 const ErrorCallback& error_callback) = 0; |
| 123 | 127 |
| 124 // Calls ChangePin method. | 128 // Calls ChangePin method. |
| 125 // |callback| is called after the method call finishes. | 129 // |callback| is called after the method call finishes. |
| 126 virtual void ChangePin(const dbus::ObjectPath& device_path, | 130 virtual void ChangePin(const dbus::ObjectPath& device_path, |
| 127 const std::string& old_pin, | 131 const std::string& old_pin, |
| 128 const std::string& new_pin, | 132 const std::string& new_pin, |
| 129 const VoidCallback& callback) = 0; | 133 const base::Closure& callback, |
| 134 const ErrorCallback& error_callback) = 0; |
| 130 | 135 |
| 131 // Calls Register method. | 136 // Calls Register method. |
| 132 // |callback| is called after the method call finishes. | 137 // |callback| is called after the method call finishes. |
| 133 virtual void Register(const dbus::ObjectPath& device_path, | 138 virtual void Register(const dbus::ObjectPath& device_path, |
| 134 const std::string& network_id, | 139 const std::string& network_id, |
| 135 const VoidCallback& callback) = 0; | 140 const base::Closure& callback, |
| 141 const ErrorCallback& error_callback) = 0; |
| 136 | 142 |
| 137 protected: | 143 protected: |
| 138 // Create() should be used instead. | 144 // Create() should be used instead. |
| 139 FlimflamDeviceClient(); | 145 FlimflamDeviceClient(); |
| 140 | 146 |
| 141 private: | 147 private: |
| 142 DISALLOW_COPY_AND_ASSIGN(FlimflamDeviceClient); | 148 DISALLOW_COPY_AND_ASSIGN(FlimflamDeviceClient); |
| 143 }; | 149 }; |
| 144 | 150 |
| 145 } // namespace chromeos | 151 } // namespace chromeos |
| 146 | 152 |
| 147 #endif // CHROMEOS_DBUS_FLIMFLAM_DEVICE_CLIENT_H_ | 153 #endif // CHROMEOS_DBUS_FLIMFLAM_DEVICE_CLIENT_H_ |
| OLD | NEW |