Darin Petkov | 096b347 | 2012-05-15 10:26:22 +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_WIMAX_DEVICE_PROXY_INTERFACE_ |
| 6 | #define SHILL_WIMAX_DEVICE_PROXY_INTERFACE_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/basictypes.h> |
Darin Petkov | 8ea0eaf | 2012-05-29 11:21:33 +0200 | [diff] [blame] | 11 | #include <chromeos/dbus/service_constants.h> |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 12 | |
| 13 | #include "shill/callbacks.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | class Error; |
Darin Petkov | 25665aa | 2012-05-21 14:08:12 +0200 | [diff] [blame] | 18 | class KeyValueStore; |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 19 | |
| 20 | // These are the methods that a WiMaxManager.Device proxy must support. The |
| 21 | // interface is provided so that it can be mocked in tests. |
| 22 | class WiMaxDeviceProxyInterface { |
| 23 | public: |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 24 | typedef base::Callback<void(const RpcIdentifiers &)> NetworksChangedCallback; |
Darin Petkov | 8ea0eaf | 2012-05-29 11:21:33 +0200 | [diff] [blame] | 25 | typedef base::Callback<void( |
| 26 | wimax_manager::DeviceStatus)> StatusChangedCallback; |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 27 | |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 28 | virtual ~WiMaxDeviceProxyInterface() {} |
| 29 | |
| 30 | virtual void Enable(Error *error, |
| 31 | const ResultCallback &callback, |
| 32 | int timeout) = 0; |
| 33 | virtual void Disable(Error *error, |
| 34 | const ResultCallback &callback, |
| 35 | int timeout) = 0; |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 36 | virtual void ScanNetworks(Error *error, |
| 37 | const ResultCallback &callback, |
| 38 | int timeout) = 0; |
Darin Petkov | 25665aa | 2012-05-21 14:08:12 +0200 | [diff] [blame] | 39 | virtual void Connect(const RpcIdentifier &network, |
| 40 | const KeyValueStore ¶meters, |
Ben Chan | 4e5c131 | 2012-05-18 18:45:38 -0700 | [diff] [blame] | 41 | Error *error, |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 42 | const ResultCallback &callback, |
| 43 | int timeout) = 0; |
| 44 | virtual void Disconnect(Error *error, |
| 45 | const ResultCallback &callback, |
| 46 | int timeout) = 0; |
| 47 | |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 48 | virtual void set_networks_changed_callback( |
| 49 | const NetworksChangedCallback &callback) = 0; |
Darin Petkov | 8ea0eaf | 2012-05-29 11:21:33 +0200 | [diff] [blame] | 50 | virtual void set_status_changed_callback( |
| 51 | const StatusChangedCallback &callback) = 0; |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 52 | |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 53 | // Properties. |
| 54 | virtual uint8 Index(Error *error) = 0; |
| 55 | virtual std::string Name(Error *error) = 0; |
Darin Petkov | 59f2d69 | 2012-06-07 15:57:46 +0200 | [diff] [blame] | 56 | virtual RpcIdentifiers Networks(Error *error) = 0; |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | } // namespace shill |
| 60 | |
| 61 | #endif // SHILL_WIMAX_DEVICE_PROXY_INTERFACE_H_ |