gtk4::prelude

Trait PrintOperationPreviewExt

Source
pub trait PrintOperationPreviewExt:
    IsA<PrintOperationPreview>
    + Sealed
    + 'static {
    // Provided methods
    fn end_preview(&self) { ... }
    fn is_selected(&self, page_nr: i32) -> bool { ... }
    fn render_page(&self, page_nr: i32) { ... }
    fn connect_got_page_size<F: Fn(&Self, &PrintContext, &PageSetup) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_ready<F: Fn(&Self, &PrintContext) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all PrintOperationPreview methods.

§Implementors

PrintOperationPreview, PrintOperation

Provided Methods§

Source

fn end_preview(&self)

Ends a preview.

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

Source

fn is_selected(&self, page_nr: i32) -> bool

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

§page_nr

a page number

§Returns

true if the page has been selected for printing

Source

fn render_page(&self, page_nr: i32)

Renders a page to the preview.

This is using the print context that was passed to the preview handler together with @self.

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.

§page_nr

the page to render

Source

fn connect_got_page_size<F: Fn(&Self, &PrintContext, &PageSetup) + 'static>( &self, f: F, ) -> SignalHandlerId

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 PrintContext::set_cairo_context().

§context

the current PrintContext

§page_setup

the PageSetup for the current page

Source

fn connect_ready<F: Fn(&Self, &PrintContext) + 'static>( &self, f: F, ) -> SignalHandlerId

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.

§context

the current PrintContext

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§