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 gtk.CenterLayout;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.LayoutManager;
30 private import gtk.Widget;
31 private import gtk.c.functions;
32 public  import gtk.c.types;
33 
34 
35 /**
36  * `GtkCenterLayout` is a layout manager that manages up to three children.
37  * 
38  * The start widget is allocated at the start of the layout (left in
39  * left-to-right locales and right in right-to-left ones), and the end
40  * widget at the end.
41  * 
42  * The center widget is centered regarding the full width of the layout's.
43  */
44 public class CenterLayout : LayoutManager
45 {
46 	/** the main Gtk struct */
47 	protected GtkCenterLayout* gtkCenterLayout;
48 
49 	/** Get the main Gtk struct */
50 	public GtkCenterLayout* getCenterLayoutStruct(bool transferOwnership = false)
51 	{
52 		if (transferOwnership)
53 			ownedRef = false;
54 		return gtkCenterLayout;
55 	}
56 
57 	/** the main Gtk struct as a void* */
58 	protected override void* getStruct()
59 	{
60 		return cast(void*)gtkCenterLayout;
61 	}
62 
63 	/**
64 	 * Sets our main struct and passes it to the parent class.
65 	 */
66 	public this (GtkCenterLayout* gtkCenterLayout, bool ownedRef = false)
67 	{
68 		this.gtkCenterLayout = gtkCenterLayout;
69 		super(cast(GtkLayoutManager*)gtkCenterLayout, ownedRef);
70 	}
71 
72 
73 	/** */
74 	public static GType getType()
75 	{
76 		return gtk_center_layout_get_type();
77 	}
78 
79 	/**
80 	 * Creates a new `GtkCenterLayout`.
81 	 *
82 	 * Returns: the newly created `GtkCenterLayout`
83 	 *
84 	 * Throws: ConstructionException GTK+ fails to create the object.
85 	 */
86 	public this()
87 	{
88 		auto __p = gtk_center_layout_new();
89 
90 		if(__p is null)
91 		{
92 			throw new ConstructionException("null returned by new");
93 		}
94 
95 		this(cast(GtkCenterLayout*) __p, true);
96 	}
97 
98 	/**
99 	 * Returns the baseline position of the layout.
100 	 *
101 	 * Returns: The current baseline position of @self.
102 	 */
103 	public GtkBaselinePosition getBaselinePosition()
104 	{
105 		return gtk_center_layout_get_baseline_position(gtkCenterLayout);
106 	}
107 
108 	/**
109 	 * Returns the center widget of the layout.
110 	 *
111 	 * Returns: the current center widget of @self
112 	 */
113 	public Widget getCenterWidget()
114 	{
115 		auto __p = gtk_center_layout_get_center_widget(gtkCenterLayout);
116 
117 		if(__p is null)
118 		{
119 			return null;
120 		}
121 
122 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p);
123 	}
124 
125 	/**
126 	 * Returns the end widget of the layout.
127 	 *
128 	 * Returns: the current end widget of @self
129 	 */
130 	public Widget getEndWidget()
131 	{
132 		auto __p = gtk_center_layout_get_end_widget(gtkCenterLayout);
133 
134 		if(__p is null)
135 		{
136 			return null;
137 		}
138 
139 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p);
140 	}
141 
142 	/**
143 	 * Gets the current orienration of the layout manager.
144 	 *
145 	 * Returns: The current orientation of @self
146 	 */
147 	public GtkOrientation getOrientation()
148 	{
149 		return gtk_center_layout_get_orientation(gtkCenterLayout);
150 	}
151 
152 	/**
153 	 * Returns the start widget fo the layout.
154 	 *
155 	 * Returns: The current start widget of @self
156 	 */
157 	public Widget getStartWidget()
158 	{
159 		auto __p = gtk_center_layout_get_start_widget(gtkCenterLayout);
160 
161 		if(__p is null)
162 		{
163 			return null;
164 		}
165 
166 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p);
167 	}
168 
169 	/**
170 	 * Sets the new baseline position of @self
171 	 *
172 	 * Params:
173 	 *     baselinePosition = the new baseline position
174 	 */
175 	public void setBaselinePosition(GtkBaselinePosition baselinePosition)
176 	{
177 		gtk_center_layout_set_baseline_position(gtkCenterLayout, baselinePosition);
178 	}
179 
180 	/**
181 	 * Sets the new center widget of @self.
182 	 *
183 	 * To remove the existing center widget, pass %NULL.
184 	 *
185 	 * Params:
186 	 *     widget = the new center widget
187 	 */
188 	public void setCenterWidget(Widget widget)
189 	{
190 		gtk_center_layout_set_center_widget(gtkCenterLayout, (widget is null) ? null : widget.getWidgetStruct());
191 	}
192 
193 	/**
194 	 * Sets the new end widget of @self.
195 	 *
196 	 * To remove the existing center widget, pass %NULL.
197 	 *
198 	 * Params:
199 	 *     widget = the new end widget
200 	 */
201 	public void setEndWidget(Widget widget)
202 	{
203 		gtk_center_layout_set_end_widget(gtkCenterLayout, (widget is null) ? null : widget.getWidgetStruct());
204 	}
205 
206 	/**
207 	 * Sets the orientation of @self.
208 	 *
209 	 * Params:
210 	 *     orientation = the new orientation
211 	 */
212 	public void setOrientation(GtkOrientation orientation)
213 	{
214 		gtk_center_layout_set_orientation(gtkCenterLayout, orientation);
215 	}
216 
217 	/**
218 	 * Sets the new start widget of @self.
219 	 *
220 	 * To remove the existing start widget, pass %NULL.
221 	 *
222 	 * Params:
223 	 *     widget = the new start widget
224 	 */
225 	public void setStartWidget(Widget widget)
226 	{
227 		gtk_center_layout_set_start_widget(gtkCenterLayout, (widget is null) ? null : widget.getWidgetStruct());
228 	}
229 }