Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -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_CARD_PROXY_ |
| 6 | #define SHILL_MODEM_GSM_CARD_PROXY_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 10 | #include <base/basictypes.h> |
| 11 | |
| 12 | #include "shill/dbus_bindings/modem-gsm-card.h" |
| 13 | #include "shill/modem_gsm_card_proxy_interface.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | class ModemGSMCardProxy : public ModemGSMCardProxyInterface { |
| 18 | public: |
| 19 | // Constructs a ModemManager.Modem.Gsm.Card DBus object proxy at |path| owned |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 20 | // by |service|. Callbacks will be dispatched to |delegate|. |
| 21 | ModemGSMCardProxy(ModemGSMCardProxyDelegate *delegate, |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 22 | DBus::Connection *connection, |
| 23 | const std::string &path, |
| 24 | const std::string &service); |
| 25 | virtual ~ModemGSMCardProxy(); |
| 26 | |
| 27 | // Inherited from ModemGSMCardProxyInterface. |
| 28 | virtual std::string GetIMEI(); |
| 29 | virtual std::string GetIMSI(); |
| 30 | virtual std::string GetSPN(); |
| 31 | virtual std::string GetMSISDN(); |
Darin Petkov | e42e101 | 2011-08-31 12:35:04 -0700 | [diff] [blame] | 32 | virtual void EnablePIN(const std::string &pin, bool enabled); |
| 33 | virtual void SendPIN(const std::string &pin); |
| 34 | virtual void SendPUK(const std::string &puk, const std::string &pin); |
| 35 | virtual void ChangePIN(const std::string &old_pin, |
| 36 | const std::string &new_pin); |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 37 | |
| 38 | private: |
| 39 | class Proxy |
| 40 | : public org::freedesktop::ModemManager::Modem::Gsm::Card_proxy, |
| 41 | public DBus::ObjectProxy { |
| 42 | public: |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 43 | Proxy(ModemGSMCardProxyDelegate *delegate, |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 44 | DBus::Connection *connection, |
| 45 | const std::string &path, |
| 46 | const std::string &service); |
| 47 | virtual ~Proxy(); |
| 48 | |
| 49 | private: |
| 50 | // Signal callbacks inherited from ModemManager::Modem::Gsm::Card_proxy. |
| 51 | // None. |
| 52 | |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 53 | ModemGSMCardProxyDelegate *delegate_; |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 54 | |
| 55 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 56 | }; |
| 57 | |
| 58 | Proxy proxy_; |
| 59 | |
| 60 | DISALLOW_COPY_AND_ASSIGN(ModemGSMCardProxy); |
| 61 | }; |
| 62 | |
| 63 | } // namespace shill |
| 64 | |
| 65 | #endif // SHILL_MODEM_GSM_CARD_PROXY_ |