blob: bf58502747e192d5b80b739cce5cec6c544b160a [file] [log] [blame]
Jason Glasgowee1081c2012-03-06 15:14:53 -05001// 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 Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_MM1_MODEM_MODEMCDMA_PROXY_H_
6#define SHILL_MM1_MODEM_MODEMCDMA_PROXY_H_
Jason Glasgowee1081c2012-03-06 15:14:53 -05007
8#include <string>
9
Liam McLoughlinef342b42013-09-13 21:05:36 +010010#include "dbus_proxies/org.freedesktop.ModemManager1.Modem.ModemCdma.h"
Jason Glasgowee1081c2012-03-06 15:14:53 -050011#include "shill/dbus_properties.h"
12#include "shill/mm1_modem_modemcdma_proxy_interface.h"
13
14namespace shill {
Jason Glasgowee1081c2012-03-06 15:14:53 -050015namespace mm1 {
16
mukesh agrawalf407d592013-07-31 11:37:57 -070017// A proxy to org.freedesktop.ModemManager1.Modem.ModemCdma.
Jason Glasgowee1081c2012-03-06 15:14:53 -050018class ModemModemCdmaProxy : public ModemModemCdmaProxyInterface {
19 public:
20 // Constructs a org.freedesktop.ModemManager1.Modem.ModemCdma DBus
Eric Shienbrood9a245532012-03-07 14:20:39 -050021 // object proxy at |path| owned by |service|.
22 ModemModemCdmaProxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050023 const std::string &path,
24 const std::string &service);
Ben Chan5ea763b2014-08-13 11:07:54 -070025 ~ModemModemCdmaProxy() override;
Jason Glasgowee1081c2012-03-06 15:14:53 -050026
27 // Inherited methods from ModemModemCdmaProxyInterface.
28 virtual void Activate(const std::string &carrier,
Eric Shienbrood9a245532012-03-07 14:20:39 -050029 Error *error,
30 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050031 int timeout);
32 virtual void ActivateManual(
33 const DBusPropertiesMap &properties,
Eric Shienbrood9a245532012-03-07 14:20:39 -050034 Error *error,
35 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050036 int timeout);
37
Eric Shienbrood9a245532012-03-07 14:20:39 -050038 virtual void set_activation_state_callback(
39 const ActivationStateSignalCallback &callback);
40
Jason Glasgowee1081c2012-03-06 15:14:53 -050041 private:
42 class Proxy : public org::freedesktop::ModemManager1::Modem::ModemCdma_proxy,
43 public DBus::ObjectProxy {
44 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050045 Proxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050046 const std::string &path,
47 const std::string &service);
Ben Chan5ea763b2014-08-13 11:07:54 -070048 ~Proxy() override;
Jason Glasgowee1081c2012-03-06 15:14:53 -050049
Eric Shienbrood9a245532012-03-07 14:20:39 -050050 virtual void set_activation_state_callback(
51 const ActivationStateSignalCallback &callback);
52
Jason Glasgowee1081c2012-03-06 15:14:53 -050053 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 Shienbrood9a245532012-03-07 14:20:39 -050066 ActivationStateSignalCallback activation_state_callback_;
Jason Glasgowee1081c2012-03-06 15:14:53 -050067
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 Chanc45688b2014-07-02 23:50:45 -070079#endif // SHILL_MM1_MODEM_MODEMCDMA_PROXY_H_