blob: ff99d6523f593a77a25cf0a39d3ed0e68f306ba3 [file] [log] [blame]
Eric Shienbrood5de44ab2011-12-05 10:46:27 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkove604f702011-07-28 15:51:17 -07002// 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_MODEM_SIMPLE_PROXY_
6#define SHILL_MODEM_SIMPLE_PROXY_
7
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <string>
9
Darin Petkove604f702011-07-28 15:51:17 -070010#include <base/basictypes.h>
11
12#include "shill/dbus_bindings/modem-simple.h"
13#include "shill/modem_simple_proxy_interface.h"
14
15namespace shill {
16
17// A proxy to ModemManager.Modem.Simple.
18class ModemSimpleProxy : public ModemSimpleProxyInterface {
19 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050020 ModemSimpleProxy(DBus::Connection *connection,
Darin Petkove604f702011-07-28 15:51:17 -070021 const std::string &path,
22 const std::string &service);
23 virtual ~ModemSimpleProxy();
24
25 // Inherited from ModemSimpleProxyInterface.
Eric Shienbrood9a245532012-03-07 14:20:39 -050026 virtual void GetModemStatus(Error *error,
27 const DBusPropertyMapCallback &callback,
28 int timeout);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050029 virtual void Connect(const DBusPropertiesMap &properties,
Eric Shienbrood9a245532012-03-07 14:20:39 -050030 Error *error,
31 const ResultCallback &callback,
32 int timeout);
Darin Petkove604f702011-07-28 15:51:17 -070033
34 private:
35 class Proxy : public org::freedesktop::ModemManager::Modem::Simple_proxy,
36 public DBus::ObjectProxy {
37 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050038 Proxy(DBus::Connection *connection,
Darin Petkove604f702011-07-28 15:51:17 -070039 const std::string &path,
40 const std::string &service);
41 virtual ~Proxy();
42
43 private:
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050044 // Signal callbacks inherited from ModemManager::Modem::Simple_proxy.
45 // [None]
46
47 // Method callbacks inherited from ModemManager::Modem::Simple_proxy.
48 virtual void GetStatusCallback(const DBusPropertiesMap &props,
49 const DBus::Error &dberror, void *data);
50 virtual void ConnectCallback(const DBus::Error &dberror, void *data);
51
Darin Petkove604f702011-07-28 15:51:17 -070052 DISALLOW_COPY_AND_ASSIGN(Proxy);
53 };
54
55 Proxy proxy_;
56
57 DISALLOW_COPY_AND_ASSIGN(ModemSimpleProxy);
58};
59
60} // namespace shill
61
62#endif // SHILL_MODEM_SIMPLE_PROXY_