I've no idea here...
[gtkD.git] / src / gtk / FileChooserButton.d
blob4f5a85edc6113d210d73a5511bc4201f46ff52e0
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 = GtkFileChooserButton.html
26 * outPack = gtk
27 * outFile = FileChooserButton
28 * strct = GtkFileChooserButton
29 * realStrct=
30 * ctorStrct=
31 * clss = FileChooserButton
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_file_chooser_button_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gtk.Widget
47 * - glib.ListSG;
48 * - gtk.Widget;
49 * - gtk.FileFilter;
50 * - gtk.FileChooser;
51 * structWrap:
52 * - GtkWidget* -> Widget
53 * local aliases:
56 module gtk.FileChooserButton;
58 private import gtk.gtktypes;
60 private import lib.gtk;
62 private import glib.Str;
63 private import gtk.Widget;
64 private import glib.ListSG;;
65 private import gtk.Widget;;
66 private import gtk.FileFilter;;
67 private import gtk.FileChooser;;
69 /**
70 * Description
71 * The GtkFileChooserButton is a widget that lets the user select a
72 * file. It implements the GtkFileChooser interface. Visually, it is a
73 * file name with a button to bring up a GtkFileChooserDialog.
74 * The user can then use that dialog to change the file associated with
75 * that button. This widget does not support setting the "select-multiple"
76 * property to TRUE.
77 * Example6.Create a button to let the user select a file in /etc
78 * {
79 * GtkWidget *button;
80 * button = gtk_file_chooser_button_new (_("Select a file"),
81 * GTK_FILE_CHOOSER_ACTION_OPEN);
82 * gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button),
83 * "/etc");
84 * }
85 * The GtkFileChooserButton supports the GtkFileChooserActions GTK_FILE_CHOOSER_ACTION_OPEN and GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
86 * Important
87 * The GtkFileChooserButton will ellipsize the label,
88 * and thus will thus request little horizontal space. To give the button
89 * more space, you should call gtk_widget_size_request(),
90 * gtk_file_chooser_button_set_width_chars(), or pack the button in
91 * such a way that other interface elements give space to the widget.
93 private import gtk.HBox;
94 public class FileChooserButton : HBox
97 /** the main Gtk struct */
98 protected GtkFileChooserButton* gtkFileChooserButton;
101 public GtkFileChooserButton* getFileChooserButtonStruct()
103 return gtkFileChooserButton;
107 /** the main Gtk struct as a void* */
108 protected void* getStruct()
110 return cast(void*)gtkFileChooserButton;
114 * Sets our main struct and passes it to the parent class
116 public this (GtkFileChooserButton* gtkFileChooserButton)
118 super(cast(GtkHBox*)gtkFileChooserButton);
119 this.gtkFileChooserButton = gtkFileChooserButton;
122 private FileChooser fileChooser;
124 public FileChooser getFileChooser()
126 if ( fileChooser is null )
128 fileChooser = new FileChooser(cast(GtkFileChooser*)getFileChooserButtonStruct());
130 return fileChooser;
138 * Creates a new file-selecting button widget.
139 * title:
140 * the title of the browse dialog.
141 * action:
142 * the open mode for the widget.
143 * Returns:
144 * a new button widget.
145 * Since 2.6
147 public this (char[] title, GtkFileChooserAction action)
149 // GtkWidget* gtk_file_chooser_button_new (const gchar *title, GtkFileChooserAction action);
150 this(cast(GtkFileChooserButton*)gtk_file_chooser_button_new(Str.toStringz(title), action) );
154 * Creates a new file-selecting button widget using backend.
155 * title:
156 * the title of the browse dialog.
157 * action:
158 * the open mode for the widget.
159 * backend:
160 * the name of the GtkFileSystem backend to use.
161 * Returns:
162 * a new button widget.
163 * Since 2.6
165 public this (char[] title, GtkFileChooserAction action, char[] backend)
167 // GtkWidget* gtk_file_chooser_button_new_with_backend (const gchar *title, GtkFileChooserAction action, const gchar *backend);
168 this(cast(GtkFileChooserButton*)gtk_file_chooser_button_new_with_backend(Str.toStringz(title), action, Str.toStringz(backend)) );
172 * Creates a GtkFileChooserButton widget which uses dialog as it's
173 * file-picking window. Note that dialog must be a GtkFileChooserDialog (or
174 * subclass) and must not have GTK_DIALOG_DESTROY_WITH_PARENT set.
175 * dialog:
176 * the GtkFileChooserDialog widget to use.
177 * Returns:
178 * a new button widget.
179 * Since 2.6
181 public this (Widget dialog)
183 // GtkWidget* gtk_file_chooser_button_new_with_dialog (GtkWidget *dialog);
184 this(cast(GtkFileChooserButton*)gtk_file_chooser_button_new_with_dialog((dialog is null) ? null : dialog.getWidgetStruct()) );
188 * Retrieves the title of the browse dialog used by button. The returned value
189 * should not be modified or freed.
190 * button:
191 * the button widget to examine.
192 * Returns:
193 * a pointer to the browse dialog's title.
194 * Since 2.6
196 public char[] getTitle()
198 // const gchar* gtk_file_chooser_button_get_title (GtkFileChooserButton *button);
199 return Str.toString(gtk_file_chooser_button_get_title(gtkFileChooserButton) );
203 * Modifies the title of the browse dialog used by button.
204 * button:
205 * the button widget to modify.
206 * title:
207 * the new browse dialog title.
208 * Since 2.6
210 public void setTitle(char[] title)
212 // void gtk_file_chooser_button_set_title (GtkFileChooserButton *button, const gchar *title);
213 gtk_file_chooser_button_set_title(gtkFileChooserButton, Str.toStringz(title));
217 * Retrieves the width in characters of the button widget's entry and/or label.
218 * button:
219 * the button widget to examine.
220 * Returns:
221 * an integer width (in characters) that the button will use to size itself.
222 * Since 2.6
224 public int getWidthChars()
226 // gint gtk_file_chooser_button_get_width_chars (GtkFileChooserButton *button);
227 return gtk_file_chooser_button_get_width_chars(gtkFileChooserButton);
231 * Sets the width (in characters) that button will use to n_chars.
232 * button:
233 * the button widget to examine.
234 * n_chars:
235 * the new width, in characters.
236 * Since 2.6
238 public void setWidthChars(int nChars)
240 // void gtk_file_chooser_button_set_width_chars (GtkFileChooserButton *button, gint n_chars);
241 gtk_file_chooser_button_set_width_chars(gtkFileChooserButton, nChars);
245 * Returns whether the button grabs focus when it is clicked with the mouse.
246 * See gtk_file_chooser_button_set_focus_on_click().
247 * button:
248 * a GtkFileChooserButton
249 * Returns:
250 * TRUE if the button grabs focus when it is clicked with
251 * the mouse.
252 * Since 2.10
254 public int getFocusOnClick()
256 // gboolean gtk_file_chooser_button_get_focus_on_click (GtkFileChooserButton *button);
257 return gtk_file_chooser_button_get_focus_on_click(gtkFileChooserButton);
261 * Sets whether the button will grab focus when it is clicked with the mouse.
262 * Making mouse clicks not grab focus is useful in places like toolbars where
263 * you don't want the keyboard focus removed from the main area of the
264 * application.
265 * button:
266 * a GtkFileChooserButton
267 * focus_on_click:
268 * whether the button grabs focus when clicked with the mouse
269 * Since 2.10
270 * Property Details
271 * The "dialog" property
272 * "dialog" GtkFileChooserDialog : Write / Construct Only
273 * Instance of the GtkFileChooserDialog associated with the button.
274 * Since 2.6
276 public void setFocusOnClick(int focusOnClick)
278 // void gtk_file_chooser_button_set_focus_on_click (GtkFileChooserButton *button, gboolean focus_on_click);
279 gtk_file_chooser_button_set_focus_on_click(gtkFileChooserButton, focusOnClick);