gtk.print_settings

Module for [PrintSettings] class

Types 3

A gtk.print_settings.PrintSettings 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.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
PrintSettings self() nothrowReturns `this`, for use in `with` statements.
PrintSettingsGidBuilder builder() static nothrowGet builder for [gtk.print_settings.PrintSettings] Returns: New builder object
gtk.print_settings.PrintSettings newFromFile(string fileName) staticReads the print settings from file_name.
gtk.print_settings.PrintSettings newFromGvariant(glib.variant.Variant variant) static nothrowDeserialize print settings from an a{sv} variant.
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.
gtk.print_settings.PrintSettings copy() nothrowCopies a [gtk.print_settings.PrintSettings] object. Returns: a newly allocated copy of other
void foreach_(gtk.types.PrintSettingsFunc func) nothrowCalls func for each key-value pair of settings.
string get(string key) nothrowLooks up the string value associated with key.
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 pages
string getDefaultSource() nothrowGets the value of [gtk.types.PRINT_SETTINGS_DEFAULT_SOURCE]. Returns: the default source
string getDither() nothrowGets the value of [gtk.types.PRINT_SETTINGS_DITHER]. Returns: the dithering that is used
double getDouble(string key) nothrowReturns the double value associated with key, or 0.
double 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 finishings
int getInt(string key) nothrowReturns the integer value of key, or 0.
int 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.
string getMediaType() nothrowGets the value of [gtk.types.PRINT_SETTINGS_MEDIA_TYPE].
int getNCopies() nothrowGets the value of [gtk.types.PRINT_SETTINGS_N_COPIES]. Returns: the number of copies to print
int getNumberUp() nothrowGets the value of [gtk.types.PRINT_SETTINGS_NUMBER_UP]. Returns: the number of pages per sheet
gtk.types.NumberUpLayout getNumberUpLayout() nothrowGets the value of [gtk.types.PRINT_SETTINGS_NUMBER_UP_LAYOUT]. Returns: layout of page in number-up mode
gtk.types.PageOrientation getOrientation() nothrowGet the value of [gtk.types.PRINT_SETTINGS_ORIENTATION], converted to a [gtk.types.PageOrientation]. Returns: the orientation
string getOutputBin() nothrowGets the value of [gtk.types.PRINT_SETTINGS_OUTPUT_BIN]. Returns: the output bin
gtk.types.PageRange[] getPageRanges() nothrowGets the value of [gtk.types.PRINT_SETTINGS_PAGE_RANGES]. Returns: an array of [gtk.types.PageRange]s. 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 print
double 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 [gtk.paper_size.PaperSize]. Returns: the paper size
double 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 print
string getPrinter() nothrowConvenience function to obtain the value of [gtk.types.PRINT_SETTINGS_PRINTER]. Returns: the printer name
double 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 quality
int getResolution() nothrowGets the value of [gtk.types.PRINT_SETTINGS_RESOLUTION]. Returns: the resolution in dpi
int getResolutionX() nothrowGets the value of [gtk.types.PRINT_SETTINGS_RESOLUTION_X]. Returns: the horizontal resolution in dpi
int getResolutionY() nothrowGets the value of [gtk.types.PRINT_SETTINGS_RESOLUTION_Y]. Returns: the vertical resolution in dpi
bool getReverse() nothrowGets the value of [gtk.types.PRINT_SETTINGS_REVERSE]. Returns: whether to reverse the order of the printed pages
double getScale() nothrowGets the value of [gtk.types.PRINT_SETTINGS_SCALE]. Returns: the scale in percent
bool getUseColor() nothrowGets the value of [gtk.types.PRINT_SETTINGS_USE_COLOR]. Returns: whether to use color
bool hasKey(string key) nothrowReturns true, if a value is associated with key.
bool loadFile(string fileName)Reads the print settings from file_name.
bool loadKeyFile(glib.key_file.KeyFile keyFile, string groupName = null)Reads the print settings from the group group_name in key_file.
void set(string key, string value = null) nothrowAssociates value with key.
void setBool(string key, bool value) nothrowSets key to a boolean value.
void setCollate(bool collate) nothrowSets the value of [gtk.types.PRINT_SETTINGS_COLLATE].
void setDefaultSource(string defaultSource) nothrowSets the value of [gtk.types.PRINT_SETTINGS_DEFAULT_SOURCE].
void setDither(string dither) nothrowSets the value of [gtk.types.PRINT_SETTINGS_DITHER].
void setDouble(string key, double value) nothrowSets key to a double value.
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 setInt(string key, int value) nothrowSets key to an integer value.
void setLength(string key, double value, gtk.types.Unit unit) nothrowAssociates a length in units of unit with key.
void setMediaType(string mediaType) nothrowSets the value of [gtk.types.PRINT_SETTINGS_MEDIA_TYPE].
void setNCopies(int numCopies) nothrowSets the value of [gtk.types.PRINT_SETTINGS_N_COPIES].
void setNumberUp(int numberUp) nothrowSets the value of [gtk.types.PRINT_SETTINGS_NUMBER_UP].
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 setOutputBin(string outputBin) nothrowSets the value of [gtk.types.PRINT_SETTINGS_OUTPUT_BIN].
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 setPrinterLpi(double lpi) nothrowSets the value of [gtk.types.PRINT_SETTINGS_PRINTER_LPI].
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].
void setReverse(bool reverse) nothrowSets the value of [gtk.types.PRINT_SETTINGS_REVERSE].
void setScale(double scale) nothrowSets the value of [gtk.types.PRINT_SETTINGS_SCALE].
void setUseColor(bool useColor) nothrowSets the value of [gtk.types.PRINT_SETTINGS_USE_COLOR].
bool toFile(string fileName)This function saves the print settings from settings to file_name.
glib.variant.Variant toGvariant() nothrowSerialize print settings to an a{sv} variant. Returns: a new, floating, [glib.variant.Variant]
void 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.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [gtk.print_settings.PrintSettings] object. Returns: a new [gtk.print_settings.PrintSettings] object
Methods
PrintSettings build() nothrowCreate object from builder. Returns: New object