WebKit.PrintOperation¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
|||
r/w |
|||
r/w/co |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Emitted when an error occurs while printing. |
|
Emitted when the print operation has finished doing everything required for printing. |
Fields¶
- Inherited:
Class Details¶
- class WebKit.PrintOperation(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Controls a print operation.
A
WebKit.PrintOperationcontrols a print operation in WebKit. With a similar API toGtk.PrintOperation, it lets you set the print settings withWebKit.PrintOperation.set_print_settings() or display the print dialog withWebKit.PrintOperation.run_dialog().- classmethod new(web_view)¶
- Parameters:
web_view (
WebKit.WebView) – aWebKit.WebView- Returns:
a new
WebKit.PrintOperation.- Return type:
Create a new
WebKit.PrintOperationto print web_view contents.
- get_page_setup()¶
- Returns:
the current
Gtk.PageSetupof self.- Return type:
Return the current page setup of self.
It returns
Noneuntil eitherWebKit.PrintOperation.set_page_setup() orWebKit.PrintOperation.run_dialog() have been called.
- get_print_settings()¶
- Returns:
the current
Gtk.PrintSettingsof self.- Return type:
Return the current print settings of self.
It returns
Noneuntil eitherWebKit.PrintOperation.set_print_settings() orWebKit.PrintOperation.run_dialog() have been called.
- print_()¶
Start a print operation using current print settings and page setup.
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.PrintOperation.set_print_settings() andWebKit.PrintOperation.set_page_setup(), the default options will be used and the print job will be sent to the default printer. TheWebKit.PrintOperation::finishedsignal is emitted when the printing operation finishes. If an error occurs while printing the signalWebKit.PrintOperation::failedis emitted beforeWebKit.PrintOperation::finished.If the app is running in a sandbox, this function only works if printing to a file that is in a location accessible to the sandbox, usually acquired through the File Chooser portal. This function will not work for physical printers when running in a sandbox.
- run_dialog(parent)¶
- Parameters:
parent (
Gtk.WindoworNone) – transient parent of the print dialog- Returns:
the
WebKit.PrintOperationResponseof the print dialog- Return type:
Run the print dialog and start printing.
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.PrintOperationResponse.CANCELis returned. If the user clicks on the print button,WebKit.PrintOperationResponse.PRINTis returned and the print operation starts. In this case, theWebKit.PrintOperation::finishedsignal is emitted when the operation finishes. If an error occurs while printing, the signalWebKit.PrintOperation::failedis emitted beforeWebKit.PrintOperation::finished. If the print dialog is not cancelled current print settings and page setup of self 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 callingWebKit.PrintOperation.get_print_settings() andWebKit.PrintOperation.get_page_setup() after this method.
- set_page_setup(page_setup)¶
- Parameters:
page_setup (
Gtk.PageSetup) – aGtk.PageSetupto set
Set the current page setup of self.
Current page setup is used for the initial values of the print dialog when
WebKit.PrintOperation.run_dialog() is called.
- set_print_settings(print_settings)¶
- Parameters:
print_settings (
Gtk.PrintSettings) – aGtk.PrintSettingsto set
Set the current print settings of self.
Set the current print settings of self. Current print settings are used for the initial values of the print dialog when
WebKit.PrintOperation.run_dialog() is called.
Signal Details¶
- WebKit.PrintOperation.signals.failed(print_operation, error)¶
- Signal Name:
failed- Flags:
- Parameters:
print_operation (
WebKit.PrintOperation) – The object which received the signalerror (
GLib.Error) – theGLib.Errorthat was triggered
Emitted when an error occurs while printing. The given error, of the domain %WEBKIT_PRINT_ERROR, contains further details of the failure. The
WebKit.PrintOperation::finishedsignal is emitted after this one.
- WebKit.PrintOperation.signals.finished(print_operation)¶
- Signal Name:
finished- Flags:
- Parameters:
print_operation (
WebKit.PrintOperation) – The object which received the signal
Emitted when the print operation has finished doing everything required for printing.
Property Details¶
- WebKit.PrintOperation.props.page_setup¶
- Name:
page-setup- Type:
- Default Value:
- Flags:
The initial
Gtk.PageSetupfor the print operation.
- WebKit.PrintOperation.props.print_settings¶
- Name:
print-settings- Type:
- Default Value:
- Flags:
The initial
Gtk.PrintSettingsfor the print operation.
- WebKit.PrintOperation.props.web_view¶
- Name:
web-view- Type:
- Default Value:
- Flags:
The
WebKit.WebViewthat will be printed.