#ifndef NETWORK_H
#define NETWORK_H

#include <QObject>
#include <QNetworkConfigurationManager>
#include <QtNetwork/QNetworkConfigurationManager>
#include <QHostInfo>
#include <QDebug>
#include <QDBusArgument>
#include <QDBusObjectPath>
#include <QDBusInterface>
#include <QDBusReply>
#include <QDBusConnection>
#include <QTimer>
#include "controller/core/errorreact.h"
class Network : public QObject
{
    Q_OBJECT
public:
    explicit Network(QObject *parent = 0);
    void checkNetWork();       //检查网络
    void initConnectionInfo(); //初始化网络dbus

private:
    QStringList m_oldPathInfo;
    QList<QDBusObjectPath> m_oldPaths;

    void initConnect(); //初始化信号槽
private slots:
    void checkNetAvailable(const QHostInfo &host); //检查网络可用
    void onPropertiesChanged(QVariantMap qvm);     //监听断网联网
    void onTimeFinished();                         //延时发送重新定位请求
    void onScreenSaverUnlock();                    //监听屏幕解锁 
signals:
    void effectiveNetwork(bool isOnline); //网络连接正常
    void haveNet();                       //网络从无到有，开始刷新
};


#endif // NETWORK_H
