2011-02-19 03:53:06 +00:00
|
|
|
#include <QObject>
|
2011-02-26 04:29:36 +00:00
|
|
|
#include <QStringList>
|
2011-02-19 03:53:06 +00:00
|
|
|
|
|
|
|
class QTcpSocket;
|
|
|
|
class WebPage;
|
|
|
|
class Command;
|
2011-05-05 21:45:44 +00:00
|
|
|
class Response;
|
2011-10-14 15:22:24 +00:00
|
|
|
class CommandParser;
|
|
|
|
class CommandFactory;
|
2011-02-19 03:53:06 +00:00
|
|
|
|
|
|
|
class Connection : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Connection(QTcpSocket *socket, WebPage *page, QObject *parent = 0);
|
|
|
|
|
|
|
|
public slots:
|
2012-03-21 23:30:43 +00:00
|
|
|
void commandReady(Command *command);
|
2011-05-05 21:45:44 +00:00
|
|
|
void finishCommand(Response *response);
|
2011-03-09 05:08:30 +00:00
|
|
|
void pendingLoadFinished(bool success);
|
2012-01-31 21:57:57 +00:00
|
|
|
void pageLoadingFromCommand();
|
2011-02-19 03:53:06 +00:00
|
|
|
|
|
|
|
private:
|
2011-02-26 04:29:36 +00:00
|
|
|
void startCommand();
|
2011-05-05 21:45:44 +00:00
|
|
|
void writeResponse(Response *response);
|
2012-03-21 23:11:50 +00:00
|
|
|
void writePageLoadFailure();
|
2011-02-19 03:53:06 +00:00
|
|
|
|
|
|
|
QTcpSocket *m_socket;
|
2012-03-21 22:56:01 +00:00
|
|
|
Command *m_runningCommand;
|
|
|
|
Command *m_queuedCommand;
|
2011-02-19 03:53:06 +00:00
|
|
|
WebPage *m_page;
|
2011-10-14 15:22:24 +00:00
|
|
|
CommandParser *m_commandParser;
|
|
|
|
CommandFactory *m_commandFactory;
|
2011-05-05 22:27:04 +00:00
|
|
|
bool m_pageSuccess;
|
|
|
|
bool m_commandWaiting;
|
2012-01-31 21:57:57 +00:00
|
|
|
bool m_pageLoadingFromCommand;
|
|
|
|
Response *m_pendingResponse;
|
2011-02-19 03:53:06 +00:00
|
|
|
};
|
|
|
|
|