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  = GtkAppChooser.html
27  * outPack = gtk
28  * outFile = AppChooserT
29  * strct   = GtkAppChooser
30  * realStrct=
31  * ctorStrct=
32  * clss    = AppChooserT
33  * interf  = AppChooserIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gtk_app_chooser_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gio.AppInfo
49  * structWrap:
50  * 	- GAppInfo* -> AppInfo
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module gtk.AppChooserT;
57 
58 public  import gtkc.gtktypes;
59 
60 public import gtkc.gtk;
61 public import glib.ConstructionException;
62 public import gobject.ObjectG;
63 
64 public import glib.Str;
65 public import gio.AppInfo;
66 
67 
68 
69 /**
70  * GtkAppChooser is an interface that can be implemented by widgets which
71  * allow the user to choose an application (typically for the purpose of
72  * opening a file). The main objects that implement this interface are
73  * GtkAppChooserWidget, GtkAppChooserDialog and GtkAppChooserButton.
74  *
75  * Applications are represented by GIO GAppInfo objects here.
76  * GIO has a concept of recommended and fallback applications for a
77  * given content type. Recommended applications are those that claim
78  * to handle the content type itself, while fallback also includes
79  * applications that handle a more generic content type. GIO also
80  * knows the default and last-used application for a given content
81  * type. The GtkAppChooserWidget provides detailed control over
82  * whether the shown list of applications should include default,
83  * recommended or fallback applications.
84  *
85  * To obtain the application that has been selected in a GtkAppChooser,
86  * use gtk_app_chooser_get_app_info().
87  */
88 public template AppChooserT(TStruct)
89 {
90 	
91 	/** the main Gtk struct */
92 	protected GtkAppChooser* gtkAppChooser;
93 	
94 	
95 	/** Get the main Gtk struct */
96 	public GtkAppChooser* getAppChooserTStruct()
97 	{
98 		return cast(GtkAppChooser*)getStruct();
99 	}
100 	
101 	
102 	/**
103 	 */
104 	
105 	/**
106 	 * Returns the currently selected application.
107 	 * Returns: a GAppInfo for the currently selected application, or NULL if none is selected. Free with g_object_unref(). [transfer full] Since 3.0
108 	 */
109 	public AppInfo getAppInfo()
110 	{
111 		// GAppInfo * gtk_app_chooser_get_app_info (GtkAppChooser *self);
112 		auto p = gtk_app_chooser_get_app_info(getAppChooserTStruct());
113 		
114 		if(p is null)
115 		{
116 			return null;
117 		}
118 		
119 		return ObjectG.getDObject!(AppInfo)(cast(GAppInfo*) p);
120 	}
121 	
122 	/**
123 	 * Returns the current value of the "content-type" property.
124 	 * Returns: the content type of self. Free with g_free() Since 3.0
125 	 */
126 	public string getContentType()
127 	{
128 		// gchar * gtk_app_chooser_get_content_type (GtkAppChooser *self);
129 		return Str.toString(gtk_app_chooser_get_content_type(getAppChooserTStruct()));
130 	}
131 	
132 	/**
133 	 * Reloads the list of applications.
134 	 */
135 	public void refresh()
136 	{
137 		// void gtk_app_chooser_refresh (GtkAppChooser *self);
138 		gtk_app_chooser_refresh(getAppChooserTStruct());
139 	}
140 }