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