blob: deb175aa5dfa784fd4d9b2f7e2bcc4cff6ad39c1 [file] [log] [blame]
David Rochbergb8b89b12012-02-28 16:11:33 -05001// 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 Shienbrood9a245532012-03-07 14:20:39 -05009#include <base/callback.h>
David Rochbergb8b89b12012-02-28 16:11:33 -050010
11#include "shill/dbus_properties.h" // For DBusPropertiesMap
12
13namespace shill {
14
David Rochbergb8b89b12012-02-28 16:11:33 -050015class Error;
16
17typedef std::map<std::string, DBusPropertiesMap> DBusInterfaceToProperties;
Eric Shienbrood9a245532012-03-07 14:20:39 -050018typedef std::map< ::DBus::Path, DBusInterfaceToProperties>
19 DBusObjectsWithProperties;
20typedef base::Callback<void(const DBusObjectsWithProperties &, const Error &)>
21 ManagedObjectsCallback;
22typedef base::Callback<void(const DBusInterfaceToProperties &, const Error &)>
23 InterfaceAndPropertiesCallback;
24typedef base::Callback<void(const DBus::Path &,
25 const DBusInterfaceToProperties &)>
26 InterfacesAddedSignalCallback;
27typedef base::Callback<void(const DBus::Path &,
28 const std::vector<std::string> &)>
29 InterfacesRemovedSignalCallback;
David Rochbergb8b89b12012-02-28 16:11:33 -050030
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 Shienbrood9a245532012-03-07 14:20:39 -050033// mocked in tests. All calls are made asynchronously. Call completion
34// is signalled via the callbacks passed to the methods.
David Rochbergb8b89b12012-02-28 16:11:33 -050035class DBusObjectManagerProxyInterface {
36 public:
37 virtual ~DBusObjectManagerProxyInterface() {}
Eric Shienbrood9a245532012-03-07 14:20:39 -050038 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 Rochbergb8b89b12012-02-28 16:11:33 -050045};
46
47} // namespace shill
48
49#endif // SHILL_DBUS_OBJECTMANAGER_INTERFACE_H_