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.CellAreaBox;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.CellArea;
30 private import gtk.CellRenderer;
31 private import gtk.OrientableIF;
32 private import gtk.OrientableT;
33 private import gtkc.gtk;
34 public  import gtkc.gtktypes;
35 
36 
37 /**
38  * The #GtkCellAreaBox renders cell renderers into a row or a column
39  * depending on its #GtkOrientation.
40  * 
41  * GtkCellAreaBox uses a notion of packing. Packing
42  * refers to adding cell renderers with reference to a particular position
43  * in a #GtkCellAreaBox. There are two reference positions: the
44  * start and the end of the box.
45  * When the #GtkCellAreaBox is oriented in the %GTK_ORIENTATION_VERTICAL
46  * orientation, the start is defined as the top of the box and the end is
47  * defined as the bottom. In the %GTK_ORIENTATION_HORIZONTAL orientation
48  * start is defined as the left side and the end is defined as the right
49  * side.
50  * 
51  * Alignments of #GtkCellRenderers rendered in adjacent rows can be
52  * configured by configuring the #GtkCellAreaBox align child cell property
53  * with gtk_cell_area_cell_set_property() or by specifying the "align"
54  * argument to gtk_cell_area_box_pack_start() and gtk_cell_area_box_pack_end().
55  */
56 public class CellAreaBox : CellArea, OrientableIF
57 {
58 	/** the main Gtk struct */
59 	protected GtkCellAreaBox* gtkCellAreaBox;
60 
61 	/** Get the main Gtk struct */
62 	public GtkCellAreaBox* getCellAreaBoxStruct(bool transferOwnership = false)
63 	{
64 		if (transferOwnership)
65 			ownedRef = false;
66 		return gtkCellAreaBox;
67 	}
68 
69 	/** the main Gtk struct as a void* */
70 	protected override void* getStruct()
71 	{
72 		return cast(void*)gtkCellAreaBox;
73 	}
74 
75 	protected override void setStruct(GObject* obj)
76 	{
77 		gtkCellAreaBox = cast(GtkCellAreaBox*)obj;
78 		super.setStruct(obj);
79 	}
80 
81 	/**
82 	 * Sets our main struct and passes it to the parent class.
83 	 */
84 	public this (GtkCellAreaBox* gtkCellAreaBox, bool ownedRef = false)
85 	{
86 		this.gtkCellAreaBox = gtkCellAreaBox;
87 		super(cast(GtkCellArea*)gtkCellAreaBox, ownedRef);
88 	}
89 
90 	// add the Orientable capabilities
91 	mixin OrientableT!(GtkCellAreaBox);
92 
93 
94 	/** */
95 	public static GType getType()
96 	{
97 		return gtk_cell_area_box_get_type();
98 	}
99 
100 	/**
101 	 * Creates a new #GtkCellAreaBox.
102 	 *
103 	 * Returns: a newly created #GtkCellAreaBox
104 	 *
105 	 * Since: 3.0
106 	 *
107 	 * Throws: ConstructionException GTK+ fails to create the object.
108 	 */
109 	public this()
110 	{
111 		auto p = gtk_cell_area_box_new();
112 		
113 		if(p is null)
114 		{
115 			throw new ConstructionException("null returned by new");
116 		}
117 		
118 		this(cast(GtkCellAreaBox*) p);
119 	}
120 
121 	/**
122 	 * Gets the spacing added between cell renderers.
123 	 *
124 	 * Returns: the space added between cell renderers in @box.
125 	 *
126 	 * Since: 3.0
127 	 */
128 	public int getSpacing()
129 	{
130 		return gtk_cell_area_box_get_spacing(gtkCellAreaBox);
131 	}
132 
133 	/**
134 	 * Adds @renderer to @box, packed with reference to the end of @box.
135 	 *
136 	 * The @renderer is packed after (away from end of) any other
137 	 * #GtkCellRenderer packed with reference to the end of @box.
138 	 *
139 	 * Params:
140 	 *     renderer = the #GtkCellRenderer to add
141 	 *     expand = whether @renderer should receive extra space when the area receives
142 	 *         more than its natural size
143 	 *     alig = whether @renderer should be aligned in adjacent rows
144 	 *     fixed = whether @renderer should have the same size in all rows
145 	 *
146 	 * Since: 3.0
147 	 */
148 	public void packEnd(CellRenderer renderer, bool expand, bool alig, bool fixed)
149 	{
150 		gtk_cell_area_box_pack_end(gtkCellAreaBox, (renderer is null) ? null : renderer.getCellRendererStruct(), expand, alig, fixed);
151 	}
152 
153 	/**
154 	 * Adds @renderer to @box, packed with reference to the start of @box.
155 	 *
156 	 * The @renderer is packed after any other #GtkCellRenderer packed
157 	 * with reference to the start of @box.
158 	 *
159 	 * Params:
160 	 *     renderer = the #GtkCellRenderer to add
161 	 *     expand = whether @renderer should receive extra space when the area receives
162 	 *         more than its natural size
163 	 *     alig = whether @renderer should be aligned in adjacent rows
164 	 *     fixed = whether @renderer should have the same size in all rows
165 	 *
166 	 * Since: 3.0
167 	 */
168 	public void packStart(CellRenderer renderer, bool expand, bool alig, bool fixed)
169 	{
170 		gtk_cell_area_box_pack_start(gtkCellAreaBox, (renderer is null) ? null : renderer.getCellRendererStruct(), expand, alig, fixed);
171 	}
172 
173 	/**
174 	 * Sets the spacing to add between cell renderers in @box.
175 	 *
176 	 * Params:
177 	 *     spacing = the space to add between #GtkCellRenderers
178 	 *
179 	 * Since: 3.0
180 	 */
181 	public void setSpacing(int spacing)
182 	{
183 		gtk_cell_area_box_set_spacing(gtkCellAreaBox, spacing);
184 	}
185 }