blob: 38866d1d6fd97a403e130f8c0c82f45988851740 [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:
Jason Glasgow9c09e362012-04-18 15:16:29 -040017 DBusPropertiesProxy(DBus::Connection *connection,
Darin Petkov5c97ac52011-07-19 16:30:49 -070018 const std::string &path,
19 const std::string &service);
20 virtual ~DBusPropertiesProxy();
21
22 // Inherited from DBusPropertiesProxyInterface.
Darin Petkove0a312e2011-07-20 13:45:28 -070023 virtual DBusPropertiesMap GetAll(const std::string &interface_name);
Darin Petkov5c97ac52011-07-19 16:30:49 -070024
Jason Glasgow9c09e362012-04-18 15:16:29 -040025 virtual void set_properties_changed_callback(
26 const PropertiesChangedCallback &callback);
27 virtual void set_modem_manager_properties_changed_callback(
28 const ModemManagerPropertiesChangedCallback &callback);
29
Darin Petkov5c97ac52011-07-19 16:30:49 -070030 private:
31 class Proxy : public org::freedesktop::DBus::Properties_proxy,
32 public DBus::ObjectProxy {
33 public:
Jason Glasgow9c09e362012-04-18 15:16:29 -040034 Proxy(DBus::Connection *connection,
Darin Petkov5c97ac52011-07-19 16:30:49 -070035 const std::string &path,
36 const std::string &service);
37 virtual ~Proxy();
38
Jason Glasgow9c09e362012-04-18 15:16:29 -040039 virtual void set_properties_changed_callback(
40 const PropertiesChangedCallback &callback);
41 virtual void set_modem_manager_properties_changed_callback(
42 const ModemManagerPropertiesChangedCallback &callback);
43
Darin Petkov5c97ac52011-07-19 16:30:49 -070044 private:
45 // Signal callbacks inherited from DBusProperties_proxy.
Darin Petkove0a312e2011-07-20 13:45:28 -070046 virtual void MmPropertiesChanged(const std::string &interface,
47 const DBusPropertiesMap &properties);
Darin Petkov5c97ac52011-07-19 16:30:49 -070048
49 virtual void PropertiesChanged(
50 const std::string &interface,
Darin Petkove0a312e2011-07-20 13:45:28 -070051 const DBusPropertiesMap &changed_properties,
Darin Petkov5c97ac52011-07-19 16:30:49 -070052 const std::vector<std::string> &invalidated_properties);
53
Jason Glasgow9c09e362012-04-18 15:16:29 -040054 PropertiesChangedCallback properties_changed_callback_;
55 ModemManagerPropertiesChangedCallback mm_properties_changed_callback_;
Darin Petkov5c97ac52011-07-19 16:30:49 -070056
57 DISALLOW_COPY_AND_ASSIGN(Proxy);
58 };
59
60 Proxy proxy_;
61
62 DISALLOW_COPY_AND_ASSIGN(DBusPropertiesProxy);
63};
64
65} // namespace shill
66
67#endif // SHILL_DBUS_PROPERTIES_PROXY_