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 DBUS_OBJECT_PROXY_H_ | 5 #ifndef DBUS_OBJECT_PROXY_H_ |
6 #define DBUS_OBJECT_PROXY_H_ | 6 #define DBUS_OBJECT_PROXY_H_ |
7 | 7 |
8 #include <dbus/dbus.h> | 8 #include <dbus/dbus.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 // | 135 // |
136 // |on_connected_callback| is called when the object proxy is connected | 136 // |on_connected_callback| is called when the object proxy is connected |
137 // to the signal, or failed to be connected, in the origin thread. | 137 // to the signal, or failed to be connected, in the origin thread. |
138 // | 138 // |
139 // Must be called in the origin thread. | 139 // Must be called in the origin thread. |
140 virtual void ConnectToSignal(const std::string& interface_name, | 140 virtual void ConnectToSignal(const std::string& interface_name, |
141 const std::string& signal_name, | 141 const std::string& signal_name, |
142 SignalCallback signal_callback, | 142 SignalCallback signal_callback, |
143 OnConnectedCallback on_connected_callback); | 143 OnConnectedCallback on_connected_callback); |
144 | 144 |
145 // Sets a callback for "NameOwnerChanged" signal. The callback is called when | |
146 // D-Bus system sends "NameOwnerChanged" for the name represented by | |
147 // |service_name_|. | |
satorux1
2012/11/13 07:00:39
I think |callback| should be called on the origin
Haruki Sato
2012/11/14 06:35:15
Done. Thanks.
| |
148 virtual void SetNameOwnerChangedCallback(SignalCallback callback); | |
149 | |
145 // Detaches from the remote object. The Bus object will take care of | 150 // Detaches from the remote object. The Bus object will take care of |
146 // detaching so you don't have to do this manually. | 151 // detaching so you don't have to do this manually. |
147 // | 152 // |
148 // BLOCKING CALL. | 153 // BLOCKING CALL. |
149 virtual void Detach(); | 154 virtual void Detach(); |
150 | 155 |
151 // Returns an empty callback that does nothing. Can be used for | 156 // Returns an empty callback that does nothing. Can be used for |
152 // CallMethod(). | 157 // CallMethod(). |
153 static ResponseCallback EmptyResponseCallback(); | 158 static ResponseCallback EmptyResponseCallback(); |
154 | 159 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 ObjectPath object_path_; | 266 ObjectPath object_path_; |
262 | 267 |
263 // True if the message filter was added. | 268 // True if the message filter was added. |
264 bool filter_added_; | 269 bool filter_added_; |
265 | 270 |
266 // The method table where keys are absolute signal names (i.e. interface | 271 // The method table where keys are absolute signal names (i.e. interface |
267 // name + signal name), and values are the corresponding callbacks. | 272 // name + signal name), and values are the corresponding callbacks. |
268 typedef std::map<std::string, SignalCallback> MethodTable; | 273 typedef std::map<std::string, SignalCallback> MethodTable; |
269 MethodTable method_table_; | 274 MethodTable method_table_; |
270 | 275 |
276 // The callback called when NameOwnerChanged signal is received. | |
277 SignalCallback name_owner_changed_callback_; | |
278 | |
271 std::set<std::string> match_rules_; | 279 std::set<std::string> match_rules_; |
272 | 280 |
273 const bool ignore_service_unknown_errors_; | 281 const bool ignore_service_unknown_errors_; |
274 | 282 |
275 // Known name owner of the well-known bus name represnted by |service_name_|. | 283 // Known name owner of the well-known bus name represnted by |service_name_|. |
276 std::string service_name_owner_; | 284 std::string service_name_owner_; |
277 | 285 |
278 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); | 286 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); |
279 }; | 287 }; |
280 | 288 |
281 } // namespace dbus | 289 } // namespace dbus |
282 | 290 |
283 #endif // DBUS_OBJECT_PROXY_H_ | 291 #endif // DBUS_OBJECT_PROXY_H_ |
OLD | NEW |