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