Paul Stewart | 75897df | 2011-04-27 09:05:53 -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_CONTROL_INTERFACE_ |
| 6 | #define SHILL_CONTROL_INTERFACE_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | namespace shill { |
| 11 | |
| 12 | class Manager; |
| 13 | class Service; |
| 14 | class Device; |
| 15 | |
| 16 | using std::string; |
| 17 | |
| 18 | // This is the Inteface for "partner" objects which are in charge of |
| 19 | // RPC to the various core classes. |
| 20 | class ProxyInterface { |
| 21 | 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; |
| 25 | virtual ~ProxyInterface() {} |
| 26 | }; |
| 27 | |
| 28 | // These are the functions that a Manager proxy must support |
| 29 | class ManagerProxyInterface { |
| 30 | public: |
| 31 | virtual void UpdateRunning() = 0; |
| 32 | virtual ~ManagerProxyInterface() {} |
| 33 | }; |
| 34 | |
| 35 | // These are the functions that a Manager proxy must support |
| 36 | class ServiceProxyInterface { |
| 37 | public: |
| 38 | virtual void UpdateConnected() = 0; |
| 39 | virtual ~ServiceProxyInterface() {} |
| 40 | }; |
| 41 | |
| 42 | // These are the functions that a Manager proxy must support |
| 43 | class DeviceProxyInterface { |
| 44 | public: |
| 45 | virtual void UpdateEnabled() = 0; |
| 46 | virtual ~DeviceProxyInterface() {} |
| 47 | }; |
| 48 | |
| 49 | // This is the Interface for an object factory that creates proxy objects |
| 50 | class ControlInterface { |
| 51 | public: |
| 52 | virtual ManagerProxyInterface *CreateManagerProxy(Manager *manager) = 0; |
| 53 | virtual ServiceProxyInterface *CreateServiceProxy(Service *service) = 0; |
| 54 | virtual DeviceProxyInterface *CreateDeviceProxy(Device *device) = 0; |
| 55 | virtual ~ControlInterface() {} |
| 56 | }; |
| 57 | |
| 58 | } // namespace shill |
| 59 | #endif // SHILL_CONTROL_INTERFACE_ |