2
* Copyright (C) 2015 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3, as published
6
* by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License along
14
* with this program. If not, see <http://www.gnu.org/licenses/>.
18
#include "forwardingmiracastcontroller.h"
23
ForwardingMiracastController::ForwardingMiracastController(const MiracastController::Ptr& fwd) : fwd_{fwd} {
25
throw std::logic_error{"Cannot operate without a valid MiracastController instance."};
29
void ForwardingMiracastController::SetDelegate(const std::weak_ptr<MiracastController::Delegate> &delegate) {
30
fwd_->SetDelegate(delegate);
33
void ForwardingMiracastController::ResetDelegate() {
34
fwd_->ResetDelegate();
37
void ForwardingMiracastController::Connect(const NetworkDevice::Ptr &device, ResultCallback callback) {
38
fwd_->Connect(device, callback);
41
void ForwardingMiracastController::Disconnect(const NetworkDevice::Ptr &device, ResultCallback callback) {
42
fwd_->Disconnect(device, callback);
45
void ForwardingMiracastController::Scan(const std::chrono::seconds &timeout) {
49
NetworkDeviceState ForwardingMiracastController::State() const {
53
std::vector<NetworkDeviceRole> ForwardingMiracastController::SupportedRoles() const {
54
return fwd_->SupportedRoles();
57
bool ForwardingMiracastController::Scanning() const {
58
return fwd_->Scanning();