AusweisApp2/src/network/WifiInfo.h

52 lines
835 B
C
Raw Normal View History

2017-12-20 14:54:05 +01:00
/*!
* \brief Provides information about the Wifi status
*
2019-05-22 10:08:38 +02:00
* \copyright Copyright (c) 2017-2019 Governikus GmbH & Co. KG, Germany
2017-12-20 14:54:05 +01:00
*/
#pragma once
2018-03-28 15:10:51 +02:00
#include <QHostAddress>
2017-12-20 14:54:05 +01:00
#include <QObject>
2018-03-28 15:10:51 +02:00
class test_WifiInfo;
2017-12-20 14:54:05 +01:00
namespace governikus
{
class WifiInfo
: public QObject
{
Q_OBJECT
private:
2018-03-28 15:10:51 +02:00
friend class ::test_WifiInfo;
2017-12-20 14:54:05 +01:00
bool mWifiEnabled;
2018-03-28 15:10:51 +02:00
int mWifiCheckTimerId;
int mWifiEnableWaitCounter;
2017-12-20 14:54:05 +01:00
2018-03-28 15:10:51 +02:00
static bool isPrivateIp(const QHostAddress& pAddress);
2019-01-03 15:06:22 +01:00
static bool hasPrivateIpAddress();
2017-12-20 14:54:05 +01:00
bool getCurrentWifiEnabled();
2018-03-28 15:10:51 +02:00
bool shouldWifiEnabledBeCalled();
2017-12-20 14:54:05 +01:00
protected:
void timerEvent(QTimerEvent* pEvent) override;
public:
WifiInfo();
2018-03-28 15:10:51 +02:00
virtual ~WifiInfo() override = default;
2017-12-20 14:54:05 +01:00
bool isWifiEnabled();
2018-03-28 15:10:51 +02:00
void enableWifi();
2017-12-20 14:54:05 +01:00
Q_SIGNALS:
void fireWifiEnabledChanged(bool pEnabled);
};
2019-01-03 15:06:22 +01:00
} // namespace governikus