Darin Petkov | 18fb2f7 | 2012-06-14 09:09:34 +0200 | [diff] [blame] | 1 | // 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 | |
| 5 | #ifndef SHILL_DBUS_SERVICE_PROXY_INTERFACE_H_ |
| 6 | #define SHILL_DBUS_SERVICE_PROXY_INTERFACE_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "shill/callbacks.h" |
| 11 | |
| 12 | namespace shill { |
| 13 | |
| 14 | // These are the methods that a DBus service proxy must support. The interface |
| 15 | // is provided so that it can be mocked in tests. |
| 16 | class DBusServiceProxyInterface { |
| 17 | public: |
| 18 | typedef base::Callback< |
| 19 | void(const std::string &name, |
| 20 | const std::string &old_owner, |
| 21 | const std::string &new_owner)> NameOwnerChangedCallback; |
| 22 | |
| 23 | virtual ~DBusServiceProxyInterface() {} |
| 24 | |
| 25 | virtual void GetNameOwner(const std::string &name, |
| 26 | Error *error, |
| 27 | const StringCallback &callback, |
| 28 | int timeout) = 0; |
| 29 | |
| 30 | virtual void set_name_owner_changed_callback( |
| 31 | const NameOwnerChangedCallback &callback) = 0; |
| 32 | }; |
| 33 | |
| 34 | } // namespace shill |
| 35 | |
| 36 | #endif // SHILL_DBUS_SERVICE_PROXY_INTERFACE_H_ |