PrintOperation

A #WebKitPrintOperation controls a print operation in WebKit. With a similar API to #GtkPrintOperation, it lets you set the print settings with webkit_print_operation_set_print_settings() or display the print dialog with webkit_print_operation_run_dialog().

Constructors

this
this(WebKitPrintOperation* webKitPrintOperation, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(WebView webView)

Create a new #WebKitPrintOperation to print @web_view contents.

Members

Functions

addOnCreateCustomWidget
gulong addOnCreateCustomWidget(PrintCustomWidget delegate(PrintOperation) dlg, ConnectFlags connectFlags)

Emitted when displaying the print dialog with webkit_print_operation_run_dialog(). The returned #WebKitPrintCustomWidget will be added to the print dialog and it will be owned by the @print_operation. However, the object is guaranteed to be alive until the #WebKitPrintCustomWidget::apply is emitted.

addOnFailed
gulong addOnFailed(void delegate(ErrorG, PrintOperation) dlg, ConnectFlags connectFlags)

Emitted when an error occurs while printing. The given @error, of the domain %WEBKIT_PRINT_ERROR, contains further details of the failure. The #WebKitPrintOperation::finished signal is emitted after this one.

addOnFinished
gulong addOnFinished(void delegate(PrintOperation) dlg, ConnectFlags connectFlags)

Emitted when the print operation has finished doing everything required for printing.

getPageSetup
PageSetup getPageSetup()

Return the current page setup of @print_operation. It returns %NULL until either webkit_print_operation_set_page_setup() or webkit_print_operation_run_dialog() have been called.

getPrintOperationStruct
WebKitPrintOperation* getPrintOperationStruct(bool transferOwnership)

Get the main Gtk struct

getPrintSettings
PrintSettings getPrintSettings()

Return the current print settings of @print_operation. It returns %NULL until either webkit_print_operation_set_print_settings() or webkit_print_operation_run_dialog() have been called.

getStruct
void* getStruct()

the main Gtk struct as a void*

print
void print()

Start a print operation using current print settings and page setup without showing the print dialog. If either print settings or page setup are not set with webkit_print_operation_set_print_settings() and webkit_print_operation_set_page_setup(), the default options will be used and the print job will be sent to the default printer. The #WebKitPrintOperation::finished signal is emitted when the printing operation finishes. If an error occurs while printing the signal #WebKitPrintOperation::failed is emitted before #WebKitPrintOperation::finished.

runDialog
WebKitPrintOperationResponse runDialog(Window parent)

Run the print dialog and start printing using the options selected by the user. This method returns when the print dialog is closed. If the print dialog is cancelled %WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL is returned. If the user clicks on the print button, %WEBKIT_PRINT_OPERATION_RESPONSE_PRINT is returned and the print operation starts. In this case, the #WebKitPrintOperation::finished signal is emitted when the operation finishes. If an error occurs while printing, the signal #WebKitPrintOperation::failed is emitted before #WebKitPrintOperation::finished. If the print dialog is not cancelled current print settings and page setup of @print_operation are updated with options selected by the user when Print button is pressed in print dialog. You can get the updated print settings and page setup by calling webkit_print_operation_get_print_settings() and webkit_print_operation_get_page_setup() after this method.

setPageSetup
void setPageSetup(PageSetup pageSetup)

Set the current page setup of @print_operation. Current page setup is used for the initial values of the print dialog when webkit_print_operation_run_dialog() is called.

setPrintSettings
void setPrintSettings(PrintSettings printSettings)

Set the current print settings of @print_operation. Current print settings are used for the initial values of the print dialog when webkit_print_operation_run_dialog() is called.

Static functions

getType
GType getType()

Variables

webKitPrintOperation
WebKitPrintOperation* webKitPrintOperation;

the main Gtk struct

Meta