Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Darin Petkov | e604f70 | 2011-07-28 15:51:17 -0700 | [diff] [blame] | 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_SIMPLE_PROXY_ |
| 6 | #define SHILL_MODEM_SIMPLE_PROXY_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | e604f70 | 2011-07-28 15:51:17 -0700 | [diff] [blame] | 10 | #include <base/basictypes.h> |
| 11 | |
| 12 | #include "shill/dbus_bindings/modem-simple.h" |
| 13 | #include "shill/modem_simple_proxy_interface.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | // A proxy to ModemManager.Modem.Simple. |
| 18 | class ModemSimpleProxy : public ModemSimpleProxyInterface { |
| 19 | public: |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 20 | ModemSimpleProxy(DBus::Connection *connection, |
Darin Petkov | e604f70 | 2011-07-28 15:51:17 -0700 | [diff] [blame] | 21 | const std::string &path, |
| 22 | const std::string &service); |
| 23 | virtual ~ModemSimpleProxy(); |
| 24 | |
| 25 | // Inherited from ModemSimpleProxyInterface. |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 26 | virtual void GetModemStatus(Error *error, |
| 27 | const DBusPropertyMapCallback &callback, |
| 28 | int timeout); |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 29 | virtual void Connect(const DBusPropertiesMap &properties, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 30 | Error *error, |
| 31 | const ResultCallback &callback, |
| 32 | int timeout); |
Darin Petkov | e604f70 | 2011-07-28 15:51:17 -0700 | [diff] [blame] | 33 | |
| 34 | private: |
| 35 | class Proxy : public org::freedesktop::ModemManager::Modem::Simple_proxy, |
| 36 | public DBus::ObjectProxy { |
| 37 | public: |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 38 | Proxy(DBus::Connection *connection, |
Darin Petkov | e604f70 | 2011-07-28 15:51:17 -0700 | [diff] [blame] | 39 | const std::string &path, |
| 40 | const std::string &service); |
| 41 | virtual ~Proxy(); |
| 42 | |
| 43 | private: |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 44 | // Signal callbacks inherited from ModemManager::Modem::Simple_proxy. |
| 45 | // [None] |
| 46 | |
| 47 | // Method callbacks inherited from ModemManager::Modem::Simple_proxy. |
| 48 | virtual void GetStatusCallback(const DBusPropertiesMap &props, |
| 49 | const DBus::Error &dberror, void *data); |
| 50 | virtual void ConnectCallback(const DBus::Error &dberror, void *data); |
| 51 | |
Darin Petkov | e604f70 | 2011-07-28 15:51:17 -0700 | [diff] [blame] | 52 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 53 | }; |
| 54 | |
| 55 | Proxy proxy_; |
| 56 | |
| 57 | DISALLOW_COPY_AND_ASSIGN(ModemSimpleProxy); |
| 58 | }; |
| 59 | |
| 60 | } // namespace shill |
| 61 | |
| 62 | #endif // SHILL_MODEM_SIMPLE_PROXY_ |