David Rochberg | b8b89b1 | 2012-02-28 16:11:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2012 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 | #ifndef SHILL_DBUS_OBJECTMANAGER_INTERFACE_H_ |
| 5 | #define SHILL_DBUS_OBJECTMANAGER_INTERFACE_H_ |
| 6 | #include <string> |
| 7 | |
| 8 | #include <base/basictypes.h> |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 9 | #include <base/callback.h> |
David Rochberg | b8b89b1 | 2012-02-28 16:11:33 -0500 | [diff] [blame] | 10 | |
| 11 | #include "shill/dbus_properties.h" // For DBusPropertiesMap |
| 12 | |
| 13 | namespace shill { |
| 14 | |
David Rochberg | b8b89b1 | 2012-02-28 16:11:33 -0500 | [diff] [blame] | 15 | class Error; |
| 16 | |
| 17 | typedef std::map<std::string, DBusPropertiesMap> DBusInterfaceToProperties; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 18 | typedef std::map< ::DBus::Path, DBusInterfaceToProperties> |
| 19 | DBusObjectsWithProperties; |
| 20 | typedef base::Callback<void(const DBusObjectsWithProperties &, const Error &)> |
| 21 | ManagedObjectsCallback; |
| 22 | typedef base::Callback<void(const DBusInterfaceToProperties &, const Error &)> |
| 23 | InterfaceAndPropertiesCallback; |
| 24 | typedef base::Callback<void(const DBus::Path &, |
| 25 | const DBusInterfaceToProperties &)> |
| 26 | InterfacesAddedSignalCallback; |
| 27 | typedef base::Callback<void(const DBus::Path &, |
| 28 | const std::vector<std::string> &)> |
| 29 | InterfacesRemovedSignalCallback; |
David Rochberg | b8b89b1 | 2012-02-28 16:11:33 -0500 | [diff] [blame] | 30 | |
| 31 | // These are the methods that a org.freedesktop.DBus.ObjectManager |
| 32 | // proxy must support. The interface is provided so that it can be |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 33 | // mocked in tests. All calls are made asynchronously. Call completion |
| 34 | // is signalled via the callbacks passed to the methods. |
David Rochberg | b8b89b1 | 2012-02-28 16:11:33 -0500 | [diff] [blame] | 35 | class DBusObjectManagerProxyInterface { |
| 36 | public: |
| 37 | virtual ~DBusObjectManagerProxyInterface() {} |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 38 | virtual void GetManagedObjects(Error *error, |
| 39 | const ManagedObjectsCallback &callback, |
| 40 | int timeout) = 0; |
| 41 | virtual void set_interfaces_added_callback( |
| 42 | const InterfacesAddedSignalCallback &callback) = 0; |
| 43 | virtual void set_interfaces_removed_callback( |
| 44 | const InterfacesRemovedSignalCallback &callback) = 0; |
David Rochberg | b8b89b1 | 2012-02-28 16:11:33 -0500 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | } // namespace shill |
| 48 | |
| 49 | #endif // SHILL_DBUS_OBJECTMANAGER_INTERFACE_H_ |