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_NETWORK_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_NETWORK_CLIENT_H_ |
6 #define CHROMEOS_DBUS_SHILL_NETWORK_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SHILL_NETWORK_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 // ShillNetworkClient is used to communicate with the Shill Network | 32 // ShillNetworkClient is used to communicate with the Shill Network |
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 ShillNetworkClient { | 35 class CHROMEOS_EXPORT ShillNetworkClient { |
36 public: | 36 public: |
37 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; | 37 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; |
38 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback; | 38 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback; |
39 typedef ShillClientHelper::PropertyChangedObserver PropertyChangedObserver; | |
39 | 40 |
40 virtual ~ShillNetworkClient(); | 41 virtual ~ShillNetworkClient(); |
41 | 42 |
42 // Factory function, creates a new instance which is owned by the caller. | 43 // Factory function, creates a new instance which is owned by the caller. |
43 // For normal usage, access the singleton via DBusThreadManager::Get(). | 44 // For normal usage, access the singleton via DBusThreadManager::Get(). |
44 static ShillNetworkClient* Create(DBusClientImplementationType type, | 45 static ShillNetworkClient* Create(DBusClientImplementationType type, |
45 dbus::Bus* bus); | 46 dbus::Bus* bus); |
46 | 47 |
47 // Sets PropertyChanged signal handler. | 48 virtual void AddPropertyChangedObserver( |
hashimoto
2012/09/21 11:52:01
Please add method comments.
Greg Spencer (Chromium)
2012/09/21 22:03:47
Done.
| |
48 virtual void SetPropertyChangedHandler( | |
49 const dbus::ObjectPath& network_path, | 49 const dbus::ObjectPath& network_path, |
50 const PropertyChangedHandler& handler) = 0; | 50 PropertyChangedObserver* observer) = 0; |
51 | 51 |
52 // Resets PropertyChanged signal handler. | 52 virtual void RemovePropertyChangedObserver( |
53 virtual void ResetPropertyChangedHandler( | 53 const dbus::ObjectPath& network_path, |
54 const dbus::ObjectPath& network_path) = 0; | 54 PropertyChangedObserver* observer) = 0; |
55 | 55 |
56 // Calls GetProperties method. | 56 // Calls GetProperties method. |
57 // |callback| is called after the method call succeeds. | 57 // |callback| is called after the method call succeeds. |
58 virtual void GetProperties(const dbus::ObjectPath& network_path, | 58 virtual void GetProperties(const dbus::ObjectPath& network_path, |
59 const DictionaryValueCallback& callback) = 0; | 59 const DictionaryValueCallback& callback) = 0; |
60 | 60 |
61 // DEPRECATED DO NOT USE: Calls GetProperties method and blocks until the | 61 // DEPRECATED DO NOT USE: Calls GetProperties method and blocks until the |
62 // method call finishes. The caller is responsible to delete the result. | 62 // method call finishes. The caller is responsible to delete the result. |
63 // Thie method returns NULL when method call fails. | 63 // Thie method returns NULL when method call fails. |
64 // | 64 // |
65 // TODO(hashimoto): Refactor CrosGetWifiAccessPoints and remove this method. | 65 // TODO(hashimoto): Refactor CrosGetWifiAccessPoints and remove this method. |
66 // crosbug.com/29902 | 66 // crosbug.com/29902 |
67 virtual base::DictionaryValue* CallGetPropertiesAndBlock( | 67 virtual base::DictionaryValue* CallGetPropertiesAndBlock( |
68 const dbus::ObjectPath& network_path) = 0; | 68 const dbus::ObjectPath& network_path) = 0; |
69 | 69 |
70 protected: | 70 protected: |
71 // Create() should be used instead. | 71 // Create() should be used instead. |
72 ShillNetworkClient(); | 72 ShillNetworkClient(); |
73 | 73 |
74 private: | 74 private: |
75 DISALLOW_COPY_AND_ASSIGN(ShillNetworkClient); | 75 DISALLOW_COPY_AND_ASSIGN(ShillNetworkClient); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace chromeos | 78 } // namespace chromeos |
79 | 79 |
80 #endif // CHROMEOS_DBUS_SHILL_NETWORK_CLIENT_H_ | 80 #endif // CHROMEOS_DBUS_SHILL_NETWORK_CLIENT_H_ |
OLD | NEW |