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_SERVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_ |
6 #define CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FLIMFLAM_SERVICE_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 // FlimflamServiceClient is used to communicate with the Flimflam Service | 32 // FlimflamServiceClient is used to communicate with the Flimflam Service |
33 // service. | 33 // service. |
34 // All methods should be called from the origin thread which initializes the | 34 // All methods should be called from the origin thread which initializes the |
35 // DBusThreadManager instance. | 35 // DBusThreadManager instance. |
36 class CHROMEOS_EXPORT FlimflamServiceClient { | 36 class CHROMEOS_EXPORT FlimflamServiceClient { |
37 public: | 37 public: |
38 typedef FlimflamClientHelper::PropertyChangedHandler PropertyChangedHandler; | 38 typedef FlimflamClientHelper::PropertyChangedHandler PropertyChangedHandler; |
39 typedef FlimflamClientHelper::VoidCallback VoidCallback; | 39 typedef FlimflamClientHelper::VoidCallback VoidCallback; |
40 typedef FlimflamClientHelper::DictionaryValueCallback DictionaryValueCallback; | 40 typedef FlimflamClientHelper::DictionaryValueCallback DictionaryValueCallback; |
| 41 typedef FlimflamClientHelper::ErrorCallback ErrorCallback; |
41 | 42 |
42 virtual ~FlimflamServiceClient(); | 43 virtual ~FlimflamServiceClient(); |
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 FlimflamServiceClient* Create(DBusClientImplementationType type, | 47 static FlimflamServiceClient* 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 18 matching lines...) Expand all Loading... |
69 | 70 |
70 // Calls ClearProperty method. | 71 // Calls ClearProperty method. |
71 // |callback| is called after the method call succeeds. | 72 // |callback| is called after the method call succeeds. |
72 virtual void ClearProperty(const dbus::ObjectPath& service_path, | 73 virtual void ClearProperty(const dbus::ObjectPath& service_path, |
73 const std::string& name, | 74 const std::string& name, |
74 const VoidCallback& callback) = 0; | 75 const VoidCallback& callback) = 0; |
75 | 76 |
76 // Calls Connect method. | 77 // Calls Connect method. |
77 // |callback| is called after the method call succeeds. | 78 // |callback| is called after the method call succeeds. |
78 virtual void Connect(const dbus::ObjectPath& service_path, | 79 virtual void Connect(const dbus::ObjectPath& service_path, |
79 const VoidCallback& callback) = 0; | 80 const base::Closure& callback, |
| 81 const ErrorCallback& error_callback) = 0; |
80 | 82 |
81 // Calls Disconnect method. | 83 // Calls Disconnect method. |
82 // |callback| is called after the method call succeeds. | 84 // |callback| is called after the method call succeeds. |
83 virtual void Disconnect(const dbus::ObjectPath& service_path, | 85 virtual void Disconnect(const dbus::ObjectPath& service_path, |
84 const VoidCallback& callback) = 0; | 86 const VoidCallback& callback) = 0; |
85 | 87 |
86 // Calls Remove method. | 88 // Calls Remove method. |
87 // |callback| is called after the method call succeeds. | 89 // |callback| is called after the method call succeeds. |
88 virtual void Remove(const dbus::ObjectPath& service_path, | 90 virtual void Remove(const dbus::ObjectPath& service_path, |
89 const VoidCallback& callback) = 0; | 91 const VoidCallback& callback) = 0; |
90 | 92 |
91 // Calls ActivateCellularModem method. | 93 // Calls ActivateCellularModem method. |
92 // |callback| is called after the method call succeeds. | 94 // |callback| is called after the method call succeeds. |
93 virtual void ActivateCellularModem(const dbus::ObjectPath& service_path, | 95 virtual void ActivateCellularModem(const dbus::ObjectPath& service_path, |
94 const std::string& carrier, | 96 const std::string& carrier, |
95 const VoidCallback& callback) = 0; | 97 const VoidCallback& callback) = 0; |
96 | 98 |
97 protected: | 99 protected: |
98 // Create() should be used instead. | 100 // Create() should be used instead. |
99 FlimflamServiceClient(); | 101 FlimflamServiceClient(); |
100 | 102 |
101 private: | 103 private: |
102 DISALLOW_COPY_AND_ASSIGN(FlimflamServiceClient); | 104 DISALLOW_COPY_AND_ASSIGN(FlimflamServiceClient); |
103 }; | 105 }; |
104 | 106 |
105 } // namespace chromeos | 107 } // namespace chromeos |
106 | 108 |
107 #endif // CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_ | 109 #endif // CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_ |
OLD | NEW |