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  = GtkPrintUnixDialog.html
27  * outPack = gtk
28  * outFile = PrintUnixDialog
29  * strct   = GtkPrintUnixDialog
30  * realStrct=
31  * ctorStrct=
32  * clss    = PrintUnixDialog
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_print_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.Printer
51  * 	- gtk.PageSetup
52  * 	- gtk.PrintSettings
53  * structWrap:
54  * 	- GtkPageSetup* -> PageSetup
55  * 	- GtkPrintSettings* -> PrintSettings
56  * 	- GtkPrinter* -> Printer
57  * 	- GtkWidget* -> Widget
58  * 	- GtkWindow* -> Window
59  * module aliases:
60  * local aliases:
61  * 	- getSettings -> getPrintSettings
62  * 	- setSettings -> setPrintSettings
63  * overrides:
64  */
65 
66 module gtk.PrintUnixDialog;
67 
68 public  import gtkc.gtktypes;
69 
70 private import gtkc.gtk;
71 private import glib.ConstructionException;
72 private import gobject.ObjectG;
73 
74 
75 private import glib.Str;
76 private import gtk.Widget;
77 private import gtk.Window;
78 private import gtk.Printer;
79 private import gtk.PageSetup;
80 private import gtk.PrintSettings;
81 
82 
83 
84 private import gtk.Dialog;
85 
86 /**
87  * Description
88  * GtkPrintUnixDialog implements a print dialog for platforms
89  * which don't provide a native print dialog, like Unix. It can
90  * be used very much like any other GTK+ dialog, at the cost of
91  * the portability offered by the high-level printing API
92  * In order to print something with GtkPrintUnixDialog, you need
93  * to use gtk_print_unix_dialog_get_selected_printer() to obtain
94  * a GtkPrinter object and use it to construct a GtkPrintJob using
95  * gtk_print_job_new().
96  * GtkPrintUnixDialog uses the following response values:
97  * GTK_RESPONSE_OK
98  * for the "Print" button
99  * GTK_RESPONSE_APPLY
100  * for the "Preview" button
101  * GTK_RESPONSE_CANCEL
102  * for the "Cancel" button
103  * Printing support was added in GTK+ 2.10.
104  * GtkPrintUnixDialog as GtkBuildable
105  * The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its
106  * notebook internal children with the name "notebook".
107  * $(DDOC_COMMENT example)
108  */
109 public class PrintUnixDialog : Dialog
110 {
111 	
112 	/** the main Gtk struct */
113 	protected GtkPrintUnixDialog* gtkPrintUnixDialog;
114 	
115 	
116 	public GtkPrintUnixDialog* getPrintUnixDialogStruct()
117 	{
118 		return gtkPrintUnixDialog;
119 	}
120 	
121 	
122 	/** the main Gtk struct as a void* */
123 	protected override void* getStruct()
124 	{
125 		return cast(void*)gtkPrintUnixDialog;
126 	}
127 	
128 	/**
129 	 * Sets our main struct and passes it to the parent class
130 	 */
131 	public this (GtkPrintUnixDialog* gtkPrintUnixDialog)
132 	{
133 		super(cast(GtkDialog*)gtkPrintUnixDialog);
134 		this.gtkPrintUnixDialog = gtkPrintUnixDialog;
135 	}
136 	
137 	protected override void setStruct(GObject* obj)
138 	{
139 		super.setStruct(obj);
140 		gtkPrintUnixDialog = cast(GtkPrintUnixDialog*)obj;
141 	}
142 	
143 	/**
144 	 */
145 	
146 	/**
147 	 * Creates a new GtkPrintUnixDialog.
148 	 * Since 2.10
149 	 * Params:
150 	 * title = Title of the dialog, or NULL. [allow-none]
151 	 * parent = Transient parent of the dialog, or NULL. [allow-none]
152 	 * Throws: ConstructionException GTK+ fails to create the object.
153 	 */
154 	public this (string title, Window parent)
155 	{
156 		// GtkWidget * gtk_print_unix_dialog_new (const gchar *title,  GtkWindow *parent);
157 		auto p = gtk_print_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct());
158 		if(p is null)
159 		{
160 			throw new ConstructionException("null returned by gtk_print_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct())");
161 		}
162 		this(cast(GtkPrintUnixDialog*) p);
163 	}
164 	
165 	/**
166 	 * Sets the page setup of the GtkPrintUnixDialog.
167 	 * Since 2.10
168 	 * Params:
169 	 * pageSetup = a GtkPageSetup
170 	 */
171 	public void setPageSetup(PageSetup pageSetup)
172 	{
173 		// void gtk_print_unix_dialog_set_page_setup  (GtkPrintUnixDialog *dialog,  GtkPageSetup *page_setup);
174 		gtk_print_unix_dialog_set_page_setup(gtkPrintUnixDialog, (pageSetup is null) ? null : pageSetup.getPageSetupStruct());
175 	}
176 	
177 	/**
178 	 * Gets the page setup that is used by the GtkPrintUnixDialog.
179 	 * Since 2.10
180 	 * Returns: the page setup of dialog. [transfer none]
181 	 */
182 	public PageSetup getPageSetup()
183 	{
184 		// GtkPageSetup * gtk_print_unix_dialog_get_page_setup  (GtkPrintUnixDialog *dialog);
185 		auto p = gtk_print_unix_dialog_get_page_setup(gtkPrintUnixDialog);
186 		
187 		if(p is null)
188 		{
189 			return null;
190 		}
191 		
192 		return ObjectG.getDObject!(PageSetup)(cast(GtkPageSetup*) p);
193 	}
194 	
195 	/**
196 	 * Sets the current page number. If current_page is not -1, this enables
197 	 * the current page choice for the range of pages to print.
198 	 * Since 2.10
199 	 * Params:
200 	 * currentPage = the current page number.
201 	 */
202 	public void setCurrentPage(int currentPage)
203 	{
204 		// void gtk_print_unix_dialog_set_current_page  (GtkPrintUnixDialog *dialog,  gint current_page);
205 		gtk_print_unix_dialog_set_current_page(gtkPrintUnixDialog, currentPage);
206 	}
207 	
208 	/**
209 	 * Gets the current page of the GtkPrintDialog.
210 	 * Since 2.10
211 	 * Returns: the current page of dialog
212 	 */
213 	public int getCurrentPage()
214 	{
215 		// gint gtk_print_unix_dialog_get_current_page  (GtkPrintUnixDialog *dialog);
216 		return gtk_print_unix_dialog_get_current_page(gtkPrintUnixDialog);
217 	}
218 	
219 	/**
220 	 * Sets the GtkPrintSettings for the GtkPrintUnixDialog. Typically,
221 	 * this is used to restore saved print settings from a previous print
222 	 * operation before the print dialog is shown.
223 	 * Since 2.10
224 	 * Params:
225 	 * settings = a GtkPrintSettings, or NULL. [allow-none]
226 	 */
227 	public void setPrintSettings(PrintSettings settings)
228 	{
229 		// void gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog *dialog,  GtkPrintSettings *settings);
230 		gtk_print_unix_dialog_set_settings(gtkPrintUnixDialog, (settings is null) ? null : settings.getPrintSettingsStruct());
231 	}
232 	
233 	/**
234 	 * Gets a new GtkPrintSettings object that represents the
235 	 * current values in the print dialog. Note that this creates a
236 	 * new object, and you need to unref it
237 	 * if don't want to keep it.
238 	 * Since 2.10
239 	 * Returns: a new GtkPrintSettings object with the values from dialog
240 	 */
241 	public PrintSettings getPrintSettings()
242 	{
243 		// GtkPrintSettings * gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog);
244 		auto p = gtk_print_unix_dialog_get_settings(gtkPrintUnixDialog);
245 		
246 		if(p is null)
247 		{
248 			return null;
249 		}
250 		
251 		return ObjectG.getDObject!(PrintSettings)(cast(GtkPrintSettings*) p);
252 	}
253 	
254 	/**
255 	 * Gets the currently selected printer.
256 	 * Since 2.10
257 	 * Returns: the currently selected printer. [transfer none]
258 	 */
259 	public Printer getSelectedPrinter()
260 	{
261 		// GtkPrinter * gtk_print_unix_dialog_get_selected_printer  (GtkPrintUnixDialog *dialog);
262 		auto p = gtk_print_unix_dialog_get_selected_printer(gtkPrintUnixDialog);
263 		
264 		if(p is null)
265 		{
266 			return null;
267 		}
268 		
269 		return ObjectG.getDObject!(Printer)(cast(GtkPrinter*) p);
270 	}
271 	
272 	/**
273 	 * Adds a custom tab to the print dialog.
274 	 * Since 2.10
275 	 * Params:
276 	 * child = the widget to put in the custom tab
277 	 * tabLabel = the widget to use as tab label
278 	 */
279 	public void addCustomTab(Widget child, Widget tabLabel)
280 	{
281 		// void gtk_print_unix_dialog_add_custom_tab  (GtkPrintUnixDialog *dialog,  GtkWidget *child,  GtkWidget *tab_label);
282 		gtk_print_unix_dialog_add_custom_tab(gtkPrintUnixDialog, (child is null) ? null : child.getWidgetStruct(), (tabLabel is null) ? null : tabLabel.getWidgetStruct());
283 	}
284 	
285 	/**
286 	 * Sets whether the print dialog allows user to print a selection.
287 	 * Since 2.18
288 	 * Params:
289 	 * supportSelection = TRUE to allow print selection
290 	 */
291 	public void setSupportSelection(int supportSelection)
292 	{
293 		// void gtk_print_unix_dialog_set_support_selection  (GtkPrintUnixDialog *dialog,  gboolean support_selection);
294 		gtk_print_unix_dialog_set_support_selection(gtkPrintUnixDialog, supportSelection);
295 	}
296 	
297 	/**
298 	 * Gets the value of "support-selection" property.
299 	 * Since 2.18
300 	 * Returns: whether the application supports print of selection
301 	 */
302 	public int getSupportSelection()
303 	{
304 		// gboolean gtk_print_unix_dialog_get_support_selection  (GtkPrintUnixDialog *dialog);
305 		return gtk_print_unix_dialog_get_support_selection(gtkPrintUnixDialog);
306 	}
307 	
308 	/**
309 	 * Sets whether a selection exists.
310 	 * Since 2.18
311 	 * Params:
312 	 * hasSelection = TRUE indicates that a selection exists
313 	 */
314 	public void setHasSelection(int hasSelection)
315 	{
316 		// void gtk_print_unix_dialog_set_has_selection  (GtkPrintUnixDialog *dialog,  gboolean has_selection);
317 		gtk_print_unix_dialog_set_has_selection(gtkPrintUnixDialog, hasSelection);
318 	}
319 	
320 	/**
321 	 * Gets the value of "has-selection" property.
322 	 * Since 2.18
323 	 * Returns: whether there is a selection
324 	 */
325 	public int getHasSelection()
326 	{
327 		// gboolean gtk_print_unix_dialog_get_has_selection  (GtkPrintUnixDialog *dialog);
328 		return gtk_print_unix_dialog_get_has_selection(gtkPrintUnixDialog);
329 	}
330 	
331 	/**
332 	 * Embed page size combo box and orientation combo box into page setup page.
333 	 * Since 2.18
334 	 * Params:
335 	 * embed = embed page setup selection
336 	 */
337 	public void setEmbedPageSetup(int embed)
338 	{
339 		// void gtk_print_unix_dialog_set_embed_page_setup  (GtkPrintUnixDialog *dialog,  gboolean embed);
340 		gtk_print_unix_dialog_set_embed_page_setup(gtkPrintUnixDialog, embed);
341 	}
342 	
343 	/**
344 	 * Gets the value of "embed-page-setup" property.
345 	 * Since 2.18
346 	 * Returns: whether there is a selection
347 	 */
348 	public int getEmbedPageSetup()
349 	{
350 		// gboolean gtk_print_unix_dialog_get_embed_page_setup  (GtkPrintUnixDialog *dialog);
351 		return gtk_print_unix_dialog_get_embed_page_setup(gtkPrintUnixDialog);
352 	}
353 	
354 	/**
355 	 * Gets the page setup that is used by the GtkPrintUnixDialog.
356 	 * Since 2.18
357 	 * Returns: whether a page setup was set by user.
358 	 */
359 	public int getPageSetupSet()
360 	{
361 		// gboolean gtk_print_unix_dialog_get_page_setup_set  (GtkPrintUnixDialog *dialog);
362 		return gtk_print_unix_dialog_get_page_setup_set(gtkPrintUnixDialog);
363 	}
364 	
365 	/**
366 	 * This lets you specify the printing capabilities your application
367 	 * supports. For instance, if you can handle scaling the output then
368 	 * you pass GTK_PRINT_CAPABILITY_SCALE. If you don't pass that, then
369 	 * the dialog will only let you select the scale if the printing
370 	 * system automatically handles scaling.
371 	 * Since 2.10
372 	 * Params:
373 	 * capabilities = the printing capabilities of your application
374 	 */
375 	public void setManualCapabilities(GtkPrintCapabilities capabilities)
376 	{
377 		// void gtk_print_unix_dialog_set_manual_capabilities  (GtkPrintUnixDialog *dialog,  GtkPrintCapabilities capabilities);
378 		gtk_print_unix_dialog_set_manual_capabilities(gtkPrintUnixDialog, capabilities);
379 	}
380 	
381 	/**
382 	 * Gets the value of "manual-capabilities" property.
383 	 * Since 2.18
384 	 * Returns: the printing capabilities
385 	 */
386 	public GtkPrintCapabilities getManualCapabilities()
387 	{
388 		// GtkPrintCapabilities gtk_print_unix_dialog_get_manual_capabilities  (GtkPrintUnixDialog *dialog);
389 		return gtk_print_unix_dialog_get_manual_capabilities(gtkPrintUnixDialog);
390 	}
391 }