Last change
on this file since 8768 was 8252, checked in by stoecker, 7 years ago |
see #105 - reenable Qt4 build options, drop generic version dependend includes, replace by direct requirements, remaining QtCore lines should also be replaced
|
File size:
1.0 KB
|
Rev | Line | |
---|
[1372] | 1 | #ifndef BNCNETQUERY_H
|
---|
| 2 | #define BNCNETQUERY_H
|
---|
| 3 |
|
---|
[8252] | 4 | #include <QByteArray>
|
---|
| 5 | #include <QUrl>
|
---|
| 6 |
|
---|
[1372] | 7 | #include "bncconst.h"
|
---|
[5070] | 8 | #include "bnccore.h"
|
---|
[1372] | 9 |
|
---|
| 10 | class bncNetQuery : public QObject {
|
---|
| 11 | Q_OBJECT
|
---|
| 12 |
|
---|
| 13 | public:
|
---|
[1816] | 14 | enum queryStatus {init, running, finished, error};
|
---|
[1374] | 15 |
|
---|
[1383] | 16 | bncNetQuery() {
|
---|
[5066] | 17 | connect(this, SIGNAL(newMessage(QByteArray,bool)),
|
---|
[5068] | 18 | BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
|
---|
[1383] | 19 | }
|
---|
[1711] | 20 | virtual ~bncNetQuery() {}
|
---|
[1390] | 21 |
|
---|
| 22 | virtual void stop() = 0;
|
---|
[1379] | 23 | virtual void waitForRequestResult(const QUrl& url, QByteArray& outData) = 0;
|
---|
[1380] | 24 | virtual void startRequest(const QUrl& url, const QByteArray& gga) = 0;
|
---|
[6787] | 25 | virtual void keepAliveRequest(const QUrl& url, const QByteArray& gga) = 0;
|
---|
[1379] | 26 | virtual void waitForReadyRead(QByteArray& outData) = 0;
|
---|
[1716] | 27 |
|
---|
| 28 | void sendNMEA(const QByteArray& gga) {
|
---|
[6787] | 29 | keepAliveRequest(_url, gga);
|
---|
[1716] | 30 | }
|
---|
[1374] | 31 |
|
---|
| 32 | queryStatus status() const {return _status;}
|
---|
| 33 |
|
---|
[1372] | 34 | signals:
|
---|
| 35 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
| 36 |
|
---|
| 37 | private slots:
|
---|
| 38 |
|
---|
[1379] | 39 | protected:
|
---|
[1499] | 40 | queryStatus _status;
|
---|
| 41 | int _timeOut;
|
---|
[1500] | 42 | QUrl _url;
|
---|
[1372] | 43 | };
|
---|
| 44 |
|
---|
| 45 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.