Interface PrintOperationPreview
- All Superinterfaces:
Proxy
- All Known Implementing Classes:
PrintOperation
,PrintOperationPreview.PrintOperationPreviewImpl
GtkPrintOperationPreview
is the interface that is used to
implement print preview.
A GtkPrintOperationPreview
object is passed to the
Gtk.PrintOperation::preview
signal by
PrintOperation
.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Functional interface declaration of theGotPageSizeCallback
callback.static class
static class
The PrintOperationPreviewImpl type represents a native instance of the PrintOperationPreview interface.static interface
Functional interface declaration of theReadyCallback
callback. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
emitGotPageSize
(PrintContext context, PageSetup pageSetup) Emits the "got-page-size" signal.default void
emitReady
(PrintContext context) Emits the "ready" signal.default void
Ends a preview.static Type
getType()
Get the GType of the PrintOperationPreview classdefault boolean
isSelected
(int pageNr) Returns whether the given page is included in the set of pages that have been selected for printing.Emitted once for each page that gets rendered to the preview.The ::ready signal gets emitted once per preview operation, before the first page is rendered.default void
renderPage
(int pageNr) Renders a page to the preview.
-
Method Details
-
getType
-
endPreview
default void endPreview()Ends a preview.This function must be called to finish a custom print preview.
-
isSelected
default boolean isSelected(int pageNr) Returns whether the given page is included in the set of pages that have been selected for printing.- Parameters:
pageNr
- a page number- Returns:
true
if the page has been selected for printing
-
renderPage
default void renderPage(int pageNr) Renders a page to the preview.This is using the print context that was passed to the
Gtk.PrintOperation::preview
handler together with this PrintOperationPreview.A custom print preview should use this function to render the currently selected page.
Note that this function requires a suitable cairo context to be associated with the print context.
- Parameters:
pageNr
- the page to render
-
onGotPageSize
default SignalConnection<PrintOperationPreview.GotPageSizeCallback> onGotPageSize(PrintOperationPreview.GotPageSizeCallback handler) Emitted once for each page that gets rendered to the preview.A handler for this signal should update the
context
according topageSetup
and set up a suitable cairo context, usingPrintContext.setCairoContext(org.freedesktop.cairo.Context, double, double)
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitGotPageSize
Emits the "got-page-size" signal. SeeonGotPageSize(org.gnome.gtk.PrintOperationPreview.GotPageSizeCallback)
. -
onReady
default SignalConnection<PrintOperationPreview.ReadyCallback> onReady(PrintOperationPreview.ReadyCallback handler) The ::ready signal gets emitted once per preview operation, before the first page is rendered.A handler for this signal can be used for setup tasks.
- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitReady
Emits the "ready" signal. SeeonReady(org.gnome.gtk.PrintOperationPreview.ReadyCallback)
.
-