Rev | Line | |
---|
[1372] | 1 | #ifndef BNCNETQUERY_H
|
---|
| 2 | #define BNCNETQUERY_H
|
---|
| 3 |
|
---|
| 4 | #include <QtNetwork>
|
---|
| 5 | #include "bncconst.h"
|
---|
[1383] | 6 | #include "bncapp.h"
|
---|
[1372] | 7 |
|
---|
| 8 | class bncNetQuery : public QObject {
|
---|
| 9 | Q_OBJECT
|
---|
| 10 |
|
---|
| 11 | public:
|
---|
[1374] | 12 | enum queryStatus {init, running, finished, error};
|
---|
| 13 |
|
---|
[1383] | 14 | bncNetQuery() {
|
---|
| 15 | connect(this, SIGNAL(newMessage(QByteArray,bool)),
|
---|
| 16 | (bncApp*) qApp, SLOT(slotMessage(const QByteArray,bool)));
|
---|
| 17 | }
|
---|
[1387] | 18 | virtual ~bncNetQuery() {};
|
---|
[1390] | 19 |
|
---|
| 20 | virtual void stop() = 0;
|
---|
[1379] | 21 | virtual void waitForRequestResult(const QUrl& url, QByteArray& outData) = 0;
|
---|
[1380] | 22 | virtual void startRequest(const QUrl& url, const QByteArray& gga) = 0;
|
---|
[1379] | 23 | virtual void waitForReadyRead(QByteArray& outData) = 0;
|
---|
[1374] | 24 |
|
---|
| 25 | queryStatus status() const {return _status;}
|
---|
| 26 |
|
---|
[1372] | 27 | signals:
|
---|
| 28 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
| 29 |
|
---|
| 30 | private slots:
|
---|
| 31 |
|
---|
[1379] | 32 | protected:
|
---|
[1499] | 33 | queryStatus _status;
|
---|
| 34 | int _timeOut;
|
---|
[1500] | 35 | QUrl _url;
|
---|
[1372] | 36 | };
|
---|
| 37 |
|
---|
| 38 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.