Peter Qiu | a522e00 | 2015-10-13 13:21:58 -0700 | [diff] [blame] | 1 | // |
| 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 Qiu | f933540 | 2015-11-16 12:09:16 -0800 | [diff] [blame^] | 23 | #include "apmanager/device_adaptor_interface.h" |
Peter Qiu | a522e00 | 2015-10-13 13:21:58 -0700 | [diff] [blame] | 24 | #include "apmanager/firewall_proxy_interface.h" |
| 25 | #include "apmanager/shill_proxy_interface.h" |
| 26 | |
| 27 | namespace apmanager { |
| 28 | |
Peter Qiu | f933540 | 2015-11-16 12:09:16 -0800 | [diff] [blame^] | 29 | class Device; |
| 30 | |
Peter Qiu | a522e00 | 2015-10-13 13:21:58 -0700 | [diff] [blame] | 31 | // This is the Interface for an object factory that creates adaptor/proxy |
| 32 | // objects |
| 33 | class ControlInterface { |
| 34 | public: |
| 35 | virtual ~ControlInterface() {} |
| 36 | |
Peter Qiu | 0d70fa7 | 2015-11-12 10:31:40 -0800 | [diff] [blame] | 37 | virtual void Init() = 0; |
| 38 | virtual void Shutdown() = 0; |
| 39 | |
Peter Qiu | f933540 | 2015-11-16 12:09:16 -0800 | [diff] [blame^] | 40 | // Adaptor creation APIs. |
| 41 | virtual std::unique_ptr<DeviceAdaptorInterface> CreateDeviceAdaptor( |
| 42 | Device* device) = 0; |
| 43 | |
Peter Qiu | a522e00 | 2015-10-13 13:21:58 -0700 | [diff] [blame] | 44 | // 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_ |