gtkpagesetup.h 5.44 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
2 3 4 5 6 7 8 9 10 11 12 13 14 15
 * gtkpagesetup.h: Page Setup
 * Copyright (C) 2006, Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
16
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 18 19 20 21
 */

#ifndef __GTK_PAGE_SETUP_H__
#define __GTK_PAGE_SETUP_H__

22

23 24 25 26
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

27
#include <gtk/gtkpapersize.h>
28

29

30 31 32 33 34 35 36 37
G_BEGIN_DECLS

typedef struct _GtkPageSetup GtkPageSetup;

#define GTK_TYPE_PAGE_SETUP    (gtk_page_setup_get_type ())
#define GTK_PAGE_SETUP(obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PAGE_SETUP, GtkPageSetup))
#define GTK_IS_PAGE_SETUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PAGE_SETUP))

38
GDK_AVAILABLE_IN_ALL
39
GType              gtk_page_setup_get_type          (void) G_GNUC_CONST;
40
GDK_AVAILABLE_IN_ALL
41
GtkPageSetup *     gtk_page_setup_new               (void);
42
GDK_AVAILABLE_IN_ALL
43
GtkPageSetup *     gtk_page_setup_copy              (GtkPageSetup       *other);
44
GDK_AVAILABLE_IN_ALL
45
GtkPageOrientation gtk_page_setup_get_orientation   (GtkPageSetup       *setup);
46
GDK_AVAILABLE_IN_ALL
47 48
void               gtk_page_setup_set_orientation   (GtkPageSetup       *setup,
						     GtkPageOrientation  orientation);
49
GDK_AVAILABLE_IN_ALL
50
GtkPaperSize *     gtk_page_setup_get_paper_size    (GtkPageSetup       *setup);
51
GDK_AVAILABLE_IN_ALL
52 53
void               gtk_page_setup_set_paper_size    (GtkPageSetup       *setup,
						     GtkPaperSize       *size);
54
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
55
gdouble            gtk_page_setup_get_top_margin    (GtkPageSetup       *setup,
56
						     GtkUnit             unit);
57
GDK_AVAILABLE_IN_ALL
58
void               gtk_page_setup_set_top_margin    (GtkPageSetup       *setup,
Matthias Clasen's avatar
Matthias Clasen committed
59
						     gdouble             margin,
60
						     GtkUnit             unit);
61
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
62
gdouble            gtk_page_setup_get_bottom_margin (GtkPageSetup       *setup,
63
						     GtkUnit             unit);
64
GDK_AVAILABLE_IN_ALL
65
void               gtk_page_setup_set_bottom_margin (GtkPageSetup       *setup,
Matthias Clasen's avatar
Matthias Clasen committed
66
						     gdouble             margin,
67
						     GtkUnit             unit);
68
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
69
gdouble            gtk_page_setup_get_left_margin   (GtkPageSetup       *setup,
70
						     GtkUnit             unit);
71
GDK_AVAILABLE_IN_ALL
72
void               gtk_page_setup_set_left_margin   (GtkPageSetup       *setup,
Matthias Clasen's avatar
Matthias Clasen committed
73
						     gdouble             margin,
74
						     GtkUnit             unit);
75
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
76
gdouble            gtk_page_setup_get_right_margin  (GtkPageSetup       *setup,
77
						     GtkUnit             unit);
78
GDK_AVAILABLE_IN_ALL
79
void               gtk_page_setup_set_right_margin  (GtkPageSetup       *setup,
Matthias Clasen's avatar
Matthias Clasen committed
80
						     gdouble             margin,
81 82
						     GtkUnit             unit);

83
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
84 85
void gtk_page_setup_set_paper_size_and_default_margins (GtkPageSetup    *setup,
							GtkPaperSize    *size);
86 87

/* These take orientation, but not margins into consideration */
88
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
89
gdouble            gtk_page_setup_get_paper_width   (GtkPageSetup       *setup,
90
						     GtkUnit             unit);
91
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
92
gdouble            gtk_page_setup_get_paper_height  (GtkPageSetup       *setup,
93 94 95 96
						     GtkUnit             unit);


/* These take orientation, and margins into consideration */
97
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
98
gdouble            gtk_page_setup_get_page_width    (GtkPageSetup       *setup,
99
						     GtkUnit             unit);
100
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
101
gdouble            gtk_page_setup_get_page_height   (GtkPageSetup       *setup,
102 103
						     GtkUnit             unit);

Matthias Clasen's avatar
Matthias Clasen committed
104
/* Saving and restoring page setup */
105
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
106 107
GtkPageSetup	  *gtk_page_setup_new_from_file	    (const gchar         *file_name,
						     GError              **error);
108
GDK_AVAILABLE_IN_ALL
109 110 111
gboolean	   gtk_page_setup_load_file	    (GtkPageSetup        *setup,
						     const char          *file_name,
						     GError             **error);
112
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
113 114 115
gboolean	   gtk_page_setup_to_file	    (GtkPageSetup        *setup,
						     const char          *file_name,
						     GError             **error);
116
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
117 118 119
GtkPageSetup	  *gtk_page_setup_new_from_key_file (GKeyFile            *key_file,
						     const gchar         *group_name,
						     GError             **error);
120
GDK_AVAILABLE_IN_ALL
121 122 123 124
gboolean           gtk_page_setup_load_key_file     (GtkPageSetup        *setup,
				                     GKeyFile            *key_file,
				                     const gchar         *group_name,
				                     GError             **error);
125
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
126 127 128
void		   gtk_page_setup_to_key_file	    (GtkPageSetup        *setup,
						     GKeyFile            *key_file,
						     const gchar         *group_name);
129

130 131 132 133 134
GDK_AVAILABLE_IN_3_22
GVariant          *gtk_page_setup_to_gvariant       (GtkPageSetup        *setup);
GDK_AVAILABLE_IN_3_22
GtkPageSetup      *gtk_page_setup_new_from_gvariant (GVariant            *variant);

135 136 137
G_END_DECLS

#endif /* __GTK_PAGE_SETUP_H__ */