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