blob: 0de30327ff01eb0c2a14e684046782d1a915b420 [file] [log] [blame]
Darin Petkova9b1fed2012-02-29 11:49:05 +01001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewart75897df2011-04-27 09:05:53 -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_DBUS_CONTROL_
6#define SHILL_DBUS_CONTROL_
7
Eric Shienbrood3e20a232012-02-16 11:35:56 -05008#include <base/memory/scoped_ptr.h>
Chris Masoned7732e42011-05-20 11:08:56 -07009#include <dbus-c++/glib-integration.h>
10#include <dbus-c++/util.h>
11
Paul Stewart75897df2011-04-27 09:05:53 -070012#include "shill/control_interface.h"
13
14namespace shill {
15// This is the Interface for the control channel for Shill.
16class DBusControl : public ControlInterface {
17 public:
Chris Masoned7732e42011-05-20 11:08:56 -070018 DBusControl();
19 virtual ~DBusControl();
20
Chris Masonec6c6c132011-06-30 11:29:52 -070021 virtual DeviceAdaptorInterface *CreateDeviceAdaptor(Device *device);
22 virtual IPConfigAdaptorInterface *CreateIPConfigAdaptor(IPConfig *ipconfig);
23 virtual ManagerAdaptorInterface *CreateManagerAdaptor(Manager *manager);
24 virtual ProfileAdaptorInterface *CreateProfileAdaptor(Profile *profile);
Darin Petkova9b1fed2012-02-29 11:49:05 +010025 virtual RPCTaskAdaptorInterface *CreateRPCTaskAdaptor(RPCTask *task);
Chris Masonec6c6c132011-06-30 11:29:52 -070026 virtual ServiceAdaptorInterface *CreateServiceAdaptor(Service *service);
Chris Masoned7732e42011-05-20 11:08:56 -070027
Darin Petkovd1b715b2011-06-02 21:21:22 -070028 void Init();
Darin Petkov50308cd2011-06-01 18:25:07 -070029 DBus::Connection *connection() { return connection_.get(); }
30
31 private:
Chris Masoned7732e42011-05-20 11:08:56 -070032 scoped_ptr<DBus::Glib::BusDispatcher> dispatcher_;
Paul Stewart28fbfdf2011-05-31 09:37:38 -070033 scoped_ptr<DBus::Connection> connection_;
Paul Stewart75897df2011-04-27 09:05:53 -070034};
35
36} // namespace shill
37
Chris Masoned7732e42011-05-20 11:08:56 -070038#endif // SHILL_DBUS_CONTROL_