#ifndef QtWebError_h
#define QtWebError_h
#include "qwebdownloaditem_p.h"
#include <QtNetwork/QNetworkReply>
#include <WKError.h>
#include <WKRetainPtr.h>
QT_BEGIN_NAMESPACE
class QUrl;
QT_END_NAMESPACE
namespace WebKit {
class QtWebError {
public:
enum Type {
NoError,
InternalError,
NetworkError,
HttpError,
DownloadError
};
Type type() const;
QString url() const;
int errorCode() const;
QString description() const;
bool isCancellation() const;
int errorCodeAsHttpStatusCode() const { return errorCode(); }
QNetworkReply::NetworkError errorCodeAsNetworkError() const { return static_cast<QNetworkReply::NetworkError>(errorCode()); }
QWebDownloadItem::DownloadError errorCodeAsDownloadError() const { return static_cast<QWebDownloadItem::DownloadError>(errorCode()); }
QtWebError(const QtWebError&);
QtWebError(WKErrorRef);
private:
WKRetainPtr<WKErrorRef> error;
};
}
#endif