Enroute Flight Navigation
A navigation app for VFR pilots
TrafficDataSource_AbstractSocket.h
1/***************************************************************************
2 * Copyright (C) 2021-2024 by Stefan Kebekus *
3 * stefan.kebekus@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21#pragma once
22
23#include <QAbstractSocket>
24
25#include "traffic/TrafficDataSource_Abstract.h"
26
27
28namespace Traffic {
29
41
43 Q_OBJECT
44
45public:
52 explicit TrafficDataSource_AbstractSocket(bool isCanonical, QObject* parent);
53
54protected slots:
55 // Handle socket errors. This method will call
56 // TrafficDataSource_Abstract::setErrorString() with a suitable,
57 // human-readable, translated error message.
58 void onErrorOccurred(QAbstractSocket::SocketError socketError);
59
60 // Handle socket state changes. This method will call
61 // TrafficDataSource_Abstract::setConnectivityStatus() with a suitable,
62 // human-readable, translated message.
63 void onStateChanged(QAbstractSocket::SocketState socketState);
64
65private slots:
66 // Acquire or release WiFi lock
67 static void onReceivingHeartbeatChanged(bool receivingHB);
68
69};
70
71} // namespace Traffic
TrafficDataSource_AbstractSocket(bool isCanonical, QObject *parent)
Default constructor.
TrafficDataSource_Abstract(bool isCanonical, QObject *parent)
Default constructor.