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