pub struct PrintOperation { /* private fields */ }Expand description
GtkPrintOperation is the high-level, portable printing API.
It looks a bit different than other GTK+ dialogs such as the
FileChooser, since some platforms don’t expose enough
infrastructure to implement a good print dialog. On such
platforms, GtkPrintOperation uses the native print dialog.
On platforms which do not provide a native print dialog, GTK+
uses its own, see GtkPrintUnixDialog.
The typical way to use the high-level printing API is to create
a GtkPrintOperation object with new() when
the user selects to print. Then you set some properties on it,
e.g. the page size, any PrintSettings from previous print
operations, the number of pages, the current page, etc.
Then you start the print operation by calling PrintOperationExt::run().
It will then show a dialog, let the user select a printer and
options. When the user finished the dialog various signals will
be emitted on the PrintOperation, the main one being
draw-page, which you are supposed to catch
and render the page on the provided PrintContext using Cairo.
§The high-level printing API
⚠️ The following code is in C ⚠️
static GtkPrintSettings *settings = NULL;
static void
do_print (void)
{
GtkPrintOperation *print;
GtkPrintOperationResult res;
print = gtk_print_operation_new ();
if (settings != NULL)
gtk_print_operation_set_print_settings (print, settings);
g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), NULL);
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL);
res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
GTK_WINDOW (main_window), NULL);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
{
if (settings != NULL)
g_object_unref (settings);
settings = g_object_ref (gtk_print_operation_get_print_settings (print));
}
g_object_unref (print);
}By default GtkPrintOperation uses an external application to do
print preview. To implement a custom print preview, an application
must connect to the preview signal. The functions
PrintOperationPreviewExt::render_page(),
PrintOperationPreviewExt::end_preview() and
PrintOperationPreviewExt::is_selected()
are useful when implementing a print preview.
§Properties
§allow-async
Determines whether the print operation may run asynchronously or not.
Some systems don’t support asynchronous printing, but those that do
will return PrintOperationResult::InProgress as the status, and
emit the done signal when the operation is actually
done.
The Windows port does not support asynchronous operation at all (this
is unlikely to change). On other platforms, all actions except for
PrintOperationAction::Export support asynchronous operation.
Readable | Writeable
§current-page
The current page in the document.
If this is set before PrintOperationExt::run(),
the user will be able to select to print only the current page.
Note that this only makes sense for pre-paginated documents.
Readable | Writeable
§custom-tab-label
Used as the label of the tab containing custom widgets. Note that this property may be ignored on some platforms.
If this is None, GTK+ uses a default label.
Readable | Writeable
§default-page-setup
The PageSetup used by default.
This page setup will be used by PrintOperationExt::run(),
but it can be overridden on a per-page basis by connecting
to the request-page-setup signal.
Readable | Writeable
§embed-page-setup
If true, page size combo box and orientation combo box are embedded into page setup page.
Readable | Writeable
§export-filename
The name of a file to generate instead of showing the print dialog. Currently, PDF is the only supported format.
The intended use of this property is for implementing “Export to PDF” actions.
“Print to PDF” support is independent of this and is done by letting the user pick the “Print to PDF” item from the list of printers in the print dialog.
Readable | Writeable
§has-selection
Determines whether there is a selection in your application. This can allow your application to print the selection. This is typically used to make a “Selection” button sensitive.
Readable | Writeable
§job-name
A string used to identify the job (e.g. in monitoring applications like eggcups).
If you don’t set a job name, GTK+ picks a default one by numbering successive print jobs.
Readable | Writeable
§n-pages
The number of pages in the document.
This must be set to a positive number
before the rendering starts. It may be set in a
begin-print signal hander.
Note that the page numbers passed to the
request-page-setup and
draw-page signals are 0-based, i.e. if
the user chooses to print all pages, the last ::draw-page signal
will be for page n_pages - 1.
Readable | Writeable
§n-pages-to-print
The number of pages that will be printed.
Note that this value is set during print preparation phase
(PrintStatus::Preparing), so this value should never be
get before the data generation phase (PrintStatus::GeneratingData).
You can connect to the status-changed signal
and call PrintOperationExt::n_pages_to_print() when
print status is PrintStatus::GeneratingData.
This is typically used to track the progress of print operation.
Readable
§print-settings
The PrintSettings used for initializing the dialog.
Setting this property is typically used to re-establish
print settings from a previous print operation, see
PrintOperationExt::run().
Readable | Writeable
§show-progress
Determines whether to show a progress dialog during the print operation.
Readable | Writeable
§status
The status of the print operation.
Readable
§status-string
A string representation of the status of the print operation.
The string is translated and suitable for displaying the print
status e.g. in a Statusbar.
See the status property for a status value that
is suitable for programmatic use.
Readable
§support-selection
If true, the print operation will support print of selection.
This allows the print dialog to show a “Selection” button.
Readable | Writeable
§track-print-status
If true, the print operation will try to continue report on
the status of the print job in the printer queues and printer.
This can allow your application to show things like “out of paper”
issues, and when the print job actually reaches the printer.
However, this is often implemented using polling, and should
not be enabled unless needed.
Readable | Writeable
§unit
The transformation for the cairo context obtained from
PrintContext is set up in such a way that distances
are measured in units of unit.
Readable | Writeable
§use-full-page
If true, the transformation for the cairo context obtained
from PrintContext puts the origin at the top left corner
of the page (which may not be the top left corner of the sheet,
depending on page orientation and the number of pages per sheet).
Otherwise, the origin is at the top left corner of the imageable
area (i.e. inside the margins).
Readable | Writeable
§Signals
§begin-print
Emitted after the user has finished changing print settings in the dialog, before the actual rendering starts.
A typical use for ::begin-print is to use the parameters from the
PrintContext and paginate the document accordingly, and then
set the number of pages with PrintOperationExt::set_n_pages().
§create-custom-widget
Emitted when displaying the print dialog. If you return a widget in a handler for this signal it will be added to a custom tab in the print dialog. You typically return a container widget with multiple widgets in it.
The print dialog owns the returned widget, and its lifetime is not
controlled by the application. However, the widget is guaranteed
to stay around until the custom-widget-apply
signal is emitted on the operation. Then you can read out any
information you need from the widgets.
§custom-widget-apply
Emitted right before begin-print if you added
a custom widget in the create-custom-widget handler.
When you get this signal you should read the information from the
custom widgets, as the widgets are not guaraneed to be around at a
later time.
§done
Emitted when the print operation run has finished doing everything required for printing.
result gives you information about what happened during the run.
If result is PrintOperationResult::Error then you can call
gtk_print_operation_get_error() for more information.
If you enabled print status tracking then
PrintOperationExt::is_finished() may still return false
after done was emitted.
§draw-page
Emitted for every page that is printed. The signal handler
must render the page_nr’s page onto the cairo context obtained
from context using PrintContext::cairo_context().
⚠️ The following code is in C ⚠️
static void
draw_page (GtkPrintOperation *operation,
GtkPrintContext *context,
gint page_nr,
gpointer user_data)
{
cairo_t *cr;
PangoLayout *layout;
gdouble width, text_height;
gint layout_height;
PangoFontDescription *desc;
cr = gtk_print_context_get_cairo_context (context);
width = gtk_print_context_get_width (context);
cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT);
cairo_set_source_rgb (cr, 0.8, 0.8, 0.8);
cairo_fill (cr);
layout = gtk_print_context_create_pango_layout (context);
desc = pango_font_description_from_string ("sans 14");
pango_layout_set_font_description (layout, desc);
pango_font_description_free (desc);
pango_layout_set_text (layout, "some text", -1);
pango_layout_set_width (layout, width * PANGO_SCALE);
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
pango_layout_get_size (layout, NULL, &layout_height);
text_height = (gdouble)layout_height / PANGO_SCALE;
cairo_move_to (cr, width / 2, (HEADER_HEIGHT - text_height) / 2);
pango_cairo_show_layout (cr, layout);
g_object_unref (layout);
}Use PrintOperationExt::set_use_full_page() and
PrintOperationExt::set_unit() before starting the print operation
to set up the transformation of the cairo context according to your
needs.
§end-print
Emitted after all pages have been rendered.
A handler for this signal can clean up any resources that have
been allocated in the begin-print handler.
§paginate
Emitted after the begin-print signal, but before
the actual rendering starts. It keeps getting emitted until a connected
signal handler returns true.
The ::paginate signal is intended to be used for paginating a document
in small chunks, to avoid blocking the user interface for a long
time. The signal handler should update the number of pages using
PrintOperationExt::set_n_pages(), and return true if the document
has been completely paginated.
If you don’t need to do pagination in chunks, you can simply do it all in the ::begin-print handler, and set the number of pages from there.
§preview
Gets emitted when a preview is requested from the native dialog.
The default handler for this signal uses an external viewer application to preview.
To implement a custom print preview, an application must return
true from its handler for this signal. In order to use the
provided context for the preview implementation, it must be
given a suitable cairo context with PrintContext::set_cairo_context().
The custom preview implementation can use
PrintOperationPreviewExt::is_selected() and
PrintOperationPreviewExt::render_page() to find pages which
are selected for print and render them. The preview must be
finished by calling PrintOperationPreviewExt::end_preview()
(typically in response to the user clicking a close button).
§request-page-setup
Emitted once for every page that is printed, to give
the application a chance to modify the page setup. Any changes
done to setup will be in force only for printing this page.
§status-changed
Emitted at between the various phases of the print operation.
See PrintStatus for the phases that are being discriminated.
Use PrintOperationExt::status() to find out the current
status.
§update-custom-widget
Emitted after change of selected printer. The actual page setup and print settings are passed to the custom widget, which can actualize itself according to this change.
PrintOperationPreview
§got-page-size
The ::got-page-size signal is 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().
§ready
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.
§Implements
PrintOperationExt, glib::ObjectExt, PrintOperationPreviewExt
Implementations§
Source§impl PrintOperation
impl PrintOperation
pub const NONE: Option<&'static PrintOperation> = None
Sourcepub fn new() -> PrintOperation
pub fn new() -> PrintOperation
Sourcepub fn builder() -> PrintOperationBuilder
pub fn builder() -> PrintOperationBuilder
Creates a new builder-pattern struct instance to construct PrintOperation objects.
This method returns an instance of PrintOperationBuilder which can be used to create PrintOperation objects.
Trait Implementations§
Source§impl Clone for PrintOperation
impl Clone for PrintOperation
Source§impl Debug for PrintOperation
impl Debug for PrintOperation
Source§impl Default for PrintOperation
impl Default for PrintOperation
Source§impl Display for PrintOperation
impl Display for PrintOperation
impl Eq for PrintOperation
Source§impl HasParamSpec for PrintOperation
impl HasParamSpec for PrintOperation
type ParamSpec = ParamSpecObject
Source§type SetValue = PrintOperation
type SetValue = PrintOperation
type BuilderFn = fn(&str) -> ParamSpecObjectBuilder<'_, PrintOperation>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Hash for PrintOperation
impl Hash for PrintOperation
impl IsA<PrintOperationPreview> for PrintOperation
Source§impl Ord for PrintOperation
impl Ord for PrintOperation
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl ParentClassIs for PrintOperation
impl ParentClassIs for PrintOperation
Source§impl<OT: ObjectType> PartialEq<OT> for PrintOperation
impl<OT: ObjectType> PartialEq<OT> for PrintOperation
Source§impl<OT: ObjectType> PartialOrd<OT> for PrintOperation
impl<OT: ObjectType> PartialOrd<OT> for PrintOperation
Source§impl StaticType for PrintOperation
impl StaticType for PrintOperation
Source§fn static_type() -> Type
fn static_type() -> Type
Self.Auto Trait Implementations§
impl !Send for PrintOperation
impl !Sync for PrintOperation
impl Freeze for PrintOperation
impl RefUnwindSafe for PrintOperation
impl Unpin for PrintOperation
impl UnsafeUnpin for PrintOperation
impl UnwindSafe for PrintOperation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
Source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
T. Read moreSource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
T. Read moreSource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
T. Read moreSource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
T. Read moreSource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
T. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while upcast will do many checks at compile-time already. downcast will
perform the same checks at runtime as dynamic_cast, but will also ensure some amount of
compile-time safety. Read moreSource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
T. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast and upcast will do many checks at compile-time already. Read moreSource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
T unconditionally. Read moreSource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
&T unconditionally. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>
impl<'a, T, C, E> FromValueOptional<'a> for Twhere
T: FromValue<'a, Checker = C>,
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>,
E: Error + Send + 'static,
Source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
Source§impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
fn parent_class_init<T>(class: &mut Class<U>)
fn parent_instance_init<T>(instance: &mut InitializingObject<T>)
impl<Super, Sub> MayDowncastTo<Sub> for Super
Source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
Source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
true if the object is an instance of (can be cast to) T.Source§fn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
ObjectClass of the object. Read moreSource§fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
T. Read moreSource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
T of the object. Read moreSource§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
Source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
Source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
Source§fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
property_name of the object and cast it to the type V. Read moreSource§fn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
property_name of the object. Read moreSource§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
property_name of this object. Read moreSource§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
ParamSpec of the property property_name of this object.Source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
ParamSpec of the properties of this object.Source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
Source§unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
key. Read moreSource§unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
key. Read moreSource§unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
key. Read moreSource§unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
key. Read moreSource§unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
key. Read moreSource§unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
key. Read moreSource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
Source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
Source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
Source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
Source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
closure to the lifetime of the object. When
the object’s reference count drops to zero, the closure will be
invalidated. An invalidated closure will ignore any calls to
invoke_with_values, or
invoke when using Rust closures.Source§fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Self::emit but takes Value for the arguments.Source§fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>
Source§fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
Source§fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify signal of the object. Read moreSource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify signal of the object. Read moreSource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F,
) -> SignalHandlerId
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
notify signal of the object. Read moreSource§fn notify(&self, property_name: &str)
fn notify(&self, property_name: &str)
Source§fn notify_by_pspec(&self, pspec: &ParamSpec)
fn notify_by_pspec(&self, pspec: &ParamSpec)
Source§fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
Source§fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>where
F: FnOnce() + 'static,
fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>where
F: FnOnce() + 'static,
Source§fn bind_property<'a, 'f, 't, O>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str,
) -> BindingBuilder<'a, 'f, 't>where
O: ObjectType,
fn bind_property<'a, 'f, 't, O>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str,
) -> BindingBuilder<'a, 'f, 't>where
O: ObjectType,
Source§unsafe fn run_dispose(&self)
unsafe fn run_dispose(&self)
Source§impl<O> PrintOperationExt for Owhere
O: IsA<PrintOperation>,
impl<O> PrintOperationExt for Owhere
O: IsA<PrintOperation>,
Source§fn cancel(&self)
fn cancel(&self)
begin-print,
paginate or draw-page
signal handler to stop the currently running print
operation.Source§fn draw_page_finish(&self)
fn draw_page_finish(&self)
Source§fn default_page_setup(&self) -> Option<PageSetup>
fn default_page_setup(&self) -> Option<PageSetup>
set_default_page_setup(). Read moreSource§fn embeds_page_setup(&self) -> bool
fn embeds_page_setup(&self) -> bool
embed-page-setup property. Read moreSource§fn has_selection(&self) -> bool
fn has_selection(&self) -> bool
has-selection property. Read moreSource§fn n_pages_to_print(&self) -> i32
fn n_pages_to_print(&self) -> i32
Source§fn print_settings(&self) -> Option<PrintSettings>
fn print_settings(&self) -> Option<PrintSettings>
Source§fn status(&self) -> PrintStatus
fn status(&self) -> PrintStatus
status_string(). Read moreSource§fn status_string(&self) -> Option<GString>
fn status_string(&self) -> Option<GString>
Source§fn supports_selection(&self) -> bool
fn supports_selection(&self) -> bool
support-selection property. Read moreSource§fn is_finished(&self) -> bool
fn is_finished(&self) -> bool
PrintStatus::Finished)
or unsuccessfully (PrintStatus::FinishedAborted). Read moreSource§fn run(
&self,
action: PrintOperationAction,
parent: Option<&impl IsA<Window>>,
) -> Result<PrintOperationResult, Error>
fn run( &self, action: PrintOperationAction, parent: Option<&impl IsA<Window>>, ) -> Result<PrintOperationResult, Error>
Source§fn set_allow_async(&self, allow_async: bool)
fn set_allow_async(&self, allow_async: bool)
Source§fn set_current_page(&self, current_page: i32)
fn set_current_page(&self, current_page: i32)
Source§fn set_custom_tab_label(&self, label: Option<&str>)
fn set_custom_tab_label(&self, label: Option<&str>)
Source§fn set_default_page_setup(&self, default_page_setup: Option<&PageSetup>)
fn set_default_page_setup(&self, default_page_setup: Option<&PageSetup>)
Source§fn set_defer_drawing(&self)
fn set_defer_drawing(&self)
PrintOperation to wait for calling of
draw_page_finish() from application. It can
be used for drawing page in another thread. Read moreSource§fn set_embed_page_setup(&self, embed: bool)
fn set_embed_page_setup(&self, embed: bool)
PrintOperation. Read moreSource§fn set_export_filename(&self, filename: impl AsRef<Path>)
fn set_export_filename(&self, filename: impl AsRef<Path>)
PrintOperation to generate a file instead
of showing the print dialog. The indended use of this function
is for implementing “Export to PDF” actions. Currently, PDF
is the only supported format. Read moreSource§fn set_has_selection(&self, has_selection: bool)
fn set_has_selection(&self, has_selection: bool)
Source§fn set_job_name(&self, job_name: &str)
fn set_job_name(&self, job_name: &str)
Source§fn set_n_pages(&self, n_pages: i32)
fn set_n_pages(&self, n_pages: i32)
Source§fn set_print_settings(&self, print_settings: Option<&PrintSettings>)
fn set_print_settings(&self, print_settings: Option<&PrintSettings>)
Source§fn set_show_progress(&self, show_progress: bool)
fn set_show_progress(&self, show_progress: bool)
Source§fn set_support_selection(&self, support_selection: bool)
fn set_support_selection(&self, support_selection: bool)
PrintOperation. Read moreSource§fn set_track_print_status(&self, track_status: bool)
fn set_track_print_status(&self, track_status: bool)
Source§fn set_unit(&self, unit: Unit)
fn set_unit(&self, unit: Unit)
PrintContext in such a way that distances are measured in
units of unit. Read moreSource§fn set_use_full_page(&self, full_page: bool)
fn set_use_full_page(&self, full_page: bool)
full_page is true, the transformation for the cairo context
obtained from PrintContext puts the origin at the top left
corner of the page (which may not be the top left corner of the
sheet, depending on page orientation and the number of pages per
sheet). Otherwise, the origin is at the top left corner of the
imageable area (i.e. inside the margins). Read moreSource§fn allows_async(&self) -> bool
fn allows_async(&self) -> bool
Source§fn current_page(&self) -> i32
fn current_page(&self) -> i32
Source§fn custom_tab_label(&self) -> Option<GString>
fn custom_tab_label(&self) -> Option<GString>
Source§fn export_filename(&self) -> Option<GString>
fn export_filename(&self) -> Option<GString>
Source§fn job_name(&self) -> Option<GString>
fn job_name(&self) -> Option<GString>
Source§fn shows_progress(&self) -> bool
fn shows_progress(&self) -> bool
Source§fn tracks_print_status(&self) -> bool
fn tracks_print_status(&self) -> bool
true, the print operation will try to continue report on
the status of the print job in the printer queues and printer.
This can allow your application to show things like “out of paper”
issues, and when the print job actually reaches the printer.
However, this is often implemented using polling, and should
not be enabled unless needed.Source§fn unit(&self) -> Unit
fn unit(&self) -> Unit
PrintContext is set up in such a way that distances
are measured in units of unit.Source§fn uses_full_page(&self) -> bool
fn uses_full_page(&self) -> bool
true, the transformation for the cairo context obtained
from PrintContext puts the origin at the top left corner
of the page (which may not be the top left corner of the sheet,
depending on page orientation and the number of pages per sheet).
Otherwise, the origin is at the top left corner of the imageable
area (i.e. inside the margins).Source§fn connect_begin_print<F: Fn(&Self, &PrintContext) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_begin_print<F: Fn(&Self, &PrintContext) + 'static>( &self, f: F, ) -> SignalHandlerId
Source§fn connect_create_custom_widget<F: Fn(&Self) -> Object + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_create_custom_widget<F: Fn(&Self) -> Object + 'static>( &self, f: F, ) -> SignalHandlerId
Source§fn connect_custom_widget_apply<F: Fn(&Self, &Widget) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_custom_widget_apply<F: Fn(&Self, &Widget) + 'static>( &self, f: F, ) -> SignalHandlerId
begin-print if you added
a custom widget in the create-custom-widget handler.
When you get this signal you should read the information from the
custom widgets, as the widgets are not guaraneed to be around at a
later time. Read moreSource§fn connect_done<F: Fn(&Self, PrintOperationResult) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_done<F: Fn(&Self, PrintOperationResult) + 'static>( &self, f: F, ) -> SignalHandlerId
Source§fn connect_draw_page<F: Fn(&Self, &PrintContext, i32) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_draw_page<F: Fn(&Self, &PrintContext, i32) + 'static>( &self, f: F, ) -> SignalHandlerId
page_nr’s page onto the cairo context obtained
from context using PrintContext::cairo_context(). Read moreSource§fn connect_end_print<F: Fn(&Self, &PrintContext) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_end_print<F: Fn(&Self, &PrintContext) + 'static>( &self, f: F, ) -> SignalHandlerId
begin-print handler. Read moreSource§fn connect_paginate<F: Fn(&Self, &PrintContext) -> bool + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_paginate<F: Fn(&Self, &PrintContext) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId
begin-print signal, but before
the actual rendering starts. It keeps getting emitted until a connected
signal handler returns true. Read moreSource§fn connect_preview<F: Fn(&Self, &PrintOperationPreview, &PrintContext, Option<&Window>) -> bool + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_preview<F: Fn(&Self, &PrintOperationPreview, &PrintContext, Option<&Window>) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId
Source§fn connect_request_page_setup<F: Fn(&Self, &PrintContext, i32, &PageSetup) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_request_page_setup<F: Fn(&Self, &PrintContext, i32, &PageSetup) + 'static>( &self, f: F, ) -> SignalHandlerId
setup will be in force only for printing this page. Read moreSource§fn connect_status_changed<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_status_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
PrintStatus for the phases that are being discriminated.
Use status() to find out the current
status.