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 = GtkFileChooserWidget.html 27 * outPack = gtk 28 * outFile = FileChooserWidget 29 * strct = GtkFileChooserWidget 30 * realStrct= 31 * ctorStrct= 32 * clss = FileChooserWidget 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - FileChooserIF 40 * prefixes: 41 * - gtk_file_chooser_widget_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - gtk.FileChooserT 49 * - gtk.FileChooserIF 50 * structWrap: 51 * module aliases: 52 * local aliases: 53 * overrides: 54 */ 55 56 module gtk.FileChooserWidget; 57 58 public import gtkc.gtktypes; 59 60 private import gtkc.gtk; 61 private import glib.ConstructionException; 62 private import gobject.ObjectG; 63 64 private import glib.Str; 65 private import gtk.FileChooserT; 66 private import gtk.FileChooserIF; 67 68 69 private import gtk.Box; 70 71 /** 72 * GtkFileChooserWidget is a widget suitable for selecting files. 73 * It is the main building block of a GtkFileChooserDialog. Most 74 * applications will only need to use the latter; you can use 75 * GtkFileChooserWidget as part of a larger window if you have 76 * special needs. 77 * 78 * Note that GtkFileChooserWidget does not have any methods of its 79 * own. Instead, you should use the functions that work on a 80 * GtkFileChooser. 81 */ 82 public class FileChooserWidget : Box, FileChooserIF 83 { 84 85 /** the main Gtk struct */ 86 protected GtkFileChooserWidget* gtkFileChooserWidget; 87 88 89 /** Get the main Gtk struct */ 90 public GtkFileChooserWidget* getFileChooserWidgetStruct() 91 { 92 return gtkFileChooserWidget; 93 } 94 95 96 /** the main Gtk struct as a void* */ 97 protected override void* getStruct() 98 { 99 return cast(void*)gtkFileChooserWidget; 100 } 101 102 /** 103 * Sets our main struct and passes it to the parent class 104 */ 105 public this (GtkFileChooserWidget* gtkFileChooserWidget) 106 { 107 super(cast(GtkBox*)gtkFileChooserWidget); 108 this.gtkFileChooserWidget = gtkFileChooserWidget; 109 } 110 111 protected override void setStruct(GObject* obj) 112 { 113 super.setStruct(obj); 114 gtkFileChooserWidget = cast(GtkFileChooserWidget*)obj; 115 } 116 117 // add the FileChooser capabilities 118 mixin FileChooserT!(GtkFileChooserWidget); 119 120 /** 121 */ 122 123 /** 124 * Creates a new GtkFileChooserWidget. This is a file chooser widget that can 125 * be embedded in custom windows, and it is the same widget that is used by 126 * GtkFileChooserDialog. 127 * Since 2.4 128 * Params: 129 * action = Open or save mode for the widget 130 * Throws: ConstructionException GTK+ fails to create the object. 131 */ 132 public this (GtkFileChooserAction action) 133 { 134 // GtkWidget * gtk_file_chooser_widget_new (GtkFileChooserAction action); 135 auto p = gtk_file_chooser_widget_new(action); 136 if(p is null) 137 { 138 throw new ConstructionException("null returned by gtk_file_chooser_widget_new(action)"); 139 } 140 this(cast(GtkFileChooserWidget*) p); 141 } 142 }