Main Page Widgets Namespaces Book

# Gtk::PaperSize Class Reference
[Printing]

List of all members.

## Detailed Description

PaperSize handles paper sizes.

It uses the standard called "PWG 5101.1-2002 PWG: Standard for Media Standardized Names" to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, PaperSize allows to construct custom paper sizes with arbitrary dimensions.

The PaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.

Since gtkmm 2.10:

## Public Member Functions

bool | equal (const PaperSize& other) const
double | get_default_bottom_margin (Unit unit) const
| Gets the default bottom margin for the Gtk::PaperSize.
double | get_default_left_margin (Unit unit) const
| Gets the default left margin for the Gtk::PaperSize.
double | get_default_right_margin (Unit unit) const
| Gets the default right margin for the Gtk::PaperSize.
double | get_default_top_margin (Unit unit) const
| Gets the default top margin for the Gtk::PaperSize.
Glib::ustring | get_display_name () const
| Gets the human-readable name of the Gtk::PaperSize.
double | get_height (Unit unit) const
| Gets the paper height of the Gtk::PaperSize, in units of unit.
Glib::ustring | get_name () const
| Gets the name of the Gtk::PaperSize.
Glib::ustring | get_ppd_name () const
| Gets the PPD name of the Gtk::PaperSize, which may be `0`.
double | get_width (Unit unit) const
| Gets the paper width of the Gtk::PaperSize, in units of unit.
const GtkPaperSize* | gobj () const
| Provides access to the underlying C instance.
GtkPaperSize* | gobj ()
| Provides access to the underlying C instance.
GtkPaperSize* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
bool | is_custom () const
| Return value: whether size is a custom paper size.
| operator bool () const
| Returns true if the PaperSize is a valid object.
PaperSize& | operator= (const PaperSize& other)
| PaperSize (const Glib::KeyFile& key_file, const Glib::ustring& group_name=Glib::ustring())
| PaperSize (const Glib::ustring& name, const Glib::ustring& display_name, double width, double height, Unit unit)
| PaperSize (const Glib::ustring& ppd_name, const Glib::ustring& ppd_display_name, double width, double height)
| PaperSize (const Glib::ustring& name="")
| If a name is not specified, a default value will be used.
| PaperSize (const PaperSize& other)
| PaperSize (GtkPaperSize* gobject, bool make_a_copy=true)
| PaperSize ()
void | save_to_key_file (Glib::KeyFile& key_file)
| This function adds the paper size to key_file in the first group.
void | save_to_key_file (Glib::KeyFile& key_file, const Glib::ustring& group_name)
| This function adds the paper size from size to key_file.
void | set_size (double width, double height, Unit unit)
| Changes the dimensions of a size to width x height.
void | swap (PaperSize& other)
| ~PaperSize ()

## Static Public Member Functions

static Glib::ustring | get_default ()
| Return value: the name of the default paper size.

## Protected Attributes

GtkPaperSize* | gobject_

## Related Functions

(Note that these are not member functions.)
bool | operator!= (const PaperSize& lhs, const PaperSize& rhs)
bool | operator== (const PaperSize& lhs, const PaperSize& rhs)
void | swap (PaperSize& lhs, PaperSize& rhs)
Gtk::PaperSize | wrap (GtkPaperSize* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Constructor & Destructor Documentation

Gtk::PaperSize::PaperSize | ( |  | ) |

Gtk::PaperSize::PaperSize | ( | GtkPaperSize * | gobject,
|  | bool | make_a_copy = `true` |
| ) |  |  | `[explicit]`

Gtk::PaperSize::PaperSize | ( | const PaperSize& | other | ) |

Gtk::PaperSize::~PaperSize | ( |  | ) |

Gtk::PaperSize::PaperSize | ( | const Glib::ustring & | name = `""` | ) | `[explicit]`

If a name is not specified, a default value will be used.

Gtk::PaperSize::PaperSize | ( | const Glib::ustring & | ppd_name,
|  | const Glib::ustring & | ppd_display_name,
|  | double | width,
|  | double | height |
| ) |  |  | `[explicit]`

Gtk::PaperSize::PaperSize | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | display_name,
|  | double | width,
|  | double | height,
|  | Unit | unit |
| ) |  |  | `[explicit]`

Gtk::PaperSize::PaperSize | ( | const Glib::KeyFile & | key_file,
|  | const Glib::ustring & | group_name = `Glib::ustring()` |
| ) |  |  | `[explicit]`

## Member Function Documentation

bool Gtk::PaperSize::equal | ( | const PaperSize& | other | ) | const

Referenced by operator!=(), and operator==().

static Glib::ustring Gtk::PaperSize::get_default | ( |  | ) | `[static]`

