blob: c754f7655e1acb0dbab1c9cc24b7e7b9fd8434a5 [file] [log] [blame]
Darin Petkovd78ee7e2012-01-12 11:21:10 +01001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masoned7732e42011-05-20 11:08:56 -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_ADAPTOR_INTERFACES_
6#define SHILL_ADAPTOR_INTERFACES_
7
8#include <string>
mukesh agrawal32399322011-09-01 10:53:43 -07009#include <vector>
Chris Masoned7732e42011-05-20 11:08:56 -070010
Chris Masoned0ceb8c2011-06-02 10:05:39 -070011#include <base/basictypes.h>
12
Darin Petkov3cfbf212011-11-21 16:02:09 +010013#include "shill/accessor_interface.h"
14
Chris Masoned7732e42011-05-20 11:08:56 -070015namespace shill {
16
Darin Petkove5bc2cb2011-12-07 14:47:32 +010017class Error;
18
Chris Masone4e851612011-07-01 10:46:53 -070019// These are the functions that a Device adaptor must support
20class 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 Petkov3cfbf212011-11-21 16:02:09 +010034 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 Petkov63138a92012-02-06 14:09:15 +010041 virtual void EmitKeyValueStoreChanged(const std::string &name,
42 const KeyValueStore &value) = 0;
Chris Masone4e851612011-07-01 10:46:53 -070043};
44
45// These are the functions that an IPConfig adaptor must support
46class 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 Shah435de2c2011-11-17 19:01:07 -080054 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 Masone4e851612011-07-01 10:46:53 -070059};
60
Chris Masoned7732e42011-05-20 11:08:56 -070061// These are the functions that a Manager adaptor must support
62class ManagerAdaptorInterface {
63 public:
Chris Masoned7732e42011-05-20 11:08:56 -070064 virtual ~ManagerAdaptorInterface() {}
Chris Masone95207da2011-06-29 16:50:49 -070065
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 Masoned0ceb8c2011-06-02 10:05:39 -070070 virtual void UpdateRunning() = 0;
71
Gaurav Shah435de2c2011-11-17 19:01:07 -080072 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;
mukesh agrawal32399322011-09-01 10:53:43 -070079 virtual void EmitRpcIdentifierArrayChanged(
80 const std::string &name,
81 const std::vector<std::string> &value) = 0;
Chris Masoned0ceb8c2011-06-02 10:05:39 -070082
Gaurav Shah435de2c2011-11-17 19:01:07 -080083 virtual void EmitStateChanged(const std::string &new_state) = 0;
Chris Masoned7732e42011-05-20 11:08:56 -070084};
85
Chris Masone52cd19b2011-06-29 17:23:04 -070086// These are the functions that a Profile adaptor must support
87class ProfileAdaptorInterface {
88 public:
89 virtual ~ProfileAdaptorInterface() {}
90
Chris Masonec6c6c132011-06-30 11:29:52 -070091 // Getter for the opaque identifier that represents this object on the
92 // RPC interface to which the implementation is adapting.
93 virtual const std::string &GetRpcIdentifier() = 0;
94
Gaurav Shah435de2c2011-11-17 19:01:07 -080095 virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
96 virtual void EmitUintChanged(const std::string &name, uint32 value) = 0;
97 virtual void EmitIntChanged(const std::string &name, int value) = 0;
98 virtual void EmitStringChanged(const std::string &name,
99 const std::string &value) = 0;
Chris Masonec6c6c132011-06-30 11:29:52 -0700100};
101
Darin Petkova9b1fed2012-02-29 11:49:05 +0100102// These are the functions that a RPCTask adaptor must support.
103class RPCTaskAdaptorInterface {
104 public:
105 virtual ~RPCTaskAdaptorInterface() {}
106
107 // Getter for the opaque identifier that represents this object on the
108 // RPC interface to which the implementation is adapting.
109 virtual const std::string &GetRpcIdentifier() = 0;
110
111 virtual const std::string &GetRpcInterfaceIdentifier() = 0;
112
113 // Getter for the opaque identifier that represents this object's
114 // connection to the RPC interface to which the implementation is adapting.
115 virtual const std::string &GetRpcConnectionIdentifier() = 0;
116};
117
Chris Masone4e851612011-07-01 10:46:53 -0700118// These are the functions that a Service adaptor must support
119class ServiceAdaptorInterface {
Chris Masonec6c6c132011-06-30 11:29:52 -0700120 public:
Chris Masone4e851612011-07-01 10:46:53 -0700121 virtual ~ServiceAdaptorInterface() {}
Chris Masonec6c6c132011-06-30 11:29:52 -0700122
123 // Getter for the opaque identifier that represents this object on the
124 // RPC interface to which the implementation is adapting.
125 virtual const std::string &GetRpcIdentifier() = 0;
126
Chris Masone4e851612011-07-01 10:46:53 -0700127 virtual void UpdateConnected() = 0;
128
Gaurav Shah435de2c2011-11-17 19:01:07 -0800129 virtual void EmitBoolChanged(const std::string &name, bool value) = 0;
Darin Petkovd78ee7e2012-01-12 11:21:10 +0100130 virtual void EmitUint8Changed(const std::string &name, uint8 value) = 0;
mukesh agrawale1d90e92012-02-15 17:36:08 -0800131 virtual void EmitUint16Changed(const std::string &name, uint16 value) = 0;
Gaurav Shah435de2c2011-11-17 19:01:07 -0800132 virtual void EmitUintChanged(const std::string &name, uint32 value) = 0;
133 virtual void EmitIntChanged(const std::string &name, int value) = 0;
134 virtual void EmitStringChanged(const std::string &name,
135 const std::string &value) = 0;
Darin Petkov9cb02682012-01-28 00:17:38 +0100136 virtual void EmitStringmapChanged(const std::string &name,
137 const Stringmap &value) = 0;
Chris Masone52cd19b2011-06-29 17:23:04 -0700138};
139
Chris Masoned7732e42011-05-20 11:08:56 -0700140} // namespace shill
141#endif // SHILL_ADAPTOR_INTERFACES_