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 | |
30 | G_BEGIN_DECLS |
31 | |
32 | typedef 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 | |
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 | void gtk_page_setup_set_orientation (GtkPageSetup *setup, |
48 | GtkPageOrientation orientation); |
49 | GDK_AVAILABLE_IN_ALL |
50 | GtkPaperSize * gtk_page_setup_get_paper_size (GtkPageSetup *setup); |
51 | GDK_AVAILABLE_IN_ALL |
52 | void gtk_page_setup_set_paper_size (GtkPageSetup *setup, |
53 | GtkPaperSize *size); |
54 | GDK_AVAILABLE_IN_ALL |
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, |
59 | gdouble margin, |
60 | GtkUnit unit); |
61 | GDK_AVAILABLE_IN_ALL |
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, |
66 | gdouble margin, |
67 | GtkUnit unit); |
68 | GDK_AVAILABLE_IN_ALL |
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, |
73 | gdouble margin, |
74 | GtkUnit unit); |
75 | GDK_AVAILABLE_IN_ALL |
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, |
80 | gdouble margin, |
81 | GtkUnit unit); |
82 | |
83 | GDK_AVAILABLE_IN_ALL |
84 | void gtk_page_setup_set_paper_size_and_default_margins (GtkPageSetup *setup, |
85 | GtkPaperSize *size); |
86 | |
87 | /* These take orientation, but not margins into consideration */ |
88 | GDK_AVAILABLE_IN_ALL |
89 | gdouble gtk_page_setup_get_paper_width (GtkPageSetup *setup, |
90 | GtkUnit unit); |
91 | GDK_AVAILABLE_IN_ALL |
92 | gdouble gtk_page_setup_get_paper_height (GtkPageSetup *setup, |
93 | GtkUnit unit); |
94 | |
95 | |
96 | /* These take orientation, and margins into consideration */ |
97 | GDK_AVAILABLE_IN_ALL |
98 | gdouble gtk_page_setup_get_page_width (GtkPageSetup *setup, |
99 | GtkUnit unit); |
100 | GDK_AVAILABLE_IN_ALL |
101 | gdouble gtk_page_setup_get_page_height (GtkPageSetup *setup, |
102 | GtkUnit unit); |
103 | |
104 | /* Saving and restoring page setup */ |
105 | GDK_AVAILABLE_IN_ALL |
106 | GtkPageSetup *gtk_page_setup_new_from_file (const gchar *file_name, |
107 | GError **error); |
108 | GDK_AVAILABLE_IN_ALL |
109 | gboolean gtk_page_setup_load_file (GtkPageSetup *setup, |
110 | const char *file_name, |
111 | GError **error); |
112 | GDK_AVAILABLE_IN_ALL |
113 | gboolean gtk_page_setup_to_file (GtkPageSetup *setup, |
114 | const char *file_name, |
115 | GError **error); |
116 | GDK_AVAILABLE_IN_ALL |
117 | GtkPageSetup *gtk_page_setup_new_from_key_file (GKeyFile *key_file, |
118 | const gchar *group_name, |
119 | GError **error); |
120 | GDK_AVAILABLE_IN_ALL |
121 | gboolean gtk_page_setup_load_key_file (GtkPageSetup *setup, |
122 | GKeyFile *key_file, |
123 | const gchar *group_name, |
124 | GError **error); |
125 | GDK_AVAILABLE_IN_ALL |
126 | void gtk_page_setup_to_key_file (GtkPageSetup *setup, |
127 | GKeyFile *key_file, |
128 | const gchar *group_name); |
129 | |
130 | GDK_AVAILABLE_IN_3_22 |
131 | GVariant *gtk_page_setup_to_gvariant (GtkPageSetup *setup); |
132 | GDK_AVAILABLE_IN_3_22 |
133 | GtkPageSetup *gtk_page_setup_new_from_gvariant (GVariant *variant); |
134 | |
135 | G_END_DECLS |
136 | |
137 | #endif /* __GTK_PAGE_SETUP_H__ */ |
138 | |