blob: b6196d125218f4bb9bc95014197ff02c89a90481 [file] [log] [blame]
Eric Shienbrood5de44ab2011-12-05 10:46:27 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkov975b5e72011-08-30 11:48:08 -07002// 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 Stefanoved2c28c2011-11-29 15:37:30 -08008#include <string>
9
Darin Petkov975b5e72011-08-30 11:48:08 -070010#include <base/basictypes.h>
11
12#include "shill/dbus_bindings/modem-gsm-card.h"
13#include "shill/modem_gsm_card_proxy_interface.h"
14
15namespace shill {
16
17class ModemGSMCardProxy : public ModemGSMCardProxyInterface {
18 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050019 // Constructs a ModemManager.Modem.Gsm.Card DBus
20 // object proxy at |path| owned by |service|.
21 ModemGSMCardProxy(DBus::Connection *connection,
Darin Petkov975b5e72011-08-30 11:48:08 -070022 const std::string &path,
23 const std::string &service);
24 virtual ~ModemGSMCardProxy();
25
26 // Inherited from ModemGSMCardProxyInterface.
Eric Shienbrood9a245532012-03-07 14:20:39 -050027 virtual void GetIMEI(Error *error, const GSMIdentifierCallback &callback,
28 int timeout);
29 virtual void GetIMSI(Error *error, const GSMIdentifierCallback &callback,
30 int timeout);
31 virtual void GetSPN(Error *error, const GSMIdentifierCallback &callback,
32 int timeout);
33 virtual void GetMSISDN(Error *error, const GSMIdentifierCallback &callback,
34 int timeout);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050035 virtual void EnablePIN(const std::string &pin, bool enabled,
Eric Shienbrood9a245532012-03-07 14:20:39 -050036 Error *error, const ResultCallback &callback,
37 int timeout);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050038 virtual void SendPIN(const std::string &pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -050039 Error *error, const ResultCallback &callback,
40 int timeout);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050041 virtual void SendPUK(const std::string &puk, const std::string &pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -050042 Error *error, const ResultCallback &callback,
43 int timeout);
Darin Petkove42e1012011-08-31 12:35:04 -070044 virtual void ChangePIN(const std::string &old_pin,
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050045 const std::string &new_pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -050046 Error *error, const ResultCallback &callback,
47 int timeout);
Darin Petkov63138a92012-02-06 14:09:15 +010048 virtual uint32 EnabledFacilityLocks();
Darin Petkov975b5e72011-08-30 11:48:08 -070049
50 private:
51 class Proxy
52 : public org::freedesktop::ModemManager::Modem::Gsm::Card_proxy,
53 public DBus::ObjectProxy {
54 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050055 Proxy(DBus::Connection *connection,
Darin Petkov975b5e72011-08-30 11:48:08 -070056 const std::string &path,
57 const std::string &service);
58 virtual ~Proxy();
59
60 private:
61 // Signal callbacks inherited from ModemManager::Modem::Gsm::Card_proxy.
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050062 // [None]
63
64 // Method callbacks inherited from ModemManager::Modem::Gsm::Card_proxy.
65 virtual void GetImeiCallback(const std::string &imei,
66 const DBus::Error &dberror, void *data);
67 virtual void GetImsiCallback(const std::string &imsi,
68 const DBus::Error &dberror, void *data);
69 virtual void GetSpnCallback(const std::string &spn,
70 const DBus::Error &dberror, void *data);
Eric Shienbrood9a245532012-03-07 14:20:39 -050071 virtual void GetMsIsdnCallback(const std::string &msisdn,
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050072 const DBus::Error &dberror, void *data);
73 virtual void EnablePinCallback(const DBus::Error &dberror, void *data);
74 virtual void SendPinCallback(const DBus::Error &dberror, void *data);
75 virtual void SendPukCallback(const DBus::Error &dberror, void *data);
76 virtual void ChangePinCallback(const DBus::Error &dberror, void *data);
Darin Petkov975b5e72011-08-30 11:48:08 -070077
Eric Shienbrood9a245532012-03-07 14:20:39 -050078 virtual void GetIdCallback(const std::string &id,
79 const DBus::Error &dberror, void *data);
80 virtual void PinCallback(const DBus::Error &dberror, void *data);
Darin Petkov975b5e72011-08-30 11:48:08 -070081
82 DISALLOW_COPY_AND_ASSIGN(Proxy);
83 };
84
85 Proxy proxy_;
86
87 DISALLOW_COPY_AND_ASSIGN(ModemGSMCardProxy);
88};
89
90} // namespace shill
91
92#endif // SHILL_MODEM_GSM_CARD_PROXY_