blob: 415f90199f0bce1e8692cebcb457b19fd411ff1c [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 Petkov580c7af2011-10-24 12:32:50 +020017 DBusPropertiesProxy(DBusPropertiesProxyDelegate *delegate,
Darin Petkovc5f56562011-08-06 16:40:05 -070018 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 Petkov580c7af2011-10-24 12:32:50 +020030 Proxy(DBusPropertiesProxyDelegate *delegate,
Darin Petkovc5f56562011-08-06 16:40:05 -070031 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 Petkov580c7af2011-10-24 12:32:50 +020046 DBusPropertiesProxyDelegate *delegate_;
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_