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