# Gtk::PrintSettings Class Reference
[Printing]

A PrintSettings object represents the settings of a print dialog in a system-independent way. More...

Inherits Glib::Object.

Collaboration diagram for Gtk::PrintSettings:
[legend]

List of all members.

## Classes

class | Keys
| Print settings keys. More...
class | PageRange

## Public Types

typedef sigc::slot< void, const Glib::ustring &, const Glib::ustring& > | SlotForeach
| For example, void on_foreach_setting(const Glib::ustring& key, const Glib::ustring& value);.

## Public Member Functions

virtual | ~PrintSettings ()
GtkPrintSettings* | gobj ()
| Provides access to the underlying C GObject.
const GtkPrintSettings* | gobj () const
| Provides access to the underlying C GObject.
GtkPrintSettings* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< PrintSettings > | copy () const
| Copies a Gtk::PrintSettings object.
bool | load_from_file (const std::string& file_name)
| Reads the print settings from file_name.
bool | load_from_key_file (const Glib::KeyFile& key_file, const Glib::ustring& group_name)
| Reads the print settings from the group group_name in key_file.
bool | load_from_key_file (const Glib::KeyFile& key_file)
| Reads the print settings from the key_file.
bool | save_to_file (const std::string& file_name) const
| This function saves the print settings from settings to file_name.
void | save_to_key_file (Glib::KeyFile& key_file, const Glib::ustring& group_name) const
| This function adds the print settings from settings to key_file.
void | save_to_key_file (Glib::KeyFile& key_file) const
| This function adds the print settings from settings to key_file, in the "Print Settings" group.
bool | has_key (const Glib::ustring& key) const
| Returns `true`, if a value is associated with key.
Glib::ustring | get (const Glib::ustring& key) const
| Looks up the string value associated with key.
void | set (const Glib::ustring& key, const Glib::ustring&value)
| Associates value with key.
void | unset (const Glib::ustring& key)
| Removes any value associated with key.
void | setting_foreach (const SlotForeach& slot)
| Calls a function for each print setting.
bool | get_bool (const Glib::ustring& key) const
| Returns the boolean represented by the value that is associated with key.
void | set_bool (const Glib::ustring& key, bool value=true)
| Sets key to a boolean value.
double | get_double (const Glib::ustring& key) const
| Returns the double value associated with key, or 0.
double | get_double_with_default (const Glib::ustring& key, double def) const
| 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.
void | set_double (const Glib::ustring& key, double value)
| Sets key to a double value.
double | get_length (const Glib::ustring& key, Unit unit) const
| Returns the value associated with key, interpreted as a length.
void | set_length (const Glib::ustring& key, double value, Unit unit)
| Associates a length in units of unit with key.
int | get_int (const Glib::ustring& key) const
| Returns the integer value of key, or 0.
int | get_int_with_default (const Glib::ustring& key, int def) const
| Returns the value of key, interpreted as an integer, or the default value.
void | set_int (const Glib::ustring& key, int value)
| Sets key to an integer value.
Glib::ustring | get_printer () const
| Convenience function to obtain the value of Gtk::PRINT_SETTINGS_PRINTER.
void | set_printer (const Glib::ustring& name)
| Convenience function to set Gtk::PRINT_SETTINGS_PRINTER to printer.
PageOrientation | get_orientation () const
| Get the value of Gtk::PRINT_SETTINGS_ORIENTATION, converted to a Gtk::PageOrientation.
void | set_orientation (PageOrientation orientation)
| Sets the value of Gtk::PRINT_SETTINGS_ORIENTATION.
PaperSize | get_paper_size ()
| Gets the value of Gtk::PRINT_SETTINGS_PAPER_FORMAT, converted to a Gtk::PaperSize.
const PaperSize | get_paper_size () const
| Gets the value of Gtk::PRINT_SETTINGS_PAPER_FORMAT, converted to a Gtk::PaperSize.
void | set_paper_size (const PaperSize& paper_size)
| Sets the value of Gtk::PRINT_SETTINGS_PAPER_FORMAT, Gtk::PRINT_SETTINGS_PAPER_WIDTH and Gtk::PRINT_SETTINGS_PAPER_HEIGHT.
double | get_paper_width (Unit unit) const
| Gets the value of Gtk::PRINT_SETTINGS_PAPER_WIDTH, converted to unit.
void | set_paper_width (double width, Unit unit)
| Sets the value of Gtk::PRINT_SETTINGS_PAPER_WIDTH.
double | get_paper_height (Unit unit) const
| Gets the value of Gtk::PRINT_SETTINGS_PAPER_HEIGHT, converted to unit.
void | set_paper_height (double height, Unit unit)
| Sets the value of Gtk::PRINT_SETTINGS_PAPER_HEIGHT.
bool | get_use_color () const
| Gets the value of Gtk::PRINT_SETTINGS_USE_COLOR.
void | set_use_color (bool use_color=true)
| Sets the value of Gtk::PRINT_SETTINGS_USE_COLOR.
bool | get_collate () const
| Gets the value of Gtk::PRINT_SETTINGS_COLLATE.
void | set_collate (bool collate=true)
| Sets the value of Gtk::PRINT_SETTINGS_COLLATE.
bool | get_reverse () const
| Gets the value of Gtk::PRINT_SETTINGS_REVERSE.
void | set_reverse (bool reverse=true)
| Sets the value of Gtk::PRINT_SETTINGS_REVERSE.
PrintDuplex | get_duplex () const
| Gets the value of Gtk::PRINT_SETTINGS_DUPLEX.
void | set_duplex (PrintDuplex duplex)
| Sets the value of Gtk::PRINT_SETTINGS_DUPLEX.
PrintQuality | get_quality () const
| Gets the value of Gtk::PRINT_SETTINGS_QUALITY.
void | set_quality (PrintQuality quality)
| Sets the value of Gtk::PRINT_SETTINGS_QUALITY.
int | get_n_copies () const
| Gets the value of Gtk::PRINT_SETTINGS_N_COPIES.
void | set_n_copies (int num_copies)
| Sets the value of Gtk::PRINT_SETTINGS_N_COPIES.
int | get_number_up () const
| Gets the value of Gtk::PRINT_SETTINGS_NUMBER_UP.
void | set_number_up (int number_up)
| Sets the value of Gtk::PRINT_SETTINGS_NUMBER_UP.
NumberUpLayout | get_number_up_layout () const
| Gets the value of Gtk::PRINT_SETTINGS_NUMBER_UP_LAYOUT.
void | set_number_up (NumberUpLayout number_up_layout)
| Sets the value of Gtk::PRINT_SETTINGS_NUMBER_UP_LAYOUT.
int | get_resolution () const
| Gets the value of Gtk::PRINT_SETTINGS_RESOLUTION.
void | set_resolution (int resolution)
| Sets the values of Gtk::PRINT_SETTINGS_RESOLUTION, Gtk::PRINT_SETTINGS_RESOLUTION_X and Gtk::PRINT_SETTINGS_RESOLUTION_Y.
int | get_resolution_x () const
| Gets the value of Gtk::PRINT_SETTINGS_RESOLUTION_X.
int | get_resolution_y () const
| Gets the value of Gtk::PRINT_SETTINGS_RESOLUTION_Y.
void | set_resolution_xy (int resolution_x, int resolution_y)
| Sets the values of Gtk::PRINT_SETTINGS_RESOLUTION, Gtk::PRINT_SETTINGS_RESOLUTION_X and Gtk::PRINT_SETTINGS_RESOLUTION_Y.
double | get_printer_lpi () const
| Gets the value of Gtk::PRINT_SETTINGS_PRINTER_LPI.
void | set_printer_lpi (double lpi)
| Sets the value of Gtk::PRINT_SETTINGS_PRINTER_LPI.
double | get_scale () const
| Gets the value of Gtk::PRINT_SETTINGS_SCALE.
void | set_scale (double scale)
| Sets the value of Gtk::PRINT_SETTINGS_SCALE.
PrintPages | get_print_pages () const
| Gets the value of Gtk::PRINT_SETTINGS_PRINT_PAGES.
void | set_print_pages (PrintPages print_pages)
| Sets the value of Gtk::PRINT_SETTINGS_PRINT_PAGES.
Glib::ArrayHandle< PageRange > | get_page_ranges () const
void | set_page_ranges (const Glib::ArrayHandle< PageRange >& page_ranges)
PageSet | get_page_set () const
| Gets the value of Gtk::PRINT_SETTINGS_PAGE_SET.
void | set_page_set (PageSet page_set)
| Sets the value of Gtk::PRINT_SETTINGS_PAGE_SET.
Glib::ustring | get_default_source () const
| Gets the value of Gtk::PRINT_SETTINGS_DEFAULT_SOURCE.
void | set_default_source (const Glib::ustring& default_source)
| Sets the value of Gtk::PRINT_SETTINGS_DEFAULT_SOURCE.
Glib::ustring | get_media_type () const
| Gets the value of Gtk::PRINT_SETTINGS_MEDIA_TYPE.
void | set_media_type (const Glib::ustring& media_type)
| Sets the value of Gtk::PRINT_SETTINGS_MEDIA_TYPE.
Glib::ustring | get_dither () const
| Gets the value of Gtk::PRINT_SETTINGS_DITHER.
void | set_dither (const Glib::ustring& dither)
| Sets the value of Gtk::PRINT_SETTINGS_DITHER.
Glib::ustring | get_finishings () const
| Gets the value of Gtk::PRINT_SETTINGS_FINISHINGS.
void | set_finishings (const Glib::ustring& finishings)
| Sets the value of Gtk::PRINT_SETTINGS_FINISHINGS.
Glib::ustring | get_output_bin () const
| Gets the value of Gtk::PRINT_SETTINGS_OUTPUT_BIN.
void | set_output_bin (const Glib::ustring& output_bin)
| Sets the value of Gtk::PRINT_SETTINGS_OUTPUT_BIN.

