blob: 67e78cbb1a18269d8c6db2ab5e38b3600b15e973 [file] [log] [blame]
Arman Uguray6e5639f2012-11-15 20:30:19 -08001// 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_BEARER_PROXY_H_
6#define SHILL_MM1_BEARER_PROXY_H_
7
8#include <string>
9
10#include "shill/dbus_bindings/mm1-bearer.h"
11#include "shill/dbus_properties.h"
12#include "shill/mm1_bearer_proxy_interface.h"
13
14namespace shill {
15namespace mm1 {
16
17class BearerProxy : public BearerProxyInterface {
18 public:
19 // Constructs an org.freedesktop.ModemManager1.Bearer DBus object
20 // proxy at |path| owned by |service|.
21 BearerProxy(DBus::Connection *connection,
22 const std::string &path,
23 const std::string &service);
24
25 virtual ~BearerProxy();
26
27 // Inherited methods from BearerProxyInterface
28 virtual void Connect(Error *error,
29 const ResultCallback &callback,
30 int timeout);
31 virtual void Disconnect(Error *error,
32 const ResultCallback &callback,
33 int timeout);
34
35 // Inherited properties from BearerProxyInterface
36 virtual const std::string Interface();
37 virtual bool Connected();
38 virtual bool Suspended();
39 virtual const DBusPropertiesMap Ip4Config();
40 virtual const DBusPropertiesMap Ip6Config();
41 virtual uint32_t IpTimeout();
42 virtual const DBusPropertiesMap Properties();
43
44 private:
45 class Proxy : public org::freedesktop::ModemManager1::Bearer_proxy,
46 public DBus::ObjectProxy {
47 public:
48 Proxy(DBus::Connection *connection,
49 const std::string &path,
50 const std::string &service);
51 virtual ~Proxy();
52
53 private:
54 // Method callbacks inherited from
55 // org::freedesktop::ModemManager1::BearerProxy
56 virtual void ConnectCallback(const ::DBus::Error &dberror,
57 void *data);
58 virtual void DisconnectCallback(const ::DBus::Error &dberror,
59 void *data);
60
61 DISALLOW_COPY_AND_ASSIGN(Proxy);
62 };
63
64 Proxy proxy_;
65
66 DISALLOW_COPY_AND_ASSIGN(BearerProxy);
67};
68
69} // namespace mm1
70} // namespace shill
71
72#endif // SHILL_MM1_BEARER_PROXY_H_