alternative to assert
[gtkD.git] / gtkD / src / gtk / FileChooserWidget.d
blobee65be35979c7171fe0faa626b79906ba20ad8a1
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkFileChooserWidget.html
26 * outPack = gtk
27 * outFile = FileChooserWidget
28 * strct = GtkFileChooserWidget
29 * realStrct=
30 * ctorStrct=
31 * clss = FileChooserWidget
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_file_chooser_widget_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - glib.ListSG;
47 * - gtk.Widget;
48 * - gtk.FileFilter;
49 * - gtk.FileChooser;
50 * structWrap:
51 * module aliases:
52 * local aliases:
55 module gtk.FileChooserWidget;
57 version(noAssert)
59 version(Tango)
61 import tango.io.Stdout; // use the tango loging?
65 private import gtkc.gtktypes;
67 private import gtkc.gtk;
70 private import glib.Str;
71 private import glib.ListSG;;
72 private import gtk.Widget;;
73 private import gtk.FileFilter;;
74 private import gtk.FileChooser;;
79 /**
80 * Description
81 * GtkFileChooserWidget is a widget suitable for selecting files.
82 * It is the main building block of a GtkFileChooserDialog. Most
83 * applications will only need to use the latter; you can use
84 * GtkFileChooserWidget as part of a larger window if you have
85 * special needs.
86 * Note that GtkFileChooserWidget does not have any methods of its
87 * own. Instead, you should use the functions that work on a
88 * GtkFileChooser.
90 private import gtk.VBox;
91 public class FileChooserWidget : VBox
94 /** the main Gtk struct */
95 protected GtkFileChooserWidget* gtkFileChooserWidget;
98 public GtkFileChooserWidget* getFileChooserWidgetStruct()
100 return gtkFileChooserWidget;
104 /** the main Gtk struct as a void* */
105 protected void* getStruct()
107 return cast(void*)gtkFileChooserWidget;
111 * Sets our main struct and passes it to the parent class
113 public this (GtkFileChooserWidget* gtkFileChooserWidget)
115 version(noAssert)
117 if ( gtkFileChooserWidget is null )
119 int zero = 0;
120 version(Tango)
122 Stdout("struct gtkFileChooserWidget is null on constructor").newline;
124 else
126 printf("struct gtkFileChooserWidget is null on constructor");
128 zero = zero / zero;
131 else
133 assert(gtkFileChooserWidget !is null, "struct gtkFileChooserWidget is null on constructor");
135 super(cast(GtkVBox*)gtkFileChooserWidget);
136 this.gtkFileChooserWidget = gtkFileChooserWidget;
139 private FileChooser fileChooser;
141 public FileChooser getFileChooser()
143 if ( fileChooser is null )
145 fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserWidgetStruct());
147 return fileChooser;
155 * Creates a new GtkFileChooserWidget. This is a file chooser widget that can
156 * be embedded in custom windows, and it is the same widget that is used by
157 * GtkFileChooserDialog.
158 * action:
159 * Open or save mode for the widget
160 * Returns:
161 * a new GtkFileChooserWidget
162 * Since 2.4
164 public this (GtkFileChooserAction action)
166 // GtkWidget* gtk_file_chooser_widget_new (GtkFileChooserAction action);
167 this(cast(GtkFileChooserWidget*)gtk_file_chooser_widget_new(action) );
171 * Creates a new GtkFileChooserWidget with a specified backend. This is
172 * especially useful if you use gtk_file_chooser_set_local_only() to allow
173 * non-local files. This is a file chooser widget that can be embedded in
174 * custom windows and it is the same widget that is used by
175 * GtkFileChooserDialog.
176 * action:
177 * Open or save mode for the widget
178 * backend:
179 * The name of the specific filesystem backend to use.
180 * Returns:
181 * a new GtkFileChooserWidget
182 * Since 2.4
183 * See Also
184 * GtkFileChooser, GtkFileChooserDialog
186 public this (GtkFileChooserAction action, char[] backend)
188 // GtkWidget* gtk_file_chooser_widget_new_with_backend (GtkFileChooserAction action, const gchar *backend);
189 this(cast(GtkFileChooserWidget*)gtk_file_chooser_widget_new_with_backend(action, Str.toStringz(backend)) );