File: PrintSettings.d

package info (click to toggle)
gtk-d 3.10.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,204 kB
  • sloc: javascript: 565; sh: 71; makefile: 23
file content (1253 lines) | stat: -rw-r--r-- 27,522 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
/*
 * This file is part of gtkD.
 *
 * gtkD is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version, with
 * some exceptions, please read the COPYING file.
 *
 * gtkD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with gtkD; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 */

// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage


module gtk.PrintSettings;

private import glib.ConstructionException;
private import glib.ErrorG;
private import glib.GException;
private import glib.KeyFile;
private import glib.Str;
private import glib.Variant;
private import gobject.ObjectG;
private import gtk.PaperSize;
private import gtk.c.functions;
public  import gtk.c.types;
public  import gtkc.gtktypes;


/**
 * A GtkPrintSettings object represents the settings of a print dialog in
 * a system-independent way. The main use for this object is that once
 * you’ve printed you can get a settings object that represents the settings
 * the user chose, and the next time you print you can pass that object in so
 * that the user doesn’t have to re-set all his settings.
 * 
 * Its also possible to enumerate the settings so that you can easily save
 * the settings for the next time your app runs, or even store them in a
 * document. The predefined keys try to use shared values as much as possible
 * so that moving such a document between systems still works.
 * 
 * Printing support was added in GTK+ 2.10.
 */
public class PrintSettings : ObjectG
{
	/** the main Gtk struct */
	protected GtkPrintSettings* gtkPrintSettings;

	/** Get the main Gtk struct */
	public GtkPrintSettings* getPrintSettingsStruct(bool transferOwnership = false)
	{
		if (transferOwnership)
			ownedRef = false;
		return gtkPrintSettings;
	}

	/** the main Gtk struct as a void* */
	protected override void* getStruct()
	{
		return cast(void*)gtkPrintSettings;
	}

	/**
	 * Sets our main struct and passes it to the parent class.
	 */
	public this (GtkPrintSettings* gtkPrintSettings, bool ownedRef = false)
	{
		this.gtkPrintSettings = gtkPrintSettings;
		super(cast(GObject*)gtkPrintSettings, ownedRef);
	}


	/** */
	public static GType getType()
	{
		return gtk_print_settings_get_type();
	}

	/**
	 * Creates a new #GtkPrintSettings object.
	 *
	 * Returns: a new #GtkPrintSettings object
	 *
	 * Since: 2.10
	 *
	 * Throws: ConstructionException GTK+ fails to create the object.
	 */
	public this()
	{
		auto p = gtk_print_settings_new();

		if(p is null)
		{
			throw new ConstructionException("null returned by new");
		}

		this(cast(GtkPrintSettings*) p, true);
	}

	/**
	 * Reads the print settings from @file_name. Returns a new #GtkPrintSettings
	 * object with the restored settings, or %NULL if an error occurred. If the
	 * file could not be loaded then error is set to either a #GFileError or
	 * #GKeyFileError.  See gtk_print_settings_to_file().
	 *
	 * Params:
	 *     fileName = the filename to read the settings from
	 *
	 * Returns: the restored #GtkPrintSettings
	 *
	 * Since: 2.12
	 *
	 * Throws: GException on failure.
	 * Throws: ConstructionException GTK+ fails to create the object.
	 */
	public this(string fileName)
	{
		GError* err = null;

		auto p = gtk_print_settings_new_from_file(Str.toStringz(fileName), &err);

		if (err !is null)
		{
			throw new GException( new ErrorG(err) );
		}

		if(p is null)
		{
			throw new ConstructionException("null returned by new_from_file");
		}

		this(cast(GtkPrintSettings*) p, true);
	}

	/**
	 * Deserialize print settings from an a{sv} variant in
	 * the format produced by gtk_print_settings_to_gvariant().
	 *
	 * Params:
	 *     variant = an a{sv} #GVariant
	 *
	 * Returns: a new #GtkPrintSettings object
	 *
	 * Since: 3.22
	 *
	 * Throws: ConstructionException GTK+ fails to create the object.
	 */
	public this(Variant variant)
	{
		auto p = gtk_print_settings_new_from_gvariant((variant is null) ? null : variant.getVariantStruct());

		if(p is null)
		{
			throw new ConstructionException("null returned by new_from_gvariant");
		}

		this(cast(GtkPrintSettings*) p, true);
	}

