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. |
| 26 | virtual std::map<std::string, DBus::Variant> GetAll( |
| 27 | const std::string &interface_name); |
| 28 | |
| 29 | private: |
| 30 | class Proxy : public org::freedesktop::DBus::Properties_proxy, |
| 31 | public DBus::ObjectProxy { |
| 32 | public: |
| 33 | Proxy(DBus::Connection *connection, |
| 34 | Modem *modem, |
| 35 | const std::string &path, |
| 36 | const std::string &service); |
| 37 | virtual ~Proxy(); |
| 38 | |
| 39 | private: |
| 40 | // Signal callbacks inherited from DBusProperties_proxy. |
| 41 | virtual void MmPropertiesChanged( |
| 42 | const std::string &interface, |
| 43 | const std::map<std::string, DBus::Variant> &properties); |
| 44 | |
| 45 | virtual void PropertiesChanged( |
| 46 | const std::string &interface, |
| 47 | const std::map<std::string, DBus::Variant> &changed_properties, |
| 48 | const std::vector<std::string> &invalidated_properties); |
| 49 | |
| 50 | Modem *modem_; |
| 51 | |
| 52 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 53 | }; |
| 54 | |
| 55 | Proxy proxy_; |
| 56 | |
| 57 | DISALLOW_COPY_AND_ASSIGN(DBusPropertiesProxy); |
| 58 | }; |
| 59 | |
| 60 | } // namespace shill |
| 61 | |
| 62 | #endif // SHILL_DBUS_PROPERTIES_PROXY_ |