blob: 81368551b3021a2571098ba1c7132d1b961bf47e [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
10#include "shill/dbus_bindings/mm1-modem-simple.h"
11#include "shill/dbus_properties.h"
12#include "shill/mm1_modem_simple_proxy_interface.h"
13
14namespace shill {
15namespace mm1 {
16
17class ModemSimpleProxy : public ModemSimpleProxyInterface {
18 public:
19 // Constructs a org.freedesktop.ModemManager1.Modem.Simple DBus
Eric Shienbrood9a245532012-03-07 14:20:39 -050020 // object proxy at |path| owned by |service|.
21 ModemSimpleProxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050022 const std::string &path,
23 const std::string &service);
24 virtual ~ModemSimpleProxy();
25
26 // Inherited methods from SimpleProxyInterface.
27 virtual void Connect(
28 const DBusPropertiesMap &properties,
Eric Shienbrood9a245532012-03-07 14:20:39 -050029 Error *error,
30 const DBusPathCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050031 int timeout);
32 virtual void Disconnect(const ::DBus::Path &bearer,
Eric Shienbrood9a245532012-03-07 14:20:39 -050033 Error *error,
34 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050035 int timeout);
Eric Shienbrood9a245532012-03-07 14:20:39 -050036 virtual void GetStatus(Error *error,
37 const DBusPropertyMapCallback &callback,
38 int timeout);
Jason Glasgowee1081c2012-03-06 15:14:53 -050039
40 private:
41 class Proxy : public org::freedesktop::ModemManager1::Modem::Simple_proxy,
42 public DBus::ObjectProxy {
43 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050044 Proxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050045 const std::string &path,
46 const std::string &service);
47 virtual ~Proxy();
48
49 private:
50 // Method callbacks inherited from
51 // org::freedesktop::ModemManager1::Modem::SimpleProxy
52 virtual void ConnectCallback(const ::DBus::Path &bearer,
53 const ::DBus::Error &dberror,
54 void *data);
55 virtual void DisconnectCallback(const ::DBus::Error &dberror, void *data);
56 virtual void GetStatusCallback(
57 const DBusPropertiesMap &bearer,
58 const ::DBus::Error &dberror,
59 void *data);
Jason Glasgowee1081c2012-03-06 15:14:53 -050060
61 DISALLOW_COPY_AND_ASSIGN(Proxy);
62 };
63
64 Proxy proxy_;
65
66 DISALLOW_COPY_AND_ASSIGN(ModemSimpleProxy);
67};
68
69} // namespace mm1
70} // namespace shill
71
72#endif // SHILL_MM1_MODEM_SIMPLE_PROXY_