Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS 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 SHILL_DBUS_PROPERTIES_PROXY_ |
| 6 | #define SHILL_DBUS_PROPERTIES_PROXY_ |
| 7 | |
| 8 | #include <base/basictypes.h> |
| 9 | |
| 10 | #include "shill/dbus_bindings/dbus-properties.h" |
| 11 | #include "shill/dbus_properties_proxy_interface.h" |
| 12 | |
| 13 | namespace shill { |
| 14 | |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 15 | class DBusPropertiesProxy : public DBusPropertiesProxyInterface { |
| 16 | public: |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 17 | DBusPropertiesProxy(DBusPropertiesProxyDelegate *delegate, |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 18 | DBus::Connection *connection, |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 19 | const std::string &path, |
| 20 | const std::string &service); |
| 21 | virtual ~DBusPropertiesProxy(); |
| 22 | |
| 23 | // Inherited from DBusPropertiesProxyInterface. |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 24 | virtual DBusPropertiesMap GetAll(const std::string &interface_name); |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 25 | |
| 26 | private: |
| 27 | class Proxy : public org::freedesktop::DBus::Properties_proxy, |
| 28 | public DBus::ObjectProxy { |
| 29 | public: |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 30 | Proxy(DBusPropertiesProxyDelegate *delegate, |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 31 | DBus::Connection *connection, |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 32 | const std::string &path, |
| 33 | const std::string &service); |
| 34 | virtual ~Proxy(); |
| 35 | |
| 36 | private: |
| 37 | // Signal callbacks inherited from DBusProperties_proxy. |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 38 | virtual void MmPropertiesChanged(const std::string &interface, |
| 39 | const DBusPropertiesMap &properties); |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 40 | |
| 41 | virtual void PropertiesChanged( |
| 42 | const std::string &interface, |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 43 | const DBusPropertiesMap &changed_properties, |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 44 | const std::vector<std::string> &invalidated_properties); |
| 45 | |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 46 | DBusPropertiesProxyDelegate *delegate_; |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 47 | |
| 48 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 49 | }; |
| 50 | |
| 51 | Proxy proxy_; |
| 52 | |
| 53 | DISALLOW_COPY_AND_ASSIGN(DBusPropertiesProxy); |
| 54 | }; |
| 55 | |
| 56 | } // namespace shill |
| 57 | |
| 58 | #endif // SHILL_DBUS_PROPERTIES_PROXY_ |