2012-03-27 22:49:57 +00:00
|
|
|
#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>
|
2012-03-29 03:05:24 +00:00
|
|
|
#include <QObject>
|
2012-06-29 14:41:08 +00:00
|
|
|
#include <QNetworkReply>
|
2012-06-29 16:14:22 +00:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QFile>
|
2012-03-29 03:05:24 +00:00
|
|
|
|
|
|
|
class WebPage;
|
2012-06-22 03:34:51 +00:00
|
|
|
class NetworkCookieJar;
|
2012-03-26 22:41:33 +00:00
|
|
|
|
2012-04-04 19:40:18 +00:00
|
|
|
class WebPageManager : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2012-03-26 22:41:33 +00:00
|
|
|
public:
|
2012-04-04 19:40:18 +00:00
|
|
|
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;
|
2012-03-29 03:05:24 +00:00
|
|
|
void setCurrentPage(WebPage *);
|
2012-06-29 16:14:22 +00:00
|
|
|
WebPage *currentPage() const;
|
2012-03-30 19:00:51 +00:00
|
|
|
WebPage *createPage(QObject *parent);
|
|
|
|
void setIgnoreSslErrors(bool);
|
|
|
|
bool ignoreSslErrors();
|
2012-07-14 01:55:46 +00:00
|
|
|
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;
|
2012-06-29 16:14:22 +00:00
|
|
|
QDebug logger() const;
|
|
|
|
void enableLogging();
|
2012-03-26 22:41:33 +00:00
|
|
|
|
2012-04-04 19:40:18 +00:00
|
|
|
public slots:
|
2012-05-15 01:59:28 +00:00
|
|
|
void emitLoadStarted();
|
2012-06-29 16:14:22 +00:00
|
|
|
void setPageStatus(bool);
|
2012-06-29 14:41:08 +00:00
|
|
|
void requestCreated(QNetworkReply *reply);
|
|
|
|
void replyFinished(QNetworkReply *reply);
|
2012-04-04 19:40:18 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void pageFinished(bool);
|
2012-05-15 01:59:28 +00:00
|
|
|
void loadStarted();
|
2012-04-04 19:40:18 +00:00
|
|
|
|
2012-03-26 22:41:33 +00:00
|
|
|
private:
|
2012-06-29 16:14:22 +00:00
|
|
|
void emitPageFinished();
|
|
|
|
static void handleDebugMessage(QtMsgType type, const char *message);
|
|
|
|
|
2012-03-27 22:49:57 +00:00
|
|
|
QList<WebPage *> m_pages;
|
2012-03-29 03:05:24 +00:00
|
|
|
WebPage *m_currentPage;
|
2012-04-04 19:40:18 +00:00
|
|
|
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;
|
2012-06-29 16:14:22 +00:00
|
|
|
bool m_loggingEnabled;
|
|
|
|
QString *m_ignoredOutput;
|
2012-07-14 01:55:46 +00:00
|
|
|
int m_timeout;
|
2012-03-26 22:41:33 +00:00
|
|
|
};
|
|
|
|
|
2012-03-27 22:49:57 +00:00
|
|
|
#endif // _WEBPAGEMANAGER_H
|
|
|
|
|