1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD 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
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GtkPageSetupUnixDialog.html
27  * outPack = gtk
28  * outFile = PageSetupUnixDialog
29  * strct   = GtkPageSetupUnixDialog
30  * realStrct=
31  * ctorStrct=
32  * clss    = PageSetupUnixDialog
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_page_setup_unix_dialog_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gtk.PageSetup
48  * 	- gtk.PrintSettings
49  * 	- gtk.Widget
50  * 	- gtk.Window
51  * structWrap:
52  * 	- GtkPageSetup* -> PageSetup
53  * 	- GtkPrintSettings* -> PrintSettings
54  * 	- GtkWidget* -> Widget
55  * 	- GtkWindow* -> Window
56  * module aliases:
57  * local aliases:
58  * overrides:
59  */
60 
61 module gtk.PageSetupUnixDialog;
62 
63 public  import gtkc.gtktypes;
64 
65 private import gtkc.gtk;
66 private import glib.ConstructionException;
67 private import gobject.ObjectG;
68 
69 
70 private import glib.Str;
71 private import gtk.PageSetup;
72 private import gtk.PrintSettings;
73 private import gtk.Widget;
74 private import gtk.Window;
75 
76 
77 
78 private import gtk.Dialog;
79 
80 /**
81  * GtkPageSetupUnixDialog implements a page setup dialog for platforms
82  * which don't provide a native page setup dialog, like Unix. It can
83  * be used very much like any other GTK+ dialog, at the cost of
84  * the portability offered by the high-level printing API
85  *
86  * Printing support was added in GTK+ 2.10.
87  */
88 public class PageSetupUnixDialog : Dialog
89 {
90 	
91 	/** the main Gtk struct */
92 	protected GtkPageSetupUnixDialog* gtkPageSetupUnixDialog;
93 	
94 	
95 	public GtkPageSetupUnixDialog* getPageSetupUnixDialogStruct()
96 	{
97 		return gtkPageSetupUnixDialog;
98 	}
99 	
100 	
101 	/** the main Gtk struct as a void* */
102 	protected override void* getStruct()
103 	{
104 		return cast(void*)gtkPageSetupUnixDialog;
105 	}
106 	
107 	/**
108 	 * Sets our main struct and passes it to the parent class
109 	 */
110 	public this (GtkPageSetupUnixDialog* gtkPageSetupUnixDialog)
111 	{
112 		super(cast(GtkDialog*)gtkPageSetupUnixDialog);
113 		this.gtkPageSetupUnixDialog = gtkPageSetupUnixDialog;
114 	}
115 	
116 	protected override void setStruct(GObject* obj)
117 	{
118 		super.setStruct(obj);
119 		gtkPageSetupUnixDialog = cast(GtkPageSetupUnixDialog*)obj;
120 	}
121 	
122 	/**
123 	 */
124 	
125 	/**
126 	 * Creates a new page setup dialog.
127 	 * Since 2.10
128 	 * Params:
129 	 * title = the title of the dialog, or NULL. [allow-none]
130 	 * parent = transient parent of the dialog, or NULL. [allow-none]
131 	 * Throws: ConstructionException GTK+ fails to create the object.
132 	 */
133 	public this (string title, Window parent)
134 	{
135 		// GtkWidget * gtk_page_setup_unix_dialog_new (const gchar *title,  GtkWindow *parent);
136 		auto p = gtk_page_setup_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct());
137 		if(p is null)
138 		{
139 			throw new ConstructionException("null returned by gtk_page_setup_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct())");
140 		}
141 		this(cast(GtkPageSetupUnixDialog*) p);
142 	}
143 	
144 	/**
145 	 * Sets the GtkPageSetup from which the page setup
146 	 * dialog takes its values.
147 	 * Since 2.10
148 	 * Params:
149 	 * pageSetup = a GtkPageSetup
150 	 */
151 	public void setPageSetup(PageSetup pageSetup)
152 	{
153 		// void gtk_page_setup_unix_dialog_set_page_setup  (GtkPageSetupUnixDialog *dialog,  GtkPageSetup *page_setup);
154 		gtk_page_setup_unix_dialog_set_page_setup(gtkPageSetupUnixDialog, (pageSetup is null) ? null : pageSetup.getPageSetupStruct());
155 	}
156 	
157 	/**
158 	 * Gets the currently selected page setup from the dialog.
159 	 * Since 2.10
160 	 * Returns: the current page setup. [transfer none]
161 	 */
162 	public PageSetup getPageSetup()
163 	{
164 		// GtkPageSetup * gtk_page_setup_unix_dialog_get_page_setup  (GtkPageSetupUnixDialog *dialog);
165 		auto p = gtk_page_setup_unix_dialog_get_page_setup(gtkPageSetupUnixDialog);
166 		
167 		if(p is null)
168 		{
169 			return null;
170 		}
171 		
172 		return ObjectG.getDObject!(PageSetup)(cast(GtkPageSetup*) p);
173 	}
174 	
175 	/**
176 	 * Sets the GtkPrintSettings from which the page setup dialog
177 	 * takes its values.
178 	 * Since 2.10
179 	 * Params:
180 	 * printSettings = a GtkPrintSettings
181 	 */
182 	public void setPrintSettings(PrintSettings printSettings)
183 	{
184 		// void gtk_page_setup_unix_dialog_set_print_settings  (GtkPageSetupUnixDialog *dialog,  GtkPrintSettings *print_settings);
185 		gtk_page_setup_unix_dialog_set_print_settings(gtkPageSetupUnixDialog, (printSettings is null) ? null : printSettings.getPrintSettingsStruct());
186 	}
187 	
188 	/**
189 	 * Gets the current print settings from the dialog.
190 	 * Since 2.10
191 	 * Returns: the current print settings. [transfer none]
192 	 */
193 	public PrintSettings getPrintSettings()
194 	{
195 		// GtkPrintSettings * gtk_page_setup_unix_dialog_get_print_settings  (GtkPageSetupUnixDialog *dialog);
196 		auto p = gtk_page_setup_unix_dialog_get_print_settings(gtkPageSetupUnixDialog);
197 		
198 		if(p is null)
199 		{
200 			return null;
201 		}
202 		
203 		return ObjectG.getDObject!(PrintSettings)(cast(GtkPrintSettings*) p);
204 	}
205 }