1 // Copyright (c) 2012 The Chromium 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.
5 #ifndef CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_
6 #define CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_
8 #include "base/callback.h"
18 // An enum to describe whether or not a DBus method call succeeded.
19 enum DBusMethodCallStatus
{
20 DBUS_METHOD_CALL_FAILURE
,
21 DBUS_METHOD_CALL_SUCCESS
,
24 // A callback to handle responses of methods without results.
25 typedef base::Callback
<void(
26 DBusMethodCallStatus call_status
)> VoidDBusMethodCallback
;
28 // A callback to handle responses of methods returning a bool value.
29 typedef base::Callback
<void(DBusMethodCallStatus call_status
,
30 bool result
)> BoolDBusMethodCallback
;
32 // A callback to handle responses of methods returning a string value.
33 typedef base::Callback
<void(
34 DBusMethodCallStatus call_status
,
35 const std::string
& result
)> StringDBusMethodCallback
;
37 // A callback to handle responses of methods returning a boolean value.
38 typedef base::Callback
<void(
39 DBusMethodCallStatus call_status
,
40 bool result
)> BooleanDBusMethodCallback
;
42 // A callback to handle responses of methods returning a ObjectPath value.
43 typedef base::Callback
<void(
44 DBusMethodCallStatus call_status
,
45 const dbus::ObjectPath
& result
)> ObjectPathDBusMethodCallback
;
47 // A callback to handle responses of methods returning a ObjectPath value that
48 // doesn't get call status.
49 typedef base::Callback
<void(const dbus::ObjectPath
& result
)> ObjectPathCallback
;
51 } // namespace chromeos
53 #endif // CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_