/*
 * Copyright © 2014 Canonical Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *     Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
 */

#pragma once

#include <QQmlExtensionPlugin>

#include <connectivityqt/connectivity.h>

class UbuntuConnectivity : public connectivityqt::Connectivity
{
    Q_OBJECT
    Q_PROPERTY(bool limitedBandwith READ limitedBandwidth NOTIFY limitedBandwithUpdated)

public:
    UbuntuConnectivity(const std::function<void(QObject*)>& objectOwner,
                       const QDBusConnection& sessionConnection = QDBusConnection::sessionBus(),
                       QObject* parent = 0);

    ~UbuntuConnectivity();

Q_SIGNALS:
    void limitedBandwithUpdated(bool value);
};

class QmlConnectivityNetworkingPlugin : public QQmlExtensionPlugin {
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
    Q_INTERFACES(QQmlExtensionInterface)

public:
    void registerTypes(const char *uri);
    void initializeEngine(QQmlEngine *engine, const char *uri);
};

