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.BuildableIF;
26 
27 private import glib.Str;
28 private import gobject.ObjectG;
29 private import gobject.Value;
30 private import gtk.Builder;
31 private import gtk.c.functions;
32 public  import gtk.c.types;
33 public  import gtkc.gtktypes;
34 
35 
36 /**
37  * GtkBuildable allows objects to extend and customize their deserialization
38  * from [GtkBuilder UI descriptions][BUILDER-UI].
39  * The interface includes methods for setting names and properties of objects,
40  * parsing custom tags and constructing child objects.
41  * 
42  * The GtkBuildable interface is implemented by all widgets and
43  * many of the non-widget objects that are provided by GTK+. The
44  * main user of this interface is #GtkBuilder. There should be
45  * very little need for applications to call any of these functions directly.
46  * 
47  * An object only needs to implement this interface if it needs to extend the
48  * #GtkBuilder format or run any extra routines at deserialization time.
49  */
50 public interface BuildableIF{
51 	/** Get the main Gtk struct */
52 	public GtkBuildable* getBuildableStruct(bool transferOwnership = false);
53 
54 	/** the main Gtk struct as a void* */
55 	protected void* getStruct();
56 
57 
58 	/** */
59 	public static GType getType()
60 	{
61 		return gtk_buildable_get_type();
62 	}
63 
64 	/**
65 	 * Adds a child to @buildable. @type is an optional string
66 	 * describing how the child should be added.
67 	 *
68 	 * Params:
69 	 *     builder = a #GtkBuilder
70 	 *     child = child to add
71 	 *     type = kind of child or %NULL
72 	 *
73 	 * Since: 2.12
74 	 */
75 	public void addChild(Builder builder, ObjectG child, string type);
76 
77 	/**
78 	 * Constructs a child of @buildable with the name @name.
79 	 *
80 	 * #GtkBuilder calls this function if a “constructor” has been
81 	 * specified in the UI definition.
82 	 *
83 	 * Params:
84 	 *     builder = #GtkBuilder used to construct this object
85 	 *     name = name of child to construct
86 	 *
87 	 * Returns: the constructed child
88 	 *
89 	 * Since: 2.12
90 	 */
91 	public ObjectG constructChild(Builder builder, string name);
92 
93 	/**
94 	 * This is similar to gtk_buildable_parser_finished() but is
95 	 * called once for each custom tag handled by the @buildable.
96 	 *
97 	 * Params:
98 	 *     builder = a #GtkBuilder
99 	 *     child = child object or %NULL for non-child tags
100 	 *     tagname = the name of the tag
101 	 *     data = user data created in custom_tag_start
102 	 *
103 	 * Since: 2.12
104 	 */
105 	public void customFinished(Builder builder, ObjectG child, string tagname, void* data);
106 
107 	/**
108 	 * This is called at the end of each custom element handled by
109 	 * the buildable.
110 	 *
111 	 * Params:
112 	 *     builder = #GtkBuilder used to construct this object
113 	 *     child = child object or %NULL for non-child tags
114 	 *     tagname = name of tag
115 	 *     data = user data that will be passed in to parser functions
116 	 *
117 	 * Since: 2.12
118 	 */
119 	public void customTagEnd(Builder builder, ObjectG child, string tagname, void** data);
120 
121 	/**
122 	 * This is called for each unknown element under <child>.
123 	 *
124 	 * Params:
125 	 *     builder = a #GtkBuilder used to construct this object
126 	 *     child = child object or %NULL for non-child tags
127 	 *     tagname = name of tag
128 	 *     parser = a #GMarkupParser to fill in
129 	 *     data = return location for user data that will be passed in
130 	 *         to parser functions
131 	 *
132 	 * Returns: %TRUE if a object has a custom implementation, %FALSE
133 	 *     if it doesn't.
134 	 *
135 	 * Since: 2.12
136 	 */
137 	public bool customTagStart(Builder builder, ObjectG child, string tagname, out GMarkupParser parser, out void* data);
138 
139 	/**
140 	 * Get the internal child called @childname of the @buildable object.
141 	 *
142 	 * Params:
143 	 *     builder = a #GtkBuilder
144 	 *     childname = name of child
145 	 *
146 	 * Returns: the internal child of the buildable object
147 	 *
148 	 * Since: 2.12
149 	 */
150 	public ObjectG getInternalChild(Builder builder, string childname);
151 
152 	/**
153 	 * Gets the name of the @buildable object.
154 	 *
155 	 * #GtkBuilder sets the name based on the
156 	 * [GtkBuilder UI definition][BUILDER-UI]
157 	 * used to construct the @buildable.
158 	 *
159 	 * Returns: the name set with gtk_buildable_set_name()
160 	 *
161 	 * Since: 2.12
162 	 */
163 	public string buildableGetName();
164 
165 	/**
166 	 * Called when the builder finishes the parsing of a
167 	 * [GtkBuilder UI definition][BUILDER-UI].
168 	 * Note that this will be called once for each time
169 	 * gtk_builder_add_from_file() or gtk_builder_add_from_string()
170 	 * is called on a builder.
171 	 *
172 	 * Params:
173 	 *     builder = a #GtkBuilder
174 	 *
175 	 * Since: 2.12
176 	 */
177 	public void parserFinished(Builder builder);
178 
179 	/**
180 	 * Sets the property name @name to @value on the @buildable object.
181 	 *
182 	 * Params:
183 	 *     builder = a #GtkBuilder
184 	 *     name = name of property
185 	 *     value = value of property
186 	 *
187 	 * Since: 2.12
188 	 */
189 	public void setBuildableProperty(Builder builder, string name, Value value);
190 
191 	/**
192 	 * Sets the name of the @buildable object.
193 	 *
194 	 * Params:
195 	 *     name = name to set
196 	 *
197 	 * Since: 2.12
198 	 */
199 	public void buildableSetName(string name);
200 }