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. 4 5 #ifndef CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_ 6 #define CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_ 7 8 #include "base/callback.h" 9 10 namespace dbus { 11 12 class ObjectPath; 13 14 } // namespace dbus 15 16 namespace chromeos { 17 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, 22 }; 23 24 // A callback to handle responses of methods without results. 25 typedef base::Callback<void( 26 DBusMethodCallStatus call_status)> VoidDBusMethodCallback; 27 28 // A callback to handle responses of methods returning a bool value. 29 typedef base::Callback<void(DBusMethodCallStatus call_status, 30 bool result)> BoolDBusMethodCallback; 31 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; 36 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; 41 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; 46 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; 50 51 } // namespace chromeos 52 53 #endif // CHROMEOS_DBUS_DBUS_METHOD_CALL_STATUS_H_ 54