2014-11-14 14:55:14 -05:00
|
|
|
#ifndef _REQUESTHANDLER_H
|
|
|
|
#define _REQUESTHANDLER_H
|
|
|
|
|
|
|
|
#include "RequestHandler.h"
|
|
|
|
|
|
|
|
class UnknownUrlHandler : public RequestHandler {
|
|
|
|
public:
|
|
|
|
enum Mode { WARN, BLOCK };
|
|
|
|
|
|
|
|
UnknownUrlHandler(RequestHandler *next, QObject *parent = 0);
|
|
|
|
virtual QNetworkReply* handleRequest(
|
|
|
|
NetworkAccessManager *,
|
|
|
|
QNetworkAccessManager::Operation,
|
|
|
|
QNetworkRequest &,
|
|
|
|
QIODevice *
|
|
|
|
);
|
|
|
|
void allowUrl(const QString &);
|
|
|
|
void setMode(Mode);
|
2014-12-08 11:35:38 -05:00
|
|
|
void reset();
|
2014-11-14 14:55:14 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
QStringList m_allowedUrls;
|
|
|
|
bool isUnknown(QUrl);
|
|
|
|
Mode m_mode;
|
|
|
|
RequestHandler *m_next;
|
2015-01-27 10:44:00 -05:00
|
|
|
void allowDefaultUrls();
|
2014-11-14 14:55:14 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|