PrintSettingsProtocol

public protocol PrintSettingsProtocol : ObjectProtocol

A GtkPrintSettings object represents the settings of a print dialog in a system-independent way. The main use for this object is that once you’ve printed you can get a settings object that represents the settings the user chose, and the next time you print you can pass that object in so that the user doesn’t have to re-set all his settings.

Its also possible to enumerate the settings so that you can easily save the settings for the next time your app runs, or even store them in a document. The predefined keys try to use shared values as much as possible so that moving such a document between systems still works.

Printing support was added in GTK+ 2.10.

The PrintSettingsProtocol protocol exposes the methods and properties of an underlying GtkPrintSettings 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 PrintSettings. Alternatively, use PrintSettingsRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkPrintSettings instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkPrintSettings instance.

    Default Implementation

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

    Declaration

    Swift

    var print_settings_ptr: UnsafeMutablePointer<GtkPrintSettings>! { get }
  • Required Initialiser for types conforming to PrintSettingsProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

PrintSettings Class: PrintSettingsProtocol extension (methods and fields)

  • copy() Extension method

    Copies a GtkPrintSettings object.

    Declaration

    Swift

    @inlinable
    func copy() -> PrintSettingsRef!
  • foreach(func:userData:) Extension method

    Calls func for each key-value pair of settings.

    Declaration

    Swift

    @inlinable
    func foreach(func: GtkPrintSettingsFunc?, userData: gpointer! = nil)
  • get(key:) Extension method

    Looks up the string value associated with key.

    Declaration

    Swift

    @inlinable
    func get(key: UnsafePointer<gchar>!) -> String!
  • getBool(key:) Extension method

    Returns the boolean represented by the value that is associated with key.

    The string “true” represents true, any other string false.

    Declaration

    Swift

    @inlinable
    func getBool(key: UnsafePointer<gchar>!) -> Bool
  • getCollate() Extension method

    Gets the value of GTK_PRINT_SETTINGS_COLLATE.

    Declaration

    Swift

    @inlinable
    func getCollate() -> Bool
  • getDefaultSource() Extension method

    Gets the value of GTK_PRINT_SETTINGS_DEFAULT_SOURCE.

    Declaration

    Swift

    @inlinable
    func getDefaultSource() -> String!
  • getDither() Extension method

    Gets the value of GTK_PRINT_SETTINGS_DITHER.

    Declaration

    Swift

    @inlinable
    func getDither() -> String!
  • getDouble(key:) Extension method

    Returns the double value associated with key, or 0.

    Declaration

    Swift

    @inlinable
    func getDouble(key: UnsafePointer<gchar>!) -> Double
  • Returns the floating point number represented by the value that is associated with key, or default_val if the value does not represent a floating point number.

    Floating point numbers are parsed with g_ascii_strtod().

    Declaration

    Swift

    @inlinable
    func getDoubleWithDefault(key: UnsafePointer<gchar>!, def: Double) -> Double
  • getDuplex() Extension method

    Gets the value of GTK_PRINT_SETTINGS_DUPLEX.

    Declaration

    Swift

    @inlinable
    func getDuplex() -> GtkPrintDuplex
  • getFinishings() Extension method

    Gets the value of GTK_PRINT_SETTINGS_FINISHINGS.

    Declaration

    Swift

    @inlinable
    func getFinishings() -> String!
  • getInt(key:) Extension method

    Returns the integer value of key, or 0.

    Declaration

    Swift

    @inlinable
    func getInt(key: UnsafePointer<gchar>!) -> Int
  • getIntWithDefault(key:def:) Extension method

    Returns the value of key, interpreted as an integer, or the default value.

    Declaration

    Swift

    @inlinable
    func getIntWithDefault(key: UnsafePointer<gchar>!, def: Int) -> Int
  • getLength(key:unit:) Extension method

    Returns the value associated with key, interpreted as a length. The returned value is converted to units.

    Declaration

    Swift

    @inlinable
    func getLength(key: UnsafePointer<gchar>!, unit: GtkUnit) -> Double
  • getMediaType() Extension method

    Gets the value of GTK_PRINT_SETTINGS_MEDIA_TYPE.

    The set of media types is defined in PWG 5101.1-2002 PWG.

    Declaration

    Swift

    @inlinable
    func getMediaType() -> String!
  • getNCopies() Extension method

    Gets the value of GTK_PRINT_SETTINGS_N_COPIES.

    Declaration

    Swift

    @inlinable
    func getNCopies() -> Int
  • getNumberUp() Extension method

    Gets the value of GTK_PRINT_SETTINGS_NUMBER_UP.

    Declaration

    Swift

    @inlinable
    func getNumberUp() -> Int
  • getNumberUpLayout() Extension method

    Gets the value of GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.

    Declaration

    Swift

    @inlinable
    func getNumberUpLayout() -> GtkNumberUpLayout
  • getOrientation() Extension method

    Get the value of GTK_PRINT_SETTINGS_ORIENTATION, converted to a GtkPageOrientation.

    Declaration

    Swift

    @inlinable
    func getOrientation() -> GtkPageOrientation
  • getOutputBin() Extension method

    Gets the value of GTK_PRINT_SETTINGS_OUTPUT_BIN.

    Declaration

    Swift

    @inlinable
    func getOutputBin() -> String!
  • getPageRanges(numRanges:) Extension method

    Gets the value of GTK_PRINT_SETTINGS_PAGE_RANGES.

    Declaration

    Swift

    @inlinable
    func getPageRanges(numRanges: UnsafeMutablePointer<gint>!) -> UnsafeMutablePointer<GtkPageRange>!
  • getPageSet() Extension method

    Gets the value of GTK_PRINT_SETTINGS_PAGE_SET.

    Declaration

    Swift

    @inlinable
    func getPageSet() -> GtkPageSet
  • getPaperHeight(unit:) Extension method

    Gets the value of GTK_PRINT_SETTINGS_PAPER_HEIGHT, converted to unit.

    Declaration

    Swift

    @inlinable
    func getPaperHeight(unit: GtkUnit) -> Double
  • getPaperSize() Extension method

    Gets the value of GTK_PRINT_SETTINGS_PAPER_FORMAT, converted to a GtkPaperSize.

    Declaration

    Swift

    @inlinable
    func getPaperSize() -> PaperSizeRef!
  • getPaperWidth(unit:) Extension method

    Gets the value of GTK_PRINT_SETTINGS_PAPER_WIDTH, converted to unit.

    Declaration

    Swift

    @inlinable
    func getPaperWidth(unit: GtkUnit) -> Double
  • getPrintPages() Extension method

    Gets the value of GTK_PRINT_SETTINGS_PRINT_PAGES.

    Declaration

    Swift

    @inlinable
    func getPrintPages() -> GtkPrintPages
  • getPrinter() Extension method

    Convenience function to obtain the value of GTK_PRINT_SETTINGS_PRINTER.

    Declaration

    Swift

    @inlinable
    func getPrinter() -> String!
  • getPrinterLpi() Extension method

    Gets the value of GTK_PRINT_SETTINGS_PRINTER_LPI.

    Declaration

    Swift

    @inlinable
    func getPrinterLpi() -> Double
  • getQuality() Extension method

    Gets the value of GTK_PRINT_SETTINGS_QUALITY.

    Declaration

    Swift

    @inlinable
    func getQuality() -> GtkPrintQuality
  • getResolution() Extension method

    Gets the value of GTK_PRINT_SETTINGS_RESOLUTION.

    Declaration

    Swift

    @inlinable
    func getResolution() -> Int
  • getResolutionX() Extension method

    Gets the value of GTK_PRINT_SETTINGS_RESOLUTION_X.

    Declaration

    Swift

    @inlinable
    func getResolutionX() -> Int
  • getResolutionY() Extension method

    Gets the value of GTK_PRINT_SETTINGS_RESOLUTION_Y.

    Declaration

    Swift

    @inlinable
    func getResolutionY() -> Int
  • getReverse() Extension method

    Gets the value of GTK_PRINT_SETTINGS_REVERSE.

    Declaration

    Swift

    @inlinable
    func getReverse() -> Bool
  • getScale() Extension method

    Gets the value of GTK_PRINT_SETTINGS_SCALE.

    Declaration

    Swift

    @inlinable
    func getScale() -> Double
  • getUseColor() Extension method

    Gets the value of GTK_PRINT_SETTINGS_USE_COLOR.

    Declaration

    Swift

    @inlinable
    func getUseColor() -> Bool
  • has(key:) Extension method

    Returns true, if a value is associated with key.

    Declaration

    Swift

    @inlinable
    func has(key: UnsafePointer<gchar>!) -> Bool
  • loadFile(fileName:) Extension method

    Reads the print settings from file_name. If the file could not be loaded then error is set to either a GFileError or GKeyFileError. See gtk_print_settings_to_file().

    Declaration

    Swift

    @inlinable
    func loadFile(fileName: UnsafePointer<gchar>!) throws -> Bool
  • load(keyFile:groupName:) Extension method

    Reads the print settings from the group group_name in key_file. If the file could not be loaded then error is set to either a GFileError or GKeyFileError.

    Declaration

    Swift

    @inlinable
    func load<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<gchar>? = nil) throws -> Bool where KeyFileT : KeyFileProtocol
  • set(key:value:) Extension method

    Associates value with key.

    Declaration

    Swift

    @inlinable
    func set(key: UnsafePointer<gchar>!, value: UnsafePointer<gchar>? = nil)
  • setBool(key:value:) Extension method

    Sets key to a boolean value.

    Declaration

    Swift

    @inlinable
    func setBool(key: UnsafePointer<gchar>!, value: Bool)
  • set(collate:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_COLLATE.

    Declaration

    Swift

    @inlinable
    func set(collate: Bool)
  • set(defaultSource:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_DEFAULT_SOURCE.

    Declaration

    Swift

    @inlinable
    func set(defaultSource: UnsafePointer<gchar>!)
  • set(dither:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_DITHER.

    Declaration

    Swift

    @inlinable
    func set(dither: UnsafePointer<gchar>!)
  • setDouble(key:value:) Extension method

    Sets key to a double value.

    Declaration

    Swift

    @inlinable
    func setDouble(key: UnsafePointer<gchar>!, value: Double)
  • set(duplex:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_DUPLEX.

    Declaration

    Swift

    @inlinable
    func set(duplex: GtkPrintDuplex)
  • set(finishings:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_FINISHINGS.

    Declaration

    Swift

    @inlinable
    func set(finishings: UnsafePointer<gchar>!)
  • setInt(key:value:) Extension method

    Sets key to an integer value.

    Declaration

    Swift

    @inlinable
    func setInt(key: UnsafePointer<gchar>!, value: Int)
  • setLength(key:value:unit:) Extension method

    Associates a length in units of unit with key.

    Declaration

    Swift

    @inlinable
    func setLength(key: UnsafePointer<gchar>!, value: Double, unit: GtkUnit)
  • set(mediaType:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_MEDIA_TYPE.

    The set of media types is defined in PWG 5101.1-2002 PWG.

    Declaration

    Swift

    @inlinable
    func set(mediaType: UnsafePointer<gchar>!)
  • setNCopies(numCopies:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_N_COPIES.

    Declaration

    Swift

    @inlinable
    func setNCopies(numCopies: Int)
  • set(numberUp:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_NUMBER_UP.

    Declaration

    Swift

    @inlinable
    func set(numberUp: Int)
  • set(numberUpLayout:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.

    Declaration

    Swift

    @inlinable
    func set(numberUpLayout: GtkNumberUpLayout)
  • set(orientation:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_ORIENTATION.

    Declaration

    Swift

    @inlinable
    func set(orientation: GtkPageOrientation)
  • set(outputBin:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_OUTPUT_BIN.

    Declaration

    Swift

    @inlinable
    func set(outputBin: UnsafePointer<gchar>!)
  • set(pageRanges:numRanges:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_PAGE_RANGES.

    Declaration

    Swift

    @inlinable
    func set(pageRanges: UnsafeMutablePointer<GtkPageRange>!, numRanges: Int)
  • set(pageSet:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_PAGE_SET.

    Declaration

    Swift

    @inlinable
    func set(pageSet: GtkPageSet)
  • setPaper(height:unit:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_PAPER_HEIGHT.

    Declaration

    Swift

    @inlinable
    func setPaper(height: Double, unit: GtkUnit)
  • set(paperSize:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_PAPER_FORMAT, GTK_PRINT_SETTINGS_PAPER_WIDTH and GTK_PRINT_SETTINGS_PAPER_HEIGHT.

    Declaration

    Swift

    @inlinable
    func set<PaperSizeT>(paperSize: PaperSizeT) where PaperSizeT : PaperSizeProtocol
  • setPaper(width:unit:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_PAPER_WIDTH.

    Declaration

    Swift

    @inlinable
    func setPaper(width: Double, unit: GtkUnit)
  • setPrint(pages:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_PRINT_PAGES.

    Declaration

    Swift

    @inlinable
    func setPrint(pages: GtkPrintPages)
  • set(printer:) Extension method

    Convenience function to set GTK_PRINT_SETTINGS_PRINTER to printer.

    Declaration

    Swift

    @inlinable
    func set(printer: UnsafePointer<gchar>!)
  • setPrinter(lpi:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_PRINTER_LPI.

    Declaration

    Swift

    @inlinable
    func setPrinter(lpi: Double)
  • set(quality:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_QUALITY.

    Declaration

    Swift

    @inlinable
    func set(quality: GtkPrintQuality)
  • set(resolution:) Extension method

    Sets the values of GTK_PRINT_SETTINGS_RESOLUTION, GTK_PRINT_SETTINGS_RESOLUTION_X and GTK_PRINT_SETTINGS_RESOLUTION_Y.

    Declaration

    Swift

    @inlinable
    func set(resolution: Int)
  • Sets the values of GTK_PRINT_SETTINGS_RESOLUTION, GTK_PRINT_SETTINGS_RESOLUTION_X and GTK_PRINT_SETTINGS_RESOLUTION_Y.

    Declaration

    Swift

    @inlinable
    func setResolutionXy(resolutionX: Int, resolutionY: Int)
  • set(reverse:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_REVERSE.

    Declaration

    Swift

    @inlinable
    func set(reverse: Bool)
  • set(scale:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_SCALE.

    Declaration

    Swift

    @inlinable
    func set(scale: Double)
  • set(useColor:) Extension method

    Sets the value of GTK_PRINT_SETTINGS_USE_COLOR.

    Declaration

    Swift

    @inlinable
    func set(useColor: Bool)
  • toFile(fileName:) Extension method

    This function saves the print settings from settings to file_name. If the file could not be loaded then error is set to either a GFileError or GKeyFileError.

    Declaration

    Swift

    @inlinable
    func toFile(fileName: UnsafePointer<gchar>!) throws -> Bool
  • toGvariant() Extension method

    Serialize print settings to an a{sv} variant.

    Declaration

    Swift

    @inlinable
    func toGvariant() -> GLib.VariantRef!
  • to(keyFile:groupName:) Extension method

    This function adds the print settings from settings to key_file.

    Declaration

    Swift

    @inlinable
    func to<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<gchar>? = nil) where KeyFileT : KeyFileProtocol
  • unset(key:) Extension method

    Removes any value associated with key. This has the same effect as setting the value to nil.

    Declaration

    Swift

    @inlinable
    func unset(key: UnsafePointer<gchar>!)
  • Runs a page setup dialog, letting the user modify the values from page_setup. If the user cancels the dialog, the returned GtkPageSetup is identical to the passed in page_setup, otherwise it contains the modifications done in the dialog.

    Note that this function may use a recursive mainloop to show the page setup dialog. See gtk_print_run_page_setup_dialog_async() if this is a problem.

    Declaration

    Swift

    @inlinable
    func printRunPageSetupDialog(parent: WindowRef? = nil, pageSetup: PageSetupRef? = nil) -> PageSetupRef!
  • Runs a page setup dialog, letting the user modify the values from page_setup. If the user cancels the dialog, the returned GtkPageSetup is identical to the passed in page_setup, otherwise it contains the modifications done in the dialog.

    Note that this function may use a recursive mainloop to show the page setup dialog. See gtk_print_run_page_setup_dialog_async() if this is a problem.

    Declaration

    Swift

    @inlinable
    func printRunPageSetupDialog<PageSetupT, WindowT>(parent: WindowT?, pageSetup: PageSetupT?) -> PageSetupRef! where PageSetupT : PageSetupProtocol, WindowT : WindowProtocol
  • Runs a page setup dialog, letting the user modify the values from page_setup.

    In contrast to gtk_print_run_page_setup_dialog(), this function returns after showing the page setup dialog on platforms that support this, and calls done_cb from a signal handler for the response signal of the dialog.

    Declaration

    Swift

    @inlinable
    func printRunPageSetupDialogAsync(parent: WindowRef? = nil, pageSetup: PageSetupRef? = nil, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil)
  • Runs a page setup dialog, letting the user modify the values from page_setup.

    In contrast to gtk_print_run_page_setup_dialog(), this function returns after showing the page setup dialog on platforms that support this, and calls done_cb from a signal handler for the response signal of the dialog.

    Declaration

    Swift

    @inlinable
    func printRunPageSetupDialogAsync<PageSetupT, WindowT>(parent: WindowT?, pageSetup: PageSetupT?, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PageSetupT : PageSetupProtocol, WindowT : WindowProtocol
  • collate Extension method

    Gets the value of GTK_PRINT_SETTINGS_COLLATE.

    Declaration

    Swift

    @inlinable
    var collate: Bool { get nonmutating set }
  • defaultSource Extension method

    Gets the value of GTK_PRINT_SETTINGS_DEFAULT_SOURCE.

    Declaration

    Swift

    @inlinable
    var defaultSource: String! { get nonmutating set }
  • dither Extension method

    Gets the value of GTK_PRINT_SETTINGS_DITHER.

    Declaration

    Swift

    @inlinable
    var dither: String! { get nonmutating set }
  • duplex Extension method

    Gets the value of GTK_PRINT_SETTINGS_DUPLEX.

    Declaration

    Swift

    @inlinable
    var duplex: GtkPrintDuplex { get nonmutating set }
  • finishings Extension method

    Gets the value of GTK_PRINT_SETTINGS_FINISHINGS.

    Declaration

    Swift

    @inlinable
    var finishings: String! { get nonmutating set }
  • mediaType Extension method

    Gets the value of GTK_PRINT_SETTINGS_MEDIA_TYPE.

    The set of media types is defined in PWG 5101.1-2002 PWG.

    Declaration

    Swift

    @inlinable
    var mediaType: String! { get nonmutating set }
  • nCopies Extension method

    Gets the value of GTK_PRINT_SETTINGS_N_COPIES.

    Declaration

    Swift

    @inlinable
    var nCopies: Int { get nonmutating set }
  • numberUp Extension method

    Gets the value of GTK_PRINT_SETTINGS_NUMBER_UP.

    Declaration

    Swift

    @inlinable
    var numberUp: Int { get nonmutating set }
  • numberUpLayout Extension method

    Gets the value of GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.

    Declaration

    Swift

    @inlinable
    var numberUpLayout: GtkNumberUpLayout { get nonmutating set }
  • orientation Extension method

    Get the value of GTK_PRINT_SETTINGS_ORIENTATION, converted to a GtkPageOrientation.

    Declaration

    Swift

    @inlinable
    var orientation: GtkPageOrientation { get nonmutating set }
  • outputBin Extension method

    Gets the value of GTK_PRINT_SETTINGS_OUTPUT_BIN.

    Declaration

    Swift

    @inlinable
    var outputBin: String! { get nonmutating set }
  • pageSet Extension method

    Gets the value of GTK_PRINT_SETTINGS_PAGE_SET.

    Declaration

    Swift

    @inlinable
    var pageSet: GtkPageSet { get nonmutating set }
  • paperSize Extension method

    Gets the value of GTK_PRINT_SETTINGS_PAPER_FORMAT, converted to a GtkPaperSize.

    Declaration

    Swift

    @inlinable
    var paperSize: PaperSizeRef! { get nonmutating set }
  • printPages Extension method

    Gets the value of GTK_PRINT_SETTINGS_PRINT_PAGES.

    Declaration

    Swift

    @inlinable
    var printPages: GtkPrintPages { get nonmutating set }
  • printer Extension method

    Convenience function to obtain the value of GTK_PRINT_SETTINGS_PRINTER.

    Declaration

    Swift

    @inlinable
    var printer: String! { get nonmutating set }
  • printerLpi Extension method

    Gets the value of GTK_PRINT_SETTINGS_PRINTER_LPI.

    Declaration

    Swift

    @inlinable
    var printerLpi: Double { get nonmutating set }
  • quality Extension method

    Gets the value of GTK_PRINT_SETTINGS_QUALITY.

    Declaration

    Swift

    @inlinable
    var quality: GtkPrintQuality { get nonmutating set }
  • resolution Extension method

    Gets the value of GTK_PRINT_SETTINGS_RESOLUTION.

    Declaration

    Swift

    @inlinable
    var resolution: Int { get nonmutating set }
  • resolutionX Extension method

    Gets the value of GTK_PRINT_SETTINGS_RESOLUTION_X.

    Declaration

    Swift

    @inlinable
    var resolutionX: Int { get }
  • resolutionY Extension method

    Gets the value of GTK_PRINT_SETTINGS_RESOLUTION_Y.

    Declaration

    Swift

    @inlinable
    var resolutionY: Int { get }
  • reverse Extension method

    Gets the value of GTK_PRINT_SETTINGS_REVERSE.

    Declaration

    Swift

    @inlinable
    var reverse: Bool { get nonmutating set }
  • scale Extension method

    Gets the value of GTK_PRINT_SETTINGS_SCALE.

    Declaration

    Swift

    @inlinable
    var scale: Double { get nonmutating set }
  • useColor Extension method

    Gets the value of GTK_PRINT_SETTINGS_USE_COLOR.

    Declaration

    Swift

    @inlinable
    var useColor: Bool { get nonmutating set }