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

65 lines
1.5 KiB
C
Raw Normal View History

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