PrintUnixDialogProtocol

public protocol PrintUnixDialogProtocol : DialogProtocol

GtkPrintUnixDialog implements a print dialog for platforms which don’t provide a native print dialog, like Unix.

An example GtkPrintUnixDialog

It can be used very much like any other GTK dialog, at the cost of the portability offered by the high-level printing API with [classGtk.PrintOperation].

In order to print something with GtkPrintUnixDialog, you need to use [methodGtk.PrintUnixDialog.get_selected_printer] to obtain a [classGtk.Printer] object and use it to construct a [classGtk.PrintJob] using [ctorGtk.PrintJob.new].

GtkPrintUnixDialog uses the following response values:

  • GTK_RESPONSE_OK: for the “Print” button
  • GTK_RESPONSE_APPLY: for the “Preview” button
  • GTK_RESPONSE_CANCEL: for the “Cancel” button

GtkPrintUnixDialog as GtkBuildable

The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its notebook internal children with the name “notebook”.

An example of a GtkPrintUnixDialog UI definition fragment:

<object class="GtkPrintUnixDialog" id="dialog1">
  <child internal-child="notebook">
    <object class="GtkNotebook" id="notebook">
      <child>
        <object type="GtkNotebookPage">
          <property name="tab_expand">False</property>
          <property name="tab_fill">False</property>
          <property name="tab">
            <object class="GtkLabel" id="tablabel">
              <property name="label">Tab label</property>
            </object>
          </property>
          <property name="child">
            <object class="GtkLabel" id="tabcontent">
              <property name="label">Content on notebook tab</property>
            </object>
          </property>
        </object>
      </child>
    </object>
  </child>
</object>

CSS nodes

GtkPrintUnixDialog has a single CSS node with name window. The style classes dialog and print are added.

The PrintUnixDialogProtocol protocol exposes the methods and properties of an underlying GtkPrintUnixDialog instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see PrintUnixDialog. Alternatively, use PrintUnixDialogRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkPrintUnixDialog instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • print_unix_dialog_ptr Default implementation

    Typed pointer to the underlying GtkPrintUnixDialog instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkPrintUnixDialog instance.

    Declaration

    Swift

    var print_unix_dialog_ptr: UnsafeMutablePointer<GtkPrintUnixDialog>! { get }
  • Required Initialiser for types conforming to PrintUnixDialogProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

