| 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_SHILL_PROFILE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace chromeos { | 30 namespace chromeos { |
| 31 | 31 |
| 32 class ShillPropertyChangedObserver; | 32 class ShillPropertyChangedObserver; |
| 33 | 33 |
| 34 // ShillProfileClient is used to communicate with the Shill Profile | 34 // ShillProfileClient is used to communicate with the Shill Profile |
| 35 // service. All methods should be called from the origin thread which | 35 // service. All methods should be called from the origin thread which |
| 36 // initializes the DBusThreadManager instance. | 36 // initializes the DBusThreadManager instance. |
| 37 class CHROMEOS_EXPORT ShillProfileClient { | 37 class CHROMEOS_EXPORT ShillProfileClient { |
| 38 public: | 38 public: |
| 39 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; | 39 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; |
| 40 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback; | 40 typedef ShillClientHelper::DictionaryValueCallbackWithoutStatus |
| 41 DictionaryValueCallbackWithoutStatus; |
| 42 typedef ShillClientHelper::ErrorCallback ErrorCallback; |
| 41 | 43 |
| 42 virtual ~ShillProfileClient(); | 44 virtual ~ShillProfileClient(); |
| 43 | 45 |
| 44 // Factory function, creates a new instance which is owned by the caller. | 46 // Factory function, creates a new instance which is owned by the caller. |
| 45 // For normal usage, access the singleton via DBusThreadManager::Get(). | 47 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| 46 static ShillProfileClient* Create(DBusClientImplementationType type, | 48 static ShillProfileClient* Create(DBusClientImplementationType type, |
| 47 dbus::Bus* bus); | 49 dbus::Bus* bus); |
| 48 | 50 |
| 49 // Adds a property changed |observer| for the profile at |profile_path|. | 51 // Adds a property changed |observer| for the profile at |profile_path|. |
| 50 virtual void AddPropertyChangedObserver( | 52 virtual void AddPropertyChangedObserver( |
| 51 const dbus::ObjectPath& profile_path, | 53 const dbus::ObjectPath& profile_path, |
| 52 ShillPropertyChangedObserver* observer) = 0; | 54 ShillPropertyChangedObserver* observer) = 0; |
| 53 | 55 |
| 54 // Removes a property changed |observer| for the profile at |profile_path|. | 56 // Removes a property changed |observer| for the profile at |profile_path|. |
| 55 virtual void RemovePropertyChangedObserver( | 57 virtual void RemovePropertyChangedObserver( |
| 56 const dbus::ObjectPath& profile_path, | 58 const dbus::ObjectPath& profile_path, |
| 57 ShillPropertyChangedObserver* observer) = 0; | 59 ShillPropertyChangedObserver* observer) = 0; |
| 58 | 60 |
| 59 // Calls GetProperties method. | 61 // Calls GetProperties method. |
| 60 // |callback| is called after the method call succeeds. | 62 // |callback| is called after the method call succeeds. |
| 61 virtual void GetProperties(const dbus::ObjectPath& profile_path, | 63 virtual void GetProperties( |
| 62 const DictionaryValueCallback& callback) = 0; | 64 const dbus::ObjectPath& profile_path, |
| 65 const DictionaryValueCallbackWithoutStatus& callback, |
| 66 const ErrorCallback& error_callback) = 0; |
| 63 | 67 |
| 64 // Calls GetEntry method. | 68 // Calls GetEntry method. |
| 65 // |callback| is called after the method call succeeds. | 69 // |callback| is called after the method call succeeds. |
| 66 virtual void GetEntry(const dbus::ObjectPath& profile_path, | 70 virtual void GetEntry(const dbus::ObjectPath& profile_path, |
| 67 const std::string& entry_path, | 71 const std::string& entry_path, |
| 68 const DictionaryValueCallback& callback) = 0; | 72 const DictionaryValueCallbackWithoutStatus& callback, |
| 73 const ErrorCallback& error_callback) = 0; |
| 69 | 74 |
| 70 // Calls DeleteEntry method. | 75 // Calls DeleteEntry method. |
| 71 // |callback| is called after the method call succeeds. | 76 // |callback| is called after the method call succeeds. |
| 72 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, | 77 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, |
| 73 const std::string& entry_path, | 78 const std::string& entry_path, |
| 74 const VoidDBusMethodCallback& callback) = 0; | 79 const base::Closure& callback, |
| 80 const ErrorCallback& error_callback) = 0; |
| 75 | 81 |
| 76 protected: | 82 protected: |
| 77 // Create() should be used instead. | 83 // Create() should be used instead. |
| 78 ShillProfileClient(); | 84 ShillProfileClient(); |
| 79 | 85 |
| 80 private: | 86 private: |
| 81 DISALLOW_COPY_AND_ASSIGN(ShillProfileClient); | 87 DISALLOW_COPY_AND_ASSIGN(ShillProfileClient); |
| 82 }; | 88 }; |
| 83 | 89 |
| 84 } // namespace chromeos | 90 } // namespace chromeos |
| 85 | 91 |
| 86 #endif // CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ | 92 #endif // CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_H_ |
| OLD | NEW |