Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 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_MODEM_PROXY_INTERFACE_ |
| 6 | #define SHILL_MODEM_PROXY_INTERFACE_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | ceb6817 | 2011-07-29 14:47:48 -0700 | [diff] [blame] | 10 | #include <dbus-c++/types.h> |
| 11 | |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 12 | namespace shill { |
| 13 | |
| 14 | // These are the methods that a ModemManager.Modem proxy must support. The |
| 15 | // interface is provided so that it can be mocked in tests. |
| 16 | class ModemProxyInterface { |
| 17 | public: |
Darin Petkov | ceb6817 | 2011-07-29 14:47:48 -0700 | [diff] [blame] | 18 | typedef DBus::Struct<std::string, std::string, std::string> Info; |
| 19 | |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 20 | virtual ~ModemProxyInterface() {} |
| 21 | |
| 22 | virtual void Enable(const bool enable) = 0; |
Darin Petkov | ceb6817 | 2011-07-29 14:47:48 -0700 | [diff] [blame] | 23 | virtual Info GetInfo() = 0; |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 24 | }; |
| 25 | |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 26 | // ModemManager.Modem signal delegate to be associated with the proxy. |
| 27 | class ModemProxyDelegate { |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 28 | public: |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 29 | virtual ~ModemProxyDelegate() {} |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 30 | |
| 31 | virtual void OnModemStateChanged(uint32 old_state, |
| 32 | uint32 new_state, |
| 33 | uint32 reason) = 0; |
| 34 | }; |
| 35 | |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 36 | } // namespace shill |
| 37 | |
| 38 | #endif // SHILL_MODEM_PROXY_INTERFACE_ |