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_MANAGER_DBUS_ADAPTOR_H_ |
| 6 | #define SHILL_MANAGER_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" |
| 15 | #include "shill/flimflam-manager.h" |
| 16 | |
| 17 | namespace shill { |
| 18 | class Manager; |
| 19 | |
| 20 | // Subclass of DBusAdaptor for Manager objects |
| 21 | class ManagerDBusAdaptor : public org::chromium::flimflam::Manager_adaptor, |
| 22 | public DBusAdaptor, |
| 23 | public ManagerAdaptorInterface { |
| 24 | public: |
| 25 | static const char kInterfaceName[]; |
| 26 | static const char kPath[]; |
| 27 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 28 | ManagerDBusAdaptor(DBus::Connection *conn, Manager *manager); |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 29 | virtual ~ManagerDBusAdaptor(); |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 30 | |
| 31 | // Implementation of ManagerAdaptorInterface. |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 32 | void UpdateRunning(); |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 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 | void EmitStateChanged(const std::string& new_state); |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 38 | |
| 39 | // Implementation of Manager_adaptor |
| 40 | std::map<std::string, ::DBus::Variant> GetProperties(::DBus::Error &error); |
| 41 | void SetProperty(const std::string& name, |
| 42 | const ::DBus::Variant& value, |
| 43 | ::DBus::Error &error); |
| 44 | std::string GetState(::DBus::Error &error); |
| 45 | ::DBus::Path CreateProfile(const std::string& name, ::DBus::Error &error); |
| 46 | void RemoveProfile(const ::DBus::Path& path, ::DBus::Error &error); |
| 47 | void RequestScan(const std::string& , ::DBus::Error &error); |
| 48 | |
| 49 | void EnableTechnology(const std::string& , ::DBus::Error &error); |
| 50 | void DisableTechnology(const std::string& , ::DBus::Error &error); |
| 51 | |
| 52 | ::DBus::Path GetService(const std::map<std::string, ::DBus::Variant>& , |
| 53 | ::DBus::Error &error); |
| 54 | ::DBus::Path GetWifiService(const std::map<std::string, ::DBus::Variant>& , |
| 55 | ::DBus::Error &error); |
| 56 | void ConfigureWifiService(const std::map<std::string, ::DBus::Variant>& , |
| 57 | ::DBus::Error &error); |
| 58 | |
| 59 | void RegisterAgent(const ::DBus::Path& , ::DBus::Error &error); |
| 60 | void UnregisterAgent(const ::DBus::Path& , ::DBus::Error &error); |
| 61 | |
Chris Masone | 7ccc819 | 2011-05-24 14:54:49 -0700 | [diff] [blame^] | 62 | int32_t GetDebugLevel(::DBus::Error &error); |
| 63 | void SetDebugLevel(const int32_t& mask, ::DBus::Error &error); |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 64 | |
| 65 | std::string GetServiceOrder(::DBus::Error &error); |
| 66 | void SetServiceOrder(const std::string& , ::DBus::Error &error); |
| 67 | |
| 68 | private: |
| 69 | Manager *manager_; |
| 70 | DISALLOW_COPY_AND_ASSIGN(ManagerDBusAdaptor); |
| 71 | }; |
| 72 | |
| 73 | } // namespace shill |
| 74 | #endif // SHILL_MANAGER_DBUS_ADAPTOR_H_ |