blob: 84299f5412a249eca2c9fd609fa6b164246c9ed6 [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_INTERFACE_
6#define SHILL_MODEM_GSM_NETWORK_PROXY_INTERFACE_
7
Darin Petkovc0865312011-09-16 15:31:20 -07008#include <map>
Darin Petkova1e0a1c2011-08-25 15:08:33 -07009#include <string>
Darin Petkovc0865312011-09-16 15:31:20 -070010#include <vector>
Darin Petkova1e0a1c2011-08-25 15:08:33 -070011
12#include <base/basictypes.h>
Darin Petkov9bac6fe2011-08-26 12:49:05 -070013#include <dbus-c++/types.h>
Darin Petkova1e0a1c2011-08-25 15:08:33 -070014
15namespace shill {
16
17// These are the methods that a ModemManager.Modem.Gsm.Network proxy must
18// support. The interface is provided so that it can be mocked in tests.
19class ModemGSMNetworkProxyInterface {
20 public:
Darin Petkov9bac6fe2011-08-26 12:49:05 -070021 typedef DBus::Struct<uint32, std::string, std::string> RegistrationInfo;
Darin Petkovc0865312011-09-16 15:31:20 -070022 typedef std::map<std::string, std::string> ScanResult;
23 typedef std::vector<ScanResult> ScanResults;
Darin Petkov9bac6fe2011-08-26 12:49:05 -070024
Darin Petkova1e0a1c2011-08-25 15:08:33 -070025 virtual ~ModemGSMNetworkProxyInterface() {}
26
Darin Petkov9bac6fe2011-08-26 12:49:05 -070027 virtual RegistrationInfo GetRegistrationInfo() = 0;
Darin Petkov22b72bf2011-08-29 14:01:20 -070028 virtual uint32 GetSignalQuality() = 0;
29 virtual void Register(const std::string &network_id) = 0;
Darin Petkovc0865312011-09-16 15:31:20 -070030 virtual ScanResults Scan() = 0;
Darin Petkov9bac6fe2011-08-26 12:49:05 -070031
32 // Properties.
33 virtual uint32 AccessTechnology() = 0;
Darin Petkova1e0a1c2011-08-25 15:08:33 -070034};
35
36// ModemManager.Modem.Gsm.Network signal listener to be associated with the
37// proxy.
38class ModemGSMNetworkProxyListener {
39 public:
40 virtual ~ModemGSMNetworkProxyListener() {}
41
42 virtual void OnGSMNetworkModeChanged(uint32 mode) = 0;
43 virtual void OnGSMRegistrationInfoChanged(
44 uint32 status,
45 const std::string &operator_code,
46 const std::string &operator_name) = 0;
47 virtual void OnGSMSignalQualityChanged(uint32 quality) = 0;
48};
49
50} // namespace shill
51
52#endif // SHILL_MODEM_GSM_NETWORK_PROXY_INTERFACE_