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
864 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-02-18 22:53:06 -05:00
class Connection : public QObject {
Q_OBJECT
public:
Connection(QTcpSocket *socket, WebPage *page, QObject *parent = 0);
public slots:
void checkNext();
void finishCommand(Response *response);
void pendingLoadFinished(bool success);
2011-02-18 22:53:06 -05:00
private:
void readLine();
void readDataBlock();
void processNext(const char *line);
Command *createCommand(const char *name);
void processArgument(const char *line);
void startCommand();
void writeResponse(Response *response);
2011-02-18 22:53:06 -05:00
QTcpSocket *m_socket;
QString m_commandName;
2011-02-18 22:53:06 -05:00
Command *m_command;
QStringList m_arguments;
int m_argumentsExpected;
2011-02-18 22:53:06 -05:00
WebPage *m_page;
int m_expectingDataSize;
bool m_pageSuccess;
bool m_commandWaiting;
2011-02-18 22:53:06 -05:00
};