blob: b7d625ce6aaae638d4f7355ad0da4ae25b6f2f32 [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
Liam McLoughlinef342b42013-09-13 21:05:36 +010012#include "dbus_proxies/org.freedesktop.ModemManager.Modem.Simple.h"
Darin Petkove604f702011-07-28 15:51:17 -070013#include "shill/modem_simple_proxy_interface.h"
14
15namespace shill {
16
mukesh agrawalf407d592013-07-31 11:37:57 -070017// A proxy to (old) ModemManager.Modem.Simple.
Darin Petkove604f702011-07-28 15:51:17 -070018class ModemSimpleProxy : public ModemSimpleProxyInterface {
19 public:
mukesh agrawalf407d592013-07-31 11:37:57 -070020 // Constructs a ModemManager.Modem.Simple DBus object proxy at
21 // |path| owned by |service|.
Eric Shienbrood9a245532012-03-07 14:20:39 -050022 ModemSimpleProxy(DBus::Connection *connection,
Darin Petkove604f702011-07-28 15:51:17 -070023 const std::string &path,
24 const std::string &service);
25 virtual ~ModemSimpleProxy();
26
27 // Inherited from ModemSimpleProxyInterface.
Eric Shienbrood9a245532012-03-07 14:20:39 -050028 virtual void GetModemStatus(Error *error,
29 const DBusPropertyMapCallback &callback,
30 int timeout);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050031 virtual void Connect(const DBusPropertiesMap &properties,
Eric Shienbrood9a245532012-03-07 14:20:39 -050032 Error *error,
33 const ResultCallback &callback,
34 int timeout);
Darin Petkove604f702011-07-28 15:51:17 -070035
36 private:
37 class Proxy : public org::freedesktop::ModemManager::Modem::Simple_proxy,
38 public DBus::ObjectProxy {
39 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050040 Proxy(DBus::Connection *connection,
Darin Petkove604f702011-07-28 15:51:17 -070041 const std::string &path,
42 const std::string &service);
43 virtual ~Proxy();
44
45 private:
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050046 // Signal callbacks inherited from ModemManager::Modem::Simple_proxy.
47 // [None]
48
49 // Method callbacks inherited from ModemManager::Modem::Simple_proxy.
50 virtual void GetStatusCallback(const DBusPropertiesMap &props,
51 const DBus::Error &dberror, void *data);
52 virtual void ConnectCallback(const DBus::Error &dberror, void *data);
53
Darin Petkove604f702011-07-28 15:51:17 -070054 DISALLOW_COPY_AND_ASSIGN(Proxy);
55 };
56
57 Proxy proxy_;
58
59 DISALLOW_COPY_AND_ASSIGN(ModemSimpleProxy);
60};
61
62} // namespace shill
63
64#endif // SHILL_MODEM_SIMPLE_PROXY_