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 | |
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 | |
| 18 | class ModemManager; |
| 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, |
| 25 | ModemManager *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, |
| 38 | ModemManager *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 | |
| 48 | // The owner of this proxy. |
| 49 | ModemManager *manager_; |
| 50 | |
| 51 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 52 | }; |
| 53 | |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 54 | Proxy proxy_; |
| 55 | |
| 56 | DISALLOW_COPY_AND_ASSIGN(ModemManagerProxy); |
| 57 | }; |
| 58 | |
| 59 | } // namespace shill |
| 60 | |
| 61 | #endif // SHILL_MODEM_MANAGER_PROXY_ |