blob: ae15b3e68bdbc4a92408aa1bc5d35d3a1adb88c8 [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.
20typedef base::Callback<void(const Error &)> ResultCallback;
Christopher Wiley0d9cf0c2013-02-19 19:24:57 -080021typedef base::Callback<void(const Error &, bool)> ResultBoolCallback;
22typedef base::Callback<void(const Error &,
23 const std::string &)> ResultStringCallback;
Eric Shienbrood9a245532012-03-07 14:20:39 -050024typedef 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;
Arman Uguray2c39fab2012-12-12 16:56:34 -080029typedef base::Callback<void(const DBusEnumValueMap &,
30 const Error &)> DBusEnumValueMapCallback;
Eric Shienbrood9a245532012-03-07 14:20:39 -050031typedef base::Callback<void(const DBus::Path &,
32 const Error &)> DBusPathCallback;
33typedef base::Callback<void(
34 const std::vector<DBus::Path> &, const Error &)> DBusPathsCallback;
35typedef base::Callback<void(const std::string &, const Error &)> StringCallback;
Ben Chan7fab8972014-08-10 17:14:46 -070036typedef base::Callback<void(uint32_t, uint32_t, const DBusPropertiesMap &)>
37 ActivationStateSignalCallback;
Prathmesh Prabhu49ffffd2014-01-09 18:28:55 -080038typedef 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_