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 module gtk.PrintSettings;
26 
27 private import glib.ConstructionException;
28 private import glib.ErrorG;
29 private import glib.GException;
30 private import glib.KeyFile;
31 private import glib.Str;
32 private import gobject.ObjectG;
33 private import gtk.PaperSize;
34 private import gtkc.gtk;
35 public  import gtkc.gtktypes;
36 
37 
38 /**
39  * A GtkPrintSettings object represents the settings of a print dialog in
40  * a system-independent way. The main use for this object is that once
41  * you’ve printed you can get a settings object that represents the settings
42  * the user chose, and the next time you print you can pass that object in so
43  * that the user doesn’t have to re-set all his settings.
44  * 
45  * Its also possible to enumerate the settings so that you can easily save
46  * the settings for the next time your app runs, or even store them in a
47  * document. The predefined keys try to use shared values as much as possible
48  * so that moving such a document between systems still works.
49  * 
50  * Printing support was added in GTK+ 2.10.
51  */
52 public class PrintSettings : ObjectG
53 {
54 	/** the main Gtk struct */
55 	protected GtkPrintSettings* gtkPrintSettings;
56 
57 	/** Get the main Gtk struct */
58 	public GtkPrintSettings* getPrintSettingsStruct()
59 	{
60 		return gtkPrintSettings;
61 	}
62 
63 	/** the main Gtk struct as a void* */
64 	protected override void* getStruct()
65 	{
66 		return cast(void*)gtkPrintSettings;
67 	}
68 
69 	protected override void setStruct(GObject* obj)
70 	{
71 		gtkPrintSettings = cast(GtkPrintSettings*)obj;
72 		super.setStruct(obj);
73 	}
74 
75 	/**
76 	 * Sets our main struct and passes it to the parent class.
77 	 */
78 	public this (GtkPrintSettings* gtkPrintSettings, bool ownedRef = false)
79 	{
80 		this.gtkPrintSettings = gtkPrintSettings;
81 		super(cast(GObject*)gtkPrintSettings, ownedRef);
82 	}
83 
84 	/**
85 	 */
86 
87 	public static GType getType()
88 	{
89 		return gtk_print_settings_get_type();
90 	}
91 
92 	/**
93 	 * Creates a new #GtkPrintSettings object.
94 	 *
95 	 * Return: a new #GtkPrintSettings object
96 	 *
97 	 * Since: 2.10
98 	 *
99 	 * Throws: ConstructionException GTK+ fails to create the object.
100 	 */
101 	public this()
102 	{
103 		auto p = gtk_print_settings_new();
104 		
105 		if(p is null)
106 		{
107 			throw new ConstructionException("null returned by new");
108 		}
109 		
110 		this(cast(GtkPrintSettings*) p, true);
111 	}
112 
113 	/**
114 	 * Reads the print settings from @file_name. Returns a new #GtkPrintSettings
115 	 * object with the restored settings, or %NULL if an error occurred. If the
116 	 * file could not be loaded then error is set to either a #GFileError or
117 	 * #GKeyFileError.  See gtk_print_settings_to_file().
118 	 *
119 	 * Params:
120 	 *     fileName = the filename to read the settings from
121 	 *
122 	 * Return: the restored #GtkPrintSettings
123 	 *
124 	 * Since: 2.12
125 	 *
126 	 * Throws: GException on failure.
127 	 * Throws: ConstructionException GTK+ fails to create the object.
128 	 */
129 	public this(string fileName)
130 	{
131 		GError* err = null;
132 		
133 		auto p = gtk_print_settings_new_from_file(Str.toStringz(fileName), &err);
134 		
135 		if (err !is null)
136 		{
137 			throw new GException( new ErrorG(err) );
138 		}
139 		
140 		if(p is null)
141 		{
142 			throw new ConstructionException("null returned by new_from_file");
143 		}
144 		
145 		this(cast(GtkPrintSettings*) p, true);
146 	}
147 
148 	/**
149 	 * Reads the print settings from the group @group_name in @key_file.  Returns a
150 	 * new #GtkPrintSettings object with the restored settings, or %NULL if an
151 	 * error occurred. If the file could not be loaded then error is set to either
152 	 * a #GFileError or #GKeyFileError.
153 	 *
154 	 * Params:
155 	 *     keyFile = the #GKeyFile to retrieve the settings from
156 	 *     groupName = the name of the group to use, or %NULL to use
157 	 *         the default “Print Settings”
158 	 *
159 	 * Return: the restored #GtkPrintSettings
160 	 *
161 	 * Since: 2.12
162 	 *
163 	 * Throws: GException on failure.
164 	 * Throws: ConstructionException GTK+ fails to create the object.
165 	 */
166 	public this(KeyFile keyFile, string groupName)
167 	{
168 		GError* err = null;
169 		
170 		auto p = gtk_print_settings_new_from_key_file((keyFile is null) ? null : keyFile.getKeyFileStruct(), Str.toStringz(groupName), &err);
171 		
172 		if (err !is null)
173 		{
174 			throw new GException( new ErrorG(err) );
175 		}
176 		
177 		if(p is null)
178 		{
179 			throw new ConstructionException("null returned by new_from_key_file");
180 		}
181 		
182 		this(cast(GtkPrintSettings*) p, true);
183 	}
184 
185 	/**
186 	 * Copies a #GtkPrintSettings object.
187 	 *
188 	 * Return: a newly allocated copy of @other
189 	 *
190 	 * Since: 2.10
191 	 */
192 	public PrintSettings copy()
193 	{
194 		auto p = gtk_print_settings_copy(gtkPrintSettings);
195 		
196 		if(p is null)
197 		{
198 			return null;
199 		}
200 		
201 		return ObjectG.getDObject!(PrintSettings)(cast(GtkPrintSettings*) p, true);
202 	}
203 
204 	/**
205 	 * Calls @func for each key-value pair of @settings.
206 	 *
207 	 * Params:
208 	 *     func = the function to call
209 	 *     userData = user data for @func
210 	 *
211 	 * Since: 2.10
212 	 */
213 	public void foreac(GtkPrintSettingsFunc func, void* userData)
214 	{
215 		gtk_print_settings_foreach(gtkPrintSettings, func, userData);
216 	}
217 
218 	/**
219 	 * Looks up the string value associated with @key.
220 	 *
221 	 * Params:
222 	 *     key = a key
223 	 *
224 	 * Return: the string value for @key
225 	 *
226 	 * Since: 2.10
227 	 */
228 	public string get(string key)
229 	{
230 		return Str.toString(gtk_print_settings_get(gtkPrintSettings, Str.toStringz(key)));
231 	}
232 
233 	/**
234 	 * Returns the boolean represented by the value
235 	 * that is associated with @key.
236 	 *
237 	 * The string “true” represents %TRUE, any other
238 	 * string %FALSE.
239 	 *
240 	 * Params:
241 	 *     key = a key
242 	 *
243 	 * Return: %TRUE, if @key maps to a true value.
244 	 *
245 	 * Since: 2.10
246 	 */
247 	public bool getBool(string key)
248 	{
249 		return gtk_print_settings_get_bool(gtkPrintSettings, Str.toStringz(key)) != 0;
250 	}
251 
252 	/**
253 	 * Gets the value of %GTK_PRINT_SETTINGS_COLLATE.
254 	 *
255 	 * Return: whether to collate the printed pages
256 	 *
257 	 * Since: 2.10
258 	 */
259 	public bool getCollate()
260 	{
261 		return gtk_print_settings_get_collate(gtkPrintSettings) != 0;
262 	}
263 
264 	/**
265 	 * Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
266 	 *
267 	 * Return: the default source
268 	 *
269 	 * Since: 2.10
270 	 */
271 	public string getDefaultSource()
272 	{
273 		return Str.toString(gtk_print_settings_get_default_source(gtkPrintSettings));
274 	}
275 
276 	/**
277 	 * Gets the value of %GTK_PRINT_SETTINGS_DITHER.
278 	 *
279 	 * Return: the dithering that is used
280 	 *
281 	 * Since: 2.10
282 	 */
283 	public string getDither()
284 	{
285 		return Str.toString(gtk_print_settings_get_dither(gtkPrintSettings));
286 	}
287 
288 	/**
289 	 * Returns the double value associated with @key, or 0.
290 	 *
291 	 * Params:
292 	 *     key = a key
293 	 *
294 	 * Return: the double value of @key
295 	 *
296 	 * Since: 2.10
297 	 */
298 	public double getDouble(string key)
299 	{
300 		return gtk_print_settings_get_double(gtkPrintSettings, Str.toStringz(key));
301 	}
302 
303 	/**
304 	 * Returns the floating point number represented by
305 	 * the value that is associated with @key, or @default_val
306 	 * if the value does not represent a floating point number.
307 	 *
308 	 * Floating point numbers are parsed with g_ascii_strtod().
309 	 *
310 	 * Params:
311 	 *     key = a key
312 	 *     def = the default value
313 	 *
314 	 * Return: the floating point number associated with @key
315 	 *
316 	 * Since: 2.10
317 	 */
318 	public double getDoubleWithDefault(string key, double def)
319 	{
320 		return gtk_print_settings_get_double_with_default(gtkPrintSettings, Str.toStringz(key), def);
321 	}
322 
323 	/**
324 	 * Gets the value of %GTK_PRINT_SETTINGS_DUPLEX.
325 	 *
326 	 * Return: whether to print the output in duplex.
327 	 *
328 	 * Since: 2.10
329 	 */
330 	public GtkPrintDuplex getDuplex()
331 	{
332 		return gtk_print_settings_get_duplex(gtkPrintSettings);
333 	}
334 
335 	/**
336 	 * Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
337 	 *
338 	 * Return: the finishings
339 	 *
340 	 * Since: 2.10
341 	 */
342 	public string getFinishings()
343 	{
344 		return Str.toString(gtk_print_settings_get_finishings(gtkPrintSettings));
345 	}
346 
347 	/**
348 	 * Returns the integer value of @key, or 0.
349 	 *
350 	 * Params:
351 	 *     key = a key
352 	 *
353 	 * Return: the integer value of @key
354 	 *
355 	 * Since: 2.10
356 	 */
357 	public int getInt(string key)
358 	{
359 		return gtk_print_settings_get_int(gtkPrintSettings, Str.toStringz(key));
360 	}
361 
362 	/**
363 	 * Returns the value of @key, interpreted as
364 	 * an integer, or the default value.
365 	 *
366 	 * Params:
367 	 *     key = a key
368 	 *     def = the default value
369 	 *
370 	 * Return: the integer value of @key
371 	 *
372 	 * Since: 2.10
373 	 */
374 	public int getIntWithDefault(string key, int def)
375 	{
376 		return gtk_print_settings_get_int_with_default(gtkPrintSettings, Str.toStringz(key), def);
377 	}
378 
379 	/**
380 	 * Returns the value associated with @key, interpreted
381 	 * as a length. The returned value is converted to @units.
382 	 *
383 	 * Params:
384 	 *     key = a key
385 	 *     unit = the unit of the return value
386 	 *
387 	 * Return: the length value of @key, converted to @unit
388 	 *
389 	 * Since: 2.10
390 	 */
391 	public double getLength(string key, GtkUnit unit)
392 	{
393 		return gtk_print_settings_get_length(gtkPrintSettings, Str.toStringz(key), unit);
394 	}
395 
396 	/**
397 	 * Gets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
398 	 *
399 	 * The set of media types is defined in PWG 5101.1-2002 PWG.
400 	 *
401 	 * Return: the media type
402 	 *
403 	 * Since: 2.10
404 	 */
405 	public string getMediaType()
406 	{
407 		return Str.toString(gtk_print_settings_get_media_type(gtkPrintSettings));
408 	}
409 
410 	/**
411 	 * Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.
412 	 *
413 	 * Return: the number of copies to print
414 	 *
415 	 * Since: 2.10
416 	 */
417 	public int getNCopies()
418 	{
419 		return gtk_print_settings_get_n_copies(gtkPrintSettings);
420 	}
421 
422 	/**
423 	 * Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
424 	 *
425 	 * Return: the number of pages per sheet
426 	 *
427 	 * Since: 2.10
428 	 */
429 	public int getNumberUp()
430 	{
431 		return gtk_print_settings_get_number_up(gtkPrintSettings);
432 	}
433 
434 	/**
435 	 * Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
436 	 *
437 	 * Return: layout of page in number-up mode
438 	 *
439 	 * Since: 2.14
440 	 */
441 	public GtkNumberUpLayout getNumberUpLayout()
442 	{
443 		return gtk_print_settings_get_number_up_layout(gtkPrintSettings);
444 	}
445 
446 	/**
447 	 * Get the value of %GTK_PRINT_SETTINGS_ORIENTATION,
448 	 * converted to a #GtkPageOrientation.
449 	 *
450 	 * Return: the orientation
451 	 *
452 	 * Since: 2.10
453 	 */
454 	public GtkPageOrientation getOrientation()
455 	{
456 		return gtk_print_settings_get_orientation(gtkPrintSettings);
457 	}
458 
459 	/**
460 	 * Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
461 	 *
462 	 * Return: the output bin
463 	 *
464 	 * Since: 2.10
465 	 */
466 	public string getOutputBin()
467 	{
468 		return Str.toString(gtk_print_settings_get_output_bin(gtkPrintSettings));
469 	}
470 
471 	/**
472 	 * Gets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
473 	 *
474 	 * Return: an array
475 	 *     of #GtkPageRanges.  Use g_free() to free the array when
476 	 *     it is no longer needed.
477 	 *
478 	 * Since: 2.10
479 	 */
480 	public GtkPageRange[] getPageRanges()
481 	{
482 		int numRanges;
483 		
484 		auto p = gtk_print_settings_get_page_ranges(gtkPrintSettings, &numRanges);
485 		
486 		return p[0 .. numRanges];
487 	}
488 
489 	/**
490 	 * Gets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
491 	 *
492 	 * Return: the set of pages to print
493 	 *
494 	 * Since: 2.10
495 	 */
496 	public GtkPageSet getPageSet()
497 	{
498 		return gtk_print_settings_get_page_set(gtkPrintSettings);
499 	}
500 
501 	/**
502 	 * Gets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT,
503 	 * converted to @unit.
504 	 *
505 	 * Params:
506 	 *     unit = the unit for the return value
507 	 *
508 	 * Return: the paper height, in units of @unit
509 	 *
510 	 * Since: 2.10
511 	 */
512 	public double getPaperHeight(GtkUnit unit)
513 	{
514 		return gtk_print_settings_get_paper_height(gtkPrintSettings, unit);
515 	}
516 
517 	/**
518 	 * Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
519 	 * converted to a #GtkPaperSize.
520 	 *
521 	 * Return: the paper size
522 	 *
523 	 * Since: 2.10
524 	 */
525 	public PaperSize getPaperSize()
526 	{
527 		auto p = gtk_print_settings_get_paper_size(gtkPrintSettings);
528 		
529 		if(p is null)
530 		{
531 			return null;
532 		}
533 		
534 		return ObjectG.getDObject!(PaperSize)(cast(GtkPaperSize*) p);
535 	}
536 
537 	/**
538 	 * Gets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH,
539 	 * converted to @unit.
540 	 *
541 	 * Params:
542 	 *     unit = the unit for the return value
543 	 *
544 	 * Return: the paper width, in units of @unit
545 	 *
546 	 * Since: 2.10
547 	 */
548 	public double getPaperWidth(GtkUnit unit)
549 	{
550 		return gtk_print_settings_get_paper_width(gtkPrintSettings, unit);
551 	}
552 
553 	/**
554 	 * Gets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
555 	 *
556 	 * Return: which pages to print
557 	 *
558 	 * Since: 2.10
559 	 */
560 	public GtkPrintPages getPrintPages()
561 	{
562 		return gtk_print_settings_get_print_pages(gtkPrintSettings);
563 	}
564 
565 	/**
566 	 * Convenience function to obtain the value of
567 	 * %GTK_PRINT_SETTINGS_PRINTER.
568 	 *
569 	 * Return: the printer name
570 	 *
571 	 * Since: 2.10
572 	 */
573 	public string getPrinter()
574 	{
575 		return Str.toString(gtk_print_settings_get_printer(gtkPrintSettings));
576 	}
577 
578 	/**
579 	 * Gets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
580 	 *
581 	 * Return: the resolution in lpi (lines per inch)
582 	 *
583 	 * Since: 2.16
584 	 */
585 	public double getPrinterLpi()
586 	{
587 		return gtk_print_settings_get_printer_lpi(gtkPrintSettings);
588 	}
589 
590 	/**
591 	 * Gets the value of %GTK_PRINT_SETTINGS_QUALITY.
592 	 *
593 	 * Return: the print quality
594 	 *
595 	 * Since: 2.10
596 	 */
597 	public GtkPrintQuality getQuality()
598 	{
599 		return gtk_print_settings_get_quality(gtkPrintSettings);
600 	}
601 
602 	/**
603 	 * Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION.
604 	 *
605 	 * Return: the resolution in dpi
606 	 *
607 	 * Since: 2.10
608 	 */
609 	public int getResolution()
610 	{
611 		return gtk_print_settings_get_resolution(gtkPrintSettings);
612 	}
613 
614 	/**
615 	 * Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_X.
616 	 *
617 	 * Return: the horizontal resolution in dpi
618 	 *
619 	 * Since: 2.16
620 	 */
621 	public int getResolutionX()
622 	{
623 		return gtk_print_settings_get_resolution_x(gtkPrintSettings);
624 	}
625 
626 	/**
627 	 * Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_Y.
628 	 *
629 	 * Return: the vertical resolution in dpi
630 	 *
631 	 * Since: 2.16
632 	 */
633 	public int getResolutionY()
634 	{
635 		return gtk_print_settings_get_resolution_y(gtkPrintSettings);
636 	}
637 
638 	/**
639 	 * Gets the value of %GTK_PRINT_SETTINGS_REVERSE.
640 	 *
641 	 * Return: whether to reverse the order of the printed pages
642 	 *
643 	 * Since: 2.10
644 	 */
645 	public bool getReverse()
646 	{
647 		return gtk_print_settings_get_reverse(gtkPrintSettings) != 0;
648 	}
649 
650 	/**
651 	 * Gets the value of %GTK_PRINT_SETTINGS_SCALE.
652 	 *
653 	 * Return: the scale in percent
654 	 *
655 	 * Since: 2.10
656 	 */
657 	public double getScale()
658 	{
659 		return gtk_print_settings_get_scale(gtkPrintSettings);
660 	}
661 
662 	/**
663 	 * Gets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
664 	 *
665 	 * Return: whether to use color
666 	 *
667 	 * Since: 2.10
668 	 */
669 	public bool getUseColor()
670 	{
671 		return gtk_print_settings_get_use_color(gtkPrintSettings) != 0;
672 	}
673 
674 	/**
675 	 * Returns %TRUE, if a value is associated with @key.
676 	 *
677 	 * Params:
678 	 *     key = a key
679 	 *
680 	 * Return: %TRUE, if @key has a value
681 	 *
682 	 * Since: 2.10
683 	 */
684 	public bool hasKey(string key)
685 	{
686 		return gtk_print_settings_has_key(gtkPrintSettings, Str.toStringz(key)) != 0;
687 	}
688 
689 	/**
690 	 * Reads the print settings from @file_name. If the file could not be loaded
691 	 * then error is set to either a #GFileError or #GKeyFileError.
692 	 * See gtk_print_settings_to_file().
693 	 *
694 	 * Params:
695 	 *     fileName = the filename to read the settings from
696 	 *
697 	 * Return: %TRUE on success
698 	 *
699 	 * Since: 2.14
700 	 *
701 	 * Throws: GException on failure.
702 	 */
703 	public bool loadFile(string fileName)
704 	{
705 		GError* err = null;
706 		
707 		auto p = gtk_print_settings_load_file(gtkPrintSettings, Str.toStringz(fileName), &err) != 0;
708 		
709 		if (err !is null)
710 		{
711 			throw new GException( new ErrorG(err) );
712 		}
713 		
714 		return p;
715 	}
716 
717 	/**
718 	 * Reads the print settings from the group @group_name in @key_file. If the
719 	 * file could not be loaded then error is set to either a #GFileError or
720 	 * #GKeyFileError.
721 	 *
722 	 * Params:
723 	 *     keyFile = the #GKeyFile to retrieve the settings from
724 	 *     groupName = the name of the group to use, or %NULL to use the default
725 	 *         “Print Settings”
726 	 *
727 	 * Return: %TRUE on success
728 	 *
729 	 * Since: 2.14
730 	 *
731 	 * Throws: GException on failure.
732 	 */
733 	public bool loadKeyFile(KeyFile keyFile, string groupName)
734 	{
735 		GError* err = null;
736 		
737 		auto p = gtk_print_settings_load_key_file(gtkPrintSettings, (keyFile is null) ? null : keyFile.getKeyFileStruct(), Str.toStringz(groupName), &err) != 0;
738 		
739 		if (err !is null)
740 		{
741 			throw new GException( new ErrorG(err) );
742 		}
743 		
744 		return p;
745 	}
746 
747 	/**
748 	 * Associates @value with @key.
749 	 *
750 	 * Params:
751 	 *     key = a key
752 	 *     value = a string value, or %NULL
753 	 *
754 	 * Since: 2.10
755 	 */
756 	public void set(string key, string value)
757 	{
758 		gtk_print_settings_set(gtkPrintSettings, Str.toStringz(key), Str.toStringz(value));
759 	}
760 
761 	/**
762 	 * Sets @key to a boolean value.
763 	 *
764 	 * Params:
765 	 *     key = a key
766 	 *     value = a boolean
767 	 *
768 	 * Since: 2.10
769 	 */
770 	public void setBool(string key, bool value)
771 	{
772 		gtk_print_settings_set_bool(gtkPrintSettings, Str.toStringz(key), value);
773 	}
774 
775 	/**
776 	 * Sets the value of %GTK_PRINT_SETTINGS_COLLATE.
777 	 *
778 	 * Params:
779 	 *     collate = whether to collate the output
780 	 *
781 	 * Since: 2.10
782 	 */
783 	public void setCollate(bool collate)
784 	{
785 		gtk_print_settings_set_collate(gtkPrintSettings, collate);
786 	}
787 
788 	/**
789 	 * Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
790 	 *
791 	 * Params:
792 	 *     defaultSource = the default source
793 	 *
794 	 * Since: 2.10
795 	 */
796 	public void setDefaultSource(string defaultSource)
797 	{
798 		gtk_print_settings_set_default_source(gtkPrintSettings, Str.toStringz(defaultSource));
799 	}
800 
801 	/**
802 	 * Sets the value of %GTK_PRINT_SETTINGS_DITHER.
803 	 *
804 	 * Params:
805 	 *     dither = the dithering that is used
806 	 *
807 	 * Since: 2.10
808 	 */
809 	public void setDither(string dither)
810 	{
811 		gtk_print_settings_set_dither(gtkPrintSettings, Str.toStringz(dither));
812 	}
813 
814 	/**
815 	 * Sets @key to a double value.
816 	 *
817 	 * Params:
818 	 *     key = a key
819 	 *     value = a double value
820 	 *
821 	 * Since: 2.10
822 	 */
823 	public void setDouble(string key, double value)
824 	{
825 		gtk_print_settings_set_double(gtkPrintSettings, Str.toStringz(key), value);
826 	}
827 
828 	/**
829 	 * Sets the value of %GTK_PRINT_SETTINGS_DUPLEX.
830 	 *
831 	 * Params:
832 	 *     duplex = a #GtkPrintDuplex value
833 	 *
834 	 * Since: 2.10
835 	 */
836 	public void setDuplex(GtkPrintDuplex duplex)
837 	{
838 		gtk_print_settings_set_duplex(gtkPrintSettings, duplex);
839 	}
840 
841 	/**
842 	 * Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
843 	 *
844 	 * Params:
845 	 *     finishings = the finishings
846 	 *
847 	 * Since: 2.10
848 	 */
849 	public void setFinishings(string finishings)
850 	{
851 		gtk_print_settings_set_finishings(gtkPrintSettings, Str.toStringz(finishings));
852 	}
853 
854 	/**
855 	 * Sets @key to an integer value.
856 	 *
857 	 * Params:
858 	 *     key = a key
859 	 *     value = an integer
860 	 *
861 	 * Since: 2.10
862 	 */
863 	public void setInt(string key, int value)
864 	{
865 		gtk_print_settings_set_int(gtkPrintSettings, Str.toStringz(key), value);
866 	}
867 
868 	/**
869 	 * Associates a length in units of @unit with @key.
870 	 *
871 	 * Params:
872 	 *     key = a key
873 	 *     value = a length
874 	 *     unit = the unit of @length
875 	 *
876 	 * Since: 2.10
877 	 */
878 	public void setLength(string key, double value, GtkUnit unit)
879 	{
880 		gtk_print_settings_set_length(gtkPrintSettings, Str.toStringz(key), value, unit);
881 	}
882 
883 	/**
884 	 * Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
885 	 *
886 	 * The set of media types is defined in PWG 5101.1-2002 PWG.
887 	 *
888 	 * Params:
889 	 *     mediaType = the media type
890 	 *
891 	 * Since: 2.10
892 	 */
893 	public void setMediaType(string mediaType)
894 	{
895 		gtk_print_settings_set_media_type(gtkPrintSettings, Str.toStringz(mediaType));
896 	}
897 
898 	/**
899 	 * Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.
900 	 *
901 	 * Params:
902 	 *     numCopies = the number of copies
903 	 *
904 	 * Since: 2.10
905 	 */
906 	public void setNCopies(int numCopies)
907 	{
908 		gtk_print_settings_set_n_copies(gtkPrintSettings, numCopies);
909 	}
910 
911 	/**
912 	 * Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
913 	 *
914 	 * Params:
915 	 *     numberUp = the number of pages per sheet
916 	 *
917 	 * Since: 2.10
918 	 */
919 	public void setNumberUp(int numberUp)
920 	{
921 		gtk_print_settings_set_number_up(gtkPrintSettings, numberUp);
922 	}
923 
924 	/**
925 	 * Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
926 	 *
927 	 * Params:
928 	 *     numberUpLayout = a #GtkNumberUpLayout value
929 	 *
930 	 * Since: 2.14
931 	 */
932 	public void setNumberUpLayout(GtkNumberUpLayout numberUpLayout)
933 	{
934 		gtk_print_settings_set_number_up_layout(gtkPrintSettings, numberUpLayout);
935 	}
936 
937 	/**
938 	 * Sets the value of %GTK_PRINT_SETTINGS_ORIENTATION.
939 	 *
940 	 * Params:
941 	 *     orientation = a page orientation
942 	 *
943 	 * Since: 2.10
944 	 */
945 	public void setOrientation(GtkPageOrientation orientation)
946 	{
947 		gtk_print_settings_set_orientation(gtkPrintSettings, orientation);
948 	}
949 
950 	/**
951 	 * Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
952 	 *
953 	 * Params:
954 	 *     outputBin = the output bin
955 	 *
956 	 * Since: 2.10
957 	 */
958 	public void setOutputBin(string outputBin)
959 	{
960 		gtk_print_settings_set_output_bin(gtkPrintSettings, Str.toStringz(outputBin));
961 	}
962 
963 	/**
964 	 * Sets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
965 	 *
966 	 * Params:
967 	 *     pageRanges = an array of #GtkPageRanges
968 	 *     numRanges = the length of @page_ranges
969 	 *
970 	 * Since: 2.10
971 	 */
972 	public void setPageRanges(GtkPageRange[] pageRanges)
973 	{
974 		gtk_print_settings_set_page_ranges(gtkPrintSettings, pageRanges.ptr, cast(int)pageRanges.length);
975 	}
976 
977 	/**
978 	 * Sets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
979 	 *
980 	 * Params:
981 	 *     pageSet = a #GtkPageSet value
982 	 *
983 	 * Since: 2.10
984 	 */
985 	public void setPageSet(GtkPageSet pageSet)
986 	{
987 		gtk_print_settings_set_page_set(gtkPrintSettings, pageSet);
988 	}
989 
990 	/**
991 	 * Sets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
992 	 *
993 	 * Params:
994 	 *     height = the paper height
995 	 *     unit = the units of @height
996 	 *
997 	 * Since: 2.10
998 	 */
999 	public void setPaperHeight(double height, GtkUnit unit)
1000 	{
1001 		gtk_print_settings_set_paper_height(gtkPrintSettings, height, unit);
1002 	}
1003 
1004 	/**
1005 	 * Sets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
1006 	 * %GTK_PRINT_SETTINGS_PAPER_WIDTH and
1007 	 * %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
1008 	 *
1009 	 * Params:
1010 	 *     paperSize = a paper size
1011 	 *
1012 	 * Since: 2.10
1013 	 */
1014 	public void setPaperSize(PaperSize paperSize)
1015 	{
1016 		gtk_print_settings_set_paper_size(gtkPrintSettings, (paperSize is null) ? null : paperSize.getPaperSizeStruct());
1017 	}
1018 
1019 	/**
1020 	 * Sets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH.
1021 	 *
1022 	 * Params:
1023 	 *     width = the paper width
1024 	 *     unit = the units of @width
1025 	 *
1026 	 * Since: 2.10
1027 	 */
1028 	public void setPaperWidth(double width, GtkUnit unit)
1029 	{
1030 		gtk_print_settings_set_paper_width(gtkPrintSettings, width, unit);
1031 	}
1032 
1033 	/**
1034 	 * Sets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
1035 	 *
1036 	 * Params:
1037 	 *     pages = a #GtkPrintPages value
1038 	 *
1039 	 * Since: 2.10
1040 	 */
1041 	public void setPrintPages(GtkPrintPages pages)
1042 	{
1043 		gtk_print_settings_set_print_pages(gtkPrintSettings, pages);
1044 	}
1045 
1046 	/**
1047 	 * Convenience function to set %GTK_PRINT_SETTINGS_PRINTER
1048 	 * to @printer.
1049 	 *
1050 	 * Params:
1051 	 *     printer = the printer name
1052 	 *
1053 	 * Since: 2.10
1054 	 */
1055 	public void setPrinter(string printer)
1056 	{
1057 		gtk_print_settings_set_printer(gtkPrintSettings, Str.toStringz(printer));
1058 	}
1059 
1060 	/**
1061 	 * Sets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
1062 	 *
1063 	 * Params:
1064 	 *     lpi = the resolution in lpi (lines per inch)
1065 	 *
1066 	 * Since: 2.16
1067 	 */
1068 	public void setPrinterLpi(double lpi)
1069 	{
1070 		gtk_print_settings_set_printer_lpi(gtkPrintSettings, lpi);
1071 	}
1072 
1073 	/**
1074 	 * Sets the value of %GTK_PRINT_SETTINGS_QUALITY.
1075 	 *
1076 	 * Params:
1077 	 *     quality = a #GtkPrintQuality value
1078 	 *
1079 	 * Since: 2.10
1080 	 */
1081 	public void setQuality(GtkPrintQuality quality)
1082 	{
1083 		gtk_print_settings_set_quality(gtkPrintSettings, quality);
1084 	}
1085 
1086 	/**
1087 	 * Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
1088 	 * %GTK_PRINT_SETTINGS_RESOLUTION_X and
1089 	 * %GTK_PRINT_SETTINGS_RESOLUTION_Y.
1090 	 *
1091 	 * Params:
1092 	 *     resolution = the resolution in dpi
1093 	 *
1094 	 * Since: 2.10
1095 	 */
1096 	public void setResolution(int resolution)
1097 	{
1098 		gtk_print_settings_set_resolution(gtkPrintSettings, resolution);
1099 	}
1100 
1101 	/**
1102 	 * Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
1103 	 * %GTK_PRINT_SETTINGS_RESOLUTION_X and
1104 	 * %GTK_PRINT_SETTINGS_RESOLUTION_Y.
1105 	 *
1106 	 * Params:
1107 	 *     resolutionX = the horizontal resolution in dpi
1108 	 *     resolutionY = the vertical resolution in dpi
1109 	 *
1110 	 * Since: 2.16
1111 	 */
1112 	public void setResolutionXy(int resolutionX, int resolutionY)
1113 	{
1114 		gtk_print_settings_set_resolution_xy(gtkPrintSettings, resolutionX, resolutionY);
1115 	}
1116 
1117 	/**
1118 	 * Sets the value of %GTK_PRINT_SETTINGS_REVERSE.
1119 	 *
1120 	 * Params:
1121 	 *     reverse = whether to reverse the output
1122 	 *
1123 	 * Since: 2.10
1124 	 */
1125 	public void setReverse(bool reverse)
1126 	{
1127 		gtk_print_settings_set_reverse(gtkPrintSettings, reverse);
1128 	}
1129 
1130 	/**
1131 	 * Sets the value of %GTK_PRINT_SETTINGS_SCALE.
1132 	 *
1133 	 * Params:
1134 	 *     scale = the scale in percent
1135 	 *
1136 	 * Since: 2.10
1137 	 */
1138 	public void setScale(double scale)
1139 	{
1140 		gtk_print_settings_set_scale(gtkPrintSettings, scale);
1141 	}
1142 
1143 	/**
1144 	 * Sets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
1145 	 *
1146 	 * Params:
1147 	 *     useColor = whether to use color
1148 	 *
1149 	 * Since: 2.10
1150 	 */
1151 	public void setUseColor(bool useColor)
1152 	{
1153 		gtk_print_settings_set_use_color(gtkPrintSettings, useColor);
1154 	}
1155 
1156 	/**
1157 	 * This function saves the print settings from @settings to @file_name. If the
1158 	 * file could not be loaded then error is set to either a #GFileError or
1159 	 * #GKeyFileError.
1160 	 *
1161 	 * Params:
1162 	 *     fileName = the file to save to
1163 	 *
1164 	 * Return: %TRUE on success
1165 	 *
1166 	 * Since: 2.12
1167 	 *
1168 	 * Throws: GException on failure.
1169 	 */
1170 	public bool toFile(string fileName)
1171 	{
1172 		GError* err = null;
1173 		
1174 		auto p = gtk_print_settings_to_file(gtkPrintSettings, Str.toStringz(fileName), &err) != 0;
1175 		
1176 		if (err !is null)
1177 		{
1178 			throw new GException( new ErrorG(err) );
1179 		}
1180 		
1181 		return p;
1182 	}
1183 
1184 	/**
1185 	 * This function adds the print settings from @settings to @key_file.
1186 	 *
1187 	 * Params:
1188 	 *     keyFile = the #GKeyFile to save the print settings to
1189 	 *     groupName = the group to add the settings to in @key_file, or
1190 	 *         %NULL to use the default “Print Settings”
1191 	 *
1192 	 * Since: 2.12
1193 	 */
1194 	public void toKeyFile(KeyFile keyFile, string groupName)
1195 	{
1196 		gtk_print_settings_to_key_file(gtkPrintSettings, (keyFile is null) ? null : keyFile.getKeyFileStruct(), Str.toStringz(groupName));
1197 	}
1198 
1199 	/**
1200 	 * Removes any value associated with @key.
1201 	 * This has the same effect as setting the value to %NULL.
1202 	 *
1203 	 * Params:
1204 	 *     key = a key
1205 	 *
1206 	 * Since: 2.10
1207 	 */
1208 	public void unset(string key)
1209 	{
1210 		gtk_print_settings_unset(gtkPrintSettings, Str.toStringz(key));
1211 	}
1212 }