blob: a08bbf42445baa37db9dffffb1265941aad0dc12 [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_INTERFACE_
6#define SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_
7
Darin Petkovc5f56562011-08-06 16:40:05 -07008#include <vector>
9
Jason Glasgow9c09e362012-04-18 15:16:29 -040010#include <base/callback.h>
11
Darin Petkove0a312e2011-07-20 13:45:28 -070012#include "shill/dbus_properties.h"
Darin Petkov5c97ac52011-07-19 16:30:49 -070013
14namespace shill {
15
16// These are the methods that a DBusProperties proxy must support. The interface
17// is provided so that it can be mocked in tests.
18class DBusPropertiesProxyInterface {
19 public:
Jason Glasgow9c09e362012-04-18 15:16:29 -040020 // Callback invoked when an object sends a DBus property change signal.
21 typedef base::Callback<void(
22 const std::string &interface,
23 const DBusPropertiesMap &changed_properties,
24 const std::vector<std::string> &invalidated_properties)>
25 PropertiesChangedCallback;
26
27 // Callback invoked when the classic modem manager sends a DBus
28 // property change signal.
29 typedef base::Callback<void(
30 const std::string &interface,
31 const DBusPropertiesMap &properties)>
32 ModemManagerPropertiesChangedCallback;
33
Darin Petkov5c97ac52011-07-19 16:30:49 -070034 virtual ~DBusPropertiesProxyInterface() {}
35
Darin Petkove0a312e2011-07-20 13:45:28 -070036 virtual DBusPropertiesMap GetAll(const std::string &interface_name) = 0;
Arman Uguray5d9a8522013-09-10 17:43:13 -070037 virtual DBus::Variant Get(const std::string &interface_name,
38 const std::string &property) = 0;
Darin Petkov5c97ac52011-07-19 16:30:49 -070039
Jason Glasgow9c09e362012-04-18 15:16:29 -040040 virtual void set_properties_changed_callback(
41 const PropertiesChangedCallback &callback) = 0;
42 virtual void set_modem_manager_properties_changed_callback(
43 const ModemManagerPropertiesChangedCallback &callback) = 0;
Darin Petkovc5f56562011-08-06 16:40:05 -070044};
45
Darin Petkov5c97ac52011-07-19 16:30:49 -070046} // namespace shill
47
48#endif // SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_