1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/src/Connection.h

40 lines
902 B
C
Raw Normal View History

2011-02-18 22:53:06 -05:00
#include <QObject>
#include <QStringList>
2011-02-18 22:53:06 -05:00
class QTcpSocket;
class WebPage;
class Command;
class Response;
2011-10-14 11:22:24 -04:00
class CommandParser;
class CommandFactory;
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:
2011-10-14 11:22:24 -04:00
void commandReady(QString commandName, QStringList arguments);
void finishCommand(Response *response);
void pendingLoadFinished(bool success);
void pageLoadingFromCommand();
2011-02-18 22:53:06 -05:00
private:
void startCommand();
void writeResponse(Response *response);
2012-03-16 17:53:36 -04:00
void pageLoadFailed();
2011-02-18 22:53:06 -05:00
QTcpSocket *m_socket;
Command *m_runningCommand;
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;
bool m_pageSuccess;
bool m_commandWaiting;
bool m_pageLoadingFromCommand;
Response *m_pendingResponse;
2011-02-18 22:53:06 -05:00
};