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.Widget; 30 private import gtk.c.functions; 31 public import gtk.c.types; 32 33 34 /** 35 * A `GtkRevealer` animates the transition of its child from invisible to visible. 36 * 37 * The style of transition can be controlled with 38 * [method@Gtk.Revealer.set_transition_type]. 39 * 40 * These animations respect the [property@Gtk.Settings:gtk-enable-animations] 41 * setting. 42 * 43 * # CSS nodes 44 * 45 * `GtkRevealer` has a single CSS node with name revealer. 46 * When styling `GtkRevealer` using CSS, remember that it only hides its contents, 47 * not itself. That means applied margin, padding and borders will be visible even 48 * when the [property@Gtk.Revealer:reveal-child] property is set to %FALSE. 49 * 50 * # Accessibility 51 * 52 * `GtkRevealer` uses the %GTK_ACCESSIBLE_ROLE_GROUP role. 53 * 54 * The child of `GtkRevealer`, if set, is always available in the accessibility 55 * tree, regardless of the state of the revealer widget. 56 */ 57 public class Revealer : Widget 58 { 59 /** the main Gtk struct */ 60 protected GtkRevealer* gtkRevealer; 61 62 /** Get the main Gtk struct */ 63 public GtkRevealer* getRevealerStruct(bool transferOwnership = false) 64 { 65 if (transferOwnership) 66 ownedRef = false; 67 return gtkRevealer; 68 } 69 70 /** the main Gtk struct as a void* */ 71 protected override void* getStruct() 72 { 73 return cast(void*)gtkRevealer; 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(GtkWidget*)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 * Throws: ConstructionException GTK+ fails to create the object. 98 */ 99 public this() 100 { 101 auto __p = gtk_revealer_new(); 102 103 if(__p is null) 104 { 105 throw new ConstructionException("null returned by new"); 106 } 107 108 this(cast(GtkRevealer*) __p); 109 } 110 111 /** 112 * Gets the child widget of @revealer. 113 * 114 * Returns: the child widget of @revealer 115 */ 116 public Widget getChild() 117 { 118 auto __p = gtk_revealer_get_child(gtkRevealer); 119 120 if(__p is null) 121 { 122 return null; 123 } 124 125 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p); 126 } 127 128 /** 129 * Returns whether the child is fully revealed. 130 * 131 * In other words, this returns whether the transition 132 * to the revealed state is completed. 133 * 134 * Returns: %TRUE if the child is fully revealed 135 */ 136 public bool getChildRevealed() 137 { 138 return gtk_revealer_get_child_revealed(gtkRevealer) != 0; 139 } 140 141 /** 142 * Returns whether the child is currently revealed. 143 * 144 * This function returns %TRUE as soon as the transition 145 * is to the revealed state is started. To learn whether 146 * the child is fully revealed (ie the transition is completed), 147 * use [method@Gtk.Revealer.get_child_revealed]. 148 * 149 * Returns: %TRUE if the child is revealed. 150 */ 151 public bool getRevealChild() 152 { 153 return gtk_revealer_get_reveal_child(gtkRevealer) != 0; 154 } 155 156 /** 157 * Returns the amount of time (in milliseconds) that 158 * transitions will take. 159 * 160 * Returns: the transition duration 161 */ 162 public uint getTransitionDuration() 163 { 164 return gtk_revealer_get_transition_duration(gtkRevealer); 165 } 166 167 /** 168 * Gets the type of animation that will be used 169 * for transitions in @revealer. 170 * 171 * Returns: the current transition type of @revealer 172 */ 173 public GtkRevealerTransitionType getTransitionType() 174 { 175 return gtk_revealer_get_transition_type(gtkRevealer); 176 } 177 178 /** 179 * Sets the child widget of @revealer. 180 * 181 * Params: 182 * child = the child widget 183 */ 184 public void setChild(Widget child) 185 { 186 gtk_revealer_set_child(gtkRevealer, (child is null) ? null : child.getWidgetStruct()); 187 } 188 189 /** 190 * Tells the `GtkRevealer` to reveal or conceal its child. 191 * 192 * The transition will be animated with the current 193 * transition type of @revealer. 194 * 195 * Params: 196 * revealChild = %TRUE to reveal the child 197 */ 198 public void setRevealChild(bool revealChild) 199 { 200 gtk_revealer_set_reveal_child(gtkRevealer, revealChild); 201 } 202 203 /** 204 * Sets the duration that transitions will take. 205 * 206 * Params: 207 * duration = the new duration, in milliseconds 208 */ 209 public void setTransitionDuration(uint duration) 210 { 211 gtk_revealer_set_transition_duration(gtkRevealer, duration); 212 } 213 214 /** 215 * Sets the type of animation that will be used for 216 * transitions in @revealer. 217 * 218 * Available types include various kinds of fades and slides. 219 * 220 * Params: 221 * transition = the new transition type 222 */ 223 public void setTransitionType(GtkRevealerTransitionType transition) 224 { 225 gtk_revealer_set_transition_type(gtkRevealer, transition); 226 } 227 }