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