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.Revealer;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Bin;
30 private import gtk.Widget;
31 private import gtkc.gtk;
32 public  import gtkc.gtktypes;
33 
34 
35 /**
36  * The GtkRevealer widget is a container which animates
37  * the transition of its child from invisible to visible.
38  * 
39  * The style of transition can be controlled with
40  * gtk_revealer_set_transition_type().
41  * 
42  * These animations respect the #GtkSettings:gtk-enable-animations
43  * setting.
44  * 
45  * # CSS nodes
46  * 
47  * GtkRevealer has a single CSS node with name revealer.
48  * 
49  * The GtkRevealer widget was added in GTK+ 3.10.
50  */
51 public class Revealer : Bin
52 {
53 	/** the main Gtk struct */
54 	protected GtkRevealer* gtkRevealer;
55 
56 	/** Get the main Gtk struct */
57 	public GtkRevealer* getRevealerStruct(bool transferOwnership = false)
58 	{
59 		if (transferOwnership)
60 			ownedRef = false;
61 		return gtkRevealer;
62 	}
63 
64 	/** the main Gtk struct as a void* */
65 	protected override void* getStruct()
66 	{
67 		return cast(void*)gtkRevealer;
68 	}
69 
70 	protected override void setStruct(GObject* obj)
71 	{
72 		gtkRevealer = cast(GtkRevealer*)obj;
73 		super.setStruct(obj);
74 	}
75 
76 	/**
77 	 * Sets our main struct and passes it to the parent class.
78 	 */
79 	public this (GtkRevealer* gtkRevealer, bool ownedRef = false)
80 	{
81 		this.gtkRevealer = gtkRevealer;
82 		super(cast(GtkBin*)gtkRevealer, ownedRef);
83 	}
84 
85 
86 	/** */
87 	public static GType getType()
88 	{
89 		return gtk_revealer_get_type();
90 	}
91 
92 	/**
93 	 * Creates a new #GtkRevealer.
94 	 *
95 	 * Returns: a newly created #GtkRevealer
96 	 *
97 	 * Since: 3.10
98 	 *
99 	 * Throws: ConstructionException GTK+ fails to create the object.
100 	 */
101 	public this()
102 	{
103 		auto p = gtk_revealer_new();
104 		
105 		if(p is null)
106 		{
107 			throw new ConstructionException("null returned by new");
108 		}
109 		
110 		this(cast(GtkRevealer*) p);
111 	}
112 
113 	/**
114 	 * Returns whether the child is fully revealed, in other words whether
115 	 * the transition to the revealed state is completed.
116 	 *
117 	 * Returns: %TRUE if the child is fully revealed
118 	 *
119 	 * Since: 3.10
120 	 */
121 	public bool getChildRevealed()
122 	{
123 		return gtk_revealer_get_child_revealed(gtkRevealer) != 0;
124 	}
125 
126 	/**
127 	 * Returns whether the child is currently
128 	 * revealed. See gtk_revealer_set_reveal_child().
129 	 *
130 	 * This function returns %TRUE as soon as the transition
131 	 * is to the revealed state is started. To learn whether
132 	 * the child is fully revealed (ie the transition is completed),
133 	 * use gtk_revealer_get_child_revealed().
134 	 *
135 	 * Returns: %TRUE if the child is revealed.
136 	 *
137 	 * Since: 3.10
138 	 */
139 	public bool getRevealChild()
140 	{
141 		return gtk_revealer_get_reveal_child(gtkRevealer) != 0;
142 	}
143 
144 	/**
145 	 * Returns the amount of time (in milliseconds) that
146 	 * transitions will take.
147 	 *
148 	 * Returns: the transition duration
149 	 *
150 	 * Since: 3.10
151 	 */
152 	public uint getTransitionDuration()
153 	{
154 		return gtk_revealer_get_transition_duration(gtkRevealer);
155 	}
156 
157 	/**
158 	 * Gets the type of animation that will be used
159 	 * for transitions in @revealer.
160 	 *
161 	 * Returns: the current transition type of @revealer
162 	 *
163 	 * Since: 3.10
164 	 */
165 	public GtkRevealerTransitionType getTransitionType()
166 	{
167 		return gtk_revealer_get_transition_type(gtkRevealer);
168 	}
169 
170 	/**
171 	 * Tells the #GtkRevealer to reveal or conceal its child.
172 	 *
173 	 * The transition will be animated with the current
174 	 * transition type of @revealer.
175 	 *
176 	 * Params:
177 	 *     revealChild = %TRUE to reveal the child
178 	 *
179 	 * Since: 3.10
180 	 */
181 	public void setRevealChild(bool revealChild)
182 	{
183 		gtk_revealer_set_reveal_child(gtkRevealer, revealChild);
184 	}
185 
186 	/**
187 	 * Sets the duration that transitions will take.
188 	 *
189 	 * Params:
190 	 *     duration = the new duration, in milliseconds
191 	 *
192 	 * Since: 3.10
193 	 */
194 	public void setTransitionDuration(uint duration)
195 	{
196 		gtk_revealer_set_transition_duration(gtkRevealer, duration);
197 	}
198 
199 	/**
200 	 * Sets the type of animation that will be used for
201 	 * transitions in @revealer. Available types include
202 	 * various kinds of fades and slides.
203 	 *
204 	 * Params:
205 	 *     transition = the new transition type
206 	 *
207 	 * Since: 3.10
208 	 */
209 	public void setTransitionType(GtkRevealerTransitionType transition)
210 	{
211 		gtk_revealer_set_transition_type(gtkRevealer, transition);
212 	}
213 }