Top |
GtkPageSetup * | page-setup | Read / Write |
GtkPrintSettings * | print-settings | Read / Write |
WebKitWebView * | web-view | Read / Write / Construct Only |
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()
.
WebKitPrintOperation *
webkit_print_operation_new (WebKitWebView *web_view
);
Create a new WebKitPrintOperation to print web_view
contents.
GtkPrintSettings *
webkit_print_operation_get_print_settings
(WebKitPrintOperation *print_operation
);
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.
void webkit_print_operation_set_print_settings (WebKitPrintOperation *print_operation
,GtkPrintSettings *print_settings
);
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.
GtkPageSetup *
webkit_print_operation_get_page_setup (WebKitPrintOperation *print_operation
);
Return the current page setup of print_operation
. It returns NULL
until
either webkit_print_operation_set_print_settings()
or webkit_print_operation_run_dialog()
have been called.
void webkit_print_operation_set_page_setup (WebKitPrintOperation *print_operation
,GtkPageSetup *page_setup
);
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.
WebKitPrintOperationResponse webkit_print_operation_run_dialog (WebKitPrintOperation *print_operation
,GtkWindow *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 “finished”
signal is emitted when the operation finishes. If an error occurs while printing, the signal
“failed” is emitted before “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.
void
webkit_print_operation_print (WebKitPrintOperation *print_operation
);
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 “finished” signal is emitted when the printing
operation finishes. If an error occurs while printing the signal
“failed” is emitted before “finished”.
Enum values representing the response of the print dialog shown with
webkit_print_operation_run_dialog()
.
“page-setup”
property“page-setup” GtkPageSetup *
The initial GtkPageSetup for the print operation.
Flags: Read / Write
“print-settings”
property“print-settings” GtkPrintSettings *
The initial GtkPrintSettings for the print operation.
Flags: Read / Write
“web-view”
property“web-view” WebKitWebView *
The WebKitWebView that will be printed.
Flags: Read / Write / Construct Only
“failed”
signalvoid user_function (WebKitPrintOperation *print_operation, gpointer error, gpointer user_data)
Emitted when an error occurs while printing. The given error
, of the domain
WEBKIT_PRINT_ERROR
, contains further details of the failure.
The “finished” signal is emitted after this one.
print_operation |
the WebKitPrintOperation on which the signal was emitted |
|
error |
the GError that was triggered |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“finished”
signalvoid user_function (WebKitPrintOperation *print_operation, gpointer user_data)
Emitted when the print operation has finished doing everything required for printing.
print_operation |
the WebKitPrintOperation on which the signal was emitted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last