Return value: the name of the default paper size.

The string

Returns:
  The name of the default paper size. The string is owned by GTK+ and should not be modified.

Since gtkmm 2.10:

double Gtk::PaperSize::get_default_bottom_margin | ( | Unit | unit | ) | const

Gets the default bottom margin for the Gtk::PaperSize.

Parameters:

  | unit | The unit for the return value.

Returns:
  The default bottom margin

Since gtkmm 2.10:

double Gtk::PaperSize::get_default_left_margin | ( | Unit | unit | ) | const

Gets the default left margin for the Gtk::PaperSize.

Parameters:

  | unit | The unit for the return value.

Returns:
  The default left margin

Since gtkmm 2.10:

double Gtk::PaperSize::get_default_right_margin | ( | Unit | unit | ) | const

Gets the default right margin for the Gtk::PaperSize.

Parameters:

  | unit | The unit for the return value.

Returns:
  The default right margin

Since gtkmm 2.10:

double Gtk::PaperSize::get_default_top_margin | ( | Unit | unit | ) | const

Gets the default top margin for the Gtk::PaperSize.

Parameters:

  | unit | The unit for the return value.

Returns:
  The default top margin

Since gtkmm 2.10:

Glib::ustring Gtk::PaperSize::get_display_name | ( |  | ) | const

Gets the human-readable name of the Gtk::PaperSize.

Returns:
  The human-readable name of size

Since gtkmm 2.10:

double Gtk::PaperSize::get_height | ( | Unit | unit | ) | const

Gets the paper height of the Gtk::PaperSize, in units of unit.

Parameters:

  | unit | The unit for the return value.

Returns:
  The paper height

Since gtkmm 2.10:

Glib::ustring Gtk::PaperSize::get_name | ( |  | ) | const

Gets the name of the Gtk::PaperSize.

Returns:
  The name of size

Since gtkmm 2.10:

Glib::ustring Gtk::PaperSize::get_ppd_name | ( |  | ) | const

Gets the PPD name of the Gtk::PaperSize, which may be `0`.

Returns:
  The PPD name of size

Since gtkmm 2.10:

double Gtk::PaperSize::get_width | ( | Unit | unit | ) | const

Gets the paper width of the Gtk::PaperSize, in units of unit.

Parameters:

  | unit | The unit for the return value.

Returns:
  The paper width

Since gtkmm 2.10:

const GtkPaperSize* Gtk::PaperSize::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C instance.

References gobject_.

GtkPaperSize* Gtk::PaperSize::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C instance.

References gobject_.

GtkPaperSize* Gtk::PaperSize::gobj_copy | ( |  | ) | const

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

bool Gtk::PaperSize::is_custom | ( |  | ) | const

Return value: whether size is a custom paper size.

Returns:
  Whether size is a custom paper size.

Gtk::PaperSize::operator bool | ( |  | ) | const

Returns true if the PaperSize is a valid object.

Since gtkmm 2.12:

PaperSize& Gtk::PaperSize::operator= | ( | const PaperSize& | other | ) |

void Gtk::PaperSize::save_to_key_file | ( | Glib::KeyFile & | key_file | ) |

This function adds the paper size to key_file in the first group.

Since gtkmm 2.12:

Parameters:

  | key_file | The Glib::KeyFile to save the paper size to.

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

This function adds the paper size from size to key_file.

Since gtkmm 2.12:

Parameters:

  | key_file | The KeyFile to save the paper size to.
  | group_name | The group to add the settings to in key_file.

void Gtk::PaperSize::set_size | ( | double | width,
|  | double | height,
|  | Unit | unit |
| ) |  |  |

Changes the dimensions of a size to width x height.

Since gtkmm 2.10:

Parameters:

  | width | The new width in units of unit.
  | height | The new height in units of unit.
  | unit | The unit for width and height.

void Gtk::PaperSize::swap | ( | PaperSize& | other | ) |

Referenced by swap().

## Friends And Related Function Documentation

bool operator!= | ( | const PaperSize& | lhs,
|  | const PaperSize& | rhs |
| ) |  |  | `[related]`

References equal().

bool operator== | ( | const PaperSize& | lhs,
|  | const PaperSize& | rhs |
| ) |  |  | `[related]`

References equal().

void swap | ( | PaperSize& | lhs,
|  | PaperSize& | rhs |
| ) |  |  | `[related]`

Parameters:

  | lhs | The left-hand side
  | rhs | The right-hand side

References swap().

Gtk::PaperSize wrap | ( | GtkPaperSize * | 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.

## Member Data Documentation

GtkPaperSize* Gtk::PaperSize::gobject_`[protected]`

Referenced by gobj().

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

- papersize.h