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_ADAPTOR_INTERFACES_ |
| 6 | #define SHILL_ADAPTOR_INTERFACES_ |
| 7 | |
| 8 | #include <string> |
mukesh agrawal | 3239932 | 2011-09-01 10:53:43 -0700 | [diff] [blame] | 9 | #include <vector> |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 10 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 11 | #include <base/basictypes.h> |
| 12 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 13 | namespace shill { |
| 14 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 15 | // These are the functions that a Device adaptor must support |
| 16 | class DeviceAdaptorInterface { |
| 17 | public: |
| 18 | virtual ~DeviceAdaptorInterface() {} |
| 19 | |
| 20 | // Getter for the opaque identifier that represents this object on the |
| 21 | // RPC interface to which the implementation is adapting. |
| 22 | virtual const std::string &GetRpcIdentifier() = 0; |
| 23 | |
| 24 | // Getter for the opaque identifier that represents this object's |
| 25 | // connection to the RPC interface to which the implementation is adapting. |
| 26 | virtual const std::string &GetRpcConnectionIdentifier() = 0; |
| 27 | |
| 28 | virtual void UpdateEnabled() = 0; |
| 29 | |
| 30 | virtual void EmitBoolChanged(const std::string& name, bool value) = 0; |
| 31 | virtual void EmitUintChanged(const std::string& name, uint32 value) = 0; |
| 32 | virtual void EmitIntChanged(const std::string& name, int value) = 0; |
| 33 | virtual void EmitStringChanged(const std::string& name, |
| 34 | const std::string& value) = 0; |
| 35 | }; |
| 36 | |
| 37 | // These are the functions that an IPConfig adaptor must support |
| 38 | class IPConfigAdaptorInterface { |
| 39 | public: |
| 40 | virtual ~IPConfigAdaptorInterface() {} |
| 41 | |
| 42 | // Getter for the opaque identifier that represents this object on the |
| 43 | // RPC interface to which the implementation is adapting. |
| 44 | virtual const std::string &GetRpcIdentifier() = 0; |
| 45 | |
| 46 | virtual void EmitBoolChanged(const std::string& name, bool value) = 0; |
| 47 | virtual void EmitUintChanged(const std::string& name, uint32 value) = 0; |
| 48 | virtual void EmitIntChanged(const std::string& name, int value) = 0; |
| 49 | virtual void EmitStringChanged(const std::string& name, |
| 50 | const std::string& value) = 0; |
| 51 | }; |
| 52 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 53 | // These are the functions that a Manager adaptor must support |
| 54 | class ManagerAdaptorInterface { |
| 55 | public: |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 56 | virtual ~ManagerAdaptorInterface() {} |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 57 | |
| 58 | // Getter for the opaque identifier that represents this object on the |
| 59 | // RPC interface to which the implementation is adapting. |
| 60 | virtual const std::string &GetRpcIdentifier() = 0; |
| 61 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 62 | virtual void UpdateRunning() = 0; |
| 63 | |
| 64 | virtual void EmitBoolChanged(const std::string& name, bool value) = 0; |
| 65 | virtual void EmitUintChanged(const std::string& name, uint32 value) = 0; |
| 66 | virtual void EmitIntChanged(const std::string& name, int value) = 0; |
| 67 | virtual void EmitStringChanged(const std::string& name, |
| 68 | const std::string& value) = 0; |
mukesh agrawal | 3239932 | 2011-09-01 10:53:43 -0700 | [diff] [blame] | 69 | virtual void EmitRpcIdentifierArrayChanged( |
| 70 | const std::string &name, |
| 71 | const std::vector<std::string> &value) = 0; |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 72 | |
| 73 | virtual void EmitStateChanged(const std::string& new_state) = 0; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 74 | }; |
| 75 | |
Chris Masone | 52cd19b | 2011-06-29 17:23:04 -0700 | [diff] [blame] | 76 | // These are the functions that a Profile adaptor must support |
| 77 | class ProfileAdaptorInterface { |
| 78 | public: |
| 79 | virtual ~ProfileAdaptorInterface() {} |
| 80 | |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 81 | // Getter for the opaque identifier that represents this object on the |
| 82 | // RPC interface to which the implementation is adapting. |
| 83 | virtual const std::string &GetRpcIdentifier() = 0; |
| 84 | |
| 85 | virtual void EmitBoolChanged(const std::string& name, bool value) = 0; |
| 86 | virtual void EmitUintChanged(const std::string& name, uint32 value) = 0; |
| 87 | virtual void EmitIntChanged(const std::string& name, int value) = 0; |
| 88 | virtual void EmitStringChanged(const std::string& name, |
| 89 | const std::string& value) = 0; |
| 90 | }; |
| 91 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 92 | // These are the functions that a Service adaptor must support |
| 93 | class ServiceAdaptorInterface { |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 94 | public: |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 95 | virtual ~ServiceAdaptorInterface() {} |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 96 | |
| 97 | // Getter for the opaque identifier that represents this object on the |
| 98 | // RPC interface to which the implementation is adapting. |
| 99 | virtual const std::string &GetRpcIdentifier() = 0; |
| 100 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 101 | virtual void UpdateConnected() = 0; |
| 102 | |
Chris Masone | 52cd19b | 2011-06-29 17:23:04 -0700 | [diff] [blame] | 103 | virtual void EmitBoolChanged(const std::string& name, bool value) = 0; |
| 104 | virtual void EmitUintChanged(const std::string& name, uint32 value) = 0; |
| 105 | virtual void EmitIntChanged(const std::string& name, int value) = 0; |
| 106 | virtual void EmitStringChanged(const std::string& name, |
| 107 | const std::string& value) = 0; |
| 108 | }; |
| 109 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 110 | } // namespace shill |
| 111 | #endif // SHILL_ADAPTOR_INTERFACES_ |