capybara-webkit/src/Connection.h

37 lines
823 B
C
Raw Normal View History

2011-02-19 03:53:06 +00:00
#include <QObject>
#include <QStringList>
2011-02-19 03:53:06 +00:00
class QTcpSocket;
class WebPage;
class Command;
class Connection : public QObject {
Q_OBJECT
public:
Connection(QTcpSocket *socket, WebPage *page, QObject *parent = 0);
public slots:
void checkNext();
void finishCommand(bool success, QString &response);
void pendingLoadFinished(bool success);
2011-02-19 03:53:06 +00:00
private:
void readLine();
void readDataBlock();
void processNext(const char *line);
Command *createCommand(const char *name);
void processArgument(const char *line);
void startCommand();
2011-02-26 19:03:30 +00:00
void writeResponse(bool success, QString &response);
2011-02-19 03:53:06 +00:00
QTcpSocket *m_socket;
QString m_commandName;
2011-02-19 03:53:06 +00:00
Command *m_command;
QStringList m_arguments;
int m_argumentsExpected;
2011-02-19 03:53:06 +00:00
WebPage *m_page;
int m_expectingDataSize;
2011-02-19 03:53:06 +00:00
};