	/**
	 * Reads the print settings from the group @group_name in @key_file.  Returns a
	 * new #GtkPrintSettings object with the restored settings, or %NULL if an
	 * error occurred. If the file could not be loaded then error is set to either
	 * a #GFileError or #GKeyFileError.
	 *
	 * Params:
	 *     keyFile = the #GKeyFile to retrieve the settings from
	 *     groupName = the name of the group to use, or %NULL to use
	 *         the default “Print Settings”
	 *
	 * Returns: the restored #GtkPrintSettings
	 *
	 * Since: 2.12
	 *
	 * Throws: GException on failure.
	 * Throws: ConstructionException GTK+ fails to create the object.
	 */
	public this(KeyFile keyFile, string groupName)
	{
		GError* err = null;

		auto p = gtk_print_settings_new_from_key_file((keyFile is null) ? null : keyFile.getKeyFileStruct(), Str.toStringz(groupName), &err);

		if (err !is null)
		{
			throw new GException( new ErrorG(err) );
		}

		if(p is null)
		{
			throw new ConstructionException("null returned by new_from_key_file");
		}

		this(cast(GtkPrintSettings*) p, true);
	}

	/**
	 * Copies a #GtkPrintSettings object.
	 *
	 * Returns: a newly allocated copy of @other
	 *
	 * Since: 2.10
	 */
	public PrintSettings copy()
	{
		auto p = gtk_print_settings_copy(gtkPrintSettings);

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(PrintSettings)(cast(GtkPrintSettings*) p, true);
	}

	alias foreac = foreach_;
	/**
	 * Calls @func for each key-value pair of @settings.
	 *
	 * Params:
	 *     func = the function to call
	 *     userData = user data for @func
	 *
	 * Since: 2.10
	 */
	public void foreach_(GtkPrintSettingsFunc func, void* userData)
	{
		gtk_print_settings_foreach(gtkPrintSettings, func, userData);
	}

	/**
	 * Looks up the string value associated with @key.
	 *
	 * Params:
	 *     key = a key
	 *
	 * Returns: the string value for @key
	 *
	 * Since: 2.10
	 */
	public string get(string key)
	{
		return Str.toString(gtk_print_settings_get(gtkPrintSettings, Str.toStringz(key)));
	}