PrintUnixDialog Class

  • Bind a PrintUnixDialogPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: PrintUnixDialogPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a PrintUnixDialog property

    Declaration

    Swift

    @inlinable
    func get(property: PrintUnixDialogPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a PrintUnixDialog property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: PrintUnixDialogPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

PrintUnixDialog Class: PrintUnixDialogProtocol extension (methods and fields)

  • Adds a custom tab to the print dialog.

    Declaration

    Swift

    @inlinable
    func addCustomTab<WidgetT>(child: WidgetT, tabLabel: WidgetT) where WidgetT : WidgetProtocol
  • getCurrentPage() Extension method

    Gets the current page of the GtkPrintUnixDialog.

    Declaration

    Swift

    @inlinable
    func getCurrentPage() -> Int
  • getEmbedPageSetup() Extension method

    Gets whether to embed the page setup.

    Declaration

    Swift

    @inlinable
    func getEmbedPageSetup() -> Bool
  • getHasSelection() Extension method

    Gets whether there is a selection.

    Declaration

    Swift

    @inlinable
    func getHasSelection() -> Bool
  • getManualCapabilities() Extension method

    Gets the capabilities that have been set on this GtkPrintUnixDialog.

    Declaration

    Swift

    @inlinable
    func getManualCapabilities() -> PrintCapabilities
  • getPageSetup() Extension method

    Gets the page setup that is used by the GtkPrintUnixDialog.

    Declaration

    Swift

    @inlinable
    func getPageSetup() -> PageSetupRef!
  • getPageSetupSet() Extension method

    Gets whether a page setup was set by the user.

    Declaration

    Swift

    @inlinable
    func getPageSetupSet() -> Bool
  • getSelectedPrinter() Extension method

    Gets the currently selected printer.

    Declaration

    Swift

    @inlinable
    func getSelectedPrinter() -> PrinterRef!
  • getSettings() Extension method

    Gets a new GtkPrintSettings object that represents the current values in the print dialog.

    Note that this creates a new object, and you need to unref it if don’t want to keep it.

    Declaration

    Swift

    @inlinable
    func getSettings() -> PrintSettingsRef!
  • getSupportSelection() Extension method

    Gets whether the print dialog allows user to print a selection.

    Declaration

    Swift

    @inlinable
    func getSupportSelection() -> Bool
  • set(currentPage:) Extension method

    Sets the current page number.

    If current_page is not -1, this enables the current page choice for the range of pages to print.

    Declaration

    Swift

    @inlinable
    func set(currentPage: Int)
  • setEmbedPageSetup(embed:) Extension method

    Embed page size combo box and orientation combo box into page setup page.

    Declaration

    Swift

    @inlinable
    func setEmbedPageSetup(embed: Bool)
  • set(hasSelection:) Extension method

    Sets whether a selection exists.

    Declaration

    Swift

    @inlinable
    func set(hasSelection: Bool)
  • setManual(capabilities:) Extension method

    This lets you specify the printing capabilities your application supports.

    For instance, if you can handle scaling the output then you pass GTK_PRINT_CAPABILITY_SCALE. If you don’t pass that, then the dialog will only let you select the scale if the printing system automatically handles scaling.

    Declaration

    Swift

    @inlinable
    func setManual(capabilities: PrintCapabilities)
  • set(pageSetup:) Extension method

    Sets the page setup of the GtkPrintUnixDialog.

    Declaration

    Swift

    @inlinable
    func set<PageSetupT>(pageSetup: PageSetupT) where PageSetupT : PageSetupProtocol
  • set(settings:) Extension method

    Sets the GtkPrintSettings for the GtkPrintUnixDialog.

    Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.

    Declaration

    Swift

    @inlinable
    func set(settings: PrintSettingsRef? = nil)
  • set(settings:) Extension method

    Sets the GtkPrintSettings for the GtkPrintUnixDialog.

    Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.

    Declaration

    Swift

    @inlinable
    func set<PrintSettingsT>(settings: PrintSettingsT?) where PrintSettingsT : PrintSettingsProtocol
  • set(supportSelection:) Extension method

    Sets whether the print dialog allows user to print a selection.

    Declaration

    Swift

    @inlinable
    func set(supportSelection: Bool)
  • currentPage Extension method

    Gets the current page of the GtkPrintUnixDialog.

    Declaration

    Swift

    @inlinable
    var currentPage: Int { get nonmutating set }
  • embedPageSetup Extension method

    Gets whether to embed the page setup.

    Declaration

    Swift

    @inlinable
    var embedPageSetup: Bool { get nonmutating set }
  • hasSelection Extension method

    Gets whether there is a selection.

    Declaration

    Swift

    @inlinable
    var hasSelection: Bool { get nonmutating set }
  • manualCapabilities Extension method

    Gets the capabilities that have been set on this GtkPrintUnixDialog.

    Declaration

    Swift

    @inlinable
    var manualCapabilities: PrintCapabilities { get nonmutating set }
  • pageSetup Extension method

    Gets the page setup that is used by the GtkPrintUnixDialog.

    Declaration

    Swift

    @inlinable
    var pageSetup: PageSetupRef! { get nonmutating set }
  • pageSetupSet Extension method

    Gets whether a page setup was set by the user.

    Declaration

    Swift

    @inlinable
    var pageSetupSet: Bool { get }
  • selectedPrinter Extension method

    Gets the currently selected printer.

    Declaration

    Swift

    @inlinable
    var selectedPrinter: PrinterRef! { get }
  • settings Extension method

    Gets a new GtkPrintSettings object that represents the current values in the print dialog.

    Note that this creates a new object, and you need to unref it if don’t want to keep it.

    Declaration

    Swift

    @inlinable
    var settings: PrintSettingsRef! { get nonmutating set }
  • supportSelection Extension method

    Gets whether the print dialog allows user to print a selection.

    Declaration

    Swift

    @inlinable
    var supportSelection: Bool { get nonmutating set }