blob: 58ef1e19b39f19ad7a2033e3c917b137a57cff9d [file] [log] [blame]
Peter Qiua522e002015-10-13 13:21:58 -07001//
2// Copyright (C) 2015 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17#ifndef APMANAGER_CONTROL_INTERFACE_H_
18#define APMANAGER_CONTROL_INTERFACE_H_
19
20#include <base/callback.h>
21#include <base/macros.h>
22
Peter Qiuf9335402015-11-16 12:09:16 -080023#include "apmanager/device_adaptor_interface.h"
Peter Qiua522e002015-10-13 13:21:58 -070024#include "apmanager/firewall_proxy_interface.h"
25#include "apmanager/shill_proxy_interface.h"
26
27namespace apmanager {
28
Peter Qiuf9335402015-11-16 12:09:16 -080029class Device;
30
Peter Qiua522e002015-10-13 13:21:58 -070031// This is the Interface for an object factory that creates adaptor/proxy
32// objects
33class ControlInterface {
34 public:
35 virtual ~ControlInterface() {}
36
Peter Qiu0d70fa72015-11-12 10:31:40 -080037 virtual void Init() = 0;
38 virtual void Shutdown() = 0;
39
Peter Qiuf9335402015-11-16 12:09:16 -080040 // Adaptor creation APIs.
41 virtual std::unique_ptr<DeviceAdaptorInterface> CreateDeviceAdaptor(
42 Device* device) = 0;
43
Peter Qiua522e002015-10-13 13:21:58 -070044 // Proxy creation APIs.
45 virtual std::unique_ptr<FirewallProxyInterface> CreateFirewallProxy(
46 const base::Closure& service_appeared_callback,
47 const base::Closure& service_vanished_callback) = 0;
48 virtual std::unique_ptr<ShillProxyInterface> CreateShillProxy(
49 const base::Closure& service_appeared_callback,
50 const base::Closure& service_vanished_callback) = 0;
51};
52
53} // namespace apmanager
54
55#endif // APMANAGER_CONTROL_INTERFACE_H_