1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GtkAppChooserDialog.html
27  * outPack = gtk
28  * outFile = AppChooserDialog
29  * strct   = GtkAppChooserDialog
30  * realStrct=
31  * ctorStrct=
32  * clss    = AppChooserDialog
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- AppChooserIF
40  * prefixes:
41  * 	- gtk_app_chooser_dialog_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gio.File
49  * 	- gtk.Widget
50  * 	- gtk.Window
51  * 	- gtk.AppChooserIF
52  * 	- gtk.AppChooserT
53  * structWrap:
54  * 	- GFile* -> File
55  * 	- GtkWidget* -> Widget
56  * 	- GtkWindow* -> Window
57  * module aliases:
58  * local aliases:
59  * overrides:
60  */
61 
62 module gtk.AppChooserDialog;
63 
64 public  import gtkc.gtktypes;
65 
66 private import gtkc.gtk;
67 private import glib.ConstructionException;
68 private import gobject.ObjectG;
69 
70 private import glib.Str;
71 private import gio.File;
72 private import gtk.Widget;
73 private import gtk.Window;
74 private import gtk.AppChooserIF;
75 private import gtk.AppChooserT;
76 
77 
78 private import gtk.Dialog;
79 
80 /**
81  * GtkAppChooserDialog shows a GtkAppChooserWidget inside a GtkDialog.
82  *
83  * Note that GtkAppChooserDialog does not have any interesting methods
84  * of its own. Instead, you should get the embedded GtkAppChooserWidget
85  * using gtk_app_chooser_dialog_get_widget() and call its methods if
86  * the generic GtkAppChooser interface is not sufficient for your needs.
87  *
88  * To set the heading that is shown above the GtkAppChooserWidget,
89  * use gtk_app_chooser_dialog_set_heading().
90  */
91 public class AppChooserDialog : Dialog, AppChooserIF
92 {
93 	
94 	/** the main Gtk struct */
95 	protected GtkAppChooserDialog* gtkAppChooserDialog;
96 	
97 	
98 	/** Get the main Gtk struct */
99 	public GtkAppChooserDialog* getAppChooserDialogStruct()
100 	{
101 		return gtkAppChooserDialog;
102 	}
103 	
104 	
105 	/** the main Gtk struct as a void* */
106 	protected override void* getStruct()
107 	{
108 		return cast(void*)gtkAppChooserDialog;
109 	}
110 	
111 	/**
112 	 * Sets our main struct and passes it to the parent class
113 	 */
114 	public this (GtkAppChooserDialog* gtkAppChooserDialog)
115 	{
116 		super(cast(GtkDialog*)gtkAppChooserDialog);
117 		this.gtkAppChooserDialog = gtkAppChooserDialog;
118 	}
119 	
120 	protected override void setStruct(GObject* obj)
121 	{
122 		super.setStruct(obj);
123 		gtkAppChooserDialog = cast(GtkAppChooserDialog*)obj;
124 	}
125 	
126 	// add the AppChooser capabilities
127 	mixin AppChooserT!(GtkAppChooserDialog);
128 	
129 	/**
130 	 */
131 	
132 	/**
133 	 * Creates a new GtkAppChooserDialog for the provided GFile,
134 	 * to allow the user to select an application for it.
135 	 * Params:
136 	 * parent = a GtkWindow, or NULL. [allow-none]
137 	 * flags = flags for this dialog
138 	 * file = a GFile
139 	 * Throws: ConstructionException GTK+ fails to create the object.
140 	 */
141 	public this (Window parent, GtkDialogFlags flags, File file)
142 	{
143 		// GtkWidget * gtk_app_chooser_dialog_new (GtkWindow *parent,  GtkDialogFlags flags,  GFile *file);
144 		auto p = gtk_app_chooser_dialog_new((parent is null) ? null : parent.getWindowStruct(), flags, (file is null) ? null : file.getFileStruct());
145 		if(p is null)
146 		{
147 			throw new ConstructionException("null returned by gtk_app_chooser_dialog_new((parent is null) ? null : parent.getWindowStruct(), flags, (file is null) ? null : file.getFileStruct())");
148 		}
149 		this(cast(GtkAppChooserDialog*) p);
150 	}
151 	
152 	/**
153 	 * Creates a new GtkAppChooserDialog for the provided content type,
154 	 * to allow the user to select an application for it.
155 	 * Params:
156 	 * parent = a GtkWindow, or NULL. [allow-none]
157 	 * flags = flags for this dialog
158 	 * contentType = a content type string
159 	 * Throws: ConstructionException GTK+ fails to create the object.
160 	 */
161 	public this (Window parent, GtkDialogFlags flags, string contentType)
162 	{
163 		// GtkWidget * gtk_app_chooser_dialog_new_for_content_type  (GtkWindow *parent,  GtkDialogFlags flags,  const gchar *content_type);
164 		auto p = gtk_app_chooser_dialog_new_for_content_type((parent is null) ? null : parent.getWindowStruct(), flags, Str.toStringz(contentType));
165 		if(p is null)
166 		{
167 			throw new ConstructionException("null returned by gtk_app_chooser_dialog_new_for_content_type((parent is null) ? null : parent.getWindowStruct(), flags, Str.toStringz(contentType))");
168 		}
169 		this(cast(GtkAppChooserDialog*) p);
170 	}
171 	
172 	/**
173 	 * Returns the GtkAppChooserWidget of this dialog.
174 	 * Returns: the GtkAppChooserWidget of self. [transfer none] Since 3.0
175 	 */
176 	public Widget getWidget()
177 	{
178 		// GtkWidget * gtk_app_chooser_dialog_get_widget (GtkAppChooserDialog *self);
179 		auto p = gtk_app_chooser_dialog_get_widget(gtkAppChooserDialog);
180 		
181 		if(p is null)
182 		{
183 			return null;
184 		}
185 		
186 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
187 	}
188 	
189 	/**
190 	 * Sets the text to display at the top of the dialog.
191 	 * If the heading is not set, the dialog displays a default text.
192 	 * Params:
193 	 * heading = a string containing Pango markup
194 	 */
195 	public void setHeading(string heading)
196 	{
197 		// void gtk_app_chooser_dialog_set_heading (GtkAppChooserDialog *self,  const gchar *heading);
198 		gtk_app_chooser_dialog_set_heading(gtkAppChooserDialog, Str.toStringz(heading));
199 	}
200 	
201 	/**
202 	 * Returns the text to display at the top of the dialog.
203 	 * Returns: the text to display at the top of the dialog, or NULL, in which case a default text is displayed
204 	 */
205 	public string getHeading()
206 	{
207 		// const gchar * gtk_app_chooser_dialog_get_heading (GtkAppChooserDialog *self);
208 		return Str.toString(gtk_app_chooser_dialog_get_heading(gtkAppChooserDialog));
209 	}
210 }