blob: d69bf44ee002b5be3d7596173e3b5869ddf9b223 [file] [log] [blame]
Arman Uguray2c39fab2012-12-12 16:56:34 -08001// 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_LOCATION_PROXY_H_
6#define SHILL_MM1_MODEM_LOCATION_PROXY_H_
7
8#include <string>
9
10#include "shill/dbus_bindings/mm1-modem-location.h"
11#include "shill/dbus_properties.h"
12#include "shill/mm1_modem_location_proxy_interface.h"
13
14namespace shill {
15namespace mm1 {
16
mukesh agrawalf407d592013-07-31 11:37:57 -070017// A proxy to org.freedesktop.ModemManager1.Bearer.
Arman Uguray2c39fab2012-12-12 16:56:34 -080018class ModemLocationProxy : public ModemLocationProxyInterface {
19 public:
mukesh agrawalf407d592013-07-31 11:37:57 -070020 // Constructs an org.freedesktop.ModemManager1.Modem.Location DBus
21 // object proxy at |path| owned by |service|.
Arman Uguray2c39fab2012-12-12 16:56:34 -080022 ModemLocationProxy(DBus::Connection *connection,
23 const std::string &path,
24 const std::string &service);
25
26 virtual ~ModemLocationProxy();
27
28 // Inherited methods from ModemLocationProxyInterface.
29 virtual void Setup(uint32_t sources,
30 bool signal_location,
31 Error *error,
32 const ResultCallback &callback,
33 int timeout);
34
35 virtual void GetLocation(Error *error,
36 const DBusEnumValueMapCallback &callback,
37 int timeout);
38
39 // Inherited properties from ModemLocationProxyInterface.
40 virtual uint32_t Capabilities();
41 virtual uint32_t Enabled();
42 virtual bool SignalsLocation();
43 virtual const DBusEnumValueMap Location();
44
45 private:
46 class Proxy : public org::freedesktop::ModemManager1::Modem::Location_proxy,
47 public DBus::ObjectProxy {
48 public:
49 Proxy(DBus::Connection *connection,
50 const std::string &path,
51 const std::string &service);
52 virtual ~Proxy();
53
54 private:
55 // Method callbacks inherited from
56 // org::freedesktop::ModemManager1::Modem:Location_proxy
57 virtual void SetupCallback(const ::DBus::Error &dberror,
58 void *data);
59
60 virtual void GetLocationCallback(const DBusEnumValueMap &location,
61 const ::DBus::Error &dberror,
62 void *data);
63
64 DISALLOW_COPY_AND_ASSIGN(Proxy);
65 };
66
67 Proxy proxy_;
68
69 DISALLOW_COPY_AND_ASSIGN(ModemLocationProxy);
70};
71
72} // namespace mm1
73} // namespace shill
74
75#endif // SHILL_MM1_MODEM_LOCATION_PROXY_H_