blob: e1f6f1bd6721135dff849d037b447a5282e27d0d [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 Qiu00029782015-11-17 13:45:57 -080023#include "apmanager/config_adaptor_interface.h"
Peter Qiuf9335402015-11-16 12:09:16 -080024#include "apmanager/device_adaptor_interface.h"
Peter Qiua522e002015-10-13 13:21:58 -070025#include "apmanager/firewall_proxy_interface.h"
Peter Qiu685dd4a2015-11-21 17:47:49 -080026#include "apmanager/manager_adaptor_interface.h"
Peter Qiu0e92d1e2015-11-20 10:11:36 -080027#include "apmanager/service_adaptor_interface.h"
Peter Qiua522e002015-10-13 13:21:58 -070028#include "apmanager/shill_proxy_interface.h"
29
30namespace apmanager {
31
Peter Qiu00029782015-11-17 13:45:57 -080032class Config;
Peter Qiuf9335402015-11-16 12:09:16 -080033class Device;
Peter Qiu685dd4a2015-11-21 17:47:49 -080034class Manager;
Peter Qiu0e92d1e2015-11-20 10:11:36 -080035class Service;
Peter Qiuf9335402015-11-16 12:09:16 -080036
Peter Qiua522e002015-10-13 13:21:58 -070037// This is the Interface for an object factory that creates adaptor/proxy
38// objects
39class ControlInterface {
40 public:
41 virtual ~ControlInterface() {}
42
Peter Qiu0d70fa72015-11-12 10:31:40 -080043 virtual void Init() = 0;
44 virtual void Shutdown() = 0;
45
Peter Qiuf9335402015-11-16 12:09:16 -080046 // Adaptor creation APIs.
Peter Qiu00029782015-11-17 13:45:57 -080047 virtual std::unique_ptr<ConfigAdaptorInterface> CreateConfigAdaptor(
48 Config* config, int service_identifier) = 0;
Peter Qiuf9335402015-11-16 12:09:16 -080049 virtual std::unique_ptr<DeviceAdaptorInterface> CreateDeviceAdaptor(
50 Device* device) = 0;
Peter Qiu685dd4a2015-11-21 17:47:49 -080051 virtual std::unique_ptr<ManagerAdaptorInterface> CreateManagerAdaptor(
52 Manager* manager) = 0;
Peter Qiu0e92d1e2015-11-20 10:11:36 -080053 virtual std::unique_ptr<ServiceAdaptorInterface> CreateServiceAdaptor(
54 Service* service) = 0;
Peter Qiuf9335402015-11-16 12:09:16 -080055
Peter Qiua522e002015-10-13 13:21:58 -070056 // Proxy creation APIs.
57 virtual std::unique_ptr<FirewallProxyInterface> CreateFirewallProxy(
58 const base::Closure& service_appeared_callback,
59 const base::Closure& service_vanished_callback) = 0;
60 virtual std::unique_ptr<ShillProxyInterface> CreateShillProxy(
61 const base::Closure& service_appeared_callback,
62 const base::Closure& service_vanished_callback) = 0;
63};
64
65} // namespace apmanager
66
67#endif // APMANAGER_CONTROL_INTERFACE_H_