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 	public static GType getType()
87 	{
88 		return gtk_recent_chooser_widget_get_type();
89 	}
90 
91 	/**
92 	 * Creates a new #GtkRecentChooserWidget object.  This is an embeddable widget
93 	 * used to access the recently used resources list.
94 	 *
95 	 * Return: a new #GtkRecentChooserWidget
96 	 *
97 	 * Since: 2.10
98 	 *
99 	 * Throws: ConstructionException GTK+ fails to create the object.
100 	 */
101 	public this()
102 	{
103 		auto p = gtk_recent_chooser_widget_new();
104 		
105 		if(p is null)
106 		{
107 			throw new ConstructionException("null returned by new");
108 		}
109 		
110 		this(cast(GtkRecentChooserWidget*) p);
111 	}
112 
113 	/**
114 	 * Creates a new #GtkRecentChooserWidget with a specified recent manager.
115 	 *
116 	 * This is useful if you have implemented your own recent manager, or if you
117 	 * have a customized instance of a #GtkRecentManager object.
118 	 *
119 	 * Params:
120 	 *     manager = a #GtkRecentManager
121 	 *
122 	 * Return: a new #GtkRecentChooserWidget
123 	 *
124 	 * Since: 2.10
125 	 *
126 	 * Throws: ConstructionException GTK+ fails to create the object.
127 	 */
128 	public this(RecentManager manager)
129 	{
130 		auto p = gtk_recent_chooser_widget_new_for_manager((manager is null) ? null : manager.getRecentManagerStruct());
131 		
132 		if(p is null)
133 		{
134 			throw new ConstructionException("null returned by new_for_manager");
135 		}
136 		
137 		this(cast(GtkRecentChooserWidget*) p);
138 	}
139 }