blob: ff201ad13897f4a50fc3d92ce2931f034afcf731 [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:
Darin Petkovaceede32011-07-18 15:32:38 -070021 ModemManagerProxy(DBus::Connection *connection,
22 ModemManager *manager,
Darin Petkovc90fe522011-07-15 13:59:47 -070023 const std::string &path,
24 const std::string &service);
25 virtual ~ModemManagerProxy();
26
27 // Inherited from ModemManagerProxyInterface.
28 virtual std::vector<DBus::Path> EnumerateDevices();
29
30 private:
31 class Proxy : public org::freedesktop::ModemManager_proxy,
32 public DBus::ObjectProxy {
33 public:
Darin Petkovaceede32011-07-18 15:32:38 -070034 Proxy(DBus::Connection *connection,
35 ModemManager *manager,
Darin Petkovc90fe522011-07-15 13:59:47 -070036 const std::string &path,
37 const std::string &service);
38 virtual ~Proxy();
39
40 private:
41 // Signal callbacks inherited from ModemManager_proxy.
42 virtual void DeviceAdded(const DBus::Path &device);
43 virtual void DeviceRemoved(const DBus::Path &device);
44
45 // The owner of this proxy.
46 ModemManager *manager_;
47
48 DISALLOW_COPY_AND_ASSIGN(Proxy);
49 };
50
Darin Petkovc90fe522011-07-15 13:59:47 -070051 Proxy proxy_;
52
53 DISALLOW_COPY_AND_ASSIGN(ModemManagerProxy);
54};
55
56} // namespace shill
57
58#endif // SHILL_MODEM_MANAGER_PROXY_