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.
-
Untyped pointer to the underlying
GtkPrintSettings
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
print_settings_ptr
Default implementationTyped 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)
-
copy()
Extension methodCopies a
GtkPrintSettings
object.Declaration
Swift
@inlinable func copy() -> PrintSettingsRef!
-
foreach(func:
Extension methoduserData: ) Calls
func
for 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<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 stringfalse
.Declaration
Swift
@inlinable func getBool(key: UnsafePointer<gchar>!) -> 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<gchar>!) -> Double
-
getDoubleWithDefault(key:
Extension methoddef: ) Returns the floating point number represented by the value that is associated with
key
, ordefault_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 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<gchar>!) -> 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<gchar>!, def: Int) -> Int
-
getLength(key:
Extension methodunit: ) Returns the value associated with
key
, interpreted as a length. The returned value is converted tounits
.Declaration
Swift
@inlinable func getLength(key: UnsafePointer<gchar>!, unit: GtkUnit) -> Double
-
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) -> Double
-
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) -> Double
-
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() -> Double
-
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() -> Double
-
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<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 aGFileError
orGKeyFileError
. Seegtk_print_settings_to_file()
.Declaration
Swift
@inlinable func loadFile(fileName: UnsafePointer<gchar>!) throws -> Bool
-
load(keyFile:
Extension methodgroupName: ) Reads the print settings from the group
group_name
inkey_file
. If the file could not be loaded then error is set to either aGFileError
orGKeyFileError
.Declaration
Swift
@inlinable func load<KeyFileT>(keyFile: KeyFileT, groupName: UnsafePointer<gchar>? = nil) throws -> Bool where KeyFileT : KeyFileProtocol
-
set(key:
Extension methodvalue: ) Associates
value
withkey
.Declaration
Swift
@inlinable func set(key: UnsafePointer<gchar>!, value: UnsafePointer<gchar>? = nil)
-
setBool(key:
Extension methodvalue: ) 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:
Extension methodvalue: ) 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:
Extension methodvalue: ) Sets
key
to an integer value.Declaration
Swift
@inlinable func setInt(key: UnsafePointer<gchar>!, value: Int)
-
setLength(key:
Extension methodvalue: unit: ) Associates a length in units of
unit
withkey
.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:
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: Double, unit: GtkUnit)
-
set(paperSize:
Extension method) Sets the value of
GTK_PRINT_SETTINGS_PAPER_FORMAT
,GTK_PRINT_SETTINGS_PAPER_WIDTH
andGTK_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: 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
toprinter
.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
andGTK_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_X
andGTK_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
tofile_name
. If the file could not be loaded then error is set to either aGFileError
orGKeyFileError
.Declaration
Swift
@inlinable func toFile(fileName: UnsafePointer<gchar>!) 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
settings
tokey_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 tonil
.Declaration
Swift
@inlinable func unset(key: UnsafePointer<gchar>!)
-
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 returnedGtkPageSetup
is 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 returnedGtkPageSetup
is 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_cb
from a signal handler for theresponse
signal 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_cb
from a signal handler for theresponse
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 methodGets the value of
GTK_PRINT_SETTINGS_COLLATE
.Declaration
Swift
@inlinable var collate: Bool { get nonmutating set }
-
defaultSource
Extension methodGets the value of
GTK_PRINT_SETTINGS_DEFAULT_SOURCE
.Declaration
Swift
@inlinable var defaultSource: String! { get nonmutating set }
-
dither
Extension methodGets the value of
GTK_PRINT_SETTINGS_DITHER
.Declaration
Swift
@inlinable var dither: String! { get nonmutating set }
-
duplex
Extension methodGets the value of
GTK_PRINT_SETTINGS_DUPLEX
.Declaration
Swift
@inlinable var duplex: GtkPrintDuplex { get nonmutating set }
-
finishings
Extension methodGets the value of
GTK_PRINT_SETTINGS_FINISHINGS
.Declaration
Swift
@inlinable var finishings: String! { get nonmutating set }
-
mediaType
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 var mediaType: String! { get nonmutating set }
-
nCopies
Extension methodGets the value of
GTK_PRINT_SETTINGS_N_COPIES
.Declaration
Swift
@inlinable var nCopies: Int { get nonmutating set }
-
numberUp
Extension methodGets the value of
GTK_PRINT_SETTINGS_NUMBER_UP
.Declaration
Swift
@inlinable var numberUp: Int { get nonmutating set }
-
numberUpLayout
Extension methodGets the value of
GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT
.Declaration
Swift
@inlinable var numberUpLayout: GtkNumberUpLayout { get nonmutating set }
-
orientation
Extension methodGet the value of
GTK_PRINT_SETTINGS_ORIENTATION
, converted to aGtkPageOrientation
.Declaration
Swift
@inlinable var orientation: GtkPageOrientation { get nonmutating set }
-
outputBin
Extension methodGets the value of
GTK_PRINT_SETTINGS_OUTPUT_BIN
.Declaration
Swift
@inlinable var outputBin: String! { get nonmutating set }
-
pageSet
Extension methodGets the value of
GTK_PRINT_SETTINGS_PAGE_SET
.Declaration
Swift
@inlinable var pageSet: GtkPageSet { get nonmutating set }
-
paperSize
Extension methodGets the value of
GTK_PRINT_SETTINGS_PAPER_FORMAT
, converted to aGtkPaperSize
.Declaration
Swift
@inlinable var paperSize: PaperSizeRef! { get nonmutating set }
-
printPages
Extension methodGets the value of
GTK_PRINT_SETTINGS_PRINT_PAGES
.Declaration
Swift
@inlinable var printPages: GtkPrintPages { get nonmutating set }
-
printer
Extension methodConvenience function to obtain the value of
GTK_PRINT_SETTINGS_PRINTER
.Declaration
Swift
@inlinable var printer: String! { get nonmutating set }
-
printerLpi
Extension methodGets the value of
GTK_PRINT_SETTINGS_PRINTER_LPI
.Declaration
Swift
@inlinable var printerLpi: Double { get nonmutating set }
-
quality
Extension methodGets the value of
GTK_PRINT_SETTINGS_QUALITY
.Declaration
Swift
@inlinable var quality: GtkPrintQuality { get nonmutating set }
-
resolution
Extension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION
.Declaration
Swift
@inlinable var resolution: Int { get nonmutating set }
-
resolutionX
Extension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION_X
.Declaration
Swift
@inlinable var resolutionX: Int { get }
-
resolutionY
Extension methodGets the value of
GTK_PRINT_SETTINGS_RESOLUTION_Y
.Declaration
Swift
@inlinable var resolutionY: Int { get }
-
reverse
Extension methodGets the value of
GTK_PRINT_SETTINGS_REVERSE
.Declaration
Swift
@inlinable var reverse: Bool { get nonmutating set }
-
scale
Extension methodGets the value of
GTK_PRINT_SETTINGS_SCALE
.Declaration
Swift
@inlinable var scale: Double { get nonmutating set }
-
useColor
Extension methodGets the value of
GTK_PRINT_SETTINGS_USE_COLOR
.Declaration
Swift
@inlinable var useColor: Bool { get nonmutating set }