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