Class
GtkPrintSettings
Description [src]
final class Gtk.PrintSettings : GObject.Object {
/* No available fields */
}
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.
Constructors
gtk_print_settings_new_from_file
Reads 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 a GFileError
or
GKeyFileError
. See gtk_print_settings_to_file().
Available since: 2.12
gtk_print_settings_new_from_gvariant
Deserialize print settings from an a{sv} variant in the format produced by gtk_print_settings_to_gvariant().
Available since: 3.22
gtk_print_settings_new_from_key_file
Reads 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 then error is set to either
a GFileError
or GKeyFileError
.
Available since: 2.12
Instance methods
gtk_print_settings_get_bool
Returns the boolean represented by the value
that is associated with key
.
Available since: 2.10
gtk_print_settings_get_default_source
Gets the value of GTK_PRINT_SETTINGS_DEFAULT_SOURCE
.
Available since: 2.10
gtk_print_settings_get_double
Returns the double value associated with key
, or 0.
Available since: 2.10
gtk_print_settings_get_double_with_default
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.
Available since: 2.10
gtk_print_settings_get_finishings
Gets the value of GTK_PRINT_SETTINGS_FINISHINGS
.
Available since: 2.10
gtk_print_settings_get_int_with_default
Returns the value of key
, interpreted as
an integer, or the default value.
Available since: 2.10
gtk_print_settings_get_length
Returns the value associated with key
, interpreted
as a length. The returned value is converted to units
.
Available since: 2.10
gtk_print_settings_get_media_type
Gets the value of GTK_PRINT_SETTINGS_MEDIA_TYPE
.
Available since: 2.10
gtk_print_settings_get_n_copies
Gets the value of GTK_PRINT_SETTINGS_N_COPIES
.
Available since: 2.10
gtk_print_settings_get_number_up
Gets the value of GTK_PRINT_SETTINGS_NUMBER_UP
.
Available since: 2.10
gtk_print_settings_get_number_up_layout
Gets the value of GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT
.
Available since: 2.14
gtk_print_settings_get_orientation
Get the value of GTK_PRINT_SETTINGS_ORIENTATION
,
converted to a GtkPageOrientation
.
Available since: 2.10
gtk_print_settings_get_output_bin
Gets the value of GTK_PRINT_SETTINGS_OUTPUT_BIN
.
Available since: 2.10
gtk_print_settings_get_page_ranges
Gets the value of GTK_PRINT_SETTINGS_PAGE_RANGES
.
Available since: 2.10
gtk_print_settings_get_page_set
Gets the value of GTK_PRINT_SETTINGS_PAGE_SET
.
Available since: 2.10
gtk_print_settings_get_paper_height
Gets the value of GTK_PRINT_SETTINGS_PAPER_HEIGHT
,
converted to unit
.
Available since: 2.10
gtk_print_settings_get_paper_size
Gets the value of GTK_PRINT_SETTINGS_PAPER_FORMAT
,
converted to a GtkPaperSize
.
Available since: 2.10
gtk_print_settings_get_paper_width
Gets the value of GTK_PRINT_SETTINGS_PAPER_WIDTH
,
converted to unit
.
Available since: 2.10
gtk_print_settings_get_print_pages
Gets the value of GTK_PRINT_SETTINGS_PRINT_PAGES
.
Available since: 2.10
gtk_print_settings_get_printer
Convenience function to obtain the value of
GTK_PRINT_SETTINGS_PRINTER
.
Available since: 2.10
gtk_print_settings_get_printer_lpi
Gets the value of GTK_PRINT_SETTINGS_PRINTER_LPI
.
Available since: 2.16
gtk_print_settings_get_resolution
Gets the value of GTK_PRINT_SETTINGS_RESOLUTION
.
Available since: 2.10
gtk_print_settings_get_resolution_x
Gets the value of GTK_PRINT_SETTINGS_RESOLUTION_X
.
Available since: 2.16
gtk_print_settings_get_resolution_y
Gets the value of GTK_PRINT_SETTINGS_RESOLUTION_Y
.
Available since: 2.16
gtk_print_settings_get_use_color
Gets the value of GTK_PRINT_SETTINGS_USE_COLOR
.
Available since: 2.10
gtk_print_settings_load_file
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_to_file().
Available since: 2.14
gtk_print_settings_load_key_file
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
.
Available since: 2.14
gtk_print_settings_set_default_source
Sets the value of GTK_PRINT_SETTINGS_DEFAULT_SOURCE
.
Available since: 2.10
gtk_print_settings_set_finishings
Sets the value of GTK_PRINT_SETTINGS_FINISHINGS
.
Available since: 2.10
gtk_print_settings_set_media_type
Sets the value of GTK_PRINT_SETTINGS_MEDIA_TYPE
.
Available since: 2.10
gtk_print_settings_set_n_copies
Sets the value of GTK_PRINT_SETTINGS_N_COPIES
.
Available since: 2.10
gtk_print_settings_set_number_up
Sets the value of GTK_PRINT_SETTINGS_NUMBER_UP
.
Available since: 2.10
gtk_print_settings_set_number_up_layout
Sets the value of GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT
.
Available since: 2.14
gtk_print_settings_set_orientation
Sets the value of GTK_PRINT_SETTINGS_ORIENTATION
.
Available since: 2.10
gtk_print_settings_set_output_bin
Sets the value of GTK_PRINT_SETTINGS_OUTPUT_BIN
.
Available since: 2.10
gtk_print_settings_set_page_ranges
Sets the value of GTK_PRINT_SETTINGS_PAGE_RANGES
.
Available since: 2.10
gtk_print_settings_set_page_set
Sets the value of GTK_PRINT_SETTINGS_PAGE_SET
.
Available since: 2.10
gtk_print_settings_set_paper_height
Sets the value of GTK_PRINT_SETTINGS_PAPER_HEIGHT
.
Available since: 2.10
gtk_print_settings_set_paper_size
Sets the value of GTK_PRINT_SETTINGS_PAPER_FORMAT
,
GTK_PRINT_SETTINGS_PAPER_WIDTH
and
GTK_PRINT_SETTINGS_PAPER_HEIGHT
.
Available since: 2.10
gtk_print_settings_set_paper_width
Sets the value of GTK_PRINT_SETTINGS_PAPER_WIDTH
.
Available since: 2.10
gtk_print_settings_set_print_pages
Sets the value of GTK_PRINT_SETTINGS_PRINT_PAGES
.
Available since: 2.10
gtk_print_settings_set_printer
Convenience function to set GTK_PRINT_SETTINGS_PRINTER
to printer
.
Available since: 2.10
gtk_print_settings_set_printer_lpi
Sets the value of GTK_PRINT_SETTINGS_PRINTER_LPI
.
Available since: 2.16
gtk_print_settings_set_resolution
Sets the values of GTK_PRINT_SETTINGS_RESOLUTION
,
GTK_PRINT_SETTINGS_RESOLUTION_X
and
GTK_PRINT_SETTINGS_RESOLUTION_Y
.
Available since: 2.10
gtk_print_settings_set_resolution_xy
Sets the values of GTK_PRINT_SETTINGS_RESOLUTION
,
GTK_PRINT_SETTINGS_RESOLUTION_X
and
GTK_PRINT_SETTINGS_RESOLUTION_Y
.
Available since: 2.16
gtk_print_settings_set_use_color
Sets the value of GTK_PRINT_SETTINGS_USE_COLOR
.
Available since: 2.10
gtk_print_settings_to_file
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
.
Available since: 2.12
gtk_print_settings_to_key_file
This function adds the print settings from settings
to key_file
.
Available since: 2.12
gtk_print_settings_unset
Removes any value associated with key
.
This has the same effect as setting the value to NULL
.
Available since: 2.10
Signals
Signals inherited from GObject (1)
GObject.Object::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.