Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame^] | 1 | // Copyright (c) 2012 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_MM1_MODEM_MODEM3GPP_PROXY_ |
| 6 | #define SHILL_MM1_MODEM_MODEM3GPP_PROXY_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "shill/dbus_bindings/mm1-modem-modem3gpp.h" |
| 11 | #include "shill/dbus_properties.h" |
| 12 | #include "shill/mm1_modem_modem3gpp_proxy_interface.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | namespace mm1 { |
| 16 | |
| 17 | class ModemModem3gppProxy : public ModemModem3gppProxyInterface { |
| 18 | public: |
| 19 | // Constructs a org.freedesktop.ModemManager1.Modem.Modem3gpp DBus |
| 20 | // object proxy at |path| owned by |service|. Caught signals and |
| 21 | // asynchronous method replies will be dispatched to |delegate|. |
| 22 | ModemModem3gppProxy(ModemModem3gppProxyDelegate *delegate, |
| 23 | DBus::Connection *connection, |
| 24 | const std::string &path, |
| 25 | const std::string &service); |
| 26 | virtual ~ModemModem3gppProxy(); |
| 27 | // Inherited methods from ModemModem3gppProxyInterface. |
| 28 | virtual void Register(const std::string &operator_id, |
| 29 | AsyncCallHandler *call_handler, |
| 30 | int timeout); |
| 31 | virtual void Scan(AsyncCallHandler *call_handler, int timeout); |
| 32 | |
| 33 | // Inherited properties from Modem3gppProxyInterface. |
| 34 | virtual std::string Imei(); |
| 35 | virtual uint32_t RegistrationState(); |
| 36 | virtual std::string OperatorCode(); |
| 37 | virtual std::string OperatorName(); |
| 38 | virtual uint32_t EnabledFacilityLocks(); |
| 39 | |
| 40 | private: |
| 41 | class Proxy : public org::freedesktop::ModemManager1::Modem::Modem3gpp_proxy, |
| 42 | public DBus::ObjectProxy { |
| 43 | public: |
| 44 | Proxy(ModemModem3gppProxyDelegate *delegate, |
| 45 | DBus::Connection *connection, |
| 46 | const std::string &path, |
| 47 | const std::string &service); |
| 48 | virtual ~Proxy(); |
| 49 | |
| 50 | private: |
| 51 | // Method callbacks inherited from |
| 52 | // org::freedesktop::ModemManager1::Modem::Modem3gppProxy |
| 53 | virtual void RegisterCallback(const ::DBus::Error& dberror, void *data); |
| 54 | virtual void ScanCallback( |
| 55 | const std::vector<DBusPropertiesMap> &results, |
| 56 | const ::DBus::Error& dberror, void *data); |
| 57 | ModemModem3gppProxyDelegate *delegate_; |
| 58 | |
| 59 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 60 | }; |
| 61 | |
| 62 | Proxy proxy_; |
| 63 | |
| 64 | DISALLOW_COPY_AND_ASSIGN(ModemModem3gppProxy); |
| 65 | }; |
| 66 | |
| 67 | } // namespace mm1 |
| 68 | } // namespace shill |
| 69 | |
| 70 | #endif // MM1_SHILL_MODEM_MODEM3GPP_PROXY_ |