1 /* GTK - The GIMP Toolkit
2 * gtkpapersize.h: Paper Size
3 * Copyright (C) 2006, Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
20 #error "Only <gtk/gtk.h> can be included directly."
23 #ifndef __GTK_PAPER_SIZE_H__
24 #define __GTK_PAPER_SIZE_H__
27 #include <gtk/gtkenums.h>
32 typedef struct _GtkPaperSize GtkPaperSize;
34 #define GTK_TYPE_PAPER_SIZE (gtk_paper_size_get_type ())
36 /* Common names, from PWG 5101.1-2002 PWG: Standard for Media Standardized Names */
40 * Name for the A4 paper size.
42 #define GTK_PAPER_NAME_A3 "iso_a3"
47 * Name for the A4 paper size.
49 #define GTK_PAPER_NAME_A4 "iso_a4"
54 * Name for the A5 paper size.
56 #define GTK_PAPER_NAME_A5 "iso_a5"
61 * Name for the B5 paper size.
63 #define GTK_PAPER_NAME_B5 "iso_b5"
66 * GTK_PAPER_NAME_LETTER:
68 * Name for the Letter paper size.
70 #define GTK_PAPER_NAME_LETTER "na_letter"
73 * GTK_PAPER_NAME_EXECUTIVE:
75 * Name for the Executive paper size.
77 #define GTK_PAPER_NAME_EXECUTIVE "na_executive"
80 * GTK_PAPER_NAME_LEGAL:
82 * Name for the Legal paper size.
84 #define GTK_PAPER_NAME_LEGAL "na_legal"
86 GType gtk_paper_size_get_type (void) G_GNUC_CONST;
88 GtkPaperSize *gtk_paper_size_new (const gchar *name);
89 GtkPaperSize *gtk_paper_size_new_from_ppd (const gchar *ppd_name,
90 const gchar *ppd_display_name,
93 GtkPaperSize *gtk_paper_size_new_custom (const gchar *name,
94 const gchar *display_name,
98 GtkPaperSize *gtk_paper_size_copy (GtkPaperSize *other);
99 void gtk_paper_size_free (GtkPaperSize *size);
100 gboolean gtk_paper_size_is_equal (GtkPaperSize *size1,
101 GtkPaperSize *size2);
103 GList *gtk_paper_size_get_paper_sizes (gboolean include_custom);
105 /* The width is always the shortest side, measure in mm */
106 const gchar *gtk_paper_size_get_name (GtkPaperSize *size);
107 const gchar *gtk_paper_size_get_display_name (GtkPaperSize *size);
108 const gchar *gtk_paper_size_get_ppd_name (GtkPaperSize *size);
110 gdouble gtk_paper_size_get_width (GtkPaperSize *size, GtkUnit unit);
111 gdouble gtk_paper_size_get_height (GtkPaperSize *size, GtkUnit unit);
112 gboolean gtk_paper_size_is_custom (GtkPaperSize *size);
114 /* Only for custom sizes: */
115 void gtk_paper_size_set_size (GtkPaperSize *size,
120 gdouble gtk_paper_size_get_default_top_margin (GtkPaperSize *size,
122 gdouble gtk_paper_size_get_default_bottom_margin (GtkPaperSize *size,
124 gdouble gtk_paper_size_get_default_left_margin (GtkPaperSize *size,
126 gdouble gtk_paper_size_get_default_right_margin (GtkPaperSize *size,
129 const gchar *gtk_paper_size_get_default (void);
131 GtkPaperSize *gtk_paper_size_new_from_key_file (GKeyFile *key_file,
132 const gchar *group_name,
134 void gtk_paper_size_to_key_file (GtkPaperSize *size,
136 const gchar *group_name);
140 #endif /* __GTK_PAPER_SIZE_H__ */