blob: ba94758e2d6afc73edec26cc8aea51d70905fb12 [file] [log] [blame]
Eric Shienbrood5de44ab2011-12-05 10:46:27 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkovc90fe522011-07-15 13:59:47 -07002// 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
Liam McLoughlinef342b42013-09-13 21:05:36 +010013#include "dbus_proxies/org.freedesktop.ModemManager.h"
Darin Petkovc90fe522011-07-15 13:59:47 -070014#include "shill/modem_manager_proxy_interface.h"
15
16namespace shill {
17
David Rochberg81030ea2012-03-02 15:44:25 -050018class ModemManagerClassic;
Darin Petkovc90fe522011-07-15 13:59:47 -070019
mukesh agrawalf407d592013-07-31 11:37:57 -070020// There's a single proxy per (old) ModemManager service identified by
21// its DBus |path| and owner name |service|.
Darin Petkovc90fe522011-07-15 13:59:47 -070022class ModemManagerProxy : public ModemManagerProxyInterface {
23 public:
Darin Petkovaceede32011-07-18 15:32:38 -070024 ModemManagerProxy(DBus::Connection *connection,
David Rochberg81030ea2012-03-02 15:44:25 -050025 ModemManagerClassic *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,
David Rochberg81030ea2012-03-02 15:44:25 -050038 ModemManagerClassic *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
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050048 // Method callbacks inherited from ModemManager_proxy.
49 // [None]
50
Darin Petkovc90fe522011-07-15 13:59:47 -070051 // The owner of this proxy.
David Rochberg81030ea2012-03-02 15:44:25 -050052 ModemManagerClassic *manager_;
Darin Petkovc90fe522011-07-15 13:59:47 -070053
54 DISALLOW_COPY_AND_ASSIGN(Proxy);
55 };
56
Darin Petkovc90fe522011-07-15 13:59:47 -070057 Proxy proxy_;
58
59 DISALLOW_COPY_AND_ASSIGN(ModemManagerProxy);
60};
61
62} // namespace shill
63
64#endif // SHILL_MODEM_MANAGER_PROXY_