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 65 public import glib.Str; 66 public import gio.AppInfo; 67 68 69 70 71 /** 72 * GtkAppChooser is an interface that can be implemented by widgets which 73 * allow the user to choose an application (typically for the purpose of 74 * opening a file). The main objects that implement this interface are 75 * GtkAppChooserWidget, GtkAppChooserDialog and GtkAppChooserButton. 76 * 77 * Applications are represented by GIO GAppInfo objects here. 78 * GIO has a concept of recommended and fallback applications for a 79 * given content type. Recommended applications are those that claim 80 * to handle the content type itself, while fallback also includes 81 * applications that handle a more generic content type. GIO also 82 * knows the default and last-used application for a given content 83 * type. The GtkAppChooserWidget provides detailed control over 84 * whether the shown list of applications should include default, 85 * recommended or fallback applications. 86 * 87 * To obtain the application that has been selected in a GtkAppChooser, 88 * use gtk_app_chooser_get_app_info(). 89 */ 90 public template AppChooserT(TStruct) 91 { 92 93 /** the main Gtk struct */ 94 protected GtkAppChooser* gtkAppChooser; 95 96 97 public GtkAppChooser* getAppChooserTStruct() 98 { 99 return cast(GtkAppChooser*)getStruct(); 100 } 101 102 103 /** 104 */ 105 106 /** 107 * Returns the currently selected application. 108 * Returns: a GAppInfo for the currently selected application, or NULL if none is selected. Free with g_object_unref(). [transfer full] Since 3.0 109 */ 110 public AppInfo getAppInfo() 111 { 112 // GAppInfo * gtk_app_chooser_get_app_info (GtkAppChooser *self); 113 auto p = gtk_app_chooser_get_app_info(getAppChooserTStruct()); 114 115 if(p is null) 116 { 117 return null; 118 } 119 120 return ObjectG.getDObject!(AppInfo)(cast(GAppInfo*) p); 121 } 122 123 /** 124 * Returns the current value of the "content-type" property. 125 * Returns: the content type of self. Free with g_free() Since 3.0 126 */ 127 public string getContentType() 128 { 129 // gchar * gtk_app_chooser_get_content_type (GtkAppChooser *self); 130 return Str.toString(gtk_app_chooser_get_content_type(getAppChooserTStruct())); 131 } 132 133 /** 134 * Reloads the list of applications. 135 */ 136 public void refresh() 137 { 138 // void gtk_app_chooser_refresh (GtkAppChooser *self); 139 gtk_app_chooser_refresh(getAppChooserTStruct()); 140 } 141 }