blob: b01c91c04e48c34cd9b04338ffb5dd99d8e18e07 [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
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <string>
9#include <vector>
10
Darin Petkovc90fe522011-07-15 13:59:47 -070011#include <base/basictypes.h>
12
Darin Petkov4a09b6b2011-07-19 12:52:06 -070013#include "shill/dbus_bindings/modem_manager.h"
Darin Petkovc90fe522011-07-15 13:59:47 -070014#include "shill/modem_manager_proxy_interface.h"
15
16namespace shill {
17
18class ModemManager;
19
20// There's a single proxy per ModemManager service identified by its DBus |path|
21// and owner name |service|.
22class ModemManagerProxy : public ModemManagerProxyInterface {
23 public:
Darin Petkovaceede32011-07-18 15:32:38 -070024 ModemManagerProxy(DBus::Connection *connection,
25 ModemManager *manager,
Darin Petkovc90fe522011-07-15 13:59:47 -070026 const std::string &path,
27 const std::string &service);
28 virtual ~ModemManagerProxy();
29
30 // Inherited from ModemManagerProxyInterface.
31 virtual std::vector<DBus::Path> EnumerateDevices();
32
33 private:
34 class Proxy : public org::freedesktop::ModemManager_proxy,
35 public DBus::ObjectProxy {
36 public:
Darin Petkovaceede32011-07-18 15:32:38 -070037 Proxy(DBus::Connection *connection,
38 ModemManager *manager,
Darin Petkovc90fe522011-07-15 13:59:47 -070039 const std::string &path,
40 const std::string &service);
41 virtual ~Proxy();
42
43 private:
44 // Signal callbacks inherited from ModemManager_proxy.
45 virtual void DeviceAdded(const DBus::Path &device);
46 virtual void DeviceRemoved(const DBus::Path &device);
47
48 // The owner of this proxy.
49 ModemManager *manager_;
50
51 DISALLOW_COPY_AND_ASSIGN(Proxy);
52 };
53
Darin Petkovc90fe522011-07-15 13:59:47 -070054 Proxy proxy_;
55
56 DISALLOW_COPY_AND_ASSIGN(ModemManagerProxy);
57};
58
59} // namespace shill
60
61#endif // SHILL_MODEM_MANAGER_PROXY_