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.
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.
-
Untyped pointer to the underlying
GtkPrintSettingsinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
print_settings_ptrDefault implementationTyped pointer to the underlying
GtkPrintSettingsinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPrintSettingsinstance.Declaration
Swift
var print_settings_ptr: UnsafeMutablePointer<GtkPrintSettings>! { get } -
Required Initialiser for types conforming to
PrintSettingsProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
copy()Extension methodCopies a
GtkPrintSettingsobject.Declaration
Swift
@inlinable func copy() -> PrintSettingsRef! -
foreach(func:Extension methoduserData: ) Calls
funcfor each key-value pair ofsettings.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<CChar>!) -> String! -
getBool(key:Extension method) Returns the boolean represented by the value that is associated with
key.The string “true” represents
true, any other stringfalse.Declaration
Swift
@inlinable func getBool(key: UnsafePointer<CChar>!) -> Bool -
getCollate()Extension methodGets the value of
GTK_PRINT_SETTINGS_COLLATE.Declaration
Swift
@inlinable func getCollate() -> Bool -
getDefaultSource()Extension methodGets the value of
GTK_PRINT_SETTINGS_DEFAULT_SOURCE.Declaration
Swift
@inlinable func getDefaultSource() -> String! -
getDither()Extension methodGets 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<CChar>!) -> CDouble -
getDoubleWithDefault(key:Extension methoddef: ) Returns the floating point number represented by the value that is associated with
key, ordefault_valif 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<CChar>!, def: CDouble) -> CDouble -
getDuplex()Extension methodGets the value of
GTK_PRINT_SETTINGS_DUPLEX.Declaration
Swift
@inlinable func getDuplex() -> GtkPrintDuplex -
getFinishings()Extension methodGets 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<CChar>!) -> Int -
getIntWithDefault(key:Extension methoddef: ) Returns the value of
key, interpreted as an integer, or the default value.Declaration
Swift
@inlinable func getIntWithDefault(key: UnsafePointer<CChar>!, def: Int) -> Int -
getLength(key:Extension methodunit: ) Returns the value associated with
key, interpreted as a length.The returned value is converted to
units.Declaration
Swift
@inlinable func getLength(key: UnsafePointer<CChar>!, unit: GtkUnit) -> CDouble -
getMediaType()Extension methodGets 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 methodGets the value of
GTK_PRINT_SETTINGS_N_COPIES.Declaration
Swift
@inlinable func getNCopies() -> Int -
getNumberUp()Extension methodGets the value of
GTK_PRINT_SETTINGS_NUMBER_UP.Declaration
Swift
@inlinable func getNumberUp() -> Int -
getNumberUpLayout()Extension methodGets the value of
GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.Declaration
Swift
@inlinable func getNumberUpLayout() -> GtkNumberUpLayout -
getOrientation()Extension methodGet the value of
GTK_PRINT_SETTINGS_ORIENTATION, converted to aGtkPageOrientation.Declaration
Swift
@inlinable func getOrientation() -> GtkPageOrientation -
getOutputBin()Extension methodGets 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 methodGets 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 tounit.Declaration
Swift
@inlinable func getPaperHeight(unit: GtkUnit) -> CDouble -
getPaperSize()Extension methodGets the value of
GTK_PRINT_SETTINGS_PAPER_FORMAT, converted to aGtkPaperSize.Declaration
Swift
@inlinable func getPaperSize() -> PaperSizeRef! -
getPaperWidth(unit:Extension method) Gets the value of
GTK_PRINT_SETTINGS_PAPER_WIDTH, converted tounit.Declaration
Swift
@inlinable func getPaperWidth(unit: GtkUnit) -> CDouble -
getPrintPages()Extension methodGets the value of
GTK_PRINT_SETTINGS_PRINT_PAGES.Declaration
Swift
@inlinable func getPrintPages() -> GtkPrintPages -
getPrinter()Extension methodConvenience function to obtain the value of
GTK_PRINT_SETTINGS_PRINTER.Declaration
Swift
@inlinable func getPrinter() -> String! -
getPrinterLpi()Extension methodGets the value of
GTK_PRINT_SETTINGS_PRINTER_LPI.Declaration
Swift
@inlinable func getPrinterLpi() -> CDouble -
getQuality()Extension methodGets the value of
GTK_PRINT_SETTINGS_QUALITY.Declaration
Swift
@inlinable func getQuality() -> GtkPrintQuality -
getResolution()Extension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION.Declaration
Swift
@inlinable func getResolution() -> Int -
getResolutionX()Extension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION_X.Declaration
Swift
@inlinable func getResolutionX() -> Int -
getResolutionY()Extension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION_Y.Declaration
Swift
@inlinable func getResolutionY() -> Int -
getReverse()Extension methodGets the value of
GTK_PRINT_SETTINGS_REVERSE.Declaration
Swift
@inlinable func getReverse() -> Bool -
getScale()Extension methodGets the value of
GTK_PRINT_SETTINGS_SCALE.Declaration
Swift
@inlinable func getScale() -> CDouble -
getUseColor()Extension methodGets 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 withkey.Declaration
Swift
@inlinable func has(key: UnsafePointer<CChar>!) -> 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
GFileErrororGKeyFileError.See [method
Gtk.PrintSettings.to_file].Declaration
Swift
@inlinable func loadFile(fileName: UnsafePointer<CChar>!) throws -> Bool -
load(keyFile:Extension methodgroupName: ) Reads the print settings from the group
group_nameinkey_file.If the file could not be loaded then error is set to either a
GFileErrororGKeyFileError.Declaration
Swift
@inlinable func load<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<CChar>? = nil) throws -> Bool where KeyFileT : KeyFileProtocol -
set(key:Extension methodvalue: ) Associates
valuewithkey.Declaration
Swift
@inlinable func set(key: UnsafePointer<CChar>!, value: UnsafePointer<CChar>? = nil) -
setBool(key:Extension methodvalue: ) Sets
keyto a boolean value.Declaration
Swift
@inlinable func setBool(key: UnsafePointer<CChar>!, 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<CChar>!) -
set(dither:Extension method) Sets the value of
GTK_PRINT_SETTINGS_DITHER.Declaration
Swift
@inlinable func set(dither: UnsafePointer<CChar>!) -
setDouble(key:Extension methodvalue: ) Sets
keyto a double value.Declaration
Swift
@inlinable func setDouble(key: UnsafePointer<CChar>!, value: CDouble) -
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<CChar>!) -
setInt(key:Extension methodvalue: ) Sets
keyto an integer value.Declaration
Swift
@inlinable func setInt(key: UnsafePointer<CChar>!, value: Int) -
setLength(key:Extension methodvalue: unit: ) Associates a length in units of
unitwithkey.Declaration
Swift
@inlinable func setLength(key: UnsafePointer<CChar>!, value: CDouble, 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<CChar>!) -
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<CChar>!) -
set(pageRanges:Extension methodnumRanges: ) 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:Extension methodunit: ) Sets the value of
GTK_PRINT_SETTINGS_PAPER_HEIGHT.Declaration
Swift
@inlinable func setPaper(height: CDouble, unit: GtkUnit) -
set(paperSize:Extension method) Sets the value of
GTK_PRINT_SETTINGS_PAPER_FORMAT,GTK_PRINT_SETTINGS_PAPER_WIDTHandGTK_PRINT_SETTINGS_PAPER_HEIGHT.Declaration
Swift
@inlinable func set<PaperSizeT>(paperSize: PaperSizeT) where PaperSizeT : PaperSizeProtocol -
setPaper(width:Extension methodunit: ) Sets the value of
GTK_PRINT_SETTINGS_PAPER_WIDTH.Declaration
Swift
@inlinable func setPaper(width: CDouble, 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_PRINTERtoprinter.Declaration
Swift
@inlinable func set(printer: UnsafePointer<CChar>!) -
setPrinter(lpi:Extension method) Sets the value of
GTK_PRINT_SETTINGS_PRINTER_LPI.Declaration
Swift
@inlinable func setPrinter(lpi: CDouble) -
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_XandGTK_PRINT_SETTINGS_RESOLUTION_Y.Declaration
Swift
@inlinable func set(resolution: Int) -
setResolutionXy(resolutionX:Extension methodresolutionY: ) Sets the values of
GTK_PRINT_SETTINGS_RESOLUTION,GTK_PRINT_SETTINGS_RESOLUTION_XandGTK_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: CDouble) -
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
settingstofile_name.If the file could not be written then error is set to either a
GFileErrororGKeyFileError.Declaration
Swift
@inlinable func toFile(fileName: UnsafePointer<CChar>!) throws -> Bool -
toGvariant()Extension methodSerialize print settings to an a{sv} variant.
Declaration
Swift
@inlinable func toGvariant() -> GLib.VariantRef! -
to(keyFile:Extension methodgroupName: ) This function adds the print settings from
settingstokey_file.Declaration
Swift
@inlinable func to<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<CChar>? = 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<CChar>!) -
printRunPageSetupDialog(parent:Extension methodpageSetup: ) Runs a page setup dialog, letting the user modify the values from
page_setup. If the user cancels the dialog, the returnedGtkPageSetupis identical to the passed inpage_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! -
printRunPageSetupDialog(parent:Extension methodpageSetup: ) Runs a page setup dialog, letting the user modify the values from
page_setup. If the user cancels the dialog, the returnedGtkPageSetupis identical to the passed inpage_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 -
printRunPageSetupDialogAsync(parent:Extension methodpageSetup: doneCb: data: ) 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 callsdone_cbfrom a signal handler for theresponsesignal of the dialog.Declaration
Swift
@inlinable func printRunPageSetupDialogAsync(parent: WindowRef? = nil, pageSetup: PageSetupRef? = nil, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) -
printRunPageSetupDialogAsync(parent:Extension methodpageSetup: doneCb: data: ) 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 callsdone_cbfrom a signal handler for theresponsesignal of the dialog.Declaration
Swift
@inlinable func printRunPageSetupDialogAsync<PageSetupT, WindowT>(parent: WindowT?, pageSetup: PageSetupT?, doneCb: GtkPageSetupDoneFunc?, data: gpointer! = nil) where PageSetupT : PageSetupProtocol, WindowT : WindowProtocol -
collateExtension methodGets the value of
GTK_PRINT_SETTINGS_COLLATE.Declaration
Swift
@inlinable var collate: Bool { get nonmutating set } -
defaultSourceExtension methodGets the value of
GTK_PRINT_SETTINGS_DEFAULT_SOURCE.Declaration
Swift
@inlinable var defaultSource: String! { get nonmutating set } -
ditherExtension methodGets the value of
GTK_PRINT_SETTINGS_DITHER.Declaration
Swift
@inlinable var dither: String! { get nonmutating set } -
duplexExtension methodGets the value of
GTK_PRINT_SETTINGS_DUPLEX.Declaration
Swift
@inlinable var duplex: GtkPrintDuplex { get nonmutating set } -
finishingsExtension methodGets the value of
GTK_PRINT_SETTINGS_FINISHINGS.Declaration
Swift
@inlinable var finishings: String! { get nonmutating set } -
mediaTypeExtension methodGets 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 } -
nCopiesExtension methodGets the value of
GTK_PRINT_SETTINGS_N_COPIES.Declaration
Swift
@inlinable var nCopies: Int { get nonmutating set } -
numberUpExtension methodGets the value of
GTK_PRINT_SETTINGS_NUMBER_UP.Declaration
Swift
@inlinable var numberUp: Int { get nonmutating set } -
numberUpLayoutExtension methodGets the value of
GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.Declaration
Swift
@inlinable var numberUpLayout: GtkNumberUpLayout { get nonmutating set } -
orientationExtension methodGet the value of
GTK_PRINT_SETTINGS_ORIENTATION, converted to aGtkPageOrientation.Declaration
Swift
@inlinable var orientation: GtkPageOrientation { get nonmutating set } -
outputBinExtension methodGets the value of
GTK_PRINT_SETTINGS_OUTPUT_BIN.Declaration
Swift
@inlinable var outputBin: String! { get nonmutating set } -
pageSetExtension methodGets the value of
GTK_PRINT_SETTINGS_PAGE_SET.Declaration
Swift
@inlinable var pageSet: GtkPageSet { get nonmutating set } -
paperSizeExtension methodGets the value of
GTK_PRINT_SETTINGS_PAPER_FORMAT, converted to aGtkPaperSize.Declaration
Swift
@inlinable var paperSize: PaperSizeRef! { get nonmutating set } -
printPagesExtension methodGets the value of
GTK_PRINT_SETTINGS_PRINT_PAGES.Declaration
Swift
@inlinable var printPages: GtkPrintPages { get nonmutating set } -
printerExtension methodConvenience function to obtain the value of
GTK_PRINT_SETTINGS_PRINTER.Declaration
Swift
@inlinable var printer: String! { get nonmutating set } -
printerLpiExtension methodGets the value of
GTK_PRINT_SETTINGS_PRINTER_LPI.Declaration
Swift
@inlinable var printerLpi: CDouble { get nonmutating set } -
qualityExtension methodGets the value of
GTK_PRINT_SETTINGS_QUALITY.Declaration
Swift
@inlinable var quality: GtkPrintQuality { get nonmutating set } -
resolutionExtension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION.Declaration
Swift
@inlinable var resolution: Int { get nonmutating set } -
resolutionXExtension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION_X.Declaration
Swift
@inlinable var resolutionX: Int { get } -
resolutionYExtension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION_Y.Declaration
Swift
@inlinable var resolutionY: Int { get } -
reverseExtension methodGets the value of
GTK_PRINT_SETTINGS_REVERSE.Declaration
Swift
@inlinable var reverse: Bool { get nonmutating set } -
scaleExtension methodGets the value of
GTK_PRINT_SETTINGS_SCALE.Declaration
Swift
@inlinable var scale: CDouble { get nonmutating set } -
useColorExtension methodGets the value of
GTK_PRINT_SETTINGS_USE_COLOR.Declaration
Swift
@inlinable var useColor: Bool { get nonmutating set }
View on GitHub
Install in Dash
PrintSettingsProtocol Protocol Reference