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 atk.Range; 26 27 private import glib.ConstructionException; 28 private import glib.Str; 29 private import gobject.ObjectG; 30 private import gtkc.atk; 31 public import gtkc.atktypes; 32 33 34 /** 35 * #AtkRange are used on #AtkValue, in order to represent the full 36 * range of a given component (for example an slider or a range 37 * control), or to define each individual subrange this full range is 38 * splitted if available. See #AtkValue documentation for further 39 * details. 40 */ 41 public class Range 42 { 43 /** the main Gtk struct */ 44 protected AtkRange* atkRange; 45 protected bool ownedRef; 46 47 /** Get the main Gtk struct */ 48 public AtkRange* getRangeStruct() 49 { 50 return atkRange; 51 } 52 53 /** the main Gtk struct as a void* */ 54 protected void* getStruct() 55 { 56 return cast(void*)atkRange; 57 } 58 59 /** 60 * Sets our main struct and passes it to the parent class. 61 */ 62 public this (AtkRange* atkRange, bool ownedRef = false) 63 { 64 this.atkRange = atkRange; 65 this.ownedRef = ownedRef; 66 } 67 68 69 /** */ 70 public static GType getType() 71 { 72 return atk_range_get_type(); 73 } 74 75 /** 76 * Creates a new #AtkRange. 77 * 78 * Params: 79 * lowerLimit = inferior limit for this range 80 * upperLimit = superior limit for this range 81 * description = human readable description of this range. 82 * 83 * Return: a new #AtkRange 84 * 85 * Since: 2.12 86 * 87 * Throws: ConstructionException GTK+ fails to create the object. 88 */ 89 public this(double lowerLimit, double upperLimit, string description) 90 { 91 auto p = atk_range_new(lowerLimit, upperLimit, Str.toStringz(description)); 92 93 if(p is null) 94 { 95 throw new ConstructionException("null returned by new"); 96 } 97 98 this(cast(AtkRange*) p); 99 } 100 101 /** 102 * Returns a new #AtkRange that is a exact copy of @src 103 * 104 * Return: a new #AtkRange copy of @src 105 * 106 * Since: 2.12 107 */ 108 public Range copy() 109 { 110 auto p = atk_range_copy(atkRange); 111 112 if(p is null) 113 { 114 return null; 115 } 116 117 return ObjectG.getDObject!(Range)(cast(AtkRange*) p, true); 118 } 119 120 /** 121 * Free @range 122 * 123 * Since: 2.12 124 */ 125 public void free() 126 { 127 atk_range_free(atkRange); 128 } 129 130 /** 131 * Returns the human readable description of @range 132 * 133 * Return: the human-readable description of @range 134 * 135 * Since: 2.12 136 */ 137 public string getDescription() 138 { 139 return Str.toString(atk_range_get_description(atkRange)); 140 } 141 142 /** 143 * Returns the lower limit of @range 144 * 145 * Return: the lower limit of @range 146 * 147 * Since: 2.12 148 */ 149 public double getLowerLimit() 150 { 151 return atk_range_get_lower_limit(atkRange); 152 } 153 154 /** 155 * Returns the upper limit of @range 156 * 157 * Return: the upper limit of @range 158 * 159 * Since: 2.12 160 */ 161 public double getUpperLimit() 162 { 163 return atk_range_get_upper_limit(atkRange); 164 } 165 }