gtk.print_settings
Module for [PrintSettings] class
Types 3
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.
PrintSettingsGidBuilder builder() static nothrowGet builder for [gtk.print_settings.PrintSettings] Returns: New builder objectgtk.print_settings.PrintSettings newFromFile(string fileName) staticReads the print settings from file_name. Returns a new #GtkPrintSettings object with the restored settings, or null if an error occurred. If the file could not be loaded then error is set to either...gtk.print_settings.PrintSettings newFromGvariant(glib.variant.Variant variant) static nothrowDeserialize print settings from an a{sv} variant in the format produced by [gtk.print_settings.PrintSettings.toGvariant].gtk.print_settings.PrintSettings newFromKeyFile(glib.key_file.KeyFile keyFile, string groupName = null) staticReads the print settings from the group group_name in key_file. Returns a new #GtkPrintSettings object with the restored settings, or null if an error occurred. If the file could not be loaded the...gtk.print_settings.PrintSettings copy() nothrowCopies a #GtkPrintSettings object. Returns: a newly allocated copy of othervoid foreach_(gtk.types.PrintSettingsFunc func) nothrowCalls func for each key-value pair of settings.bool getBool(string key) nothrowReturns the boolean represented by the value that is associated with key.bool getCollate() nothrowGets the value of [gtk.types.PRINT_SETTINGS_COLLATE]. Returns: whether to collate the printed pagesstring getDefaultSource() nothrowGets the value of [gtk.types.PRINT_SETTINGS_DEFAULT_SOURCE]. Returns: the default sourcestring getDither() nothrowGets the value of [gtk.types.PRINT_SETTINGS_DITHER]. Returns: the dithering that is useddouble getDoubleWithDefault(string key, double def) nothrowReturns 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.gtk.types.PrintDuplex getDuplex() nothrowGets the value of [gtk.types.PRINT_SETTINGS_DUPLEX]. Returns: whether to print the output in duplex.string getFinishings() nothrowGets the value of [gtk.types.PRINT_SETTINGS_FINISHINGS]. Returns: the finishingsint getIntWithDefault(string key, int def) nothrowReturns the value of key, interpreted as an integer, or the default value.double getLength(string key, gtk.types.Unit unit) nothrowReturns the value associated with key, interpreted as a length. The returned value is converted to units.int getNCopies() nothrowGets the value of [gtk.types.PRINT_SETTINGS_N_COPIES]. Returns: the number of copies to printint getNumberUp() nothrowGets the value of [gtk.types.PRINT_SETTINGS_NUMBER_UP]. Returns: the number of pages per sheetgtk.types.NumberUpLayout getNumberUpLayout() nothrowGets the value of [gtk.types.PRINT_SETTINGS_NUMBER_UP_LAYOUT]. Returns: layout of page in number-up modegtk.types.PageOrientation getOrientation() nothrowGet the value of [gtk.types.PRINT_SETTINGS_ORIENTATION], converted to a #GtkPageOrientation. Returns: the orientationstring getOutputBin() nothrowGets the value of [gtk.types.PRINT_SETTINGS_OUTPUT_BIN]. Returns: the output bingtk.types.PageRange[] getPageRanges() nothrowGets the value of [gtk.types.PRINT_SETTINGS_PAGE_RANGES]. Returns: an array of #GtkPageRanges. Use [glib.global.gfree] to free the array when it is no longer needed.gtk.types.PageSet getPageSet() nothrowGets the value of [gtk.types.PRINT_SETTINGS_PAGE_SET]. Returns: the set of pages to printdouble getPaperHeight(gtk.types.Unit unit) nothrowGets the value of [gtk.types.PRINT_SETTINGS_PAPER_HEIGHT], converted to unit.gtk.paper_size.PaperSize getPaperSize() nothrowGets the value of [gtk.types.PRINT_SETTINGS_PAPER_FORMAT], converted to a #GtkPaperSize. Returns: the paper sizedouble getPaperWidth(gtk.types.Unit unit) nothrowGets the value of [gtk.types.PRINT_SETTINGS_PAPER_WIDTH], converted to unit.gtk.types.PrintPages getPrintPages() nothrowGets the value of [gtk.types.PRINT_SETTINGS_PRINT_PAGES]. Returns: which pages to printstring getPrinter() nothrowConvenience function to obtain the value of [gtk.types.PRINT_SETTINGS_PRINTER]. Returns: the printer namedouble getPrinterLpi() nothrowGets the value of [gtk.types.PRINT_SETTINGS_PRINTER_LPI]. Returns: the resolution in lpi (lines per inch)gtk.types.PrintQuality getQuality() nothrowGets the value of [gtk.types.PRINT_SETTINGS_QUALITY]. Returns: the print qualityint getResolution() nothrowGets the value of [gtk.types.PRINT_SETTINGS_RESOLUTION]. Returns: the resolution in dpiint getResolutionX() nothrowGets the value of [gtk.types.PRINT_SETTINGS_RESOLUTION_X]. Returns: the horizontal resolution in dpiint getResolutionY() nothrowGets the value of [gtk.types.PRINT_SETTINGS_RESOLUTION_Y]. Returns: the vertical resolution in dpibool getReverse() nothrowGets the value of [gtk.types.PRINT_SETTINGS_REVERSE]. Returns: whether to reverse the order of the printed pagesdouble getScale() nothrowGets the value of [gtk.types.PRINT_SETTINGS_SCALE]. Returns: the scale in percentbool getUseColor() nothrowGets the value of [gtk.types.PRINT_SETTINGS_USE_COLOR]. Returns: whether to use colorbool loadFile(string fileName)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.PrintSettings.toFile].bool loadKeyFile(glib.key_file.KeyFile keyFile, string groupName = null)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.void setDefaultSource(string defaultSource) nothrowSets the value of [gtk.types.PRINT_SETTINGS_DEFAULT_SOURCE].void setDuplex(gtk.types.PrintDuplex duplex) nothrowSets the value of [gtk.types.PRINT_SETTINGS_DUPLEX].void setFinishings(string finishings) nothrowSets the value of [gtk.types.PRINT_SETTINGS_FINISHINGS].void setLength(string key, double value, gtk.types.Unit unit) nothrowAssociates a length in units of unit with key.void setNumberUpLayout(gtk.types.NumberUpLayout numberUpLayout) nothrowSets the value of [gtk.types.PRINT_SETTINGS_NUMBER_UP_LAYOUT].void setOrientation(gtk.types.PageOrientation orientation) nothrowSets the value of [gtk.types.PRINT_SETTINGS_ORIENTATION].void setPageRanges(gtk.types.PageRange[] pageRanges) nothrowSets the value of [gtk.types.PRINT_SETTINGS_PAGE_RANGES].void setPageSet(gtk.types.PageSet pageSet) nothrowSets the value of [gtk.types.PRINT_SETTINGS_PAGE_SET].void setPaperHeight(double height, gtk.types.Unit unit) nothrowSets the value of [gtk.types.PRINT_SETTINGS_PAPER_HEIGHT].void setPaperSize(gtk.paper_size.PaperSize paperSize) nothrowSets the value of [gtk.types.PRINT_SETTINGS_PAPER_FORMAT], [gtk.types.PRINT_SETTINGS_PAPER_WIDTH] and [gtk.types.PRINT_SETTINGS_PAPER_HEIGHT].void setPaperWidth(double width, gtk.types.Unit unit) nothrowSets the value of [gtk.types.PRINT_SETTINGS_PAPER_WIDTH].void setPrintPages(gtk.types.PrintPages pages) nothrowSets the value of [gtk.types.PRINT_SETTINGS_PRINT_PAGES].void setPrinter(string printer) nothrowConvenience function to set [gtk.types.PRINT_SETTINGS_PRINTER] to printer.void setQuality(gtk.types.PrintQuality quality) nothrowSets the value of [gtk.types.PRINT_SETTINGS_QUALITY].void setResolution(int resolution) nothrowSets the values of [gtk.types.PRINT_SETTINGS_RESOLUTION], [gtk.types.PRINT_SETTINGS_RESOLUTION_X] and [gtk.types.PRINT_SETTINGS_RESOLUTION_Y].void setResolutionXy(int resolutionX, int resolutionY) nothrowSets the values of [gtk.types.PRINT_SETTINGS_RESOLUTION], [gtk.types.PRINT_SETTINGS_RESOLUTION_X] and [gtk.types.PRINT_SETTINGS_RESOLUTION_Y].bool toFile(string fileName)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.glib.variant.Variant toGvariant() nothrowSerialize print settings to an a{sv} variant. Returns: a new, floating, #GVariantvoid toKeyFile(glib.key_file.KeyFile keyFile, string groupName = null) nothrowThis function adds the print settings from settings to key_file.void unset(string key) nothrowRemoves any value associated with key. This has the same effect as setting the value to null.Fluent builder implementation template for gtk.print_settings.PrintSettings
Fluent builder for gtk.print_settings.PrintSettings