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 module gtk.RecentChooserWidget;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Box;
30 private import gtk.RecentChooserIF;
31 private import gtk.RecentChooserT;
32 private import gtk.RecentManager;
33 private import gtk.Widget;
34 private import gtkc.gtk;
35 public  import gtkc.gtktypes;
36 
37 
38 /**
39  * #GtkRecentChooserWidget is a widget suitable for selecting recently used
40  * files.  It is the main building block of a #GtkRecentChooserDialog.  Most
41  * applications will only need to use the latter; you can use
42  * #GtkRecentChooserWidget as part of a larger window if you have special needs.
43  * 
44  * Note that #GtkRecentChooserWidget does not have any methods of its own.
45  * Instead, you should use the functions that work on a #GtkRecentChooser.
46  * 
47  * Recently used files are supported since GTK+ 2.10.
48  */
49 public class RecentChooserWidget : Box, RecentChooserIF
50 {
51 	/** the main Gtk struct */
52 	protected GtkRecentChooserWidget* gtkRecentChooserWidget;
53 
54 	/** Get the main Gtk struct */
55 	public GtkRecentChooserWidget* getRecentChooserWidgetStruct()
56 	{
57 		return gtkRecentChooserWidget;
58 	}
59 
60 	/** the main Gtk struct as a void* */
61 	protected override void* getStruct()
62 	{
63 		return cast(void*)gtkRecentChooserWidget;
64 	}
65 
66 	protected override void setStruct(GObject* obj)
67 	{
68 		gtkRecentChooserWidget = cast(GtkRecentChooserWidget*)obj;
69 		super.setStruct(obj);
70 	}
71 
72 	/**
73 	 * Sets our main struct and passes it to the parent class.
74 	 */
75 	public this (GtkRecentChooserWidget* gtkRecentChooserWidget, bool ownedRef = false)
76 	{
77 		this.gtkRecentChooserWidget = gtkRecentChooserWidget;
78 		super(cast(GtkBox*)gtkRecentChooserWidget, ownedRef);
79 	}
80 
81 	// add the RecentChooser capabilities
82 	mixin RecentChooserT!(GtkRecentChooserWidget);
83 
84 	/**
85 	 */
86 
87 	public static GType getType()
88 	{
89 		return gtk_recent_chooser_widget_get_type();
90 	}
91 
92 	/**
93 	 * Creates a new #GtkRecentChooserWidget object.  This is an embeddable widget
94 	 * used to access the recently used resources list.
95 	 *
96 	 * Return: a new #GtkRecentChooserWidget
97 	 *
98 	 * Since: 2.10
99 	 *
100 	 * Throws: ConstructionException GTK+ fails to create the object.
101 	 */
102 	public this()
103 	{
104 		auto p = gtk_recent_chooser_widget_new();
105 		
106 		if(p is null)
107 		{
108 			throw new ConstructionException("null returned by new");
109 		}
110 		
111 		this(cast(GtkRecentChooserWidget*) p);
112 	}
113 
114 	/**
115 	 * Creates a new #GtkRecentChooserWidget with a specified recent manager.
116 	 *
117 	 * This is useful if you have implemented your own recent manager, or if you
118 	 * have a customized instance of a #GtkRecentManager object.
119 	 *
120 	 * Params:
121 	 *     manager = a #GtkRecentManager
122 	 *
123 	 * Return: a new #GtkRecentChooserWidget
124 	 *
125 	 * Since: 2.10
126 	 *
127 	 * Throws: ConstructionException GTK+ fails to create the object.
128 	 */
129 	public this(RecentManager manager)
130 	{
131 		auto p = gtk_recent_chooser_widget_new_for_manager((manager is null) ? null : manager.getRecentManagerStruct());
132 		
133 		if(p is null)
134 		{
135 			throw new ConstructionException("null returned by new_for_manager");
136 		}
137 		
138 		this(cast(GtkRecentChooserWidget*) p);
139 	}
140 }