Package org.gnome.gtk
Interface PrintOperationPreview
- All Superinterfaces:
Proxy
- All Known Implementing Classes:
PrintOperation,PrintOperationPreview.PrintOperationPreview$Impl
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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFunctional interface declaration of theGotPageSizeCallbackcallback.static classThe PrintOperationPreview$Impl type represents a native instance of the PrintOperationPreview interface.static classstatic interfaceFunctional interface declaration of theReadyCallbackcallback. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidemitGotPageSize(@Nullable PrintContext context, @Nullable PageSetup pageSetup) Emits the "got-page-size" signal.default voidemitReady(@Nullable PrintContext context) Emits the "ready" signal.default voidEnds a preview.static @Nullable TypegetType()Get the GType of the PrintOperationPreview classdefault booleanisSelected(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 voidrenderPage(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:
trueif 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::previewhandler together withpreview.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
contextaccording topageSetupand 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).
-