blob: 0c897c05ba544f78ce99243abca8cacef39cccfd [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
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <string>
9
Darin Petkova1e0a1c2011-08-25 15:08:33 -070010#include "shill/dbus_bindings/modem-gsm-network.h"
11#include "shill/modem_gsm_network_proxy_interface.h"
12
13namespace shill {
14
15class ModemGSMNetworkProxy : public ModemGSMNetworkProxyInterface {
16 public:
17 // Constructs a ModemManager.Modem.Gsm.Network DBus object proxy at |path|
Darin Petkov580c7af2011-10-24 12:32:50 +020018 // owned by |service|. Caught signals will be dispatched to |delegate|.
19 ModemGSMNetworkProxy(ModemGSMNetworkProxyDelegate *delegate,
Darin Petkova1e0a1c2011-08-25 15:08:33 -070020 DBus::Connection *connection,
21 const std::string &path,
22 const std::string &service);
23 virtual ~ModemGSMNetworkProxy();
24
25 // Inherited from ModemGSMNetworkProxyInterface.
Darin Petkov9bac6fe2011-08-26 12:49:05 -070026 virtual RegistrationInfo GetRegistrationInfo();
Darin Petkov22b72bf2011-08-29 14:01:20 -070027 virtual uint32 GetSignalQuality();
28 virtual void Register(const std::string &network_id);
Darin Petkovc0865312011-09-16 15:31:20 -070029 virtual ScanResults Scan();
Darin Petkov9bac6fe2011-08-26 12:49:05 -070030 virtual uint32 AccessTechnology();
Darin Petkova1e0a1c2011-08-25 15:08:33 -070031
32 private:
33 class Proxy
34 : public org::freedesktop::ModemManager::Modem::Gsm::Network_proxy,
35 public DBus::ObjectProxy {
36 public:
Darin Petkov580c7af2011-10-24 12:32:50 +020037 Proxy(ModemGSMNetworkProxyDelegate *delegate,
Darin Petkova1e0a1c2011-08-25 15:08:33 -070038 DBus::Connection *connection,
39 const std::string &path,
40 const std::string &service);
41 virtual ~Proxy();
42
43 private:
44 // Signal callbacks inherited from ModemManager::Modem::Gsm::Network_proxy.
45 virtual void SignalQuality(const uint32 &quality);
46 virtual void RegistrationInfo(const uint32_t &status,
47 const std::string &operator_code,
48 const std::string &operator_name);
49 virtual void NetworkMode(const uint32_t &mode);
50
Darin Petkov580c7af2011-10-24 12:32:50 +020051 ModemGSMNetworkProxyDelegate *delegate_;
Darin Petkova1e0a1c2011-08-25 15:08:33 -070052
53 DISALLOW_COPY_AND_ASSIGN(Proxy);
54 };
55
56 Proxy proxy_;
57
58 DISALLOW_COPY_AND_ASSIGN(ModemGSMNetworkProxy);
59};
60
61} // namespace shill
62
63#endif // SHILL_MODEM_GSM_NETWORK_PROXY_