blob: bcb23311c28c42059258b63ada34a259085539a8 [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
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_H_
6#define SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_H_
Darin Petkov5c97ac52011-07-19 16:30:49 -07007
Alex Vakulenko8a532292014-06-16 17:18:44 -07008#include <string>
Darin Petkovc5f56562011-08-06 16:40:05 -07009#include <vector>
10
Jason Glasgow9c09e362012-04-18 15:16:29 -040011#include <base/callback.h>
12
Darin Petkove0a312e2011-07-20 13:45:28 -070013#include "shill/dbus_properties.h"
Darin Petkov5c97ac52011-07-19 16:30:49 -070014
15namespace shill {
16
17// These are the methods that a DBusProperties proxy must support. The interface
18// is provided so that it can be mocked in tests.
19class DBusPropertiesProxyInterface {
20 public:
Jason Glasgow9c09e362012-04-18 15:16:29 -040021 // Callback invoked when an object sends a DBus property change signal.
22 typedef base::Callback<void(
Paul Stewarta794cd62015-06-16 13:13:10 -070023 const std::string& interface,
24 const DBusPropertiesMap& changed_properties,
25 const std::vector<std::string>& invalidated_properties)>
Jason Glasgow9c09e362012-04-18 15:16:29 -040026 PropertiesChangedCallback;
27
28 // Callback invoked when the classic modem manager sends a DBus
29 // property change signal.
30 typedef base::Callback<void(
Paul Stewarta794cd62015-06-16 13:13:10 -070031 const std::string& interface,
32 const DBusPropertiesMap& properties)>
Jason Glasgow9c09e362012-04-18 15:16:29 -040033 ModemManagerPropertiesChangedCallback;
34
Darin Petkov5c97ac52011-07-19 16:30:49 -070035 virtual ~DBusPropertiesProxyInterface() {}
36
Paul Stewarta794cd62015-06-16 13:13:10 -070037 virtual DBusPropertiesMap GetAll(const std::string& interface_name) = 0;
38 virtual DBus::Variant Get(const std::string& interface_name,
39 const std::string& property) = 0;
Darin Petkov5c97ac52011-07-19 16:30:49 -070040
Jason Glasgow9c09e362012-04-18 15:16:29 -040041 virtual void set_properties_changed_callback(
Paul Stewarta794cd62015-06-16 13:13:10 -070042 const PropertiesChangedCallback& callback) = 0;
Jason Glasgow9c09e362012-04-18 15:16:29 -040043 virtual void set_modem_manager_properties_changed_callback(
Paul Stewarta794cd62015-06-16 13:13:10 -070044 const ModemManagerPropertiesChangedCallback& callback) = 0;
Darin Petkovc5f56562011-08-06 16:40:05 -070045};
46
Darin Petkov5c97ac52011-07-19 16:30:49 -070047} // namespace shill
48
Ben Chanc45688b2014-07-02 23:50:45 -070049#endif // SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_H_