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