## Static Public Member Functions

static Glib::RefPtr < PrintSettings > | create ()

## Protected Member Functions

| PrintSettings ()

## Static Protected Member Functions

static Glib::RefPtr < PrintSettings > | create_from_key_file (const Glib::KeyFile& key_file)
| Reads the print settings from the key_file.
static Glib::RefPtr < PrintSettings > | create_from_key_file (const Glib::KeyFile& key_file, const Glib::ustring& group_name)
| Reads the print settings from the group group_name in key_file.
static Glib::RefPtr < PrintSettings > | create_from_file (const std::string& file_name)
| Reads the print settings from file_name.

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gtk::PrintSettings > | wrap (GtkPrintSettings* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

A 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.

It's 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.

Since gtkmm 2.10:

## Member Typedef Documentation

typedef sigc::slot<void, const Glib::ustring&, const Glib::ustring&> Gtk::PrintSettings::SlotForeach

For example, void on_foreach_setting(const Glib::ustring& key, const Glib::ustring& value);.

## Constructor & Destructor Documentation

virtual Gtk::PrintSettings::~PrintSettings | ( |  | ) | `[virtual]`

Gtk::PrintSettings::PrintSettings | ( |  | ) | `[protected]`

## Member Function Documentation

Glib::RefPtr<PrintSettings> Gtk::PrintSettings::copy | ( |  | ) | const

Copies a Gtk::PrintSettings object.

Since gtkmm 2.10:

Returns:
  A newly allocated copy of other.

static Glib::RefPtr<PrintSettings> Gtk::PrintSettings::create | ( |  | ) | `[static]`

static Glib::RefPtr<PrintSettings> Gtk::PrintSettings::create_from_file | ( | const std::string & | file_name | ) | `[static, protected]`

Reads the print settings from file_name.

Returns a new PrintSettings object with the restored settings, or an empty RefPtr if an error occurred. See save_to_file().

Parameters:

  | file_name | The filename to read the settings from.

Returns:
  the restored PrintSettings

Exceptions:

  | KeyFileError,FileError |

Since gtkmm 2.14:

static Glib::RefPtr<PrintSettings> Gtk::PrintSettings::create_from_key_file | ( | const Glib::KeyFile & | key_file,
|  | const Glib::ustring & | group_name |
| ) |  |  | `[static, protected]`

Reads the print settings from the group group_name in key_file.

Returns a new PrintSettings object with the restored settings, or an empty RefPtr if an error occurred. See save_to_key_file().

Parameters:

  | key_file | The KeyFile to retrieve the settings from.
  | group_name | The name of the group to use.

Returns:
  the restored PrintSettings

Exceptions:

  | KeyFileError,FileError |

Since gtkmm 2.14:

static Glib::RefPtr<PrintSettings> Gtk::PrintSettings::create_from_key_file | ( | const Glib::KeyFile & | key_file | ) | `[static, protected]`

Reads the print settings from the key_file.

Returns a new PrintSettings object with the restored settings, or an empty RefPtr if an error occurred. See save_to_key_file().

Parameters:

  | key_file | The KeyFile to retrieve the settings from.

Returns:
  the restored PrintSettings

Exceptions:

  | KeyFileError,FileError |

Since gtkmm 2.14:

Glib::ustring Gtk::PrintSettings::get | ( | const Glib::ustring & | key | ) | const

Looks up the string value associated with key.

Since gtkmm 2.10:

Parameters:

  | key | A key.

Returns:
  The string value for key.

bool Gtk::PrintSettings::get_bool | ( | const Glib::ustring & | key | ) | const

Returns the boolean represented by the value that is associated with key.

The string "true" represents `true`, any other string `false`.

Since gtkmm 2.10:

Parameters:

  | key | A key.

Returns:
  `true`, if key maps to a true value.

bool Gtk::PrintSettings::get_collate | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_COLLATE.

Since gtkmm 2.10:

Returns:
  Whether to collate the printed pages.

Glib::ustring Gtk::PrintSettings::get_default_source | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_DEFAULT_SOURCE.

Since gtkmm 2.10:

Returns:
  The default source.

Glib::ustring Gtk::PrintSettings::get_dither | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_DITHER.

Since gtkmm 2.10:

Returns:
  The dithering that is used.

double Gtk::PrintSettings::get_double | ( | const Glib::ustring & | key | ) | const

Returns the double value associated with key, or 0.

Since gtkmm 2.10:

Parameters:

  | key | A key.

Returns:
  The double value of key.

double Gtk::PrintSettings::get_double_with_default | ( | const Glib::ustring & | key,
|  | double | def |
| ) |  |  | const

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 Glib::ascii_strtod().

Since gtkmm 2.10:

Parameters:

  | key | A key.
  | def | The default value.

Returns:
  The floating point number associated with key.

PrintDuplex Gtk::PrintSettings::get_duplex | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_DUPLEX.

Since gtkmm 2.10:

Returns:
  Whether to print the output in duplex.

Glib::ustring Gtk::PrintSettings::get_finishings | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_FINISHINGS.

Since gtkmm 2.10:

Returns:
  The finishings.

int Gtk::PrintSettings::get_int | ( | const Glib::ustring & | key | ) | const

Returns the integer value of key, or 0.

Since gtkmm 2.10:

Parameters:

  | key | A key.

Returns:
  The integer value of key.

int Gtk::PrintSettings::get_int_with_default | ( | const Glib::ustring & | key,
|  | int | def |
| ) |  |  | const

Returns the value of key, interpreted as an integer, or the default value.

Since gtkmm 2.10:

Parameters:

  | key | A key.
  | def | The default value.

Returns:
  The integer value of key.

double Gtk::PrintSettings::get_length | ( | const Glib::ustring & | key,
|  | Unit | unit |
| ) |  |  | const

Returns the value associated with key, interpreted as a length.

The returned value is converted to units.

Since gtkmm 2.10:

Parameters:

  | key | A key.
  | unit | The unit of the return value.

Returns:
  The length value of key, converted to unit.

Glib::ustring Gtk::PrintSettings::get_media_type | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_MEDIA_TYPE.

The set of media types is defined in PWG 5101.1-2002 PWG.

Since gtkmm 2.10:

Returns:
  The media type.

int Gtk::PrintSettings::get_n_copies | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_N_COPIES.

Since gtkmm 2.10:

Returns:
  The number of copies to print.

int Gtk::PrintSettings::get_number_up | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_NUMBER_UP.

Since gtkmm 2.10:

Returns:
  The number of pages per sheet.

NumberUpLayout Gtk::PrintSettings::get_number_up_layout | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_NUMBER_UP_LAYOUT.

Since gtkmm 2.14:

Returns:
  Layout of page in number-up mode.

PageOrientation Gtk::PrintSettings::get_orientation | ( |  | ) | const

Get the value of Gtk::PRINT_SETTINGS_ORIENTATION, converted to a Gtk::PageOrientation.

Since gtkmm 2.10:

Returns:
  The orientation.

Glib::ustring Gtk::PrintSettings::get_output_bin | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_OUTPUT_BIN.

Since gtkmm 2.10:

Returns:
  The output bin.

Glib::ArrayHandle<PageRange> Gtk::PrintSettings::get_page_ranges | ( |  | ) | const

PageSet Gtk::PrintSettings::get_page_set | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_PAGE_SET.

Since gtkmm 2.10:

Returns:
  The set of pages to print.

double Gtk::PrintSettings::get_paper_height | ( | Unit | unit | ) | const

Gets the value of Gtk::PRINT_SETTINGS_PAPER_HEIGHT, converted to unit.

Since gtkmm 2.10:

Parameters:

  | unit | The unit for the return value.

Returns:
  The paper height, in units of unit.

PaperSize Gtk::PrintSettings::get_paper_size | ( |  | ) |

Gets the value of Gtk::PRINT_SETTINGS_PAPER_FORMAT, converted to a Gtk::PaperSize.

Since gtkmm 2.10:

Returns:
  The paper size.

const PaperSize Gtk::PrintSettings::get_paper_size | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_PAPER_FORMAT, converted to a Gtk::PaperSize.

Since gtkmm 2.10:

Returns:
  The paper size.

double Gtk::PrintSettings::get_paper_width | ( | Unit | unit | ) | const

Gets the value of Gtk::PRINT_SETTINGS_PAPER_WIDTH, converted to unit.

Since gtkmm 2.10:

Parameters:

  | unit | The unit for the return value.

Returns:
  The paper width, in units of unit.

PrintPages Gtk::PrintSettings::get_print_pages | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_PRINT_PAGES.

Since gtkmm 2.10:

Returns:
  Which pages to print.

Glib::ustring Gtk::PrintSettings::get_printer | ( |  | ) | const

Convenience function to obtain the value of Gtk::PRINT_SETTINGS_PRINTER.

Since gtkmm 2.10:

Returns:
  The printer name.

double Gtk::PrintSettings::get_printer_lpi | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_PRINTER_LPI.

Since gtkmm 2.16:

Returns:
  The resolution in lpi (lines per inch).

PrintQuality Gtk::PrintSettings::get_quality | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_QUALITY.

Since gtkmm 2.10:

Returns:
  The print quality.

int Gtk::PrintSettings::get_resolution | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_RESOLUTION.

Since gtkmm 2.10:

Returns:
  The resolution in dpi.

int Gtk::PrintSettings::get_resolution_x | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_RESOLUTION_X.

Since gtkmm 2.16:

Returns:
  The horizontal resolution in dpi.

int Gtk::PrintSettings::get_resolution_y | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_RESOLUTION_Y.

Since gtkmm 2.16:

Returns:
  The vertical resolution in dpi.

bool Gtk::PrintSettings::get_reverse | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_REVERSE.

Since gtkmm 2.10:

Returns:
  Whether to reverse the order of the printed pages.

double Gtk::PrintSettings::get_scale | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_SCALE.

Since gtkmm 2.10:

Returns:
  The scale in percent.

bool Gtk::PrintSettings::get_use_color | ( |  | ) | const

Gets the value of Gtk::PRINT_SETTINGS_USE_COLOR.

Since gtkmm 2.10:

Returns:
  Whether to use color.

GtkPrintSettings* Gtk::PrintSettings::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

const GtkPrintSettings* Gtk::PrintSettings::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GtkPrintSettings* Gtk::PrintSettings::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Gtk::PrintSettings::has_key | ( | const Glib::ustring & | key | ) | const

Returns `true`, if a value is associated with key.

Since gtkmm 2.10:

Parameters:

  | key | A key.

Returns:
  `true`, if key has a value.

bool Gtk::PrintSettings::load_from_file | ( | const std::string & | file_name | ) |

Reads the print settings from file_name.

If the file could not be loaded then error is set to either a FileError or KeyFileError. See to_file().

Since gtkmm 2.14:

Parameters:

  | file_name | The filename to read the settings from.

Returns:
  `true` on success.

bool Gtk::PrintSettings::load_from_key_file | ( | const Glib::KeyFile & | key_file,
|  | const Glib::ustring & | group_name |
| ) |  |  |

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 FileError or KeyFileError.

Since gtkmm 2.14:

Parameters:

  | key_file | The KeyFile to retrieve the settings from.
  | group_name | The name of the group to use, or `0` to use the default "Print Settings".

Returns:
  `true` on success.

bool Gtk::PrintSettings::load_from_key_file | ( | const Glib::KeyFile & | key_file | ) |

Reads the print settings from the key_file.

See save_to_key_file().

Parameters:

  | key_file | The KeyFile to retrieve the settings from.

Returns:
  true on success.

Exceptions:

  | KeyFileError,FileError |

Since gtkmm 2.14:

bool Gtk::PrintSettings::save_to_file | ( | const std::string & | file_name | ) | const

This function saves the print settings from settings to file_name.

Exceptions:

  | FileError |

Parameters:

  | file_name | The file to save to.

Returns:
  `true` on success

Since gtkmm 2.12:

void Gtk::PrintSettings::save_to_key_file | ( | Glib::KeyFile & | key_file,
|  | const Glib::ustring & | group_name |
| ) |  |  | const

This function adds the print settings from settings to key_file.

Since gtkmm 2.12:

Parameters:

  | key_file | The Glib::KeyFile to save the print settings to.
  | group_name | The group to add the settings to in key_file.

void Gtk::PrintSettings::save_to_key_file | ( | Glib::KeyFile & | key_file | ) | const

This function adds the print settings from settings to key_file, in the "Print Settings" group.

Since gtkmm 2.12:

Parameters:

  | key_file | The Glib::KeyFile to save the print settings to.

void Gtk::PrintSettings::set | ( | const Glib::ustring & | key,
|  | const Glib::ustring & | value |
| ) |  |  |

Associates value with key.

Since gtkmm 2.10:

Parameters:

  | key | A key.
  | value | A string value, or `0`.

void Gtk::PrintSettings::set_bool | ( | const Glib::ustring & | key,
|  | bool | value = `true` |
| ) |  |  |

Sets key to a boolean value.

Since gtkmm 2.10:

Parameters:

  | key | A key.
  | value | A boolean.

void Gtk::PrintSettings::set_collate | ( | bool | collate = `true` | ) |

Sets the value of Gtk::PRINT_SETTINGS_COLLATE.

Since gtkmm 2.10:

Parameters:

  | collate | Whether to collate the output.

void Gtk::PrintSettings::set_default_source | ( | const Glib::ustring & | default_source | ) |

Sets the value of Gtk::PRINT_SETTINGS_DEFAULT_SOURCE.

Since gtkmm 2.10:

Parameters:

  | default_source | The default source.

void Gtk::PrintSettings::set_dither | ( | const Glib::ustring & | dither | ) |

Sets the value of Gtk::PRINT_SETTINGS_DITHER.

Since gtkmm 2.10:

Parameters:

  | dither | The dithering that is used.

void Gtk::PrintSettings::set_double | ( | const Glib::ustring & | key,
|  | double | value |
| ) |  |  |

Sets key to a double value.

Since gtkmm 2.10:

Parameters:

  | key | A key.
  | value | A double value.

void Gtk::PrintSettings::set_duplex | ( | PrintDuplex | duplex | ) |

Sets the value of Gtk::PRINT_SETTINGS_DUPLEX.

Since gtkmm 2.10:

Parameters:

  | duplex | A Gtk::PrintDuplex value.

void Gtk::PrintSettings::set_finishings | ( | const Glib::ustring & | finishings | ) |

Sets the value of Gtk::PRINT_SETTINGS_FINISHINGS.

Since gtkmm 2.10:

Parameters:

  | finishings | The finishings.

void Gtk::PrintSettings::set_int | ( | const Glib::ustring & | key,
|  | int | value |
| ) |  |  |

Sets key to an integer value.

Since gtkmm 2.10:

Parameters:

  | key | A key.
  | value | An integer.

void Gtk::PrintSettings::set_length | ( | const Glib::ustring & | key,
|  | double | value,
|  | Unit | unit |
| ) |  |  |

Associates a length in units of unit with key.

Since gtkmm 2.10:

Parameters:

  | key | A key.
  | value | A length.
  | unit | The unit of length.

void Gtk::PrintSettings::set_media_type | ( | const Glib::ustring & | media_type | ) |

Sets the value of Gtk::PRINT_SETTINGS_MEDIA_TYPE.

The set of media types is defined in PWG 5101.1-2002 PWG.

Since gtkmm 2.10:

Parameters:

  | media_type | The media type.

void Gtk::PrintSettings::set_n_copies | ( | int | num_copies | ) |

Sets the value of Gtk::PRINT_SETTINGS_N_COPIES.

Since gtkmm 2.10:

Parameters:

  | num_copies | The number of copies.

void Gtk::PrintSettings::set_number_up | ( | int | number_up | ) |

Sets the value of Gtk::PRINT_SETTINGS_NUMBER_UP.

Since gtkmm 2.10:

Parameters:

  | number_up | The number of pages per sheet.

void Gtk::PrintSettings::set_number_up | ( | NumberUpLayout | number_up_layout | ) |

Sets the value of Gtk::PRINT_SETTINGS_NUMBER_UP_LAYOUT.

Since gtkmm 2.14:

Parameters:

  | number_up_layout | A Gtk::NumberUpLayout value.

void Gtk::PrintSettings::set_orientation | ( | PageOrientation | orientation | ) |

Sets the value of Gtk::PRINT_SETTINGS_ORIENTATION.

Since gtkmm 2.10:

Parameters:

  | orientation | A page orientation.

void Gtk::PrintSettings::set_output_bin | ( | const Glib::ustring & | output_bin | ) |

Sets the value of Gtk::PRINT_SETTINGS_OUTPUT_BIN.

Since gtkmm 2.10:

Parameters:

  | output_bin | The output bin.

void Gtk::PrintSettings::set_page_ranges | ( | const Glib::ArrayHandle< PageRange >& | page_ranges | ) |

void Gtk::PrintSettings::set_page_set | ( | PageSet | page_set | ) |

Sets the value of Gtk::PRINT_SETTINGS_PAGE_SET.

Since gtkmm 2.10:

Parameters:

  | page_set | A Gtk::PageSet value.

void Gtk::PrintSettings::set_paper_height | ( | double | height,
|  | Unit | unit |
| ) |  |  |

Sets the value of Gtk::PRINT_SETTINGS_PAPER_HEIGHT.

Since gtkmm 2.10:

Parameters:

  | height | The paper height.
  | unit | The units of height.

void Gtk::PrintSettings::set_paper_size | ( | const PaperSize& | paper_size | ) |

Sets the value of Gtk::PRINT_SETTINGS_PAPER_FORMAT, Gtk::PRINT_SETTINGS_PAPER_WIDTH and Gtk::PRINT_SETTINGS_PAPER_HEIGHT.

Since gtkmm 2.10:

Parameters:

  | paper_size | A paper size.

void Gtk::PrintSettings::set_paper_width | ( | double | width,
|  | Unit | unit |
| ) |  |  |

Sets the value of Gtk::PRINT_SETTINGS_PAPER_WIDTH.

Since gtkmm 2.10:

Parameters:

  | width | The paper width.
  | unit | The units of width.

void Gtk::PrintSettings::set_print_pages | ( | PrintPages | print_pages | ) |

Sets the value of Gtk::PRINT_SETTINGS_PRINT_PAGES.

Since gtkmm 2.10:

Parameters:

  | pages | A Gtk::PrintPages value.

void Gtk::PrintSettings::set_printer | ( | const Glib::ustring & | name | ) |

Convenience function to set Gtk::PRINT_SETTINGS_PRINTER to printer.

Since gtkmm 2.10:

Parameters:

  | printer | The printer name.

void Gtk::PrintSettings::set_printer_lpi | ( | double | lpi | ) |

Sets the value of Gtk::PRINT_SETTINGS_PRINTER_LPI.

Since gtkmm 2.16:

Parameters:

  | lpi | The resolution in lpi (lines per inch).

void Gtk::PrintSettings::set_quality | ( | PrintQuality | quality | ) |

Sets the value of Gtk::PRINT_SETTINGS_QUALITY.

Since gtkmm 2.10:

Parameters:

  | quality | A Gtk::PrintQuality value.

void Gtk::PrintSettings::set_resolution | ( | int | resolution | ) |

Sets the values of Gtk::PRINT_SETTINGS_RESOLUTION, Gtk::PRINT_SETTINGS_RESOLUTION_X and Gtk::PRINT_SETTINGS_RESOLUTION_Y.

Since gtkmm 2.10:

Parameters:

  | resolution | The resolution in dpi.

void Gtk::PrintSettings::set_resolution_xy | ( | int | resolution_x,
|  | int | resolution_y |
| ) |  |  |

Sets the values of Gtk::PRINT_SETTINGS_RESOLUTION, Gtk::PRINT_SETTINGS_RESOLUTION_X and Gtk::PRINT_SETTINGS_RESOLUTION_Y.

Since gtkmm 2.16:

Parameters:

  | resolution_x | The horizontal resolution in dpi.
  | resolution_y | The vertical resolution in dpi.

void Gtk::PrintSettings::set_reverse | ( | bool | reverse = `true` | ) |

Sets the value of Gtk::PRINT_SETTINGS_REVERSE.

Since gtkmm 2.10:

Parameters:

  | reverse | Whether to reverse the output.

void Gtk::PrintSettings::set_scale | ( | double | scale | ) |

Sets the value of Gtk::PRINT_SETTINGS_SCALE.

Since gtkmm 2.10:

Parameters:

  | scale | The scale in percent.

void Gtk::PrintSettings::set_use_color | ( | bool | use_color = `true` | ) |

Sets the value of Gtk::PRINT_SETTINGS_USE_COLOR.

Since gtkmm 2.10:

Parameters:

  | use_color | Whether to use color.

void Gtk::PrintSettings::setting_foreach | ( | const SlotForeach & | slot | ) |

Calls a function for each print setting.

Parameters:

  | slot | The callback to call for each print setting.

void Gtk::PrintSettings::unset | ( | const Glib::ustring & | key | ) |

Removes any value associated with key.

This has the same effect as setting the value to `0`.

Since gtkmm 2.10:

Parameters:

  | key | A key.

## Friends And Related Function Documentation

Glib::RefPtr< Gtk::PrintSettings > wrap | ( | GtkPrintSettings * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/printsettings.h