Class: Gtk::PrintSettings
- Inherits:
-
Object
- Object
- Gtk::PrintSettings
- Extended by:
- GLib::Deprecatable
- Defined in:
- lib/gtk3/deprecated.rb
Overview
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.
Instance Method Summary collapse
-
#collate ⇒ Boolean
Gets the value of %GTK_PRINT_SETTINGS_COLLATE.
-
#collate=(collate) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_COLLATE.
-
#copy ⇒ Gtk::PrintSettings
Copies a
GtkPrintSettingsobject. -
#default_source ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
-
#default_source=(default_source) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
-
#dither ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_DITHER.
-
#dither=(dither) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_DITHER.
-
#duplex ⇒ Gtk::PrintDuplex
Gets the value of %GTK_PRINT_SETTINGS_DUPLEX.
-
#duplex=(duplex) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_DUPLEX.
-
#finishings ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
-
#finishings=(finishings) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
-
#foreach(func, user_data) ⇒ nil
Calls func for each key-value pair of settings.
-
#get(key) ⇒ String
Looks up the string value associated with key.
-
#get_bool(key) ⇒ Boolean
Returns the boolean represented by the value that is associated with key.
-
#get_double(key) ⇒ Float
Returns the double value associated with key, or 0.
-
#get_double_with_default(key, def) ⇒ Float
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.
-
#get_int(key) ⇒ Integer
Returns the integer value of key, or 0.
-
#get_int_with_default(key, def) ⇒ Integer
Returns the value of key, interpreted as an integer, or the default value.
-
#get_length(key, unit) ⇒ Float
Returns the value associated with key, interpreted as a length.
-
#get_page_ranges(num_ranges) ⇒ Array<Gtk::PageRange>
Gets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
-
#get_paper_height(unit) ⇒ Float
Gets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT, converted to unit.
-
#get_paper_width(unit) ⇒ Float
Gets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH, converted to unit.
-
#has_key(key) ⇒ Boolean
Returns true, if a value is associated with key.
-
#initialize(key_file, group_name) ⇒ Gtk::PrintSettings
constructor
Reads the print settings from the group group_name in key_file.
-
#load_file(file_name) ⇒ Boolean
Reads the print settings from file_name.
-
#load_key_file(key_file, group_name) ⇒ Boolean
Reads the print settings from the group group_name in key_file.
-
#media_type ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
-
#media_type=(media_type) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
-
#n_copies ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.
-
#n_copies=(num_copies) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.
-
#number_up ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
-
#number_up=(number_up) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
-
#number_up_layout ⇒ Gtk::NumberUpLayout
Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
-
#number_up_layout=(number_up_layout) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
-
#orientation ⇒ Gtk::PageOrientation
Get the value of %GTK_PRINT_SETTINGS_ORIENTATION, converted to a
GtkPageOrientation. -
#orientation=(orientation) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_ORIENTATION.
-
#output_bin ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
-
#output_bin=(output_bin) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
-
#page_set ⇒ Gtk::PageSet
Gets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
-
#page_set=(page_set) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
-
#paper_size ⇒ Gtk::PaperSize
Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT, converted to a
GtkPaperSize. -
#paper_size=(paper_size) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT, %GTK_PRINT_SETTINGS_PAPER_WIDTH and %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
-
#print_pages ⇒ Gtk::PrintPages
Gets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
-
#print_pages=(pages) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
-
#printer ⇒ String
Convenience function to obtain the value of %GTK_PRINT_SETTINGS_PRINTER.
-
#printer=(printer) ⇒ nil
Convenience function to set %GTK_PRINT_SETTINGS_PRINTER to printer.
-
#printer_lpi ⇒ Float
Gets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
-
#printer_lpi=(lpi) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
-
#quality ⇒ Gtk::PrintQuality
Gets the value of %GTK_PRINT_SETTINGS_QUALITY.
-
#quality=(quality) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_QUALITY.
-
#resolution ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION.
-
#resolution=(resolution) ⇒ nil
Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION, %GTK_PRINT_SETTINGS_RESOLUTION_X and %GTK_PRINT_SETTINGS_RESOLUTION_Y.
-
#resolution_x ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_X.
-
#resolution_y ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_Y.
-
#reverse ⇒ Boolean
Gets the value of %GTK_PRINT_SETTINGS_REVERSE.
-
#reverse=(reverse) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_REVERSE.
-
#scale ⇒ Float
Gets the value of %GTK_PRINT_SETTINGS_SCALE.
-
#scale=(scale) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_SCALE.
-
#set(key, value) ⇒ nil
Associates value with key.
-
#set_bool(key, value) ⇒ nil
Sets key to a boolean value.
-
#set_double(key, value) ⇒ nil
Sets key to a double value.
-
#set_int(key, value) ⇒ nil
Sets key to an integer value.
-
#set_length(key, value, unit) ⇒ nil
Associates a length in units of unit with key.
-
#set_page_ranges(page_ranges, num_ranges) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
-
#set_paper_height(height, unit) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
-
#set_paper_width(width, unit) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH.
-
#set_resolution_xy(resolution_x, resolution_y) ⇒ nil
Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION, %GTK_PRINT_SETTINGS_RESOLUTION_X and %GTK_PRINT_SETTINGS_RESOLUTION_Y.
-
#to_file(file_name) ⇒ Boolean
This function saves the print settings from settings to file_name.
-
#to_gvariant ⇒ GLib::Variant
Serialize print settings to an asv variant.
-
#to_key_file(key_file, group_name) ⇒ nil
This function adds the print settings from settings to key_file.
-
#unset(key) ⇒ nil
Removes any value associated with key.
-
#use_color ⇒ Boolean
Gets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
-
#use_color=(use_color) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
Constructor Details
#initialize(key_file, group_name) ⇒ Gtk::PrintSettings
Reads the print settings from the group group_name in key_file.
Returns a new GtkPrintSettings object with the restored settings,
or nil if an error occurred. If the file could not be loaded then
error is set to either GFileError or GKeyFileError.
Instance Method Details
#collate ⇒ Boolean
Gets the value of %GTK_PRINT_SETTINGS_COLLATE.
#collate=(collate) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_COLLATE.
#copy ⇒ Gtk::PrintSettings
Copies a GtkPrintSettings object.
#default_source ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
#default_source=(default_source) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
#dither ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_DITHER.
#dither=(dither) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_DITHER.
#duplex ⇒ Gtk::PrintDuplex
Gets the value of %GTK_PRINT_SETTINGS_DUPLEX.
#duplex=(duplex) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_DUPLEX.
#finishings ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
#finishings=(finishings) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
#foreach(func, user_data) ⇒ nil
Calls func for each key-value pair of settings.
#get(key) ⇒ String
Looks up the string value associated with key.
#get_bool(key) ⇒ Boolean
Returns the boolean represented by the value that is associated with key.
The string “true” represents true, any other string false.
#get_double(key) ⇒ Float
Returns the double value associated with key, or 0.
#get_double_with_default(key, def) ⇒ Float
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().
#get_int(key) ⇒ Integer
Returns the integer value of key, or 0.
#get_int_with_default(key, def) ⇒ Integer
Returns the value of key, interpreted as an integer, or the default value.
#get_length(key, unit) ⇒ Float
Returns the value associated with key, interpreted as a length.
The returned value is converted to units.
#get_page_ranges(num_ranges) ⇒ Array<Gtk::PageRange>
Gets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
#get_paper_height(unit) ⇒ Float
Gets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT, converted to unit.
#get_paper_width(unit) ⇒ Float
Gets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH, converted to unit.
#has_key(key) ⇒ Boolean
Returns true, if a value is associated with key.
#load_file(file_name) ⇒ Boolean
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 [methodGtk.PrintSettings.to_file].
#load_key_file(key_file, group_name) ⇒ Boolean
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.
#media_type ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
The set of media types is defined in PWG 5101.1-2002 PWG.
#media_type=(media_type) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
The set of media types is defined in PWG 5101.1-2002 PWG.
#n_copies ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.
#n_copies=(num_copies) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.
#number_up ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
#number_up=(number_up) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
#number_up_layout ⇒ Gtk::NumberUpLayout
Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
#number_up_layout=(number_up_layout) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
#orientation ⇒ Gtk::PageOrientation
Get the value of %GTK_PRINT_SETTINGS_ORIENTATION,
converted to a GtkPageOrientation.
#orientation=(orientation) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_ORIENTATION.
#output_bin ⇒ String
Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
#output_bin=(output_bin) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
#page_set ⇒ Gtk::PageSet
Gets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
#page_set=(page_set) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
#paper_size ⇒ Gtk::PaperSize
Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
converted to a GtkPaperSize.
#paper_size=(paper_size) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT, %GTK_PRINT_SETTINGS_PAPER_WIDTH and %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
#print_pages ⇒ Gtk::PrintPages
Gets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
#print_pages=(pages) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
#printer ⇒ String
Convenience function to obtain the value of %GTK_PRINT_SETTINGS_PRINTER.
#printer=(printer) ⇒ nil
Convenience function to set %GTK_PRINT_SETTINGS_PRINTER to printer.
#printer_lpi ⇒ Float
Gets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
#printer_lpi=(lpi) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
#quality ⇒ Gtk::PrintQuality
Gets the value of %GTK_PRINT_SETTINGS_QUALITY.
#quality=(quality) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_QUALITY.
#resolution ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION.
#resolution=(resolution) ⇒ nil
Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION, %GTK_PRINT_SETTINGS_RESOLUTION_X and %GTK_PRINT_SETTINGS_RESOLUTION_Y.
#resolution_x ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_X.
#resolution_y ⇒ Integer
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_Y.
#reverse ⇒ Boolean
Gets the value of %GTK_PRINT_SETTINGS_REVERSE.
#reverse=(reverse) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_REVERSE.
#scale ⇒ Float
Gets the value of %GTK_PRINT_SETTINGS_SCALE.
#scale=(scale) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_SCALE.
#set(key, value) ⇒ nil
Associates value with key.
#set_bool(key, value) ⇒ nil
Sets key to a boolean value.
#set_double(key, value) ⇒ nil
Sets key to a double value.
#set_int(key, value) ⇒ nil
Sets key to an integer value.
#set_length(key, value, unit) ⇒ nil
Associates a length in units of unit with key.
#set_page_ranges(page_ranges, num_ranges) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
#set_paper_height(height, unit) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
#set_paper_width(width, unit) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH.
#set_resolution_xy(resolution_x, resolution_y) ⇒ nil
Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION, %GTK_PRINT_SETTINGS_RESOLUTION_X and %GTK_PRINT_SETTINGS_RESOLUTION_Y.
#to_file(file_name) ⇒ Boolean
This function saves the print settings from settings to file_name.
If the file could not be written then error is set to either a
GFileError or GKeyFileError.
#to_gvariant ⇒ GLib::Variant
Serialize print settings to an asv variant.
#to_key_file(key_file, group_name) ⇒ nil
This function adds the print settings from settings to key_file.
#unset(key) ⇒ nil
Removes any value associated with key.
This has the same effect as setting the value to nil.
#use_color ⇒ Boolean
Gets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
#use_color=(use_color) ⇒ nil
Sets the value of %GTK_PRINT_SETTINGS_USE_COLOR.