SystemPreviewController.h [plain text]
#pragma once
#if USE(SYSTEM_PREVIEW)
#include <WebCore/FrameLoaderTypes.h>
#include <WebCore/IntRect.h>
#include <WebCore/ResourceError.h>
#include <wtf/RetainPtr.h>
#include <wtf/URL.h>
#if USE(QUICK_LOOK)
OBJC_CLASS QLPreviewController;
OBJC_CLASS _WKPreviewControllerDataSource;
OBJC_CLASS _WKPreviewControllerDelegate;
#endif
namespace WebKit {
class WebPageProxy;
class SystemPreviewController {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit SystemPreviewController(WebPageProxy&);
bool canPreview(const String& mimeType) const;
void start(URL originatingPageURL, const String& mimeType, const WebCore::SystemPreviewInfo&);
void updateProgress(float);
void finish(URL);
void cancel();
void fail(const WebCore::ResourceError&);
WebPageProxy& page() { return m_webPageProxy; }
const WebCore::SystemPreviewInfo& previewInfo() const { return m_systemPreviewInfo; }
void triggerSystemPreviewAction();
void triggerSystemPreviewActionWithTargetForTesting(uint64_t elementID, uint64_t frameID, uint64_t pageID);
private:
WebPageProxy& m_webPageProxy;
WebCore::SystemPreviewInfo m_systemPreviewInfo;
#if USE(QUICK_LOOK)
RetainPtr<QLPreviewController> m_qlPreviewController;
RetainPtr<_WKPreviewControllerDelegate> m_qlPreviewControllerDelegate;
RetainPtr<_WKPreviewControllerDataSource> m_qlPreviewControllerDataSource;
#endif
};
}
#endif