blob: 7b494f3754413eae70315260985e84519ba9dfbd [file] [log] [blame]
Darin Petkov975b5e72011-08-30 11:48:08 -07001// 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 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:
19 // Constructs a ModemManager.Modem.Gsm.Card DBus object proxy at |path| owned
Darin Petkov580c7af2011-10-24 12:32:50 +020020 // by |service|. Callbacks will be dispatched to |delegate|.
21 ModemGSMCardProxy(ModemGSMCardProxyDelegate *delegate,
Darin Petkov975b5e72011-08-30 11:48:08 -070022 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 Petkove42e1012011-08-31 12:35:04 -070032 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 Petkov975b5e72011-08-30 11:48:08 -070037
38 private:
39 class Proxy
40 : public org::freedesktop::ModemManager::Modem::Gsm::Card_proxy,
41 public DBus::ObjectProxy {
42 public:
Darin Petkov580c7af2011-10-24 12:32:50 +020043 Proxy(ModemGSMCardProxyDelegate *delegate,
Darin Petkov975b5e72011-08-30 11:48:08 -070044 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 Petkov580c7af2011-10-24 12:32:50 +020053 ModemGSMCardProxyDelegate *delegate_;
Darin Petkov975b5e72011-08-30 11:48:08 -070054
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_