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 | |
| 15 | class Modem; |
| 16 | |
| 17 | class DBusPropertiesProxy : public DBusPropertiesProxyInterface { |
| 18 | public: |
| 19 | DBusPropertiesProxy(DBus::Connection *connection, |
| 20 | Modem *modem, |
| 21 | const std::string &path, |
| 22 | const std::string &service); |
| 23 | virtual ~DBusPropertiesProxy(); |
| 24 | |
| 25 | // Inherited from DBusPropertiesProxyInterface. |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 26 | virtual DBusPropertiesMap GetAll(const std::string &interface_name); |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 27 | |
| 28 | private: |
| 29 | class Proxy : public org::freedesktop::DBus::Properties_proxy, |
| 30 | public DBus::ObjectProxy { |
| 31 | public: |
| 32 | Proxy(DBus::Connection *connection, |
| 33 | Modem *modem, |
| 34 | const std::string &path, |
| 35 | const std::string &service); |
| 36 | virtual ~Proxy(); |
| 37 | |
| 38 | private: |
| 39 | // Signal callbacks inherited from DBusProperties_proxy. |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 40 | virtual void MmPropertiesChanged(const std::string &interface, |
| 41 | const DBusPropertiesMap &properties); |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 42 | |
| 43 | virtual void PropertiesChanged( |
| 44 | const std::string &interface, |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 45 | const DBusPropertiesMap &changed_properties, |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 46 | const std::vector<std::string> &invalidated_properties); |
| 47 | |
| 48 | Modem *modem_; |
| 49 | |
| 50 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 51 | }; |
| 52 | |
| 53 | Proxy proxy_; |
| 54 | |
| 55 | DISALLOW_COPY_AND_ASSIGN(DBusPropertiesProxy); |
| 56 | }; |
| 57 | |
| 58 | } // namespace shill |
| 59 | |
| 60 | #endif // SHILL_DBUS_PROPERTIES_PROXY_ |