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