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