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 71 private import glib.Str; 72 private import gio.File; 73 private import gtk.Widget; 74 private import gtk.Window; 75 private import gtk.AppChooserIF; 76 private import gtk.AppChooserT; 77 78 79 80 private import gtk.Dialog; 81 82 /** 83 * GtkAppChooserDialog shows a GtkAppChooserWidget inside a GtkDialog. 84 * 85 * Note that GtkAppChooserDialog does not have any interesting methods 86 * of its own. Instead, you should get the embedded GtkAppChooserWidget 87 * using gtk_app_chooser_dialog_get_widget() and call its methods if 88 * the generic GtkAppChooser interface is not sufficient for your needs. 89 * 90 * To set the heading that is shown above the GtkAppChooserWidget, 91 * use gtk_app_chooser_dialog_set_heading(). 92 */ 93 public class AppChooserDialog : Dialog, AppChooserIF 94 { 95 96 /** the main Gtk struct */ 97 protected GtkAppChooserDialog* gtkAppChooserDialog; 98 99 100 public GtkAppChooserDialog* getAppChooserDialogStruct() 101 { 102 return gtkAppChooserDialog; 103 } 104 105 106 /** the main Gtk struct as a void* */ 107 protected override void* getStruct() 108 { 109 return cast(void*)gtkAppChooserDialog; 110 } 111 112 /** 113 * Sets our main struct and passes it to the parent class 114 */ 115 public this (GtkAppChooserDialog* gtkAppChooserDialog) 116 { 117 super(cast(GtkDialog*)gtkAppChooserDialog); 118 this.gtkAppChooserDialog = gtkAppChooserDialog; 119 } 120 121 protected override void setStruct(GObject* obj) 122 { 123 super.setStruct(obj); 124 gtkAppChooserDialog = cast(GtkAppChooserDialog*)obj; 125 } 126 127 // add the AppChooser capabilities 128 mixin AppChooserT!(GtkAppChooserDialog); 129 130 /** 131 */ 132 133 /** 134 * Creates a new GtkAppChooserDialog for the provided GFile, 135 * to allow the user to select an application for it. 136 * Params: 137 * parent = a GtkWindow, or NULL. [allow-none] 138 * flags = flags for this dialog 139 * file = a GFile 140 * Throws: ConstructionException GTK+ fails to create the object. 141 */ 142 public this (Window parent, GtkDialogFlags flags, File file) 143 { 144 // GtkWidget * gtk_app_chooser_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GFile *file); 145 auto p = gtk_app_chooser_dialog_new((parent is null) ? null : parent.getWindowStruct(), flags, (file is null) ? null : file.getFileStruct()); 146 if(p is null) 147 { 148 throw new ConstructionException("null returned by gtk_app_chooser_dialog_new((parent is null) ? null : parent.getWindowStruct(), flags, (file is null) ? null : file.getFileStruct())"); 149 } 150 this(cast(GtkAppChooserDialog*) p); 151 } 152 153 /** 154 * Creates a new GtkAppChooserDialog for the provided content type, 155 * to allow the user to select an application for it. 156 * Params: 157 * parent = a GtkWindow, or NULL. [allow-none] 158 * flags = flags for this dialog 159 * contentType = a content type string 160 * Throws: ConstructionException GTK+ fails to create the object. 161 */ 162 public this (Window parent, GtkDialogFlags flags, string contentType) 163 { 164 // GtkWidget * gtk_app_chooser_dialog_new_for_content_type (GtkWindow *parent, GtkDialogFlags flags, const gchar *content_type); 165 auto p = gtk_app_chooser_dialog_new_for_content_type((parent is null) ? null : parent.getWindowStruct(), flags, Str.toStringz(contentType)); 166 if(p is null) 167 { 168 throw new ConstructionException("null returned by gtk_app_chooser_dialog_new_for_content_type((parent is null) ? null : parent.getWindowStruct(), flags, Str.toStringz(contentType))"); 169 } 170 this(cast(GtkAppChooserDialog*) p); 171 } 172 173 /** 174 * Returns the GtkAppChooserWidget of this dialog. 175 * Returns: the GtkAppChooserWidget of self. [transfer none] Since 3.0 176 */ 177 public Widget getWidget() 178 { 179 // GtkWidget * gtk_app_chooser_dialog_get_widget (GtkAppChooserDialog *self); 180 auto p = gtk_app_chooser_dialog_get_widget(gtkAppChooserDialog); 181 182 if(p is null) 183 { 184 return null; 185 } 186 187 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 188 } 189 190 /** 191 * Sets the text to display at the top of the dialog. 192 * If the heading is not set, the dialog displays a default text. 193 * Params: 194 * heading = a string containing Pango markup 195 */ 196 public void setHeading(string heading) 197 { 198 // void gtk_app_chooser_dialog_set_heading (GtkAppChooserDialog *self, const gchar *heading); 199 gtk_app_chooser_dialog_set_heading(gtkAppChooserDialog, Str.toStringz(heading)); 200 } 201 202 /** 203 * Returns the text to display at the top of the dialog. 204 * Returns: the text to display at the top of the dialog, or NULL, in which case a default text is displayed 205 */ 206 public string getHeading() 207 { 208 // const gchar * gtk_app_chooser_dialog_get_heading (GtkAppChooserDialog *self); 209 return Str.toString(gtk_app_chooser_dialog_get_heading(gtkAppChooserDialog)); 210 } 211 }