gtkmm 4.17.0
|
PaperSize handles paper sizes. More...
#include <gtkmm/papersize.h>
Public Member Functions | |
PaperSize () | |
PaperSize (GtkPaperSize *gobject, bool make_a_copy=true) | |
PaperSize (const PaperSize &other) | |
PaperSize & | operator= (const PaperSize &other) |
PaperSize (PaperSize &&other) noexcept | |
PaperSize & | operator= (PaperSize &&other) noexcept |
~PaperSize () noexcept | |
void | swap (PaperSize &other) noexcept |
GtkPaperSize * | gobj () |
Provides access to the underlying C instance. | |
const GtkPaperSize * | gobj () const |
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. | |
PaperSize (const Glib::ustring & name) | |
PaperSize (const Glib::ustring &ppd_name, const Glib::ustring &ppd_display_name, double width, double height) | |
PaperSize (const Glib::ustring & name, const Glib::ustring & display_name, double width, double height, Unit unit) | |
PaperSize (const Glib::RefPtr< const Glib::KeyFile > &key_file, const Glib::ustring &group_name={}) | |
Reads a paper size from the group group_name in the key file key_file. | |
bool | equal (const PaperSize &other) const |
operator bool () const | |
Returns true if the PaperSize is a valid object. | |
Glib::ustring | get_name () const |
Gets the name of the Gtk::PaperSize . | |
Glib::ustring | get_display_name () const |
Gets the human-readable name of the Gtk::PaperSize . | |
Glib::ustring | get_ppd_name () const |
Gets the PPD name of the Gtk::PaperSize , which may be nullptr . | |
double | get_width (Unit unit) const |
Gets the paper width of the Gtk::PaperSize , in units of unit. | |
double | get_height (Unit unit) const |
Gets the paper height of the Gtk::PaperSize , in units of unit. | |
bool | is_custom () const |
Returns true if size is not a standard paper size. | |
bool | is_ipp () const |
Returns true if size is an IPP standard paper size. | |
void | set_size (double width, double height, Unit unit) |
Changes the dimensions of a size to width x height. | |
double | get_default_top_margin (Unit unit) const |
Gets the default top margin for the Gtk::PaperSize . | |
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 . | |
void | save_to_key_file (const Glib::RefPtr< Glib::KeyFile > &key_file, const Glib::ustring &group_name) |
This function adds the paper size from size to key_file. | |
void | save_to_key_file (const Glib::RefPtr< Glib::KeyFile > &key_file) |
This function adds the paper size to key_file in the first group. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
static std::vector< PaperSize > | get_paper_sizes (bool include_custom=true) |
Creates a list of known paper sizes. | |
static Glib::ustring | get_default () |
Returns the name of the default paper size, which depends on the current locale. | |
Protected Attributes | |
GtkPaperSize * | gobject_ |
Related Symbols | |
(Note that these are not member symbols.) | |
bool | operator== (const PaperSize &lhs, const PaperSize &rhs) |
bool | operator!= (const PaperSize &lhs, const PaperSize &rhs) |
void | swap (PaperSize &lhs, PaperSize &rhs) noexcept |
Gtk::PaperSize | wrap (GtkPaperSize *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
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.
Gtk::PaperSize::PaperSize | ( | ) |
|
explicit |
|
noexcept |
|
noexcept |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
Reads a paper size from the group group_name in the key file key_file.
key_file | The Glib::KeyFile to retrieve the paper size from. |
group_name | The name of the group in the key file to read, or an empty string to read the first group. |
Gtk::PrintError,Glib::KeyFileError |
|
static |
Returns the name of the default paper size, which depends on the current locale.
Gets the default bottom margin for the Gtk::PaperSize
.
unit | The unit for the return value, not Gtk::Unit::NONE. |
Gets the default left margin for the Gtk::PaperSize
.
unit | The unit for the return value, not Gtk::Unit::NONE. |
Gets the default right margin for the Gtk::PaperSize
.
unit | The unit for the return value, not Gtk::Unit::NONE. |
Gets the default top margin for the Gtk::PaperSize
.
unit | The unit for the return value, not Gtk::Unit::NONE. |
Glib::ustring Gtk::PaperSize::get_display_name | ( | ) | const |
Gets the human-readable name of the Gtk::PaperSize
.
Gets the paper height of the Gtk::PaperSize
, in units of unit.
unit | The unit for the return value, not Gtk::Unit::NONE. |
Glib::ustring Gtk::PaperSize::get_name | ( | ) | const |
Gets the name of the Gtk::PaperSize
.
|
static |
Creates a list of known paper sizes.
include_custom | Whether to include custom paper sizes as defined in the page setup dialog. |
Gtk::PaperSize
objects. Glib::ustring Gtk::PaperSize::get_ppd_name | ( | ) | const |
Gets the PPD name of the Gtk::PaperSize
, which may be nullptr
.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
Gets the paper width of the Gtk::PaperSize
, in units of unit.
unit | The unit for the return value, not Gtk::Unit::NONE. |
|
inline |
Provides access to the underlying C instance.
|
inline |
Provides access to the underlying C instance.
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 |
Returns true
if size is not a standard paper size.
bool Gtk::PaperSize::is_ipp | ( | ) | const |
Returns true
if size is an IPP standard paper size.
|
explicit |
void Gtk::PaperSize::save_to_key_file | ( | const Glib::RefPtr< Glib::KeyFile > & | key_file | ) |
This function adds the paper size to key_file in the first group.
key_file | The Glib::KeyFile to save the paper size to. |
void Gtk::PaperSize::save_to_key_file | ( | const Glib::RefPtr< Glib::KeyFile > & | key_file, |
const Glib::ustring & | group_name | ||
) |
This function adds the paper size from size to key_file.
key_file | The Glib::KeyFile to save the paper size to. |
group_name | The group to add the settings to in key_file. |
Changes the dimensions of a size to width x height.
width | The new width in units of unit. |
height | The new height in units of unit. |
unit | The unit for width and height. |
lhs | The left-hand side |
rhs | The right-hand side |
|
related |
A Glib::wrap() method for this object.
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. |
|
protected |