gtk.print_operation_preview_mixin

Module for [PrintOperationPreview] interface mixin

Templates 2

tmplPrintOperationPreviewT()

[gtk.print_operation_preview.PrintOperationPreview] is the interface that is used to implement print preview.

A [gtk.print_operation_preview.PrintOperationPreview] object is passed to the [gtk.print_operation.PrintOperation.preview] signal by [gtk.print_operation.PrintOperation].

Functions
void endPreview()

Ends a preview.

This function must be called to finish a custom print preview.

bool isSelected(int pageNr)

Returns whether the given page is included in the set of pages that have been selected for printing.

Parameters

pageNra page number

Returns

true if the page has been selected for printing
void renderPage(int pageNr)

Renders a page to the preview.

This is using the print context that was passed to the [gtk.print_operation.PrintOperation.preview] handler together with preview.

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

pageNrthe page to render
gulong connectGotPageSize(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.print_context.PrintContext))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.page_setup.PageSetup))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtk.print_operation_preview.PrintOperationPreview))) && Parameters!T.length < 4)

Connect to GotPageSize signal.

Emitted once for each page that gets rendered to the preview.

A handler for this signal should update the context according to page_setup and set up a suitable cairo context, using [gtk.print_context.PrintContext.setCairoContext].

Parameters

callbacksignal callback delegate or function to connect void callback(gtk.print_context.PrintContext context, gtk.page_setup.PageSetup pageSetup, gtk.print_operation_preview.PrintOperationPreview printOperationPreview) context the current [gtk.print_context.PrintContext] (optional) pageSetup the [gtk.page_setup.PageSetup] for the current page (optional) printOperationPreview the instance the signal is connected to (optional)
afterYes.After to execute callback after default handler, No.After to execute before (default)

Returns

Signal ID
gulong connectReady(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.print_context.PrintContext))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.print_operation_preview.PrintOperationPreview))) && Parameters!T.length < 3)

Connect to Ready signal.

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

callbacksignal callback delegate or function to connect void callback(gtk.print_context.PrintContext context, gtk.print_operation_preview.PrintOperationPreview printOperationPreview) context the current [gtk.print_context.PrintContext] (optional) printOperationPreview the instance the signal is connected to (optional)
afterYes.After to execute callback after default handler, No.After to execute before (default)

Returns

Signal ID
tmplPrintOperationPreviewGidBuilderT()