blob: b23e011790eb911325dbeb00cd45f0d7d095bff9 [file] [log] [blame]
Darin Petkova1e0a1c2011-08-25 15:08:33 -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_NETWORK_PROXY_
6#define SHILL_MODEM_GSM_NETWORK_PROXY_
7
8#include "shill/dbus_bindings/modem-gsm-network.h"
9#include "shill/modem_gsm_network_proxy_interface.h"
10
11namespace shill {
12
13class ModemGSMNetworkProxy : public ModemGSMNetworkProxyInterface {
14 public:
15 // Constructs a ModemManager.Modem.Gsm.Network DBus object proxy at |path|
16 // owned by |service|. Caught signals will be dispatched to |listener|.
17 ModemGSMNetworkProxy(ModemGSMNetworkProxyListener *listener,
18 DBus::Connection *connection,
19 const std::string &path,
20 const std::string &service);
21 virtual ~ModemGSMNetworkProxy();
22
23 // Inherited from ModemGSMNetworkProxyInterface.
Darin Petkov9bac6fe2011-08-26 12:49:05 -070024 virtual RegistrationInfo GetRegistrationInfo();
Darin Petkov22b72bf2011-08-29 14:01:20 -070025 virtual uint32 GetSignalQuality();
26 virtual void Register(const std::string &network_id);
Darin Petkovc0865312011-09-16 15:31:20 -070027 virtual ScanResults Scan();
Darin Petkov9bac6fe2011-08-26 12:49:05 -070028 virtual uint32 AccessTechnology();
Darin Petkova1e0a1c2011-08-25 15:08:33 -070029
30 private:
31 class Proxy
32 : public org::freedesktop::ModemManager::Modem::Gsm::Network_proxy,
33 public DBus::ObjectProxy {
34 public:
35 Proxy(ModemGSMNetworkProxyListener *listener,
36 DBus::Connection *connection,
37 const std::string &path,
38 const std::string &service);
39 virtual ~Proxy();
40
41 private:
42 // Signal callbacks inherited from ModemManager::Modem::Gsm::Network_proxy.
43 virtual void SignalQuality(const uint32 &quality);
44 virtual void RegistrationInfo(const uint32_t &status,
45 const std::string &operator_code,
46 const std::string &operator_name);
47 virtual void NetworkMode(const uint32_t &mode);
48
49 ModemGSMNetworkProxyListener *listener_;
50
51 DISALLOW_COPY_AND_ASSIGN(Proxy);
52 };
53
54 Proxy proxy_;
55
56 DISALLOW_COPY_AND_ASSIGN(ModemGSMNetworkProxy);
57};
58
59} // namespace shill
60
61#endif // SHILL_MODEM_GSM_NETWORK_PROXY_