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 | c90fe52 | 2011-07-15 13:59:47 -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_MANAGER_PROXY_ |
| 6 | #define SHILL_MODEM_MANAGER_PROXY_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 11 | #include <base/basictypes.h> |
| 12 | |
Darin Petkov | 4a09b6b | 2011-07-19 12:52:06 -0700 | [diff] [blame] | 13 | #include "shill/dbus_bindings/modem_manager.h" |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 14 | #include "shill/modem_manager_proxy_interface.h" |
| 15 | |
| 16 | namespace shill { |
| 17 | |
David Rochberg | 81030ea | 2012-03-02 15:44:25 -0500 | [diff] [blame] | 18 | class ModemManagerClassic; |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 19 | |
| 20 | // There's a single proxy per ModemManager service identified by its DBus |path| |
| 21 | // and owner name |service|. |
| 22 | class ModemManagerProxy : public ModemManagerProxyInterface { |
| 23 | public: |
Darin Petkov | aceede3 | 2011-07-18 15:32:38 -0700 | [diff] [blame] | 24 | ModemManagerProxy(DBus::Connection *connection, |
David Rochberg | 81030ea | 2012-03-02 15:44:25 -0500 | [diff] [blame] | 25 | ModemManagerClassic *manager, |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 26 | const std::string &path, |
| 27 | const std::string &service); |
| 28 | virtual ~ModemManagerProxy(); |
| 29 | |
| 30 | // Inherited from ModemManagerProxyInterface. |
| 31 | virtual std::vector<DBus::Path> EnumerateDevices(); |
| 32 | |
| 33 | private: |
| 34 | class Proxy : public org::freedesktop::ModemManager_proxy, |
| 35 | public DBus::ObjectProxy { |
| 36 | public: |
Darin Petkov | aceede3 | 2011-07-18 15:32:38 -0700 | [diff] [blame] | 37 | Proxy(DBus::Connection *connection, |
David Rochberg | 81030ea | 2012-03-02 15:44:25 -0500 | [diff] [blame] | 38 | ModemManagerClassic *manager, |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 39 | const std::string &path, |
| 40 | const std::string &service); |
| 41 | virtual ~Proxy(); |
| 42 | |
| 43 | private: |
| 44 | // Signal callbacks inherited from ModemManager_proxy. |
| 45 | virtual void DeviceAdded(const DBus::Path &device); |
| 46 | virtual void DeviceRemoved(const DBus::Path &device); |
| 47 | |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 48 | // Method callbacks inherited from ModemManager_proxy. |
| 49 | // [None] |
| 50 | |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 51 | // The owner of this proxy. |
David Rochberg | 81030ea | 2012-03-02 15:44:25 -0500 | [diff] [blame] | 52 | ModemManagerClassic *manager_; |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 53 | |
| 54 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 55 | }; |
| 56 | |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 57 | Proxy proxy_; |
| 58 | |
| 59 | DISALLOW_COPY_AND_ASSIGN(ModemManagerProxy); |
| 60 | }; |
| 61 | |
| 62 | } // namespace shill |
| 63 | |
| 64 | #endif // SHILL_MODEM_MANAGER_PROXY_ |