Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: chromeos/dbus/flimflam_device_client.h

Issue 10095004: Add FlimflamDeviceClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROMEOS_DBUS_FLIMFLAM_DEVICE_CLIENT_H_
6 #define CHROMEOS_DBUS_FLIMFLAM_DEVICE_CLIENT_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/dbus_client_implementation_type.h"
14 #include "chromeos/dbus/flimflam_client_helper.h"
15
16 namespace base {
17
18 class Value;
19 class DictionaryValue;
20
21 } // namespace base
22
23 namespace dbus {
24
25 class Bus;
26 class ObjectPath;
27
28 } // namespace dbus
29
30 namespace chromeos {
31
32 // FlimflamDeviceClient is used to communicate with the Flimflam Device service.
33 // All methods should be called from the origin thread which initializes the
34 // DBusThreadManager instance.
35 class CHROMEOS_EXPORT FlimflamDeviceClient {
36 public:
37 typedef FlimflamClientHelper::PropertyChangedHandler PropertyChangedHandler;
38 typedef FlimflamClientHelper::VoidCallback VoidCallback;
39 typedef FlimflamClientHelper::ObjectPathCallback ObjectPathCallback;
40 typedef FlimflamClientHelper::DictionaryValueCallback DictionaryValueCallback;
41
42 virtual ~FlimflamDeviceClient();
43
44 // Factory function, creates a new instance which is owned by the caller.
45 // For normal usage, access the singleton via DBusThreadManager::Get().
46 static FlimflamDeviceClient* Create(DBusClientImplementationType type,
47 dbus::Bus* bus);
48
49 // Sets PropertyChanged signal handler.
50 virtual void SetPropertyChangedHandler(
51 const dbus::ObjectPath& device_path,
52 const PropertyChangedHandler& handler) = 0;
53
54 // Resets PropertyChanged signal handler.
55 virtual void ResetPropertyChangedHandler(
56 const dbus::ObjectPath& device_path) = 0;
57
58 // Calls GetProperties method.
59 // |callback| is called after the method call finishes.
60 virtual void GetProperties(const dbus::ObjectPath& device_path,
61 const DictionaryValueCallback& callback) = 0;
62
63 // Calls ProposeScan method.
64 // |callback| is called after the method call finishes.
65 virtual void ProposeScan(const dbus::ObjectPath& device_path,
66 const VoidCallback& callback) = 0;
67
68 // Calls SetProperty method.
69 // |callback| is called after the method call finishes.
70 virtual void SetProperty(const dbus::ObjectPath& device_path,
71 const std::string& name,
72 const base::Value& value,
73 const VoidCallback& callback) = 0;
74
75 // Calls ClearProperty method.
76 // |callback| is called after the method call finishes.
77 virtual void ClearProperty(const dbus::ObjectPath& device_path,
78 const std::string& name,
79 const VoidCallback& callback) = 0;
80
81 // Calls AddIPConfig method.
82 // |callback| is called after the method call finishes.
83 virtual void AddIPConfig(const dbus::ObjectPath& device_path,
84 const std::string& method,
85 const ObjectPathCallback& callback) = 0;
86
87 // Calls RequirePin method.
88 // |callback| is called after the method call finishes.
89 virtual void RequirePin(const dbus::ObjectPath& device_path,
90 const std::string& pin,
91 bool require,
92 const VoidCallback& callback) = 0;
93
94 // Calls EnterPin method.
95 // |callback| is called after the method call finishes.
96 virtual void EnterPin(const dbus::ObjectPath& device_path,
97 const std::string& pin,
98 const VoidCallback& callback) = 0;
99
100 // Calls UnblockPin method.
101 // |callback| is called after the method call finishes.
102 virtual void UnblockPin(const dbus::ObjectPath& device_path,
103 const std::string& puk,
104 const std::string& pin,
105 const VoidCallback& callback) = 0;
106
107 // Calls ChangePin method.
108 // |callback| is called after the method call finishes.
109 virtual void ChangePin(const dbus::ObjectPath& device_path,
110 const std::string& old_pin,
111 const std::string& new_pin,
112 const VoidCallback& callback) = 0;
113
114 // Calls Register method.
115 // |callback| is called after the method call finishes.
116 virtual void Register(const dbus::ObjectPath& device_path,
117 const std::string& network_id,
118 const VoidCallback& callback) = 0;
119
120 protected:
121 // Create() should be used instead.
122 FlimflamDeviceClient();
123
124 private:
125 DISALLOW_COPY_AND_ASSIGN(FlimflamDeviceClient);
126 };
127
128 } // namespace chromeos
129
130 #endif // CHROMEOS_DBUS_FLIMFLAM_DEVICE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698