2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_PAPERSIZE_H
4 #define _GTKMM_PAPERSIZE_H
9 /* Copyright (C) 2006 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #ifndef DOXYGEN_SHOULD_SKIP_THIS
28 extern "C" { typedef struct _GtkPaperSize GtkPaperSize; }
34 /** Common paper names, from PWG 5101.1-2002 PWG: Standard for Media Standardized Names
37 const Glib::ustring PAPER_NAME_A3 = "iso_a3";
38 const Glib::ustring PAPER_NAME_A4 = "iso_a4";
39 const Glib::ustring PAPER_NAME_A5 = "iso_a5";
40 const Glib::ustring PAPER_NAME_B5 = "iso_b5";
41 const Glib::ustring PAPER_NAME_LETTER = "na_letter";
42 const Glib::ustring PAPER_NAME_EXECUTIVE = "na_executive";
43 const Glib::ustring PAPER_NAME_LEGAL = "na_legal";
45 /** @addtogroup gtkmmEnums Enums and Flags */
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
66 class Value<Gtk::Unit> : public Glib::Value_Enum<Gtk::Unit>
69 static GType value_type() G_GNUC_CONST;
73 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
80 /** PaperSize handles paper sizes. It uses the standard called "PWG 5101.1-2002 PWG: Standard for Media Standardized Names"
81 * to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, PaperSize allows
82 * to construct custom paper sizes with arbitrary dimensions.
84 * The PaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides
85 * default print margins.
93 // Cannot pass the _new function here, it must accept the 'name' argument.
95 #ifndef DOXYGEN_SHOULD_SKIP_THIS
96 typedef PaperSize CppObjectType;
97 typedef GtkPaperSize BaseObjectType;
99 static GType get_type() G_GNUC_CONST;
100 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
104 explicit PaperSize(GtkPaperSize* gobject, bool make_a_copy = true);
106 PaperSize(const PaperSize& other);
107 PaperSize& operator=(const PaperSize& other);
111 void swap(PaperSize& other);
113 ///Provides access to the underlying C instance.
114 GtkPaperSize* gobj() { return gobject_; }
116 ///Provides access to the underlying C instance.
117 const GtkPaperSize* gobj() const { return gobject_; }
119 ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
120 GtkPaperSize* gobj_copy() const;
123 GtkPaperSize* gobject_;
128 // Allowing no argument works because gtk_paper_size_new() will call
129 // gtk_paper_size_get_default() in case of NULL.
130 /// If a name is not specified, a default value will be used.
131 explicit PaperSize(const Glib::ustring& name = "");
132 explicit PaperSize(const Glib::ustring& ppd_name, const Glib::ustring& ppd_display_name, double width, double height);
133 explicit PaperSize(const Glib::ustring& name, const Glib::ustring& display_name, double width, double height, Unit unit);
136 bool equal(const PaperSize& other) const;
139 Glib::ustring get_name() const;
141 Glib::ustring get_display_name() const;
143 Glib::ustring get_ppd_name() const;
146 double get_width(Unit unit) const;
148 double get_height(Unit unit) const;
150 bool is_custom() const;
153 void set_size(double width, double height, Unit unit);
155 double get_default_top_margin(Unit unit) const;
157 double get_default_bottom_margin(Unit unit) const;
159 double get_default_left_margin(Unit unit) const;
161 double get_default_right_margin(Unit unit) const;
164 static Glib::ustring get_default();
169 /** @relates Gtk::PaperSize */
170 inline bool operator==(const PaperSize& lhs, const PaperSize& rhs)
171 { return lhs.equal(rhs); }
173 /** @relates Gtk::PaperSize */
174 inline bool operator!=(const PaperSize& lhs, const PaperSize& rhs)
175 { return !lhs.equal(rhs); }
183 /** @relates Gtk::PaperSize
184 * @param lhs The left-hand side
185 * @param rhs The right-hand side
187 inline void swap(PaperSize& lhs, PaperSize& rhs)
195 /** @relates Gtk::PaperSize
196 * @param object The C instance
197 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
198 * @result A C++ instance that wraps this C instance.
200 Gtk::PaperSize wrap(GtkPaperSize* object, bool take_copy = false);
202 #ifndef DOXYGEN_SHOULD_SKIP_THIS
204 class Value<Gtk::PaperSize> : public Glib::Value_Boxed<Gtk::PaperSize>
206 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
211 #endif /* _GTKMM_PAPERSIZE_H */