blob: 17c015f32aef0249b41b6914dcb54d3427a3c75b [file] [log] [blame]
Jason Glasgowee1081c2012-03-06 15:14:53 -05001// 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
14namespace shill {
15namespace mm1 {
16
17class ModemModem3gppProxy : public ModemModem3gppProxyInterface {
18 public:
19 // Constructs a org.freedesktop.ModemManager1.Modem.Modem3gpp DBus
Eric Shienbrood9a245532012-03-07 14:20:39 -050020 // object proxy at |path| owned by |service|.
21 ModemModem3gppProxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050022 const std::string &path,
23 const std::string &service);
24 virtual ~ModemModem3gppProxy();
25 // Inherited methods from ModemModem3gppProxyInterface.
26 virtual void Register(const std::string &operator_id,
Eric Shienbrood9a245532012-03-07 14:20:39 -050027 Error *error,
28 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050029 int timeout);
Eric Shienbrood9a245532012-03-07 14:20:39 -050030 virtual void Scan(Error *error,
31 const DBusPropertyMapsCallback &callback,
32 int timeout);
Jason Glasgowee1081c2012-03-06 15:14:53 -050033
34 // Inherited properties from Modem3gppProxyInterface.
35 virtual std::string Imei();
36 virtual uint32_t RegistrationState();
37 virtual std::string OperatorCode();
38 virtual std::string OperatorName();
39 virtual uint32_t EnabledFacilityLocks();
40
41 private:
42 class Proxy : public org::freedesktop::ModemManager1::Modem::Modem3gpp_proxy,
43 public DBus::ObjectProxy {
44 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050045 Proxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050046 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);
Jason Glasgowee1081c2012-03-06 15:14:53 -050057
58 DISALLOW_COPY_AND_ASSIGN(Proxy);
59 };
60
61 Proxy proxy_;
62
63 DISALLOW_COPY_AND_ASSIGN(ModemModem3gppProxy);
64};
65
66} // namespace mm1
67} // namespace shill
68
69#endif // MM1_SHILL_MODEM_MODEM3GPP_PROXY_