blob: 1295bf64789f53a41e0cb755fab13f56f90300b7 [file] [log] [blame]
Eric Shienbrood9a245532012-03-07 14:20:39 -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
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_CALLBACKS_H_
6#define SHILL_CALLBACKS_H_
Eric Shienbrood9a245532012-03-07 14:20:39 -05007
Christopher Wiley0d9cf0c2013-02-19 19:24:57 -08008#include <string>
Alex Vakulenko8a532292014-06-16 17:18:44 -07009#include <vector>
Christopher Wiley0d9cf0c2013-02-19 19:24:57 -080010
Eric Shienbrood9a245532012-03-07 14:20:39 -050011#include <base/callback.h>
12
Prathmesh Prabhu49ffffd2014-01-09 18:28:55 -080013#include "shill/accessor_interface.h"
Eric Shienbrood9a245532012-03-07 14:20:39 -050014#include "shill/dbus_properties.h"
15
16namespace shill {
17
18class Error;
19// Convenient typedefs for some commonly used callbacks.
Paul Stewarta794cd62015-06-16 13:13:10 -070020typedef base::Callback<void(const Error&)> ResultCallback;
21typedef base::Callback<void(const Error&, bool)> ResultBoolCallback;
22typedef base::Callback<void(const Error&,
23 const std::string&)> ResultStringCallback;
24typedef base::Callback<void(const Error&)> EnabledStateChangedCallback;
25typedef base::Callback<void(const DBusPropertiesMap&,
26 const Error&)> DBusPropertyMapCallback;
27typedef base::Callback<void(const std::vector<DBusPropertiesMap>&,
28 const Error&)> DBusPropertyMapsCallback;
29typedef base::Callback<void(const DBusEnumValueMap&,
30 const Error&)> DBusEnumValueMapCallback;
31typedef base::Callback<void(const DBus::Path&,
32 const Error&)> DBusPathCallback;
Eric Shienbrood9a245532012-03-07 14:20:39 -050033typedef base::Callback<void(
Paul Stewarta794cd62015-06-16 13:13:10 -070034 const std::vector<DBus::Path>&, const Error&)> DBusPathsCallback;
35typedef base::Callback<void(const std::string&, const Error&)> StringCallback;
36typedef base::Callback<void(uint32_t, uint32_t, const DBusPropertiesMap&)>
Ben Chan7fab8972014-08-10 17:14:46 -070037 ActivationStateSignalCallback;
Paul Stewarta794cd62015-06-16 13:13:10 -070038typedef base::Callback<void(const Stringmaps&,
39 const Error&)> ResultStringmapsCallback;
Eric Shienbrood9a245532012-03-07 14:20:39 -050040
41} // namespace shill
Ben Chanc45688b2014-07-02 23:50:45 -070042
43#endif // SHILL_CALLBACKS_H_