blob: 00d1d3c587da6ac2e7e9a0069962779a2b86834f [file] [log] [blame]
Chris Masoned7732e42011-05-20 11:08:56 -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_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
17namespace shill {
Chris Masoneec6b18b2011-06-08 14:09:10 -070018
Chris Masoned7732e42011-05-20 11:08:56 -070019class Manager;
20
21// Subclass of DBusAdaptor for Manager objects
Chris Masoneec6b18b2011-06-08 14:09:10 -070022// There is a 1:1 mapping between Manager and ManagerDBusAdaptor
23// instances. Furthermore, the Manager owns the ManagerDBusAdaptor
24// and manages its lifetime, so we're OK with ManagerDBusAdaptor
25// having a bare pointer to its owner manager.
Chris Masoned7732e42011-05-20 11:08:56 -070026class ManagerDBusAdaptor : public org::chromium::flimflam::Manager_adaptor,
27 public DBusAdaptor,
28 public ManagerAdaptorInterface {
29 public:
30 static const char kInterfaceName[];
31 static const char kPath[];
32
Chris Masoned0ceb8c2011-06-02 10:05:39 -070033 ManagerDBusAdaptor(DBus::Connection *conn, Manager *manager);
Chris Masoned7732e42011-05-20 11:08:56 -070034 virtual ~ManagerDBusAdaptor();
Chris Masoned0ceb8c2011-06-02 10:05:39 -070035
36 // Implementation of ManagerAdaptorInterface.
Chris Masoned7732e42011-05-20 11:08:56 -070037 void UpdateRunning();
Chris Masoned0ceb8c2011-06-02 10:05:39 -070038 void EmitBoolChanged(const std::string& name, bool value);
39 void EmitUintChanged(const std::string& name, uint32 value);
40 void EmitIntChanged(const std::string& name, int value);
41 void EmitStringChanged(const std::string& name, const std::string& value);
42 void EmitStateChanged(const std::string& new_state);
Chris Masoned7732e42011-05-20 11:08:56 -070043
44 // Implementation of Manager_adaptor
45 std::map<std::string, ::DBus::Variant> GetProperties(::DBus::Error &error);
46 void SetProperty(const std::string& name,
47 const ::DBus::Variant& value,
48 ::DBus::Error &error);
49 std::string GetState(::DBus::Error &error);
50 ::DBus::Path CreateProfile(const std::string& name, ::DBus::Error &error);
Chris Masoneccc88812011-06-08 18:00:10 -070051 void RemoveProfile(const std::string& name, ::DBus::Error &error);
52 ::DBus::Path PushProfile(const std::string& , ::DBus::Error &error);
53 void PopProfile(const std::string& , ::DBus::Error &error);
54 void PopAnyProfile(::DBus::Error &error);
Chris Masoned7732e42011-05-20 11:08:56 -070055 void RequestScan(const std::string& , ::DBus::Error &error);
56
57 void EnableTechnology(const std::string& , ::DBus::Error &error);
58 void DisableTechnology(const std::string& , ::DBus::Error &error);
59
60 ::DBus::Path GetService(const std::map<std::string, ::DBus::Variant>& ,
61 ::DBus::Error &error);
62 ::DBus::Path GetWifiService(const std::map<std::string, ::DBus::Variant>& ,
63 ::DBus::Error &error);
64 void ConfigureWifiService(const std::map<std::string, ::DBus::Variant>& ,
65 ::DBus::Error &error);
Chris Masoneccc88812011-06-08 18:00:10 -070066 ::DBus::Path GetVPNService(const std::map< std::string, ::DBus::Variant>& ,
67 ::DBus::Error &error);
Chris Masoned7732e42011-05-20 11:08:56 -070068
69 void RegisterAgent(const ::DBus::Path& , ::DBus::Error &error);
70 void UnregisterAgent(const ::DBus::Path& , ::DBus::Error &error);
71
Chris Masone7ccc8192011-05-24 14:54:49 -070072 int32_t GetDebugLevel(::DBus::Error &error);
73 void SetDebugLevel(const int32_t& mask, ::DBus::Error &error);
Chris Masoned7732e42011-05-20 11:08:56 -070074
75 std::string GetServiceOrder(::DBus::Error &error);
76 void SetServiceOrder(const std::string& , ::DBus::Error &error);
77
78 private:
79 Manager *manager_;
80 DISALLOW_COPY_AND_ASSIGN(ManagerDBusAdaptor);
81};
82
83} // namespace shill
84#endif // SHILL_MANAGER_DBUS_ADAPTOR_H_