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  = GtkRecentChooserMenu.html
27  * outPack = gtk
28  * outFile = RecentChooserMenu
29  * strct   = GtkRecentChooserMenu
30  * realStrct=
31  * ctorStrct=
32  * clss    = RecentChooserMenu
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- ActivatableIF
40  * 	- RecentChooserIF
41  * prefixes:
42  * 	- gtk_recent_chooser_menu_
43  * omit structs:
44  * omit prefixes:
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- glib.Str
49  * 	- gtk.RecentManager
50  * 	- gtk.ActivatableT
51  * 	- gtk.ActivatableIF
52  * 	- gtk.RecentChooserIF
53  * 	- gtk.RecentChooserT
54  * structWrap:
55  * 	- GtkRecentManager* -> RecentManager
56  * module aliases:
57  * local aliases:
58  * overrides:
59  */
60 
61 module gtk.RecentChooserMenu;
62 
63 public  import gtkc.gtktypes;
64 
65 private import gtkc.gtk;
66 private import glib.ConstructionException;
67 private import gobject.ObjectG;
68 
69 
70 private import glib.Str;
71 private import gtk.RecentManager;
72 private import gtk.ActivatableT;
73 private import gtk.ActivatableIF;
74 private import gtk.RecentChooserIF;
75 private import gtk.RecentChooserT;
76 
77 
78 
79 private import gtk.Menu;
80 
81 /**
82  * GtkRecentChooserMenu is a widget suitable for displaying recently used files
83  * inside a menu. It can be used to set a sub-menu of a GtkMenuItem using
84  * gtk_menu_item_set_submenu(), or as the menu of a GtkMenuToolButton.
85  *
86  * Note that GtkRecentChooserMenu does not have any methods of its own. Instead,
87  * you should use the functions that work on a GtkRecentChooser.
88  *
89  * Note also that GtkRecentChooserMenu does not support multiple filters, as it
90  * has no way to let the user choose between them as the GtkRecentChooserWidget
91  * and GtkRecentChooserDialog widgets do. Thus using gtk_recent_chooser_add_filter()
92  * on a GtkRecentChooserMenu widget will yield the same effects as using
93  * gtk_recent_chooser_set_filter(), replacing any currently set filter
94  * with the supplied filter; gtk_recent_chooser_remove_filter() will remove
95  * any currently set GtkRecentFilter object and will unset the current filter;
96  * gtk_recent_chooser_list_filters() will return a list containing a single
97  * GtkRecentFilter object.
98  *
99  * Recently used files are supported since GTK+ 2.10.
100  */
101 public class RecentChooserMenu : Menu, ActivatableIF, RecentChooserIF
102 {
103 	
104 	/** the main Gtk struct */
105 	protected GtkRecentChooserMenu* gtkRecentChooserMenu;
106 	
107 	
108 	public GtkRecentChooserMenu* getRecentChooserMenuStruct()
109 	{
110 		return gtkRecentChooserMenu;
111 	}
112 	
113 	
114 	/** the main Gtk struct as a void* */
115 	protected override void* getStruct()
116 	{
117 		return cast(void*)gtkRecentChooserMenu;
118 	}
119 	
120 	/**
121 	 * Sets our main struct and passes it to the parent class
122 	 */
123 	public this (GtkRecentChooserMenu* gtkRecentChooserMenu)
124 	{
125 		super(cast(GtkMenu*)gtkRecentChooserMenu);
126 		this.gtkRecentChooserMenu = gtkRecentChooserMenu;
127 	}
128 	
129 	protected override void setStruct(GObject* obj)
130 	{
131 		super.setStruct(obj);
132 		gtkRecentChooserMenu = cast(GtkRecentChooserMenu*)obj;
133 	}
134 	
135 	// add the Activatable capabilities
136 	mixin ActivatableT!(GtkRecentChooserMenu);
137 	
138 	// add the RecentChooser capabilities
139 	mixin RecentChooserT!(GtkRecentChooserMenu);
140 	
141 	/**
142 	 */
143 	
144 	/**
145 	 * Creates a new GtkRecentChooserMenu widget.
146 	 * This kind of widget shows the list of recently used resources as
147 	 * a menu, each item as a menu item. Each item inside the menu might
148 	 * have an icon, representing its MIME type, and a number, for mnemonic
149 	 * access.
150 	 * This widget implements the GtkRecentChooser interface.
151 	 * This widget creates its own GtkRecentManager object. See the
152 	 * gtk_recent_chooser_menu_new_for_manager() function to know how to create
153 	 * a GtkRecentChooserMenu widget bound to another GtkRecentManager object.
154 	 * Since 2.10
155 	 * Throws: ConstructionException GTK+ fails to create the object.
156 	 */
157 	public this ()
158 	{
159 		// GtkWidget * gtk_recent_chooser_menu_new (void);
160 		auto p = gtk_recent_chooser_menu_new();
161 		if(p is null)
162 		{
163 			throw new ConstructionException("null returned by gtk_recent_chooser_menu_new()");
164 		}
165 		this(cast(GtkRecentChooserMenu*) p);
166 	}
167 	
168 	/**
169 	 * Creates a new GtkRecentChooserMenu widget using manager as
170 	 * the underlying recently used resources manager.
171 	 * This is useful if you have implemented your own recent manager,
172 	 * or if you have a customized instance of a GtkRecentManager
173 	 * object or if you wish to share a common GtkRecentManager object
174 	 * among multiple GtkRecentChooser widgets.
175 	 * Since 2.10
176 	 * Params:
177 	 * manager = a GtkRecentManager
178 	 * Throws: ConstructionException GTK+ fails to create the object.
179 	 */
180 	public this (RecentManager manager)
181 	{
182 		// GtkWidget * gtk_recent_chooser_menu_new_for_manager  (GtkRecentManager *manager);
183 		auto p = gtk_recent_chooser_menu_new_for_manager((manager is null) ? null : manager.getRecentManagerStruct());
184 		if(p is null)
185 		{
186 			throw new ConstructionException("null returned by gtk_recent_chooser_menu_new_for_manager((manager is null) ? null : manager.getRecentManagerStruct())");
187 		}
188 		this(cast(GtkRecentChooserMenu*) p);
189 	}
190 	
191 	/**
192 	 * Returns the value set by gtk_recent_chooser_menu_set_show_numbers().
193 	 * Since 2.10
194 	 * Returns: TRUE if numbers should be shown.
195 	 */
196 	public int getShowNumbers()
197 	{
198 		// gboolean gtk_recent_chooser_menu_get_show_numbers  (GtkRecentChooserMenu *menu);
199 		return gtk_recent_chooser_menu_get_show_numbers(gtkRecentChooserMenu);
200 	}
201 	
202 	/**
203 	 * Sets whether a number should be added to the items of menu. The
204 	 * numbers are shown to provide a unique character for a mnemonic to
205 	 * be used inside ten menu item's label. Only the first the items
206 	 * get a number to avoid clashes.
207 	 * Since 2.10
208 	 * Params:
209 	 * showNumbers = whether to show numbers
210 	 */
211 	public void setShowNumbers(int showNumbers)
212 	{
213 		// void gtk_recent_chooser_menu_set_show_numbers  (GtkRecentChooserMenu *menu,  gboolean show_numbers);
214 		gtk_recent_chooser_menu_set_show_numbers(gtkRecentChooserMenu, showNumbers);
215 	}
216 }