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;
|
2012-03-28 23:05:24 -04:00
|
|
|
class WebPageManager;
|
2011-02-18 22:53:06 -05:00
|
|
|
|
|
|
|
class Connection : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2012-03-28 23:05:24 -04:00
|
|
|
Connection(QTcpSocket *socket, WebPageManager *manager, QObject *parent = 0);
|
2011-02-18 22:53:06 -05:00
|
|
|
|
|
|
|
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);
|
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;
|
2012-03-28 23:05:24 -04:00
|
|
|
WebPageManager *m_manager;
|
2011-10-14 11:22:24 -04:00
|
|
|
CommandParser *m_commandParser;
|
|
|
|
CommandFactory *m_commandFactory;
|
2012-10-22 20:53:13 -04:00
|
|
|
PageLoadingCommand *m_runningCommand;
|
2011-05-05 18:27:04 -04:00
|
|
|
bool m_pageSuccess;
|
|
|
|
bool m_commandWaiting;
|
2012-03-28 23:05:24 -04:00
|
|
|
WebPage *currentPage();
|
2011-02-18 22:53:06 -05:00
|
|
|
};
|
|
|
|
|