blob: 391ca356a5d0df378f0ce845ff2518828e27ad5f [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
Liam McLoughlinef342b42013-09-13 21:05:36 +010010#include "dbus_proxies/org.freedesktop.ModemManager1.Modem.Location.h"
Arman Uguray2c39fab2012-12-12 16:56:34 -080011#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
Ben Chan5ea763b2014-08-13 11:07:54 -070026 ~ModemLocationProxy() override;
Arman Uguray2c39fab2012-12-12 16:56:34 -080027
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
Arman Uguray2c39fab2012-12-12 16:56:34 -080039 private:
40 class Proxy : public org::freedesktop::ModemManager1::Modem::Location_proxy,
41 public DBus::ObjectProxy {
42 public:
43 Proxy(DBus::Connection *connection,
44 const std::string &path,
45 const std::string &service);
Ben Chan5ea763b2014-08-13 11:07:54 -070046 ~Proxy() override;
Arman Uguray2c39fab2012-12-12 16:56:34 -080047
48 private:
49 // Method callbacks inherited from
50 // org::freedesktop::ModemManager1::Modem:Location_proxy
51 virtual void SetupCallback(const ::DBus::Error &dberror,
52 void *data);
53
54 virtual void GetLocationCallback(const DBusEnumValueMap &location,
55 const ::DBus::Error &dberror,
56 void *data);
57
58 DISALLOW_COPY_AND_ASSIGN(Proxy);
59 };
60
61 Proxy proxy_;
62
63 DISALLOW_COPY_AND_ASSIGN(ModemLocationProxy);
64};
65
66} // namespace mm1
67} // namespace shill
68
69#endif // SHILL_MM1_MODEM_LOCATION_PROXY_H_