Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [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_MM1_MODEM_SIMPLE_PROXY_ |
| 6 | #define SHILL_MM1_MODEM_SIMPLE_PROXY_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "shill/dbus_bindings/mm1-modem-simple.h" |
| 11 | #include "shill/dbus_properties.h" |
| 12 | #include "shill/mm1_modem_simple_proxy_interface.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | namespace mm1 { |
| 16 | |
| 17 | class ModemSimpleProxy : public ModemSimpleProxyInterface { |
| 18 | public: |
| 19 | // Constructs a org.freedesktop.ModemManager1.Modem.Simple DBus |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 20 | // object proxy at |path| owned by |service|. |
| 21 | ModemSimpleProxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 22 | const std::string &path, |
| 23 | const std::string &service); |
| 24 | virtual ~ModemSimpleProxy(); |
| 25 | |
| 26 | // Inherited methods from SimpleProxyInterface. |
| 27 | virtual void Connect( |
| 28 | const DBusPropertiesMap &properties, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 29 | Error *error, |
| 30 | const DBusPathCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 31 | int timeout); |
| 32 | virtual void Disconnect(const ::DBus::Path &bearer, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 33 | Error *error, |
| 34 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 35 | int timeout); |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 36 | virtual void GetStatus(Error *error, |
| 37 | const DBusPropertyMapCallback &callback, |
| 38 | int timeout); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 39 | |
| 40 | private: |
| 41 | class Proxy : public org::freedesktop::ModemManager1::Modem::Simple_proxy, |
| 42 | public DBus::ObjectProxy { |
| 43 | public: |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 44 | Proxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 45 | const std::string &path, |
| 46 | const std::string &service); |
| 47 | virtual ~Proxy(); |
| 48 | |
| 49 | private: |
| 50 | // Method callbacks inherited from |
| 51 | // org::freedesktop::ModemManager1::Modem::SimpleProxy |
| 52 | virtual void ConnectCallback(const ::DBus::Path &bearer, |
| 53 | const ::DBus::Error &dberror, |
| 54 | void *data); |
| 55 | virtual void DisconnectCallback(const ::DBus::Error &dberror, void *data); |
| 56 | virtual void GetStatusCallback( |
| 57 | const DBusPropertiesMap &bearer, |
| 58 | const ::DBus::Error &dberror, |
| 59 | void *data); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 60 | |
| 61 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 62 | }; |
| 63 | |
| 64 | Proxy proxy_; |
| 65 | |
| 66 | DISALLOW_COPY_AND_ASSIGN(ModemSimpleProxy); |
| 67 | }; |
| 68 | |
| 69 | } // namespace mm1 |
| 70 | } // namespace shill |
| 71 | |
| 72 | #endif // SHILL_MM1_MODEM_SIMPLE_PROXY_ |