-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchtmltopdf_app.h
43 lines (24 loc) · 1.13 KB
/
chtmltopdf_app.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef CEF_CHTMLTOPDF_H
#define CEF_CHTMLTOPDF_H
#include "include/cef_app.h"
#include "chtmltopdf_handler.h"
class CHtmlToPdfApp : public CefApp,
public CefPrintHandler,
public CefBrowserProcessHandler {
public:
CHtmlToPdfApp();
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() OVERRIDE { return this; }
virtual CefRefPtr<CefPrintHandler> GetPrintHandler() override;
virtual void OnContextInitialized() OVERRIDE;
virtual void OnPrintStart(CefRefPtr<CefBrowser> browser);
virtual void OnPrintSettings(CefRefPtr<CefPrintSettings> settings, bool get_defaults);
virtual bool OnPrintDialog(bool has_selection, CefRefPtr<CefPrintDialogCallback> callback);
virtual bool OnPrintJob(const CefString &document_name, const CefString &pdf_file_path,
CefRefPtr<CefPrintJobCallback> callback);
virtual void OnPrintReset();
virtual CefSize GetPdfPaperSize(int device_units_per_inch) override;
private:
IMPLEMENT_REFCOUNTING(CHtmlToPdfApp);
CefRefPtr<CHtmlToPdfHandler> handler;
};
#endif //CEF_CHTMLTOPDF_H