1/* GTK - The GIMP Toolkit
2 * gtkpagesetup.h: Page Setup
3 * Copyright (C) 2006, Red Hat, Inc.
4 *
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.
9 *
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.
14 *
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/>.
17 */
18
19#ifndef __GTK_PAGE_SETUP_H__
20#define __GTK_PAGE_SETUP_H__
21
22
23#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
24#error "Only <gtk/gtk.h> can be included directly."
25#endif
26
27#include <gtk/gtkpapersize.h>
28
29
30G_BEGIN_DECLS
31
32typedef struct _GtkPageSetup GtkPageSetup;
33
34#define GTK_TYPE_PAGE_SETUP (gtk_page_setup_get_type ())
35#define GTK_PAGE_SETUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PAGE_SETUP, GtkPageSetup))
36#define GTK_IS_PAGE_SETUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PAGE_SETUP))
37
38GDK_AVAILABLE_IN_ALL
39GType gtk_page_setup_get_type (void) G_GNUC_CONST;
40GDK_AVAILABLE_IN_ALL
41GtkPageSetup * gtk_page_setup_new (void);
42GDK_AVAILABLE_IN_ALL
43GtkPageSetup * gtk_page_setup_copy (GtkPageSetup *other);
44GDK_AVAILABLE_IN_ALL
45GtkPageOrientation gtk_page_setup_get_orientation (GtkPageSetup *setup);
46GDK_AVAILABLE_IN_ALL
47void gtk_page_setup_set_orientation (GtkPageSetup *setup,
48 GtkPageOrientation orientation);
49GDK_AVAILABLE_IN_ALL
50GtkPaperSize * gtk_page_setup_get_paper_size (GtkPageSetup *setup);
51GDK_AVAILABLE_IN_ALL
52void gtk_page_setup_set_paper_size (GtkPageSetup *setup,
53 GtkPaperSize *size);
54GDK_AVAILABLE_IN_ALL
55gdouble gtk_page_setup_get_top_margin (GtkPageSetup *setup,
56 GtkUnit unit);
57GDK_AVAILABLE_IN_ALL
58void gtk_page_setup_set_top_margin (GtkPageSetup *setup,
59 gdouble margin,
60 GtkUnit unit);
61GDK_AVAILABLE_IN_ALL
62gdouble gtk_page_setup_get_bottom_margin (GtkPageSetup *setup,
63 GtkUnit unit);
64GDK_AVAILABLE_IN_ALL
65void gtk_page_setup_set_bottom_margin (GtkPageSetup *setup,
66 gdouble margin,
67 GtkUnit unit);
68GDK_AVAILABLE_IN_ALL
69gdouble gtk_page_setup_get_left_margin (GtkPageSetup *setup,
70 GtkUnit unit);
71GDK_AVAILABLE_IN_ALL
72void gtk_page_setup_set_left_margin (GtkPageSetup *setup,
73 gdouble margin,
74 GtkUnit unit);
75GDK_AVAILABLE_IN_ALL
76gdouble gtk_page_setup_get_right_margin (GtkPageSetup *setup,
77 GtkUnit unit);
78GDK_AVAILABLE_IN_ALL
79void gtk_page_setup_set_right_margin (GtkPageSetup *setup,
80 gdouble margin,
81 GtkUnit unit);
82
83GDK_AVAILABLE_IN_ALL
84void gtk_page_setup_set_paper_size_and_default_margins (GtkPageSetup *setup,
85 GtkPaperSize *size);
86
87/* These take orientation, but not margins into consideration */
88GDK_AVAILABLE_IN_ALL
89gdouble gtk_page_setup_get_paper_width (GtkPageSetup *setup,
90 GtkUnit unit);
91GDK_AVAILABLE_IN_ALL
92gdouble gtk_page_setup_get_paper_height (GtkPageSetup *setup,
93 GtkUnit unit);
94
95
96/* These take orientation, and margins into consideration */
97GDK_AVAILABLE_IN_ALL
98gdouble gtk_page_setup_get_page_width (GtkPageSetup *setup,
99 GtkUnit unit);
100GDK_AVAILABLE_IN_ALL
101gdouble gtk_page_setup_get_page_height (GtkPageSetup *setup,
102 GtkUnit unit);
103
104/* Saving and restoring page setup */
105GDK_AVAILABLE_IN_ALL
106GtkPageSetup *gtk_page_setup_new_from_file (const gchar *file_name,
107 GError **error);
108GDK_AVAILABLE_IN_ALL
109gboolean gtk_page_setup_load_file (GtkPageSetup *setup,
110 const char *file_name,
111 GError **error);
112GDK_AVAILABLE_IN_ALL
113gboolean gtk_page_setup_to_file (GtkPageSetup *setup,
114 const char *file_name,
115 GError **error);
116GDK_AVAILABLE_IN_ALL
117GtkPageSetup *gtk_page_setup_new_from_key_file (GKeyFile *key_file,
118 const gchar *group_name,
119 GError **error);
120GDK_AVAILABLE_IN_ALL
121gboolean gtk_page_setup_load_key_file (GtkPageSetup *setup,
122 GKeyFile *key_file,
123 const gchar *group_name,
124 GError **error);
125GDK_AVAILABLE_IN_ALL
126void gtk_page_setup_to_key_file (GtkPageSetup *setup,
127 GKeyFile *key_file,
128 const gchar *group_name);
129
130GDK_AVAILABLE_IN_3_22
131GVariant *gtk_page_setup_to_gvariant (GtkPageSetup *setup);
132GDK_AVAILABLE_IN_3_22
133GtkPageSetup *gtk_page_setup_new_from_gvariant (GVariant *variant);
134
135G_END_DECLS
136
137#endif /* __GTK_PAGE_SETUP_H__ */
138