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  = GtkProgress.html
27  * outPack = gtk
28  * outFile = Progress
29  * strct   = GtkProgress
30  * realStrct=
31  * ctorStrct=
32  * clss    = Progress
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_progress_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gtk.Adjustment
49  * structWrap:
50  * 	- GtkAdjustment* -> Adjustment
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module gtk.Progress;
57 
58 public  import gtkc.gtktypes;
59 
60 private import gtkc.gtk;
61 private import glib.ConstructionException;
62 private import gobject.ObjectG;
63 
64 
65 private import glib.Str;
66 private import gtk.Adjustment;
67 
68 
69 
70 private import gtk.Widget;
71 
72 /**
73  * Description
74  * A GtkProgress is the abstract base class used to derive
75  * a GtkProgressBar which provides a visual representation of
76  * the progress of a long running operation.
77  */
78 public class Progress : Widget
79 {
80 	
81 	/** the main Gtk struct */
82 	protected GtkProgress* gtkProgress;
83 	
84 	
85 	public GtkProgress* getProgressStruct()
86 	{
87 		return gtkProgress;
88 	}
89 	
90 	
91 	/** the main Gtk struct as a void* */
92 	protected override void* getStruct()
93 	{
94 		return cast(void*)gtkProgress;
95 	}
96 	
97 	/**
98 	 * Sets our main struct and passes it to the parent class
99 	 */
100 	public this (GtkProgress* gtkProgress)
101 	{
102 		super(cast(GtkWidget*)gtkProgress);
103 		this.gtkProgress = gtkProgress;
104 	}
105 	
106 	protected override void setStruct(GObject* obj)
107 	{
108 		super.setStruct(obj);
109 		gtkProgress = cast(GtkProgress*)obj;
110 	}
111 	
112 	/**
113 	 */
114 	
115 	/**
116 	 * Warning
117 	 * gtk_progress_set_show_text is deprecated and should not be used in newly-written code.
118 	 * Controls whether progress text is shown.
119 	 * Params:
120 	 * showText = a boolean indicating whether the progress text
121 	 * is shown.
122 	 */
123 	public void setShowText(int showText)
124 	{
125 		// void gtk_progress_set_show_text (GtkProgress *progress,  gboolean show_text);
126 		gtk_progress_set_show_text(gtkProgress, showText);
127 	}
128 	
129 	/**
130 	 * Warning
131 	 * gtk_progress_set_text_alignment is deprecated and should not be used in newly-written code.
132 	 * Controls the alignment of the text within the progress bar area.
133 	 * Params:
134 	 * xAlign = a number between 0.0 and 1.0 indicating the horizontal
135 	 * alignment of the progress text within the GtkProgress.
136 	 * yAlign = a number between 0.0 and 1.0 indicating the vertical
137 	 * alignment of the progress text within the GtkProgress.
138 	 */
139 	public void setTextAlignment(float xAlign, float yAlign)
140 	{
141 		// void gtk_progress_set_text_alignment (GtkProgress *progress,  gfloat x_align,  gfloat y_align);
142 		gtk_progress_set_text_alignment(gtkProgress, xAlign, yAlign);
143 	}
144 	
145 	/**
146 	 * Warning
147 	 * gtk_progress_set_format_string is deprecated and should not be used in newly-written code.
148 	 * Sets a format string used to display text indicating the
149 	 * Params:
150 	 * format = a string used to display progress text, or NULL
151 	 * to restore to the default format.
152 	 */
153 	public void setFormatString(string format)
154 	{
155 		// void gtk_progress_set_format_string (GtkProgress *progress,  const gchar *format);
156 		gtk_progress_set_format_string(gtkProgress, Str.toStringz(format));
157 	}
158 	
159 	/**
160 	 * Warning
161 	 * gtk_progress_set_adjustment is deprecated and should not be used in newly-written code.
162 	 * Associates a GtkAdjustment with the GtkProgress. A GtkAdjustment
163 	 * is used to represent the upper and lower bounds and the step interval
164 	 * of the underlying value for which progress is shown.
165 	 * Params:
166 	 * adjustment = the GtkAdjustment to be associated with the GtkProgress.
167 	 */
168 	public void setAdjustment(Adjustment adjustment)
169 	{
170 		// void gtk_progress_set_adjustment (GtkProgress *progress,  GtkAdjustment *adjustment);
171 		gtk_progress_set_adjustment(gtkProgress, (adjustment is null) ? null : adjustment.getAdjustmentStruct());
172 	}
173 	
174 	/**
175 	 * Warning
176 	 * gtk_progress_set_percentage is deprecated and should not be used in newly-written code.
177 	 * Sets the current percentage completion for the GtkProgress.
178 	 * Params:
179 	 * percentage = the percentage complete which must be between 0.0
180 	 * and 1.0.
181 	 */
182 	public void setPercentage(double percentage)
183 	{
184 		// void gtk_progress_set_percentage (GtkProgress *progress,  gdouble percentage);
185 		gtk_progress_set_percentage(gtkProgress, percentage);
186 	}
187 	
188 	/**
189 	 * Warning
190 	 * gtk_progress_set_value is deprecated and should not be used in newly-written code.
191 	 * Sets the value within the GtkProgress to an absolute value.
192 	 * The value must be within the valid range of values for the
193 	 * underlying GtkAdjustment.
194 	 * Params:
195 	 * value = the value indicating the current completed amount.
196 	 */
197 	public void setValue(double value)
198 	{
199 		// void gtk_progress_set_value (GtkProgress *progress,  gdouble value);
200 		gtk_progress_set_value(gtkProgress, value);
201 	}
202 	
203 	/**
204 	 * Warning
205 	 * gtk_progress_get_value is deprecated and should not be used in newly-written code.
206 	 * Returns the current progress complete value.
207 	 * Returns: the current progress complete value.
208 	 */
209 	public double getValue()
210 	{
211 		// gdouble gtk_progress_get_value (GtkProgress *progress);
212 		return gtk_progress_get_value(gtkProgress);
213 	}
214 	
215 	/**
216 	 * Warning
217 	 * gtk_progress_set_activity_mode is deprecated and should not be used in newly-written code.
218 	 * A GtkProgress can be in one of two different modes: percentage
219 	 * mode (the default) and activity mode. In activity mode, the
220 	 * progress is simply indicated as activity rather than as a percentage
221 	 * complete.
222 	 * Params:
223 	 * activityMode = a boolean, TRUE for activity mode.
224 	 */
225 	public void setActivityMode(int activityMode)
226 	{
227 		// void gtk_progress_set_activity_mode (GtkProgress *progress,  gboolean activity_mode);
228 		gtk_progress_set_activity_mode(gtkProgress, activityMode);
229 	}
230 	
231 	/**
232 	 * Warning
233 	 * gtk_progress_get_current_text is deprecated and should not be used in newly-written code.
234 	 * Returns the current text associated with the GtkProgress. This
235 	 * text is the based on the underlying format string after any substitutions
236 	 * are made.
237 	 * Returns: the text indicating the current progress.
238 	 */
239 	public string getCurrentText()
240 	{
241 		// gchar * gtk_progress_get_current_text (GtkProgress *progress);
242 		return Str.toString(gtk_progress_get_current_text(gtkProgress));
243 	}
244 	
245 	/**
246 	 * Warning
247 	 * gtk_progress_get_text_from_value is deprecated and should not be used in newly-written code.
248 	 * Returns the text indicating the progress based on the supplied value.
249 	 * The current value for the GtkProgress remains unchanged.
250 	 * Params:
251 	 * value = an absolute progress value to use when formatting the progress text.
252 	 * Returns: a string indicating the progress.
253 	 */
254 	public string getTextFromValue(double value)
255 	{
256 		// gchar * gtk_progress_get_text_from_value (GtkProgress *progress,  gdouble value);
257 		return Str.toString(gtk_progress_get_text_from_value(gtkProgress, value));
258 	}
259 	
260 	/**
261 	 * Warning
262 	 * gtk_progress_get_current_percentage is deprecated and should not be used in newly-written code.
263 	 * Returns the current progress as a percentage.
264 	 * Returns: a number between 0.0 and 1.0 indicating the percentage complete.
265 	 */
266 	public double getCurrentPercentage()
267 	{
268 		// gdouble gtk_progress_get_current_percentage (GtkProgress *progress);
269 		return gtk_progress_get_current_percentage(gtkProgress);
270 	}
271 	
272 	/**
273 	 * Warning
274 	 * gtk_progress_get_percentage_from_value is deprecated and should not be used in newly-written code.
275 	 * Returns the progress as a percentage calculated from the supplied
276 	 * absolute progress value.
277 	 * Params:
278 	 * value = an absolute progress value.
279 	 * Returns: a number between 0.0 and 1.0 indicating the percentage complete represented by value.
280 	 */
281 	public double getPercentageFromValue(double value)
282 	{
283 		// gdouble gtk_progress_get_percentage_from_value  (GtkProgress *progress,  gdouble value);
284 		return gtk_progress_get_percentage_from_value(gtkProgress, value);
285 	}
286 	
287 	/**
288 	 * Warning
289 	 * gtk_progress_configure is deprecated and should not be used in newly-written code.
290 	 * Allows the configuration of the minimum, maximum, and current values for
291 	 * the GtkProgress.
292 	 * Params:
293 	 * value = the current progress value.
294 	 * min = the minimum progress value.
295 	 * max = the maximum progress value.
296 	 */
297 	public void configure(double value, double min, double max)
298 	{
299 		// void gtk_progress_configure (GtkProgress *progress,  gdouble value,  gdouble min,  gdouble max);
300 		gtk_progress_configure(gtkProgress, value, min, max);
301 	}
302 }