forked from pipacs/o2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patho2replyserver.h
33 lines (25 loc) · 861 Bytes
/
o2replyserver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef O2REPLYSERVER_H
#define O2REPLYSERVER_H
#include <QTcpServer>
#include <QMap>
#include <QByteArray>
#include <QString>
/// HTTP server to process authentication response.
class O2ReplyServer: public QTcpServer {
Q_OBJECT
public:
explicit O2ReplyServer(QObject *parent = 0);
/// Page content on local host after successful oauth - in case you do not want to close the browser, but display something
Q_PROPERTY(QByteArray replyContent READ replyContent WRITE setReplyContent)
QByteArray replyContent();
void setReplyContent(const QByteArray &value);
Q_SIGNALS:
void verificationReceived(QMap<QString, QString>);
public Q_SLOTS:
void onIncomingConnection();
void onBytesReady();
QMap<QString, QString> parseQueryParams(QByteArray *data);
protected:
QByteArray replyContent_;
};
#endif // O2REPLYSERVER_H