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 = GtkRecentChooserDialog.html 27 * outPack = gtk 28 * outFile = RecentChooserDialog 29 * strct = GtkRecentChooserDialog 30 * realStrct= 31 * ctorStrct= 32 * clss = RecentChooserDialog 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - RecentChooserIF 40 * prefixes: 41 * - gtk_recent_chooser_dialog_ 42 * - gtk_ 43 * omit structs: 44 * omit prefixes: 45 * omit code: 46 * - gtk_recent_chooser_dialog_new 47 * - gtk_recent_chooser_dialog_new_for_manager 48 * omit signals: 49 * imports: 50 * - glib.Str 51 * - gtk.Widget 52 * - gtk.Window 53 * - gtk.RecentManager 54 * - gtk.RecentChooserIF 55 * - gtk.RecentChooserT 56 * structWrap: 57 * - GtkRecentManager* -> RecentManager 58 * - GtkWidget* -> Widget 59 * - GtkWindow* -> Window 60 * module aliases: 61 * local aliases: 62 * overrides: 63 */ 64 65 module gtk.RecentChooserDialog; 66 67 public import gtkc.gtktypes; 68 69 private import gtkc.gtk; 70 private import glib.ConstructionException; 71 private import gobject.ObjectG; 72 73 74 private import glib.Str; 75 private import gtk.Widget; 76 private import gtk.Window; 77 private import gtk.RecentManager; 78 private import gtk.RecentChooserIF; 79 private import gtk.RecentChooserT; 80 81 82 83 private import gtk.Dialog; 84 85 /** 86 * Description 87 * GtkRecentChooserDialog is a dialog box suitable for displaying the recently 88 * used documents. This widgets works by putting a GtkRecentChooserWidget inside 89 * a GtkDialog. It exposes the GtkRecentChooserIface interface, so you can use 90 * all the GtkRecentChooser functions on the recent chooser dialog as well as 91 * those for GtkDialog. 92 * Note that GtkRecentChooserDialog does not have any methods of its own. 93 * Instead, you should use the functions that work on a GtkRecentChooser. 94 * $(DDOC_COMMENT example) 95 * Recently used files are supported since GTK+ 2.10. 96 */ 97 public class RecentChooserDialog : Dialog, RecentChooserIF 98 { 99 100 /** the main Gtk struct */ 101 protected GtkRecentChooserDialog* gtkRecentChooserDialog; 102 103 104 public GtkRecentChooserDialog* getRecentChooserDialogStruct() 105 { 106 return gtkRecentChooserDialog; 107 } 108 109 110 /** the main Gtk struct as a void* */ 111 protected override void* getStruct() 112 { 113 return cast(void*)gtkRecentChooserDialog; 114 } 115 116 /** 117 * Sets our main struct and passes it to the parent class 118 */ 119 public this (GtkRecentChooserDialog* gtkRecentChooserDialog) 120 { 121 super(cast(GtkDialog*)gtkRecentChooserDialog); 122 this.gtkRecentChooserDialog = gtkRecentChooserDialog; 123 } 124 125 protected override void setStruct(GObject* obj) 126 { 127 super.setStruct(obj); 128 gtkRecentChooserDialog = cast(GtkRecentChooserDialog*)obj; 129 } 130 131 // add the RecentChooser capabilities 132 mixin RecentChooserT!(GtkRecentChooserDialog); 133 134 /** 135 * Creates a new GtkRecentChooserDialog with a specified recent manager. 136 * This is useful if you have implemented your own recent manager, or if you 137 * have a customized instance of a GtkRecentManager object. 138 * Since 2.10 139 * Params: 140 * title = Title of the dialog, or null 141 * parent = Transient parent of the dialog, or null, 142 * manager = a GtkRecentManager, or null 143 * buttonsText = text to go in the buttons 144 * responses = response ID's for the buttons 145 * Throws: ConstructionException GTK+ fails to create the object. 146 */ 147 public this (string title, Window parent, RecentManager manager, string[] buttonsText=null, ResponseType[] responses=null ) 148 { 149 // GtkWidget* gtk_recent_chooser_dialog_new_for_manager (const gchar *title, GtkWindow *parent, GtkRecentManager *manager, const gchar *first_button_text, ...); 150 auto p = gtk_recent_chooser_dialog_new_for_manager(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct(), (manager is null) ? null : manager.getRecentManagerStruct(), null); 151 if(p is null) 152 { 153 throw new ConstructionException("null returned by gtk_recent_chooser_dialog_new_for_manager"); 154 } 155 this(cast(GtkRecentChooserDialog*) p); 156 addButtons(buttonsText, responses); 157 } 158 159 /** 160 * Creates a new GtkRecentChooserDialog with a specified recent manager. 161 * This is useful if you have implemented your own recent manager, or if you 162 * have a customized instance of a GtkRecentManager object. 163 * Since 2.10 164 * Params: 165 * title = Title of the dialog, or null 166 * parent = Transient parent of the dialog, or null, 167 * manager = a GtkRecentManager, or null 168 * stockIDs = stockIDs of the buttons 169 * responses = response ID's for the buttons 170 * Throws: ConstructionException GTK+ fails to create the object. 171 */ 172 public this (string title, Window parent, RecentManager manager, StockID[] stockIDs, ResponseType[] responses=null ) 173 { 174 // GtkWidget* gtk_recent_chooser_dialog_new_for_manager (const gchar *title, GtkWindow *parent, GtkRecentManager *manager, const gchar *first_button_text, ...); 175 auto p = gtk_recent_chooser_dialog_new_for_manager(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct(), (manager is null) ? null : manager.getRecentManagerStruct(), null); 176 if(p is null) 177 { 178 throw new ConstructionException("null returned by gtk_recent_chooser_dialog_new_for_manager"); 179 } 180 this(cast(GtkRecentChooserDialog*) p); 181 addButtons(stockIDs, responses); 182 } 183 184 /** 185 */ 186 }