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  = GtkCellLayout.html
27  * outPack = gtk
28  * outFile = CellLayoutIF
29  * strct   = GtkCellLayout
30  * realStrct=
31  * ctorStrct=
32  * clss    = CellLayoutT
33  * interf  = CellLayoutIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_cell_layout_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gtk.CellRenderer
49  * 	- glib.ListG
50  * structWrap:
51  * 	- GList* -> ListG
52  * 	- GtkCellRenderer* -> CellRenderer
53  * module aliases:
54  * local aliases:
55  * overrides:
56  */
57 
58 module gtk.CellLayoutIF;
59 
60 public  import gtkc.gtktypes;
61 
62 private import gtkc.gtk;
63 private import glib.ConstructionException;
64 private import gobject.ObjectG;
65 
66 
67 private import glib.Str;
68 private import gtk.CellRenderer;
69 private import glib.ListG;
70 
71 
72 
73 
74 /**
75  * Description
76  * GtkCellLayout is an interface to be implemented by all objects which
77  * want to provide a GtkTreeViewColumn-like API for packing cells, setting
78  * attributes and data funcs.
79  * One of the notable features provided by implementations of GtkCellLayout
80  * are attributes. Attributes let you set the properties
81  * in flexible ways. They can just be set to constant values like regular
82  * properties. But they can also be mapped to a column of the underlying
83  * tree model with gtk_cell_layout_set_attributes(), which means that the value
84  * of the attribute can change from cell to cell as they are rendered by the
85  * cell renderer. Finally, it is possible to specify a function with
86  * gtk_cell_layout_set_cell_data_func() that is called to determine the value
87  * of the attribute for each cell that is rendered.
88  * GtkCellLayouts as GtkBuildable
89  * Implementations of GtkCellLayout which also implement the GtkBuildable
90  * interface (GtkCellView, GtkIconView, GtkComboBox, GtkComboBoxEntry,
91  * GtkEntryCompletion, GtkTreeViewColumn) accept GtkCellRenderer objects
92  * as <child> elements in UI definitions. They support a custom
93  * <attributes> element for their children, which can contain
94  * multiple <attribute> elements. Each <attribute> element has
95  * a name attribute which specifies a property of the cell renderer; the
96  * content of the element is the attribute value.
97  * $(DDOC_COMMENT example)
98  */
99 public interface CellLayoutIF
100 {
101 	
102 	
103 	public GtkCellLayout* getCellLayoutTStruct();
104 	
105 	/** the main Gtk struct as a void* */
106 	protected void* getStruct();
107 	
108 	
109 	/**
110 	 */
111 	
112 	/**
113 	 * Packs the cell into the beginning of cell_layout. If expand is FALSE,
114 	 * then the cell is allocated no more space than it needs. Any unused space
115 	 * is divided evenly between cells for which expand is TRUE.
116 	 * Note that reusing the same cell renderer is not supported.
117 	 * Since 2.4
118 	 * Params:
119 	 * cell = A GtkCellRenderer.
120 	 * expand = TRUE if cell is to be given extra space allocated to cell_layout.
121 	 */
122 	public void packStart(CellRenderer cell, int expand);
123 	
124 	/**
125 	 * Adds the cell to the end of cell_layout. If expand is FALSE, then the
126 	 * cell is allocated no more space than it needs. Any unused space is
127 	 * divided evenly between cells for which expand is TRUE.
128 	 * Note that reusing the same cell renderer is not supported.
129 	 * Since 2.4
130 	 * Params:
131 	 * cell = A GtkCellRenderer.
132 	 * expand = TRUE if cell is to be given extra space allocated to cell_layout.
133 	 */
134 	public void packEnd(CellRenderer cell, int expand);
135 	
136 	/**
137 	 * Returns the cell renderers which have been added to cell_layout.
138 	 * Since 2.12
139 	 * Returns: a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed. [element-type GtkCellRenderer][transfer container]
140 	 */
141 	public ListG getCells();
142 	
143 	/**
144 	 * Re-inserts cell at position. Note that cell has already to be packed
145 	 * into cell_layout for this to function properly.
146 	 * Since 2.4
147 	 * Params:
148 	 * cell = A GtkCellRenderer to reorder.
149 	 * position = New position to insert cell at.
150 	 */
151 	public void reorder(CellRenderer cell, int position);
152 	
153 	/**
154 	 * Unsets all the mappings on all renderers on cell_layout and
155 	 * removes all renderers from cell_layout.
156 	 * Since 2.4
157 	 */
158 	public void clear();
159 	
160 	/**
161 	 * Adds an attribute mapping to the list in cell_layout. The column is the
162 	 * column of the model to get a value from, and the attribute is the
163 	 * parameter on cell to be set from the value. So for example if column 2
164 	 * of the model contains strings, you could have the "text" attribute of a
165 	 * GtkCellRendererText get its values from column 2.
166 	 * Since 2.4
167 	 * Params:
168 	 * cell = A GtkCellRenderer.
169 	 * attribute = An attribute on the renderer.
170 	 * column = The column position on the model to get the attribute from.
171 	 */
172 	public void addAttribute(CellRenderer cell, string attribute, int column);
173 	
174 	/**
175 	 * Sets the GtkCellLayoutDataFunc to use for cell_layout. This function
176 	 * is used instead of the standard attributes mapping for setting the
177 	 * column value, and should set the value of cell_layout's cell renderer(s)
178 	 * as appropriate. func may be NULL to remove and older one.
179 	 * Since 2.4
180 	 * Params:
181 	 * cell = A GtkCellRenderer.
182 	 * func = The GtkCellLayoutDataFunc to use.
183 	 * funcData = The user data for func.
184 	 * destroy = The destroy notification for func_data.
185 	 */
186 	public void setCellDataFunc(CellRenderer cell, GtkCellLayoutDataFunc func, void* funcData, GDestroyNotify destroy);
187 	
188 	/**
189 	 * Clears all existing attributes previously set with
190 	 * gtk_cell_layout_set_attributes().
191 	 * Since 2.4
192 	 * Params:
193 	 * cell = A GtkCellRenderer to clear the attribute mapping on.
194 	 */
195 	public void clearAttributes(CellRenderer cell);
196 }