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, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __GTK_PAGE_SETUP_H__
22#define __GTK_PAGE_SETUP_H__
23
24
25#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
26#error "Only <gtk/gtk.h> can be included directly."
27#endif
28
29#include <gtk/gtkpapersize.h>
30
31
32G_BEGIN_DECLS
33
34typedef struct _GtkPageSetup GtkPageSetup;
35
36#define GTK_TYPE_PAGE_SETUP (gtk_page_setup_get_type ())
37#define GTK_PAGE_SETUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PAGE_SETUP, GtkPageSetup))
38#define GTK_IS_PAGE_SETUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PAGE_SETUP))
39
40GType gtk_page_setup_get_type (void) G_GNUC_CONST;
41GtkPageSetup * gtk_page_setup_new (void);
42GtkPageSetup * gtk_page_setup_copy (GtkPageSetup *other);
43GtkPageOrientation gtk_page_setup_get_orientation (GtkPageSetup *setup);
44void gtk_page_setup_set_orientation (GtkPageSetup *setup,
45 GtkPageOrientation orientation);
46GtkPaperSize * gtk_page_setup_get_paper_size (GtkPageSetup *setup);
47void gtk_page_setup_set_paper_size (GtkPageSetup *setup,
48 GtkPaperSize *size);
49gdouble gtk_page_setup_get_top_margin (GtkPageSetup *setup,
50 GtkUnit unit);
51void gtk_page_setup_set_top_margin (GtkPageSetup *setup,
52 gdouble margin,
53 GtkUnit unit);
54gdouble gtk_page_setup_get_bottom_margin (GtkPageSetup *setup,
55 GtkUnit unit);
56void gtk_page_setup_set_bottom_margin (GtkPageSetup *setup,
57 gdouble margin,
58 GtkUnit unit);
59gdouble gtk_page_setup_get_left_margin (GtkPageSetup *setup,
60 GtkUnit unit);
61void gtk_page_setup_set_left_margin (GtkPageSetup *setup,
62 gdouble margin,
63 GtkUnit unit);
64gdouble gtk_page_setup_get_right_margin (GtkPageSetup *setup,
65 GtkUnit unit);
66void gtk_page_setup_set_right_margin (GtkPageSetup *setup,
67 gdouble margin,
68 GtkUnit unit);
69
70void gtk_page_setup_set_paper_size_and_default_margins (GtkPageSetup *setup,
71 GtkPaperSize *size);
72
73/* These take orientation, but not margins into consideration */
74gdouble gtk_page_setup_get_paper_width (GtkPageSetup *setup,
75 GtkUnit unit);
76gdouble gtk_page_setup_get_paper_height (GtkPageSetup *setup,
77 GtkUnit unit);
78
79
80/* These take orientation, and margins into consideration */
81gdouble gtk_page_setup_get_page_width (GtkPageSetup *setup,
82 GtkUnit unit);
83gdouble gtk_page_setup_get_page_height (GtkPageSetup *setup,
84 GtkUnit unit);
85
86/* Saving and restoring page setup */
87GtkPageSetup *gtk_page_setup_new_from_file (const gchar *file_name,
88 GError **error);
89gboolean gtk_page_setup_load_file (GtkPageSetup *setup,
90 const char *file_name,
91 GError **error);
92gboolean gtk_page_setup_to_file (GtkPageSetup *setup,
93 const char *file_name,
94 GError **error);
95GtkPageSetup *gtk_page_setup_new_from_key_file (GKeyFile *key_file,
96 const gchar *group_name,
97 GError **error);
98gboolean gtk_page_setup_load_key_file (GtkPageSetup *setup,
99 GKeyFile *key_file,
100 const gchar *group_name,
101 GError **error);
102void gtk_page_setup_to_key_file (GtkPageSetup *setup,
103 GKeyFile *key_file,
104 const gchar *group_name);
105
106G_END_DECLS
107
108#endif /* __GTK_PAGE_SETUP_H__ */
109