blob: 99c230b5baf4e2e74c910c6b370737ce25144992 [file] [log] [blame]
Paul Stewart75897df2011-04-27 09:05:53 -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_CONTROL_INTERFACE_
6#define SHILL_CONTROL_INTERFACE_
7
8#include <string>
9
10namespace shill {
11
Chris Masone9be4a9d2011-05-16 15:44:09 -070012class Device;
Paul Stewart75897df2011-04-27 09:05:53 -070013class Manager;
14class Service;
Paul Stewart75897df2011-04-27 09:05:53 -070015
16using std::string;
17
Chris Masone413a3192011-05-09 17:10:05 -070018// This is the Interface for "partner" objects which are in charge of
19// handling incoming RPCs to the various core classes.
20class AdaptorInterface {
Paul Stewart75897df2011-04-27 09:05:53 -070021 public:
22 virtual void SetProperty(const string &key, const string &value) = 0;
23 virtual const string *GetProperty(const string &key) = 0;
24 virtual void ClearProperty(const string &key) = 0;
Chris Masone413a3192011-05-09 17:10:05 -070025 virtual ~AdaptorInterface() {}
Paul Stewart75897df2011-04-27 09:05:53 -070026};
27
Chris Masone413a3192011-05-09 17:10:05 -070028// These are the functions that a Manager adaptor must support
29class ManagerAdaptorInterface {
Paul Stewart75897df2011-04-27 09:05:53 -070030 public:
31 virtual void UpdateRunning() = 0;
Chris Masone413a3192011-05-09 17:10:05 -070032 virtual ~ManagerAdaptorInterface() {}
Paul Stewart75897df2011-04-27 09:05:53 -070033};
34
Chris Masone413a3192011-05-09 17:10:05 -070035// These are the functions that a Service adaptor must support
36class ServiceAdaptorInterface {
Paul Stewart75897df2011-04-27 09:05:53 -070037 public:
38 virtual void UpdateConnected() = 0;
Chris Masone413a3192011-05-09 17:10:05 -070039 virtual ~ServiceAdaptorInterface() {}
Paul Stewart75897df2011-04-27 09:05:53 -070040};
41
Chris Masone413a3192011-05-09 17:10:05 -070042// These are the functions that a Device adaptor must support
43class DeviceAdaptorInterface {
Paul Stewart75897df2011-04-27 09:05:53 -070044 public:
45 virtual void UpdateEnabled() = 0;
Chris Masone413a3192011-05-09 17:10:05 -070046 virtual ~DeviceAdaptorInterface() {}
Paul Stewart75897df2011-04-27 09:05:53 -070047};
48
Chris Masone413a3192011-05-09 17:10:05 -070049// This is the Interface for an object factory that creates adaptor objects
Paul Stewart75897df2011-04-27 09:05:53 -070050class ControlInterface {
51 public:
Chris Masone413a3192011-05-09 17:10:05 -070052 virtual ManagerAdaptorInterface *CreateManagerAdaptor(Manager *manager) = 0;
53 virtual ServiceAdaptorInterface *CreateServiceAdaptor(Service *service) = 0;
54 virtual DeviceAdaptorInterface *CreateDeviceAdaptor(Device *device) = 0;
Paul Stewart75897df2011-04-27 09:05:53 -070055 virtual ~ControlInterface() {}
56};
57
58} // namespace shill
59#endif // SHILL_CONTROL_INTERFACE_