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 private import glib.Str;
70 private import gtk.PageSetup;
71 private import gtk.PrintSettings;
72 private import gtk.Widget;
73 private import gtk.Window;
74 
75 
76 private import gtk.Dialog;
77 
78 /**
79  * GtkPageSetupUnixDialog implements a page setup dialog for platforms
80  * which don't provide a native page setup dialog, like Unix. It can
81  * be used very much like any other GTK+ dialog, at the cost of
82  * the portability offered by the high-level printing API
83  *
84  * Printing support was added in GTK+ 2.10.
85  */
86 public class PageSetupUnixDialog : Dialog
87 {
88 	
89 	/** the main Gtk struct */
90 	protected GtkPageSetupUnixDialog* gtkPageSetupUnixDialog;
91 	
92 	
93 	/** Get the main Gtk struct */
94 	public GtkPageSetupUnixDialog* getPageSetupUnixDialogStruct()
95 	{
96 		return gtkPageSetupUnixDialog;
97 	}
98 	
99 	
100 	/** the main Gtk struct as a void* */
101 	protected override void* getStruct()
102 	{
103 		return cast(void*)gtkPageSetupUnixDialog;
104 	}
105 	
106 	/**
107 	 * Sets our main struct and passes it to the parent class
108 	 */
109 	public this (GtkPageSetupUnixDialog* gtkPageSetupUnixDialog)
110 	{
111 		super(cast(GtkDialog*)gtkPageSetupUnixDialog);
112 		this.gtkPageSetupUnixDialog = gtkPageSetupUnixDialog;
113 	}
114 	
115 	protected override void setStruct(GObject* obj)
116 	{
117 		super.setStruct(obj);
118 		gtkPageSetupUnixDialog = cast(GtkPageSetupUnixDialog*)obj;
119 	}
120 	
121 	/**
122 	 */
123 	
124 	/**
125 	 * Creates a new page setup dialog.
126 	 * Since 2.10
127 	 * Params:
128 	 * title = the title of the dialog, or NULL. [allow-none]
129 	 * parent = transient parent of the dialog, or NULL. [allow-none]
130 	 * Throws: ConstructionException GTK+ fails to create the object.
131 	 */
132 	public this (string title, Window parent)
133 	{
134 		// GtkWidget * gtk_page_setup_unix_dialog_new (const gchar *title,  GtkWindow *parent);
135 		auto p = gtk_page_setup_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct());
136 		if(p is null)
137 		{
138 			throw new ConstructionException("null returned by gtk_page_setup_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct())");
139 		}
140 		this(cast(GtkPageSetupUnixDialog*) p);
141 	}
142 	
143 	/**
144 	 * Sets the GtkPageSetup from which the page setup
145 	 * dialog takes its values.
146 	 * Since 2.10
147 	 * Params:
148 	 * pageSetup = a GtkPageSetup
149 	 */
150 	public void setPageSetup(PageSetup pageSetup)
151 	{
152 		// void gtk_page_setup_unix_dialog_set_page_setup  (GtkPageSetupUnixDialog *dialog,  GtkPageSetup *page_setup);
153 		gtk_page_setup_unix_dialog_set_page_setup(gtkPageSetupUnixDialog, (pageSetup is null) ? null : pageSetup.getPageSetupStruct());
154 	}
155 	
156 	/**
157 	 * Gets the currently selected page setup from the dialog.
158 	 * Since 2.10
159 	 * Returns: the current page setup. [transfer none]
160 	 */
161 	public PageSetup getPageSetup()
162 	{
163 		// GtkPageSetup * gtk_page_setup_unix_dialog_get_page_setup  (GtkPageSetupUnixDialog *dialog);
164 		auto p = gtk_page_setup_unix_dialog_get_page_setup(gtkPageSetupUnixDialog);
165 		
166 		if(p is null)
167 		{
168 			return null;
169 		}
170 		
171 		return ObjectG.getDObject!(PageSetup)(cast(GtkPageSetup*) p);
172 	}
173 	
174 	/**
175 	 * Sets the GtkPrintSettings from which the page setup dialog
176 	 * takes its values.
177 	 * Since 2.10
178 	 * Params:
179 	 * printSettings = a GtkPrintSettings
180 	 */
181 	public void setPrintSettings(PrintSettings printSettings)
182 	{
183 		// void gtk_page_setup_unix_dialog_set_print_settings  (GtkPageSetupUnixDialog *dialog,  GtkPrintSettings *print_settings);
184 		gtk_page_setup_unix_dialog_set_print_settings(gtkPageSetupUnixDialog, (printSettings is null) ? null : printSettings.getPrintSettingsStruct());
185 	}
186 	
187 	/**
188 	 * Gets the current print settings from the dialog.
189 	 * Since 2.10
190 	 * Returns: the current print settings. [transfer none]
191 	 */
192 	public PrintSettings getPrintSettings()
193 	{
194 		// GtkPrintSettings * gtk_page_setup_unix_dialog_get_print_settings  (GtkPageSetupUnixDialog *dialog);
195 		auto p = gtk_page_setup_unix_dialog_get_print_settings(gtkPageSetupUnixDialog);
196 		
197 		if(p is null)
198 		{
199 			return null;
200 		}
201 		
202 		return ObjectG.getDObject!(PrintSettings)(cast(GtkPrintSettings*) p);
203 	}
204 }