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.PageSetupUnixDialog;
26 
27 private import glib.ConstructionException;
28 private import glib.Str;
29 private import gobject.ObjectG;
30 private import gtk.Dialog;
31 private import gtk.PageSetup;
32 private import gtk.PrintSettings;
33 private import gtk.Widget;
34 private import gtk.Window;
35 private import gtk.c.functions;
36 public  import gtk.c.types;
37 
38 
39 /**
40  * `GtkPageSetupUnixDialog` implements a page setup dialog for platforms
41  * which don’t provide a native page setup dialog, like Unix.
42  * 
43  * ![An example GtkPageSetupUnixDialog](pagesetupdialog.png)
44  * 
45  * It can be used very much like any other GTK dialog, at the
46  * cost of the portability offered by the high-level printing
47  * API in [class@Gtk.PrintOperation].
48  */
49 public class PageSetupUnixDialog : Dialog
50 {
51 	/** the main Gtk struct */
52 	protected GtkPageSetupUnixDialog* gtkPageSetupUnixDialog;
53 
54 	/** Get the main Gtk struct */
55 	public GtkPageSetupUnixDialog* getPageSetupUnixDialogStruct(bool transferOwnership = false)
56 	{
57 		if (transferOwnership)
58 			ownedRef = false;
59 		return gtkPageSetupUnixDialog;
60 	}
61 
62 	/** the main Gtk struct as a void* */
63 	protected override void* getStruct()
64 	{
65 		return cast(void*)gtkPageSetupUnixDialog;
66 	}
67 
68 	/**
69 	 * Sets our main struct and passes it to the parent class.
70 	 */
71 	public this (GtkPageSetupUnixDialog* gtkPageSetupUnixDialog, bool ownedRef = false)
72 	{
73 		this.gtkPageSetupUnixDialog = gtkPageSetupUnixDialog;
74 		super(cast(GtkDialog*)gtkPageSetupUnixDialog, ownedRef);
75 	}
76 
77 
78 	/** */
79 	public static GType getType()
80 	{
81 		return gtk_page_setup_unix_dialog_get_type();
82 	}
83 
84 	/**
85 	 * Creates a new page setup dialog.
86 	 *
87 	 * Params:
88 	 *     title = the title of the dialog, or %NULL
89 	 *     parent = transient parent of the dialog, or %NULL
90 	 *
91 	 * Returns: the new `GtkPageSetupUnixDialog`
92 	 *
93 	 * Throws: ConstructionException GTK+ fails to create the object.
94 	 */
95 	public this(string title, Window parent)
96 	{
97 		auto __p = gtk_page_setup_unix_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct());
98 
99 		if(__p is null)
100 		{
101 			throw new ConstructionException("null returned by new");
102 		}
103 
104 		this(cast(GtkPageSetupUnixDialog*) __p);
105 	}
106 
107 	/**
108 	 * Gets the currently selected page setup from the dialog.
109 	 *
110 	 * Returns: the current page setup
111 	 */
112 	public PageSetup getPageSetup()
113 	{
114 		auto __p = gtk_page_setup_unix_dialog_get_page_setup(gtkPageSetupUnixDialog);
115 
116 		if(__p is null)
117 		{
118 			return null;
119 		}
120 
121 		return ObjectG.getDObject!(PageSetup)(cast(GtkPageSetup*) __p);
122 	}
123 
124 	/**
125 	 * Gets the current print settings from the dialog.
126 	 *
127 	 * Returns: the current print settings
128 	 */
129 	public PrintSettings getPrintSettings()
130 	{
131 		auto __p = gtk_page_setup_unix_dialog_get_print_settings(gtkPageSetupUnixDialog);
132 
133 		if(__p is null)
134 		{
135 			return null;
136 		}
137 
138 		return ObjectG.getDObject!(PrintSettings)(cast(GtkPrintSettings*) __p);
139 	}
140 
141 	/**
142 	 * Sets the `GtkPageSetup` from which the page setup
143 	 * dialog takes its values.
144 	 *
145 	 * Params:
146 	 *     pageSetup = a `GtkPageSetup`
147 	 */
148 	public void setPageSetup(PageSetup pageSetup)
149 	{
150 		gtk_page_setup_unix_dialog_set_page_setup(gtkPageSetupUnixDialog, (pageSetup is null) ? null : pageSetup.getPageSetupStruct());
151 	}
152 
153 	/**
154 	 * Sets the `GtkPrintSettings` from which the page setup dialog
155 	 * takes its values.
156 	 *
157 	 * Params:
158 	 *     printSettings = a `GtkPrintSettings`
159 	 */
160 	public void setPrintSettings(PrintSettings printSettings)
161 	{
162 		gtk_page_setup_unix_dialog_set_print_settings(gtkPageSetupUnixDialog, (printSettings is null) ? null : printSettings.getPrintSettingsStruct());
163 	}
164 }