Darin Petkov | a1e0a1c | 2011-08-25 15:08:33 -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_GSM_NETWORK_PROXY_ |
| 6 | #define SHILL_MODEM_GSM_NETWORK_PROXY_ |
| 7 | |
| 8 | #include "shill/dbus_bindings/modem-gsm-network.h" |
| 9 | #include "shill/modem_gsm_network_proxy_interface.h" |
| 10 | |
| 11 | namespace shill { |
| 12 | |
| 13 | class ModemGSMNetworkProxy : public ModemGSMNetworkProxyInterface { |
| 14 | public: |
| 15 | // Constructs a ModemManager.Modem.Gsm.Network DBus object proxy at |path| |
| 16 | // owned by |service|. Caught signals will be dispatched to |listener|. |
| 17 | ModemGSMNetworkProxy(ModemGSMNetworkProxyListener *listener, |
| 18 | DBus::Connection *connection, |
| 19 | const std::string &path, |
| 20 | const std::string &service); |
| 21 | virtual ~ModemGSMNetworkProxy(); |
| 22 | |
| 23 | // Inherited from ModemGSMNetworkProxyInterface. |
Darin Petkov | 9bac6fe | 2011-08-26 12:49:05 -0700 | [diff] [blame] | 24 | virtual RegistrationInfo GetRegistrationInfo(); |
Darin Petkov | 22b72bf | 2011-08-29 14:01:20 -0700 | [diff] [blame] | 25 | virtual uint32 GetSignalQuality(); |
| 26 | virtual void Register(const std::string &network_id); |
Darin Petkov | c086531 | 2011-09-16 15:31:20 -0700 | [diff] [blame] | 27 | virtual ScanResults Scan(); |
Darin Petkov | 9bac6fe | 2011-08-26 12:49:05 -0700 | [diff] [blame] | 28 | virtual uint32 AccessTechnology(); |
Darin Petkov | a1e0a1c | 2011-08-25 15:08:33 -0700 | [diff] [blame] | 29 | |
| 30 | private: |
| 31 | class Proxy |
| 32 | : public org::freedesktop::ModemManager::Modem::Gsm::Network_proxy, |
| 33 | public DBus::ObjectProxy { |
| 34 | public: |
| 35 | Proxy(ModemGSMNetworkProxyListener *listener, |
| 36 | DBus::Connection *connection, |
| 37 | const std::string &path, |
| 38 | const std::string &service); |
| 39 | virtual ~Proxy(); |
| 40 | |
| 41 | private: |
| 42 | // Signal callbacks inherited from ModemManager::Modem::Gsm::Network_proxy. |
| 43 | virtual void SignalQuality(const uint32 &quality); |
| 44 | virtual void RegistrationInfo(const uint32_t &status, |
| 45 | const std::string &operator_code, |
| 46 | const std::string &operator_name); |
| 47 | virtual void NetworkMode(const uint32_t &mode); |
| 48 | |
| 49 | ModemGSMNetworkProxyListener *listener_; |
| 50 | |
| 51 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 52 | }; |
| 53 | |
| 54 | Proxy proxy_; |
| 55 | |
| 56 | DISALLOW_COPY_AND_ASSIGN(ModemGSMNetworkProxy); |
| 57 | }; |
| 58 | |
| 59 | } // namespace shill |
| 60 | |
| 61 | #endif // SHILL_MODEM_GSM_NETWORK_PROXY_ |