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