Arman Uguray | 6e5639f | 2012-11-15 20:30:19 -0800 | [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_BEARER_PROXY_H_ |
| 6 | #define SHILL_MM1_BEARER_PROXY_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
Liam McLoughlin | ef342b4 | 2013-09-13 21:05:36 +0100 | [diff] [blame] | 10 | #include "dbus_proxies/org.freedesktop.ModemManager1.Bearer.h" |
Arman Uguray | 6e5639f | 2012-11-15 20:30:19 -0800 | [diff] [blame] | 11 | #include "shill/dbus_properties.h" |
| 12 | #include "shill/mm1_bearer_proxy_interface.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | namespace mm1 { |
| 16 | |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 17 | // A proxy to org.freedesktop.ModemManager1.Bearer. |
Arman Uguray | 6e5639f | 2012-11-15 20:30:19 -0800 | [diff] [blame] | 18 | class BearerProxy : public BearerProxyInterface { |
| 19 | public: |
| 20 | // Constructs an org.freedesktop.ModemManager1.Bearer DBus object |
| 21 | // proxy at |path| owned by |service|. |
| 22 | BearerProxy(DBus::Connection *connection, |
| 23 | const std::string &path, |
| 24 | const std::string &service); |
| 25 | |
| 26 | virtual ~BearerProxy(); |
| 27 | |
| 28 | // Inherited methods from BearerProxyInterface |
| 29 | virtual void Connect(Error *error, |
| 30 | const ResultCallback &callback, |
| 31 | int timeout); |
| 32 | virtual void Disconnect(Error *error, |
| 33 | const ResultCallback &callback, |
| 34 | int timeout); |
| 35 | |
Arman Uguray | 6e5639f | 2012-11-15 20:30:19 -0800 | [diff] [blame] | 36 | private: |
| 37 | class Proxy : public org::freedesktop::ModemManager1::Bearer_proxy, |
| 38 | public DBus::ObjectProxy { |
| 39 | public: |
| 40 | Proxy(DBus::Connection *connection, |
| 41 | const std::string &path, |
| 42 | const std::string &service); |
| 43 | virtual ~Proxy(); |
| 44 | |
| 45 | private: |
| 46 | // Method callbacks inherited from |
| 47 | // org::freedesktop::ModemManager1::BearerProxy |
| 48 | virtual void ConnectCallback(const ::DBus::Error &dberror, |
| 49 | void *data); |
| 50 | virtual void DisconnectCallback(const ::DBus::Error &dberror, |
| 51 | void *data); |
| 52 | |
| 53 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 54 | }; |
| 55 | |
| 56 | Proxy proxy_; |
| 57 | |
| 58 | DISALLOW_COPY_AND_ASSIGN(BearerProxy); |
| 59 | }; |
| 60 | |
| 61 | } // namespace mm1 |
| 62 | } // namespace shill |
| 63 | |
| 64 | #endif // SHILL_MM1_BEARER_PROXY_H_ |