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