Darin Petkov | d78ee7e | 2012-01-12 11:21:10 +0100 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 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 | |
Darin Petkov | 3cfbf21 | 2011-11-21 16:02:09 +0100 | [diff] [blame] | 13 | #include "shill/accessor_interface.h" |
| 14 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 15 | namespace shill { |
| 16 | |
Darin Petkov | e5bc2cb | 2011-12-07 14:47:32 +0100 | [diff] [blame] | 17 | class Error; |
| 18 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 19 | // These are the functions that a Device adaptor must support |
| 20 | class DeviceAdaptorInterface { |
| 21 | public: |
| 22 | virtual ~DeviceAdaptorInterface() {} |
| 23 | |
| 24 | // Getter for the opaque identifier that represents this object on the |
| 25 | // RPC interface to which the implementation is adapting. |
| 26 | virtual const std::string &GetRpcIdentifier() = 0; |
| 27 | |
| 28 | // Getter for the opaque identifier that represents this object's |
| 29 | // connection to the RPC interface to which the implementation is adapting. |
| 30 | virtual const std::string &GetRpcConnectionIdentifier() = 0; |
| 31 | |
| 32 | virtual void UpdateEnabled() = 0; |
| 33 | |
Darin Petkov | 3cfbf21 | 2011-11-21 16:02:09 +0100 | [diff] [blame] | 34 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
| 35 | virtual void EmitUintChanged(const std::string &name, uint32 value) = 0; |
| 36 | virtual void EmitIntChanged(const std::string &name, int value) = 0; |
| 37 | virtual void EmitStringChanged(const std::string &name, |
| 38 | const std::string &value) = 0; |
| 39 | virtual void EmitStringmapsChanged(const std::string &name, |
| 40 | const Stringmaps &value) = 0; |
Darin Petkov | 63138a9 | 2012-02-06 14:09:15 +0100 | [diff] [blame] | 41 | virtual void EmitKeyValueStoreChanged(const std::string &name, |
| 42 | const KeyValueStore &value) = 0; |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | // These are the functions that an IPConfig adaptor must support |
| 46 | class IPConfigAdaptorInterface { |
| 47 | public: |
| 48 | virtual ~IPConfigAdaptorInterface() {} |
| 49 | |
| 50 | // Getter for the opaque identifier that represents this object on the |
| 51 | // RPC interface to which the implementation is adapting. |
| 52 | virtual const std::string &GetRpcIdentifier() = 0; |
| 53 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 54 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
| 55 | virtual void EmitUintChanged(const std::string &name, uint32 value) = 0; |
| 56 | virtual void EmitIntChanged(const std::string &name, int value) = 0; |
| 57 | virtual void EmitStringChanged(const std::string &name, |
| 58 | const std::string &value) = 0; |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 59 | }; |
| 60 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 61 | // These are the functions that a Manager adaptor must support |
| 62 | class ManagerAdaptorInterface { |
| 63 | public: |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 64 | virtual ~ManagerAdaptorInterface() {} |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 65 | |
| 66 | // Getter for the opaque identifier that represents this object on the |
| 67 | // RPC interface to which the implementation is adapting. |
| 68 | virtual const std::string &GetRpcIdentifier() = 0; |
| 69 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 70 | virtual void UpdateRunning() = 0; |
| 71 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 72 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
| 73 | virtual void EmitUintChanged(const std::string &name, uint32 value) = 0; |
| 74 | virtual void EmitIntChanged(const std::string &name, int value) = 0; |
| 75 | virtual void EmitStringChanged(const std::string &name, |
| 76 | const std::string &value) = 0; |
| 77 | virtual void EmitStringsChanged(const std::string &name, |
| 78 | const std::vector<std::string> &value) = 0; |
Paul Stewart | 49739c0 | 2012-08-08 17:24:03 -0700 | [diff] [blame] | 79 | virtual void EmitRpcIdentifierChanged( |
| 80 | const std::string &name, |
| 81 | const std::string &value) = 0; |
mukesh agrawal | 3239932 | 2011-09-01 10:53:43 -0700 | [diff] [blame] | 82 | virtual void EmitRpcIdentifierArrayChanged( |
| 83 | const std::string &name, |
| 84 | const std::vector<std::string> &value) = 0; |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 85 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 86 | virtual void EmitStateChanged(const std::string &new_state) = 0; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 87 | }; |
| 88 | |
Chris Masone | 52cd19b | 2011-06-29 17:23:04 -0700 | [diff] [blame] | 89 | // These are the functions that a Profile adaptor must support |
| 90 | class ProfileAdaptorInterface { |
| 91 | public: |
| 92 | virtual ~ProfileAdaptorInterface() {} |
| 93 | |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 94 | // Getter for the opaque identifier that represents this object on the |
| 95 | // RPC interface to which the implementation is adapting. |
| 96 | virtual const std::string &GetRpcIdentifier() = 0; |
| 97 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 98 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
| 99 | virtual void EmitUintChanged(const std::string &name, uint32 value) = 0; |
| 100 | virtual void EmitIntChanged(const std::string &name, int value) = 0; |
| 101 | virtual void EmitStringChanged(const std::string &name, |
| 102 | const std::string &value) = 0; |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 103 | }; |
| 104 | |
Darin Petkov | a9b1fed | 2012-02-29 11:49:05 +0100 | [diff] [blame] | 105 | // These are the functions that a RPCTask adaptor must support. |
| 106 | class RPCTaskAdaptorInterface { |
| 107 | public: |
| 108 | virtual ~RPCTaskAdaptorInterface() {} |
| 109 | |
| 110 | // Getter for the opaque identifier that represents this object on the |
| 111 | // RPC interface to which the implementation is adapting. |
| 112 | virtual const std::string &GetRpcIdentifier() = 0; |
| 113 | |
| 114 | virtual const std::string &GetRpcInterfaceIdentifier() = 0; |
| 115 | |
| 116 | // Getter for the opaque identifier that represents this object's |
| 117 | // connection to the RPC interface to which the implementation is adapting. |
| 118 | virtual const std::string &GetRpcConnectionIdentifier() = 0; |
| 119 | }; |
| 120 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 121 | // These are the functions that a Service adaptor must support |
| 122 | class ServiceAdaptorInterface { |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 123 | public: |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 124 | virtual ~ServiceAdaptorInterface() {} |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 125 | |
| 126 | // Getter for the opaque identifier that represents this object on the |
| 127 | // RPC interface to which the implementation is adapting. |
| 128 | virtual const std::string &GetRpcIdentifier() = 0; |
| 129 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 130 | virtual void UpdateConnected() = 0; |
| 131 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 132 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
Darin Petkov | d78ee7e | 2012-01-12 11:21:10 +0100 | [diff] [blame] | 133 | virtual void EmitUint8Changed(const std::string &name, uint8 value) = 0; |
mukesh agrawal | e1d90e9 | 2012-02-15 17:36:08 -0800 | [diff] [blame] | 134 | virtual void EmitUint16Changed(const std::string &name, uint16 value) = 0; |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 135 | virtual void EmitUintChanged(const std::string &name, uint32 value) = 0; |
| 136 | virtual void EmitIntChanged(const std::string &name, int value) = 0; |
| 137 | virtual void EmitStringChanged(const std::string &name, |
| 138 | const std::string &value) = 0; |
Darin Petkov | 9cb0268 | 2012-01-28 00:17:38 +0100 | [diff] [blame] | 139 | virtual void EmitStringmapChanged(const std::string &name, |
| 140 | const Stringmap &value) = 0; |
Chris Masone | 52cd19b | 2011-06-29 17:23:04 -0700 | [diff] [blame] | 141 | }; |
| 142 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 143 | } // namespace shill |
| 144 | #endif // SHILL_ADAPTOR_INTERFACES_ |