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