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().
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().
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
.
since: 2.12
Instance methods
gtk_print_settings_get_bool
Returns the boolean represented by the value
that is associated with key
.
since: 2.10
gtk_print_settings_get_default_source
Gets the value of GTK_PRINT_SETTINGS_DEFAULT_SOURCE
.
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.
since: 2.10
gtk_print_settings_get_int_with_default
Returns the value of key
, interpreted as
an integer, or the default value.
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
.
since: 2.10
gtk_print_settings_get_number_up_layout
Gets the value of GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT
.
since: 2.14
gtk_print_settings_get_orientation
Get the value of GTK_PRINT_SETTINGS_ORIENTATION
,
converted to a GtkPageOrientation
.
since: 2.10
gtk_print_settings_get_paper_height
Gets the value of GTK_PRINT_SETTINGS_PAPER_HEIGHT
,
converted to unit
.
since: 2.10
gtk_print_settings_get_paper_size
Gets the value of GTK_PRINT_SETTINGS_PAPER_FORMAT
,
converted to a GtkPaperSize
.
since: 2.10
gtk_print_settings_get_paper_width
Gets the value of GTK_PRINT_SETTINGS_PAPER_WIDTH
,
converted to unit
.
since: 2.10
gtk_print_settings_get_printer
Convenience function to obtain the value of
GTK_PRINT_SETTINGS_PRINTER
.
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().
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
.
since: 2.14
gtk_print_settings_set_default_source
Sets the value of GTK_PRINT_SETTINGS_DEFAULT_SOURCE
.
since: 2.10
gtk_print_settings_set_number_up_layout
Sets the value of GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT
.
since: 2.14
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
.
since: 2.10
gtk_print_settings_set_printer
Convenience function to set GTK_PRINT_SETTINGS_PRINTER
to printer
.
since: 2.10
gtk_print_settings_set_resolution
Sets the values of GTK_PRINT_SETTINGS_RESOLUTION
,
GTK_PRINT_SETTINGS_RESOLUTION_X
and
GTK_PRINT_SETTINGS_RESOLUTION_Y
.
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
.
since: 2.16
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
.
since: 2.12
gtk_print_settings_to_key_file
This function adds the print settings from settings
to key_file
.
since: 2.12
gtk_print_settings_unset
Removes any value associated with key
.
This has the same effect as setting the value to NULL
.
since: 2.10
Signals
Signals inherited from GObject (1)
GObject::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.