Arman Uguray | 2c39fab | 2012-12-12 16:56:34 -0800 | [diff] [blame] | 1 | // 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 | |
| 14 | namespace shill { |
| 15 | namespace mm1 { |
| 16 | |
| 17 | class ModemLocationProxy : public ModemLocationProxyInterface { |
| 18 | public: |
| 19 | ModemLocationProxy(DBus::Connection *connection, |
| 20 | const std::string &path, |
| 21 | const std::string &service); |
| 22 | |
| 23 | virtual ~ModemLocationProxy(); |
| 24 | |
| 25 | // Inherited methods from ModemLocationProxyInterface. |
| 26 | virtual void Setup(uint32_t sources, |
| 27 | bool signal_location, |
| 28 | Error *error, |
| 29 | const ResultCallback &callback, |
| 30 | int timeout); |
| 31 | |
| 32 | virtual void GetLocation(Error *error, |
| 33 | const DBusEnumValueMapCallback &callback, |
| 34 | int timeout); |
| 35 | |
| 36 | // Inherited properties from ModemLocationProxyInterface. |
| 37 | virtual uint32_t Capabilities(); |
| 38 | virtual uint32_t Enabled(); |
| 39 | virtual bool SignalsLocation(); |
| 40 | virtual const DBusEnumValueMap Location(); |
| 41 | |
| 42 | private: |
| 43 | class Proxy : public org::freedesktop::ModemManager1::Modem::Location_proxy, |
| 44 | public DBus::ObjectProxy { |
| 45 | public: |
| 46 | Proxy(DBus::Connection *connection, |
| 47 | const std::string &path, |
| 48 | const std::string &service); |
| 49 | virtual ~Proxy(); |
| 50 | |
| 51 | private: |
| 52 | // Method callbacks inherited from |
| 53 | // org::freedesktop::ModemManager1::Modem:Location_proxy |
| 54 | virtual void SetupCallback(const ::DBus::Error &dberror, |
| 55 | void *data); |
| 56 | |
| 57 | virtual void GetLocationCallback(const DBusEnumValueMap &location, |
| 58 | const ::DBus::Error &dberror, |
| 59 | void *data); |
| 60 | |
| 61 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 62 | }; |
| 63 | |
| 64 | Proxy proxy_; |
| 65 | |
| 66 | DISALLOW_COPY_AND_ASSIGN(ModemLocationProxy); |
| 67 | }; |
| 68 | |
| 69 | } // namespace mm1 |
| 70 | } // namespace shill |
| 71 | |
| 72 | #endif // SHILL_MM1_MODEM_LOCATION_PROXY_H_ |