capybara-webkit/src/WebPageManager.h

60 lines
1.4 KiB
C
Raw Normal View History

#ifndef _WEBPAGEMANAGER_H
#define _WEBPAGEMANAGER_H
2012-03-26 22:41:33 +00:00
#include <QList>
2012-06-29 14:41:08 +00:00
#include <QSet>
#include <QObject>
2012-06-29 14:41:08 +00:00
#include <QNetworkReply>
#include <QDebug>
#include <QFile>
class WebPage;
2012-06-22 03:34:51 +00:00
class NetworkCookieJar;
2012-03-26 22:41:33 +00:00
class WebPageManager : public QObject {
Q_OBJECT
2012-03-26 22:41:33 +00:00
public:
WebPageManager(QObject *parent = 0);
2012-03-26 22:41:33 +00:00
void append(WebPage *value);
2012-06-29 14:41:08 +00:00
QList<WebPage *> pages() const;
void setCurrentPage(WebPage *);
WebPage *currentPage() const;
WebPage *createPage(QObject *parent);
void setIgnoreSslErrors(bool);
bool ignoreSslErrors();
void setTimeout(int);
int getTimeout();
2012-05-15 01:59:28 +00:00
void reset();
2012-06-22 03:34:51 +00:00
NetworkCookieJar *cookieJar();
2012-06-29 14:41:08 +00:00
bool isLoading() const;
QDebug logger() const;
void enableLogging();
2012-03-26 22:41:33 +00:00
public slots:
2012-05-15 01:59:28 +00:00
void emitLoadStarted();
void setPageStatus(bool);
2012-07-12 03:36:22 +00:00
void requestCreated(QByteArray &url, QNetworkReply *reply);
2012-06-29 14:41:08 +00:00
void replyFinished(QNetworkReply *reply);
signals:
void pageFinished(bool);
2012-05-15 01:59:28 +00:00
void loadStarted();
2012-03-26 22:41:33 +00:00
private:
void emitPageFinished();
static void handleDebugMessage(QtMsgType type, const char *message);
QList<WebPage *> m_pages;
WebPage *m_currentPage;
bool m_ignoreSslErrors;
2012-06-22 03:34:51 +00:00
NetworkCookieJar *m_cookieJar;
2012-06-29 14:41:08 +00:00
QSet<QNetworkReply*> m_started;
bool m_success;
bool m_loggingEnabled;
QString *m_ignoredOutput;
int m_timeout;
2012-03-26 22:41:33 +00:00
};
#endif // _WEBPAGEMANAGER_H