#ifndef QtWebContext_h
#define QtWebContext_h
#include <QScopedPointer>
#include <QtGlobal>
#include <WKContext.h>
#include <WKRetainPtr.h>
namespace WebKit {
class QtDownloadManager;
class QtWebIconDatabaseClient;
class QtWebContext {
public:
~QtWebContext();
enum StorageType {
DatabaseStorage,
LocalStorage,
CookieStorage,
DiskCacheStorage,
IconDatabaseStorage
};
static QtWebContext* create(WKContextRef);
static QtWebContext* defaultContext();
static QString preparedStoragePath(StorageType);
WKContextRef context() { return m_context.get(); }
QtDownloadManager* downloadManager() { return m_downloadManager.data(); }
QtWebIconDatabaseClient* iconDatabase() { return m_iconDatabase.data(); }
private:
explicit QtWebContext(WKContextRef);
WKRetainPtr<WKContextRef> m_context;
QScopedPointer<QtDownloadManager> m_downloadManager;
QScopedPointer<QtWebIconDatabaseClient> m_iconDatabase;
};
}
#endif // QtWebContext_h