Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [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 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 5 | #ifndef SHILL_MM1_MODEM_MODEMCDMA_PROXY_H_ |
| 6 | #define SHILL_MM1_MODEM_MODEMCDMA_PROXY_H_ |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
Liam McLoughlin | ef342b4 | 2013-09-13 21:05:36 +0100 | [diff] [blame] | 10 | #include "dbus_proxies/org.freedesktop.ModemManager1.Modem.ModemCdma.h" |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 11 | #include "shill/dbus_properties.h" |
| 12 | #include "shill/mm1_modem_modemcdma_proxy_interface.h" |
| 13 | |
| 14 | namespace shill { |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 15 | namespace mm1 { |
| 16 | |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 17 | // A proxy to org.freedesktop.ModemManager1.Modem.ModemCdma. |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 18 | class ModemModemCdmaProxy : public ModemModemCdmaProxyInterface { |
| 19 | public: |
| 20 | // Constructs a org.freedesktop.ModemManager1.Modem.ModemCdma DBus |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 21 | // object proxy at |path| owned by |service|. |
| 22 | ModemModemCdmaProxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 23 | const std::string &path, |
| 24 | const std::string &service); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 25 | ~ModemModemCdmaProxy() override; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 26 | |
| 27 | // Inherited methods from ModemModemCdmaProxyInterface. |
| 28 | virtual void Activate(const std::string &carrier, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 29 | Error *error, |
| 30 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 31 | int timeout); |
| 32 | virtual void ActivateManual( |
| 33 | const DBusPropertiesMap &properties, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 34 | Error *error, |
| 35 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 36 | int timeout); |
| 37 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 38 | virtual void set_activation_state_callback( |
| 39 | const ActivationStateSignalCallback &callback); |
| 40 | |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 41 | private: |
| 42 | class Proxy : public org::freedesktop::ModemManager1::Modem::ModemCdma_proxy, |
| 43 | public DBus::ObjectProxy { |
| 44 | public: |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 45 | Proxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 46 | const std::string &path, |
| 47 | const std::string &service); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 48 | ~Proxy() override; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 49 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 50 | virtual void set_activation_state_callback( |
| 51 | const ActivationStateSignalCallback &callback); |
| 52 | |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 53 | private: |
| 54 | // Signal callbacks inherited from Proxy |
| 55 | // handle signals |
| 56 | void ActivationStateChanged( |
| 57 | const uint32_t &activation_state, |
| 58 | const uint32_t &activation_error, |
| 59 | const DBusPropertiesMap &status_changes); |
| 60 | |
| 61 | // Method callbacks inherited from |
| 62 | // org::freedesktop::ModemManager1::Modem::ModemCdmaProxy |
| 63 | virtual void ActivateCallback(const ::DBus::Error& dberror, void *data); |
| 64 | virtual void ActivateManualCallback(const ::DBus::Error& dberror, |
| 65 | void *data); |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 66 | ActivationStateSignalCallback activation_state_callback_; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 67 | |
| 68 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 69 | }; |
| 70 | |
| 71 | Proxy proxy_; |
| 72 | |
| 73 | DISALLOW_COPY_AND_ASSIGN(ModemModemCdmaProxy); |
| 74 | }; |
| 75 | |
| 76 | } // namespace mm1 |
| 77 | } // namespace shill |
| 78 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 79 | #endif // SHILL_MM1_MODEM_MODEMCDMA_PROXY_H_ |