PDFViewController.h [plain text]
#ifndef PDFViewController_h
#define PDFViewController_h
#include "WebFindOptions.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RetainPtr.h>
#include <wtf/text/WTFString.h>
@class PDFView;
@class WKView;
@class WKPDFView;
namespace CoreIPC {
class DataReference;
}
namespace WebKit {
class WebPageProxy;
class PDFViewController {
WTF_MAKE_NONCOPYABLE(PDFViewController);
public:
static PassOwnPtr<PDFViewController> create(WKView *);
~PDFViewController();
WKView* wkView() const { return m_wkView; }
WebPageProxy* page() const;
NSView* pdfView() const;
void setPDFDocumentData(const String& mimeType, const String& suggestedFilename, const CoreIPC::DataReference&);
double zoomFactor() const;
void setZoomFactor(double);
static Class pdfPreviewViewClass();
bool forwardScrollWheelEvent(NSEvent *);
NSPrintOperation *makePrintOperation(NSPrintInfo *);
void openPDFInFinder();
void savePDFToDownloadsFolder();
void linkClicked(const String& url);
void print();
void findString(const String&, FindOptions, unsigned maxMatchCount);
void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
private:
explicit PDFViewController(WKView *wkView);
static Class pdfDocumentClass();
static NSBundle* pdfKitBundle();
WKView* m_wkView;
RetainPtr<WKPDFView> m_wkPDFView;
PDFView* m_pdfView;
RetainPtr<NSString> m_suggestedFilename;
RetainPtr<CFDataRef> m_pdfData;
String m_temporaryPDFUUID;
};
}
#endif // PDFViewController_h