blob: 718168a6e5bd81584ac4b4beb5514b66c71861fe [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
5#ifndef SHILL_MM1_MODEM_SIMPLE_PROXY_
6#define SHILL_MM1_MODEM_SIMPLE_PROXY_
7
8#include <string>
9
Liam McLoughlinef342b42013-09-13 21:05:36 +010010#include "dbus_proxies/org.freedesktop.ModemManager1.Modem.Simple.h"
Jason Glasgowee1081c2012-03-06 15:14:53 -050011#include "shill/dbus_properties.h"
12#include "shill/mm1_modem_simple_proxy_interface.h"
13
14namespace shill {
15namespace mm1 {
16
mukesh agrawalf407d592013-07-31 11:37:57 -070017// A proxy to org.freedesktop.ModemManager1.Modem.Simple.
Jason Glasgowee1081c2012-03-06 15:14:53 -050018class ModemSimpleProxy : public ModemSimpleProxyInterface {
19 public:
20 // Constructs a org.freedesktop.ModemManager1.Modem.Simple DBus
Eric Shienbrood9a245532012-03-07 14:20:39 -050021 // object proxy at |path| owned by |service|.
22 ModemSimpleProxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050023 const std::string &path,
24 const std::string &service);
25 virtual ~ModemSimpleProxy();
26
27 // Inherited methods from SimpleProxyInterface.
28 virtual void Connect(
29 const DBusPropertiesMap &properties,
Eric Shienbrood9a245532012-03-07 14:20:39 -050030 Error *error,
31 const DBusPathCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050032 int timeout);
33 virtual void Disconnect(const ::DBus::Path &bearer,
Eric Shienbrood9a245532012-03-07 14:20:39 -050034 Error *error,
35 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050036 int timeout);
Eric Shienbrood9a245532012-03-07 14:20:39 -050037 virtual void GetStatus(Error *error,
38 const DBusPropertyMapCallback &callback,
39 int timeout);
Jason Glasgowee1081c2012-03-06 15:14:53 -050040
41 private:
42 class Proxy : public org::freedesktop::ModemManager1::Modem::Simple_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);
48 virtual ~Proxy();
49
50 private:
51 // Method callbacks inherited from
52 // org::freedesktop::ModemManager1::Modem::SimpleProxy
53 virtual void ConnectCallback(const ::DBus::Path &bearer,
54 const ::DBus::Error &dberror,
55 void *data);
56 virtual void DisconnectCallback(const ::DBus::Error &dberror, void *data);
57 virtual void GetStatusCallback(
58 const DBusPropertiesMap &bearer,
59 const ::DBus::Error &dberror,
60 void *data);
Jason Glasgowee1081c2012-03-06 15:14:53 -050061
62 DISALLOW_COPY_AND_ASSIGN(Proxy);
63 };
64
65 Proxy proxy_;
66
67 DISALLOW_COPY_AND_ASSIGN(ModemSimpleProxy);
68};
69
70} // namespace mm1
71} // namespace shill
72
73#endif // SHILL_MM1_MODEM_SIMPLE_PROXY_