	/**
	 * Returns the boolean represented by the value
	 * that is associated with @key.
	 *
	 * The string “true” represents %TRUE, any other
	 * string %FALSE.
	 *
	 * Params:
	 *     key = a key
	 *
	 * Returns: %TRUE, if @key maps to a true value.
	 *
	 * Since: 2.10
	 */
	public bool getBool(string key)
	{
		return gtk_print_settings_get_bool(gtkPrintSettings, Str.toStringz(key)) != 0;
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_COLLATE.
	 *
	 * Returns: whether to collate the printed pages
	 *
	 * Since: 2.10
	 */
	public bool getCollate()
	{
		return gtk_print_settings_get_collate(gtkPrintSettings) != 0;
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
	 *
	 * Returns: the default source
	 *
	 * Since: 2.10
	 */
	public string getDefaultSource()
	{
		return Str.toString(gtk_print_settings_get_default_source(gtkPrintSettings));
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_DITHER.
	 *
	 * Returns: the dithering that is used
	 *
	 * Since: 2.10
	 */
	public string getDither()
	{
		return Str.toString(gtk_print_settings_get_dither(gtkPrintSettings));
	}

	/**
	 * Returns the double value associated with @key, or 0.
	 *
	 * Params:
	 *     key = a key
	 *
	 * Returns: the double value of @key
	 *
	 * Since: 2.10
	 */
	public double getDouble(string key)
	{
		return gtk_print_settings_get_double(gtkPrintSettings, Str.toStringz(key));
	}

	/**
	 * Returns the floating point number represented by
	 * the value that is associated with @key, or @default_val
	 * if the value does not represent a floating point number.
	 *
	 * Floating point numbers are parsed with g_ascii_strtod().
	 *
	 * Params:
	 *     key = a key
	 *     def = the default value
	 *
	 * Returns: the floating point number associated with @key
	 *
	 * Since: 2.10
	 */
	public double getDoubleWithDefault(string key, double def)
	{
		return gtk_print_settings_get_double_with_default(gtkPrintSettings, Str.toStringz(key), def);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_DUPLEX.
	 *
	 * Returns: whether to print the output in duplex.
	 *
	 * Since: 2.10
	 */
	public GtkPrintDuplex getDuplex()
	{
		return gtk_print_settings_get_duplex(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
	 *
	 * Returns: the finishings
	 *
	 * Since: 2.10
	 */
	public string getFinishings()
	{
		return Str.toString(gtk_print_settings_get_finishings(gtkPrintSettings));
	}

	/**
	 * Returns the integer value of @key, or 0.
	 *
	 * Params:
	 *     key = a key
	 *
	 * Returns: the integer value of @key
	 *
	 * Since: 2.10
	 */
	public int getInt(string key)
	{
		return gtk_print_settings_get_int(gtkPrintSettings, Str.toStringz(key));
	}

	/**
	 * Returns the value of @key, interpreted as
	 * an integer, or the default value.
	 *
	 * Params:
	 *     key = a key
	 *     def = the default value
	 *
	 * Returns: the integer value of @key
	 *
	 * Since: 2.10
	 */
	public int getIntWithDefault(string key, int def)
	{
		return gtk_print_settings_get_int_with_default(gtkPrintSettings, Str.toStringz(key), def);
	}

	/**
	 * Returns the value associated with @key, interpreted
	 * as a length. The returned value is converted to @units.
	 *
	 * Params:
	 *     key = a key
	 *     unit = the unit of the return value
	 *
	 * Returns: the length value of @key, converted to @unit
	 *
	 * Since: 2.10
	 */
	public double getLength(string key, GtkUnit unit)
	{
		return gtk_print_settings_get_length(gtkPrintSettings, Str.toStringz(key), unit);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
	 *
	 * The set of media types is defined in PWG 5101.1-2002 PWG.
	 *
	 * Returns: the media type
	 *
	 * Since: 2.10
	 */
	public string getMediaType()
	{
		return Str.toString(gtk_print_settings_get_media_type(gtkPrintSettings));
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.
	 *
	 * Returns: the number of copies to print
	 *
	 * Since: 2.10
	 */
	public int getNCopies()
	{
		return gtk_print_settings_get_n_copies(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
	 *
	 * Returns: the number of pages per sheet
	 *
	 * Since: 2.10
	 */
	public int getNumberUp()
	{
		return gtk_print_settings_get_number_up(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
	 *
	 * Returns: layout of page in number-up mode
	 *
	 * Since: 2.14
	 */
	public GtkNumberUpLayout getNumberUpLayout()
	{
		return gtk_print_settings_get_number_up_layout(gtkPrintSettings);
	}

	/**
	 * Get the value of %GTK_PRINT_SETTINGS_ORIENTATION,
	 * converted to a #GtkPageOrientation.
	 *
	 * Returns: the orientation
	 *
	 * Since: 2.10
	 */
	public GtkPageOrientation getOrientation()
	{
		return gtk_print_settings_get_orientation(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
	 *
	 * Returns: the output bin
	 *
	 * Since: 2.10
	 */
	public string getOutputBin()
	{
		return Str.toString(gtk_print_settings_get_output_bin(gtkPrintSettings));
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
	 *
	 * Returns: an array
	 *     of #GtkPageRanges.  Use g_free() to free the array when
	 *     it is no longer needed.
	 *
	 * Since: 2.10
	 */
	public GtkPageRange[] getPageRanges()
	{
		int numRanges;

		auto p = gtk_print_settings_get_page_ranges(gtkPrintSettings, &numRanges);

		return p[0 .. numRanges];
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
	 *
	 * Returns: the set of pages to print
	 *
	 * Since: 2.10
	 */
	public GtkPageSet getPageSet()
	{
		return gtk_print_settings_get_page_set(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT,
	 * converted to @unit.
	 *
	 * Params:
	 *     unit = the unit for the return value
	 *
	 * Returns: the paper height, in units of @unit
	 *
	 * Since: 2.10
	 */
	public double getPaperHeight(GtkUnit unit)
	{
		return gtk_print_settings_get_paper_height(gtkPrintSettings, unit);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
	 * converted to a #GtkPaperSize.
	 *
	 * Returns: the paper size
	 *
	 * Since: 2.10
	 */
	public PaperSize getPaperSize()
	{
		auto p = gtk_print_settings_get_paper_size(gtkPrintSettings);

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(PaperSize)(cast(GtkPaperSize*) p, true);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH,
	 * converted to @unit.
	 *
	 * Params:
	 *     unit = the unit for the return value
	 *
	 * Returns: the paper width, in units of @unit
	 *
	 * Since: 2.10
	 */
	public double getPaperWidth(GtkUnit unit)
	{
		return gtk_print_settings_get_paper_width(gtkPrintSettings, unit);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
	 *
	 * Returns: which pages to print
	 *
	 * Since: 2.10
	 */
	public GtkPrintPages getPrintPages()
	{
		return gtk_print_settings_get_print_pages(gtkPrintSettings);
	}

	/**
	 * Convenience function to obtain the value of
	 * %GTK_PRINT_SETTINGS_PRINTER.
	 *
	 * Returns: the printer name
	 *
	 * Since: 2.10
	 */
	public string getPrinter()
	{
		return Str.toString(gtk_print_settings_get_printer(gtkPrintSettings));
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
	 *
	 * Returns: the resolution in lpi (lines per inch)
	 *
	 * Since: 2.16
	 */
	public double getPrinterLpi()
	{
		return gtk_print_settings_get_printer_lpi(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_QUALITY.
	 *
	 * Returns: the print quality
	 *
	 * Since: 2.10
	 */
	public GtkPrintQuality getQuality()
	{
		return gtk_print_settings_get_quality(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION.
	 *
	 * Returns: the resolution in dpi
	 *
	 * Since: 2.10
	 */
	public int getResolution()
	{
		return gtk_print_settings_get_resolution(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_X.
	 *
	 * Returns: the horizontal resolution in dpi
	 *
	 * Since: 2.16
	 */
	public int getResolutionX()
	{
		return gtk_print_settings_get_resolution_x(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_Y.
	 *
	 * Returns: the vertical resolution in dpi
	 *
	 * Since: 2.16
	 */
	public int getResolutionY()
	{
		return gtk_print_settings_get_resolution_y(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_REVERSE.
	 *
	 * Returns: whether to reverse the order of the printed pages
	 *
	 * Since: 2.10
	 */
	public bool getReverse()
	{
		return gtk_print_settings_get_reverse(gtkPrintSettings) != 0;
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_SCALE.
	 *
	 * Returns: the scale in percent
	 *
	 * Since: 2.10
	 */
	public double getScale()
	{
		return gtk_print_settings_get_scale(gtkPrintSettings);
	}

	/**
	 * Gets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
	 *
	 * Returns: whether to use color
	 *
	 * Since: 2.10
	 */
	public bool getUseColor()
	{
		return gtk_print_settings_get_use_color(gtkPrintSettings) != 0;
	}

	/**
	 * Returns %TRUE, if a value is associated with @key.
	 *
	 * Params:
	 *     key = a key
	 *
	 * Returns: %TRUE, if @key has a value
	 *
	 * Since: 2.10
	 */
	public bool hasKey(string key)
	{
		return gtk_print_settings_has_key(gtkPrintSettings, Str.toStringz(key)) != 0;
	}

	/**
	 * Reads the print settings from @file_name. If the file could not be loaded
	 * then error is set to either a #GFileError or #GKeyFileError.
	 * See gtk_print_settings_to_file().
	 *
	 * Params:
	 *     fileName = the filename to read the settings from
	 *
	 * Returns: %TRUE on success
	 *
	 * Since: 2.14
	 *
	 * Throws: GException on failure.
	 */
	public bool loadFile(string fileName)
	{
		GError* err = null;

		auto p = gtk_print_settings_load_file(gtkPrintSettings, Str.toStringz(fileName), &err) != 0;

		if (err !is null)
		{
			throw new GException( new ErrorG(err) );
		}

		return p;
	}

	/**
	 * Reads the print settings from the group @group_name in @key_file. If the
	 * file could not be loaded then error is set to either a #GFileError or
	 * #GKeyFileError.
	 *
	 * Params:
	 *     keyFile = the #GKeyFile to retrieve the settings from
	 *     groupName = the name of the group to use, or %NULL to use the default
	 *         “Print Settings”
	 *
	 * Returns: %TRUE on success
	 *
	 * Since: 2.14
	 *
	 * Throws: GException on failure.
	 */
	public bool loadKeyFile(KeyFile keyFile, string groupName)
	{
		GError* err = null;

		auto p = gtk_print_settings_load_key_file(gtkPrintSettings, (keyFile is null) ? null : keyFile.getKeyFileStruct(), Str.toStringz(groupName), &err) != 0;

		if (err !is null)
		{
			throw new GException( new ErrorG(err) );
		}

		return p;
	}

	/**
	 * Associates @value with @key.
	 *
	 * Params:
	 *     key = a key
	 *     value = a string value, or %NULL
	 *
	 * Since: 2.10
	 */
	public void set(string key, string value)
	{
		gtk_print_settings_set(gtkPrintSettings, Str.toStringz(key), Str.toStringz(value));
	}

	/**
	 * Sets @key to a boolean value.
	 *
	 * Params:
	 *     key = a key
	 *     value = a boolean
	 *
	 * Since: 2.10
	 */
	public void setBool(string key, bool value)
	{
		gtk_print_settings_set_bool(gtkPrintSettings, Str.toStringz(key), value);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_COLLATE.
	 *
	 * Params:
	 *     collate = whether to collate the output
	 *
	 * Since: 2.10
	 */
	public void setCollate(bool collate)
	{
		gtk_print_settings_set_collate(gtkPrintSettings, collate);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
	 *
	 * Params:
	 *     defaultSource = the default source
	 *
	 * Since: 2.10
	 */
	public void setDefaultSource(string defaultSource)
	{
		gtk_print_settings_set_default_source(gtkPrintSettings, Str.toStringz(defaultSource));
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_DITHER.
	 *
	 * Params:
	 *     dither = the dithering that is used
	 *
	 * Since: 2.10
	 */
	public void setDither(string dither)
	{
		gtk_print_settings_set_dither(gtkPrintSettings, Str.toStringz(dither));
	}

	/**
	 * Sets @key to a double value.
	 *
	 * Params:
	 *     key = a key
	 *     value = a double value
	 *
	 * Since: 2.10
	 */
	public void setDouble(string key, double value)
	{
		gtk_print_settings_set_double(gtkPrintSettings, Str.toStringz(key), value);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_DUPLEX.
	 *
	 * Params:
	 *     duplex = a #GtkPrintDuplex value
	 *
	 * Since: 2.10
	 */
	public void setDuplex(GtkPrintDuplex duplex)
	{
		gtk_print_settings_set_duplex(gtkPrintSettings, duplex);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
	 *
	 * Params:
	 *     finishings = the finishings
	 *
	 * Since: 2.10
	 */
	public void setFinishings(string finishings)
	{
		gtk_print_settings_set_finishings(gtkPrintSettings, Str.toStringz(finishings));
	}

	/**
	 * Sets @key to an integer value.
	 *
	 * Params:
	 *     key = a key
	 *     value = an integer
	 *
	 * Since: 2.10
	 */
	public void setInt(string key, int value)
	{
		gtk_print_settings_set_int(gtkPrintSettings, Str.toStringz(key), value);
	}

	/**
	 * Associates a length in units of @unit with @key.
	 *
	 * Params:
	 *     key = a key
	 *     value = a length
	 *     unit = the unit of @length
	 *
	 * Since: 2.10
	 */
	public void setLength(string key, double value, GtkUnit unit)
	{
		gtk_print_settings_set_length(gtkPrintSettings, Str.toStringz(key), value, unit);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
	 *
	 * The set of media types is defined in PWG 5101.1-2002 PWG.
	 *
	 * Params:
	 *     mediaType = the media type
	 *
	 * Since: 2.10
	 */
	public void setMediaType(string mediaType)
	{
		gtk_print_settings_set_media_type(gtkPrintSettings, Str.toStringz(mediaType));
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.
	 *
	 * Params:
	 *     numCopies = the number of copies
	 *
	 * Since: 2.10
	 */
	public void setNCopies(int numCopies)
	{
		gtk_print_settings_set_n_copies(gtkPrintSettings, numCopies);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
	 *
	 * Params:
	 *     numberUp = the number of pages per sheet
	 *
	 * Since: 2.10
	 */
	public void setNumberUp(int numberUp)
	{
		gtk_print_settings_set_number_up(gtkPrintSettings, numberUp);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
	 *
	 * Params:
	 *     numberUpLayout = a #GtkNumberUpLayout value
	 *
	 * Since: 2.14
	 */
	public void setNumberUpLayout(GtkNumberUpLayout numberUpLayout)
	{
		gtk_print_settings_set_number_up_layout(gtkPrintSettings, numberUpLayout);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_ORIENTATION.
	 *
	 * Params:
	 *     orientation = a page orientation
	 *
	 * Since: 2.10
	 */
	public void setOrientation(GtkPageOrientation orientation)
	{
		gtk_print_settings_set_orientation(gtkPrintSettings, orientation);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
	 *
	 * Params:
	 *     outputBin = the output bin
	 *
	 * Since: 2.10
	 */
	public void setOutputBin(string outputBin)
	{
		gtk_print_settings_set_output_bin(gtkPrintSettings, Str.toStringz(outputBin));
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
	 *
	 * Params:
	 *     pageRanges = an array of #GtkPageRanges
	 *
	 * Since: 2.10
	 */
	public void setPageRanges(GtkPageRange[] pageRanges)
	{
		gtk_print_settings_set_page_ranges(gtkPrintSettings, pageRanges.ptr, cast(int)pageRanges.length);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
	 *
	 * Params:
	 *     pageSet = a #GtkPageSet value
	 *
	 * Since: 2.10
	 */
	public void setPageSet(GtkPageSet pageSet)
	{
		gtk_print_settings_set_page_set(gtkPrintSettings, pageSet);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
	 *
	 * Params:
	 *     height = the paper height
	 *     unit = the units of @height
	 *
	 * Since: 2.10
	 */
	public void setPaperHeight(double height, GtkUnit unit)
	{
		gtk_print_settings_set_paper_height(gtkPrintSettings, height, unit);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
	 * %GTK_PRINT_SETTINGS_PAPER_WIDTH and
	 * %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
	 *
	 * Params:
	 *     paperSize = a paper size
	 *
	 * Since: 2.10
	 */
	public void setPaperSize(PaperSize paperSize)
	{
		gtk_print_settings_set_paper_size(gtkPrintSettings, (paperSize is null) ? null : paperSize.getPaperSizeStruct());
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH.
	 *
	 * Params:
	 *     width = the paper width
	 *     unit = the units of @width
	 *
	 * Since: 2.10
	 */
	public void setPaperWidth(double width, GtkUnit unit)
	{
		gtk_print_settings_set_paper_width(gtkPrintSettings, width, unit);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
	 *
	 * Params:
	 *     pages = a #GtkPrintPages value
	 *
	 * Since: 2.10
	 */
	public void setPrintPages(GtkPrintPages pages)
	{
		gtk_print_settings_set_print_pages(gtkPrintSettings, pages);
	}

	/**
	 * Convenience function to set %GTK_PRINT_SETTINGS_PRINTER
	 * to @printer.
	 *
	 * Params:
	 *     printer = the printer name
	 *
	 * Since: 2.10
	 */
	public void setPrinter(string printer)
	{
		gtk_print_settings_set_printer(gtkPrintSettings, Str.toStringz(printer));
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
	 *
	 * Params:
	 *     lpi = the resolution in lpi (lines per inch)
	 *
	 * Since: 2.16
	 */
	public void setPrinterLpi(double lpi)
	{
		gtk_print_settings_set_printer_lpi(gtkPrintSettings, lpi);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_QUALITY.
	 *
	 * Params:
	 *     quality = a #GtkPrintQuality value
	 *
	 * Since: 2.10
	 */
	public void setQuality(GtkPrintQuality quality)
	{
		gtk_print_settings_set_quality(gtkPrintSettings, quality);
	}

	/**
	 * Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
	 * %GTK_PRINT_SETTINGS_RESOLUTION_X and
	 * %GTK_PRINT_SETTINGS_RESOLUTION_Y.
	 *
	 * Params:
	 *     resolution = the resolution in dpi
	 *
	 * Since: 2.10
	 */
	public void setResolution(int resolution)
	{
		gtk_print_settings_set_resolution(gtkPrintSettings, resolution);
	}

	/**
	 * Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
	 * %GTK_PRINT_SETTINGS_RESOLUTION_X and
	 * %GTK_PRINT_SETTINGS_RESOLUTION_Y.
	 *
	 * Params:
	 *     resolutionX = the horizontal resolution in dpi
	 *     resolutionY = the vertical resolution in dpi
	 *
	 * Since: 2.16
	 */
	public void setResolutionXy(int resolutionX, int resolutionY)
	{
		gtk_print_settings_set_resolution_xy(gtkPrintSettings, resolutionX, resolutionY);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_REVERSE.
	 *
	 * Params:
	 *     reverse = whether to reverse the output
	 *
	 * Since: 2.10
	 */
	public void setReverse(bool reverse)
	{
		gtk_print_settings_set_reverse(gtkPrintSettings, reverse);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_SCALE.
	 *
	 * Params:
	 *     scale = the scale in percent
	 *
	 * Since: 2.10
	 */
	public void setScale(double scale)
	{
		gtk_print_settings_set_scale(gtkPrintSettings, scale);
	}

	/**
	 * Sets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
	 *
	 * Params:
	 *     useColor = whether to use color
	 *
	 * Since: 2.10
	 */
	public void setUseColor(bool useColor)
	{
		gtk_print_settings_set_use_color(gtkPrintSettings, useColor);
	}

	/**
	 * This function saves the print settings from @settings to @file_name. If the
	 * file could not be loaded then error is set to either a #GFileError or
	 * #GKeyFileError.
	 *
	 * Params:
	 *     fileName = the file to save to
	 *
	 * Returns: %TRUE on success
	 *
	 * Since: 2.12
	 *
	 * Throws: GException on failure.
	 */
	public bool toFile(string fileName)
	{
		GError* err = null;

		auto p = gtk_print_settings_to_file(gtkPrintSettings, Str.toStringz(fileName), &err) != 0;

		if (err !is null)
		{
			throw new GException( new ErrorG(err) );
		}

		return p;
	}

	/**
	 * Serialize print settings to an a{sv} variant.
	 *
	 * Returns: a new, floating, #GVariant
	 *
	 * Since: 3.22
	 */
	public Variant toGvariant()
	{
		auto p = gtk_print_settings_to_gvariant(gtkPrintSettings);

		if(p is null)
		{
			return null;
		}

		return new Variant(cast(GVariant*) p);
	}

	/**
	 * This function adds the print settings from @settings to @key_file.
	 *
	 * Params:
	 *     keyFile = the #GKeyFile to save the print settings to
	 *     groupName = the group to add the settings to in @key_file, or
	 *         %NULL to use the default “Print Settings”
	 *
	 * Since: 2.12
	 */
	public void toKeyFile(KeyFile keyFile, string groupName)
	{
		gtk_print_settings_to_key_file(gtkPrintSettings, (keyFile is null) ? null : keyFile.getKeyFileStruct(), Str.toStringz(groupName));
	}

	/**
	 * Removes any value associated with @key.
	 * This has the same effect as setting the value to %NULL.
	 *
	 * Params:
	 *     key = a key
	 *
	 * Since: 2.10
	 */
	public void unset(string key)
	{
		gtk_print_settings_unset(gtkPrintSettings, Str.toStringz(key));
	}
}