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 | 0002978 | 2015-11-17 13:45:57 -0800 | [diff] [blame^] | 23 | #include "apmanager/config_adaptor_interface.h" |
Peter Qiu | f933540 | 2015-11-16 12:09:16 -0800 | [diff] [blame] | 24 | #include "apmanager/device_adaptor_interface.h" |
Peter Qiu | a522e00 | 2015-10-13 13:21:58 -0700 | [diff] [blame] | 25 | #include "apmanager/firewall_proxy_interface.h" |
| 26 | #include "apmanager/shill_proxy_interface.h" |
| 27 | |
| 28 | namespace apmanager { |
| 29 | |
Peter Qiu | 0002978 | 2015-11-17 13:45:57 -0800 | [diff] [blame^] | 30 | class Config; |
Peter Qiu | f933540 | 2015-11-16 12:09:16 -0800 | [diff] [blame] | 31 | class Device; |
| 32 | |
Peter Qiu | a522e00 | 2015-10-13 13:21:58 -0700 | [diff] [blame] | 33 | // This is the Interface for an object factory that creates adaptor/proxy |
| 34 | // objects |
| 35 | class ControlInterface { |
| 36 | public: |
| 37 | virtual ~ControlInterface() {} |
| 38 | |
Peter Qiu | 0d70fa7 | 2015-11-12 10:31:40 -0800 | [diff] [blame] | 39 | virtual void Init() = 0; |
| 40 | virtual void Shutdown() = 0; |
| 41 | |
Peter Qiu | f933540 | 2015-11-16 12:09:16 -0800 | [diff] [blame] | 42 | // Adaptor creation APIs. |
Peter Qiu | 0002978 | 2015-11-17 13:45:57 -0800 | [diff] [blame^] | 43 | virtual std::unique_ptr<ConfigAdaptorInterface> CreateConfigAdaptor( |
| 44 | Config* config, int service_identifier) = 0; |
Peter Qiu | f933540 | 2015-11-16 12:09:16 -0800 | [diff] [blame] | 45 | virtual std::unique_ptr<DeviceAdaptorInterface> CreateDeviceAdaptor( |
| 46 | Device* device) = 0; |
| 47 | |
Peter Qiu | a522e00 | 2015-10-13 13:21:58 -0700 | [diff] [blame] | 48 | // Proxy creation APIs. |
| 49 | virtual std::unique_ptr<FirewallProxyInterface> CreateFirewallProxy( |
| 50 | const base::Closure& service_appeared_callback, |
| 51 | const base::Closure& service_vanished_callback) = 0; |
| 52 | virtual std::unique_ptr<ShillProxyInterface> CreateShillProxy( |
| 53 | const base::Closure& service_appeared_callback, |
| 54 | const base::Closure& service_vanished_callback) = 0; |
| 55 | }; |
| 56 | |
| 57 | } // namespace apmanager |
| 58 | |
| 59 | #endif // APMANAGER_CONTROL_INTERFACE_H_ |