Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 1 | // 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_DEVICE_DBUS_ADAPTOR_H_ |
| 6 | #define SHILL_DEVICE_DBUS_ADAPTOR_H_ |
| 7 | |
| 8 | #include <map> |
| 9 | #include <string> |
| 10 | |
| 11 | #include <base/basictypes.h> |
| 12 | |
| 13 | #include "shill/adaptor_interfaces.h" |
| 14 | #include "shill/dbus_adaptor.h" |
Chris Masone | c1e5041 | 2011-06-07 13:04:53 -0700 | [diff] [blame] | 15 | #include "shill/device.h" |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 16 | #include "shill/flimflam-device.h" |
| 17 | |
| 18 | namespace shill { |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 19 | |
| 20 | // Subclass of DBusAdaptor for Device objects |
| 21 | class DeviceDBusAdaptor : public org::chromium::flimflam::Device_adaptor, |
| 22 | public DBusAdaptor, |
| 23 | public DeviceAdaptorInterface { |
| 24 | public: |
| 25 | static const char kInterfaceName[]; |
| 26 | static const char kPath[]; |
| 27 | |
Chris Masone | c1e5041 | 2011-06-07 13:04:53 -0700 | [diff] [blame] | 28 | DeviceDBusAdaptor(DBus::Connection* conn, DeviceRefPtr device); |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 29 | virtual ~DeviceDBusAdaptor(); |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 30 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 31 | // Implementation of DeviceAdaptorInterface. |
| 32 | void UpdateEnabled(); |
| 33 | void EmitBoolChanged(const std::string& name, bool value); |
| 34 | void EmitUintChanged(const std::string& name, uint32 value); |
| 35 | void EmitIntChanged(const std::string& name, int value); |
| 36 | void EmitStringChanged(const std::string& name, const std::string& value); |
| 37 | |
| 38 | // Implementation of Device_adaptor. |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 39 | std::map<std::string, ::DBus::Variant> GetProperties(::DBus::Error &error); |
| 40 | void SetProperty(const std::string& , |
| 41 | const ::DBus::Variant& , |
| 42 | ::DBus::Error &error); |
| 43 | void ProposeScan(::DBus::Error &error); |
| 44 | ::DBus::Path AddIPConfig(const std::string& , ::DBus::Error &error); |
| 45 | |
| 46 | private: |
Chris Masone | c1e5041 | 2011-06-07 13:04:53 -0700 | [diff] [blame] | 47 | DeviceRefPtr device_; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 48 | DISALLOW_COPY_AND_ASSIGN(DeviceDBusAdaptor); |
| 49 | }; |
| 50 | |
| 51 | } // namespace shill |
| 52 | #endif // SHILL_DEVICE_DBUS_ADAPTOR_H_ |