blob: 2b261a6b93e9df0c2622b3431c60c5535b3fab10 [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
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
David Rochberg81030ea2012-03-02 15:44:25 -050018class ModemManagerClassic;
Darin Petkovc90fe522011-07-15 13:59:47 -070019
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,
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_