cef_print_handler_t

Type Alias cef_print_handler_t 

Source
pub type cef_print_handler_t = _cef_print_handler_t;
Expand description

Implement this structure to handle printing on Linux. Each browser will have only one print job in progress at a time. The functions of this structure will be called on the browser process UI thread.

NOTE: This struct is allocated client-side.

Aliased Type§

#[repr(C)]
pub struct cef_print_handler_t { pub base: _cef_base_ref_counted_t, pub on_print_start: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t)>, pub on_print_settings: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t, *mut _cef_print_settings_t, i32)>, pub on_print_dialog: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t, i32, *mut _cef_print_dialog_callback_t) -> i32>, pub on_print_job: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t, *const _cef_string_utf16_t, *const _cef_string_utf16_t, *mut _cef_print_job_callback_t) -> i32>, pub on_print_reset: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t)>, pub get_pdf_paper_size: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t, i32) -> _cef_size_t>, }

Fields§

§base: _cef_base_ref_counted_t

Base structure.

§on_print_start: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t)>

Called when printing has started for the specified |browser|. This function will be called before the other OnPrint*() functions and irrespective of how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript window.print() or PDF extension print button).

§on_print_settings: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t, *mut _cef_print_settings_t, i32)>

Synchronize |settings| with client state. If |get_defaults| is true (1) then populate |settings| with the default print settings. Do not keep a reference to |settings| outside of this callback.

§on_print_dialog: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t, i32, *mut _cef_print_dialog_callback_t) -> i32>

Show the print dialog. Execute |callback| once the dialog is dismissed. Return true (1) if the dialog will be displayed or false (0) to cancel the printing immediately.

§on_print_job: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t, *const _cef_string_utf16_t, *const _cef_string_utf16_t, *mut _cef_print_job_callback_t) -> i32>

Send the print job to the printer. Execute |callback| once the job is completed. Return true (1) if the job will proceed or false (0) to cancel the job immediately.

§on_print_reset: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t)>

Reset client state related to printing.

§get_pdf_paper_size: Option<unsafe extern "C" fn(*mut _cef_print_handler_t, *mut _cef_browser_t, i32) -> _cef_size_t>

Return the PDF paper size in device units. Used in combination with cef_browser_host_t::print_to_pdf().