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