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