blob: 8bf474b7b0997078dde06f38998c47b3472b25ab [file] [log] [blame]
Darin Petkov5c97ac52011-07-19 16:30:49 -07001// 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
13namespace shill {
14
Darin Petkov5c97ac52011-07-19 16:30:49 -070015class DBusPropertiesProxy : public DBusPropertiesProxyInterface {
16 public:
Darin Petkovc5f56562011-08-06 16:40:05 -070017 DBusPropertiesProxy(DBusPropertiesProxyListener *listener,
18 DBus::Connection *connection,
Darin Petkov5c97ac52011-07-19 16:30:49 -070019 const std::string &path,
20 const std::string &service);
21 virtual ~DBusPropertiesProxy();
22
23 // Inherited from DBusPropertiesProxyInterface.
Darin Petkove0a312e2011-07-20 13:45:28 -070024 virtual DBusPropertiesMap GetAll(const std::string &interface_name);
Darin Petkov5c97ac52011-07-19 16:30:49 -070025
26 private:
27 class Proxy : public org::freedesktop::DBus::Properties_proxy,
28 public DBus::ObjectProxy {
29 public:
Darin Petkovc5f56562011-08-06 16:40:05 -070030 Proxy(DBusPropertiesProxyListener *listener,
31 DBus::Connection *connection,
Darin Petkov5c97ac52011-07-19 16:30:49 -070032 const std::string &path,
33 const std::string &service);
34 virtual ~Proxy();
35
36 private:
37 // Signal callbacks inherited from DBusProperties_proxy.
Darin Petkove0a312e2011-07-20 13:45:28 -070038 virtual void MmPropertiesChanged(const std::string &interface,
39 const DBusPropertiesMap &properties);
Darin Petkov5c97ac52011-07-19 16:30:49 -070040
41 virtual void PropertiesChanged(
42 const std::string &interface,
Darin Petkove0a312e2011-07-20 13:45:28 -070043 const DBusPropertiesMap &changed_properties,
Darin Petkov5c97ac52011-07-19 16:30:49 -070044 const std::vector<std::string> &invalidated_properties);
45
Darin Petkovc5f56562011-08-06 16:40:05 -070046 DBusPropertiesProxyListener *listener_;
Darin Petkov5c97ac52011-07-19 16:30:49 -070047
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_