blob: 03d804ffcb24a064b64dc565e65cdd82e28d46cb [file] [log] [blame]
Chris Masoned7732e42011-05-20 11:08:56 -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_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
Chris Masoned7732e42011-05-20 11:08:56 -070013namespace shill {
14
Chris Masone4e851612011-07-01 10:46:53 -070015// These are the functions that a Device adaptor must support
16class 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
38class 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 Masoned7732e42011-05-20 11:08:56 -070053// These are the functions that a Manager adaptor must support
54class ManagerAdaptorInterface {
55 public:
Chris Masoned7732e42011-05-20 11:08:56 -070056 virtual ~ManagerAdaptorInterface() {}
Chris Masone95207da2011-06-29 16:50:49 -070057
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 Masoned0ceb8c2011-06-02 10:05:39 -070062 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 agrawal32399322011-09-01 10:53:43 -070069 virtual void EmitRpcIdentifierArrayChanged(
70 const std::string &name,
71 const std::vector<std::string> &value) = 0;
Chris Masoned0ceb8c2011-06-02 10:05:39 -070072
73 virtual void EmitStateChanged(const std::string& new_state) = 0;
Chris Masoned7732e42011-05-20 11:08:56 -070074};
75
Chris Masone52cd19b2011-06-29 17:23:04 -070076// These are the functions that a Profile adaptor must support
77class ProfileAdaptorInterface {
78 public:
79 virtual ~ProfileAdaptorInterface() {}
80
Chris Masonec6c6c132011-06-30 11:29:52 -070081 // 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 Masone4e851612011-07-01 10:46:53 -070092// These are the functions that a Service adaptor must support
93class ServiceAdaptorInterface {
Chris Masonec6c6c132011-06-30 11:29:52 -070094 public:
Chris Masone4e851612011-07-01 10:46:53 -070095 virtual ~ServiceAdaptorInterface() {}
Chris Masonec6c6c132011-06-30 11:29:52 -070096
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 Masone4e851612011-07-01 10:46:53 -0700101 virtual void UpdateConnected() = 0;
102
Chris Masone52cd19b2011-06-29 17:23:04 -0700103 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 Masoned7732e42011-05-20 11:08:56 -0700110} // namespace shill
111#endif // SHILL_ADAPTOR_INTERFACES_