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