blob: b782267588767adcdf320726f96cad43c3df8919 [file] [log] [blame]
Darin Petkovc90fe522011-07-15 13:59:47 -07001// Copyright (c) 2011 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_MODEM_MANAGER_PROXY_
6#define SHILL_MODEM_MANAGER_PROXY_
7
8#include <base/basictypes.h>
9
10#include "shill/mm.h"
11#include "shill/modem_manager_proxy_interface.h"
12
13namespace shill {
14
15class ModemManager;
16
17// There's a single proxy per ModemManager service identified by its DBus |path|
18// and owner name |service|.
19class ModemManagerProxy : public ModemManagerProxyInterface {
20 public:
21 ModemManagerProxy(ModemManager *manager,
22 const std::string &path,
23 const std::string &service);
24 virtual ~ModemManagerProxy();
25
26 // Inherited from ModemManagerProxyInterface.
27 virtual std::vector<DBus::Path> EnumerateDevices();
28
29 private:
30 class Proxy : public org::freedesktop::ModemManager_proxy,
31 public DBus::ObjectProxy {
32 public:
33 Proxy(ModemManager *manager,
34 DBus::Connection *connection,
35 const std::string &path,
36 const std::string &service);
37 virtual ~Proxy();
38
39 private:
40 // Signal callbacks inherited from ModemManager_proxy.
41 virtual void DeviceAdded(const DBus::Path &device);
42 virtual void DeviceRemoved(const DBus::Path &device);
43
44 // The owner of this proxy.
45 ModemManager *manager_;
46
47 DISALLOW_COPY_AND_ASSIGN(Proxy);
48 };
49
50 DBus::Connection connection_;
51 Proxy proxy_;
52
53 DISALLOW_COPY_AND_ASSIGN(ModemManagerProxy);
54};
55
56} // namespace shill
57
58#endif // SHILL_MODEM_MANAGER_PROXY_