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