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 gstreamer.ChildProxyIF;
26 
27 private import glib.Str;
28 private import gobject.ObjectG;
29 private import gobject.ParamSpec;
30 private import gobject.Signals;
31 private import gobject.Value;
32 private import gstreamerc.gstreamer;
33 public  import gstreamerc.gstreamertypes;
34 public  import gtkc.gdktypes;
35 private import std.algorithm;
36 
37 
38 /**
39  * This interface abstracts handling of property sets for elements with
40  * children. Imagine elements such as mixers or polyphonic generators. They all
41  * have multiple #GstPad or some kind of voice objects. Another use case are
42  * container elements like #GstBin.
43  * The element implementing the interface acts as a parent for those child
44  * objects.
45  * 
46  * By implementing this interface the child properties can be accessed from the
47  * parent element by using gst_child_proxy_get() and gst_child_proxy_set().
48  * 
49  * Property names are written as "child-name::property-name". The whole naming
50  * scheme is recursive. Thus "child1::child2::property" is valid too, if
51  * "child1" and "child2" implement the #GstChildProxy interface.
52  */
53 public interface ChildProxyIF{
54 	/** Get the main Gtk struct */
55 	public GstChildProxy* getChildProxyStruct();
56 
57 	/** the main Gtk struct as a void* */
58 	protected void* getStruct();
59 
60 
61 	/**
62 	 * Emits the "child-added" signal.
63 	 *
64 	 * Params:
65 	 *     child = the newly added child
66 	 *     name = the name of the new child
67 	 */
68 	public void childAdded(ObjectG child, string name);
69 
70 	/**
71 	 * Emits the "child-removed" signal.
72 	 *
73 	 * Params:
74 	 *     child = the removed child
75 	 *     name = the name of the old child
76 	 */
77 	public void childRemoved(ObjectG child, string name);
78 
79 	/**
80 	 * Fetches a child by its number.
81 	 *
82 	 * Params:
83 	 *     index = the child's position in the child list
84 	 *
85 	 * Return: the child object or %NULL if
86 	 *     not found (index too high). Unref after usage.
87 	 *
88 	 *     MT safe.
89 	 */
90 	public ObjectG getChildByIndex(uint index);
91 
92 	/**
93 	 * Looks up a child element by the given name.
94 	 *
95 	 * This virtual method has a default implementation that uses #GstObject
96 	 * together with gst_object_get_name(). If the interface is to be used with
97 	 * #GObjects, this methods needs to be overridden.
98 	 *
99 	 * Params:
100 	 *     name = the child's name
101 	 *
102 	 * Return: the child object or %NULL if
103 	 *     not found. Unref after usage.
104 	 *
105 	 *     MT safe.
106 	 */
107 	public ObjectG getChildByName(string name);
108 
109 	/**
110 	 * Gets the number of child objects this parent contains.
111 	 *
112 	 * Return: the number of child objects
113 	 *
114 	 *     MT safe.
115 	 */
116 	public uint getChildrenCount();
117 
118 	/**
119 	 * Gets a single property using the GstChildProxy mechanism.
120 	 * You are responsible for freeing it by calling g_value_unset()
121 	 *
122 	 * Params:
123 	 *     name = name of the property
124 	 *     value = a #GValue that should take the result.
125 	 */
126 	public void childGetProperty(string name, out Value value);
127 
128 	/**
129 	 * Gets properties of the parent object and its children.
130 	 *
131 	 * Params:
132 	 *     firstPropertyName = name of the first property to get
133 	 *     varArgs = return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
134 	 */
135 	public void childGetValist(string firstPropertyName, void* varArgs);
136 
137 	/**
138 	 * Looks up which object and #GParamSpec would be effected by the given @name.
139 	 *
140 	 * MT safe.
141 	 *
142 	 * Params:
143 	 *     name = name of the property to look up
144 	 *     target = pointer to a #GObject that
145 	 *         takes the real object to set property on
146 	 *     pspec = pointer to take the #GParamSpec
147 	 *         describing the property
148 	 *
149 	 * Return: %TRUE if @target and @pspec could be found. %FALSE otherwise. In that
150 	 *     case the values for @pspec and @target are not modified. Unref @target after
151 	 *     usage. For plain GObjects @target is the same as @object.
152 	 */
153 	public bool lookup(string name, out ObjectG target, out ParamSpec pspec);
154 
155 	/**
156 	 * Sets a single property using the GstChildProxy mechanism.
157 	 *
158 	 * Params:
159 	 *     name = name of the property to set
160 	 *     value = new #GValue for the property
161 	 */
162 	public void childSetProperty(string name, Value value);
163 
164 	/**
165 	 * Sets properties of the parent object and its children.
166 	 *
167 	 * Params:
168 	 *     firstPropertyName = name of the first property to set
169 	 *     varArgs = value for the first property, followed optionally by more name/value pairs, followed by %NULL
170 	 */
171 	public void childSetValist(string firstPropertyName, void* varArgs);
172 	/**
173 	 * Will be emitted after the @object was added to the @child_proxy.
174 	 *
175 	 * Params:
176 	 *     object = the #GObject that was added
177 	 *     name = the name of the new child
178 	 */
179 	gulong addOnChildAdded(void delegate(ObjectG, string, ChildProxyIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
180 	;
181 
182 	/**
183 	 * Will be emitted after the @object was removed from the @child_proxy.
184 	 *
185 	 * Params:
186 	 *     object = the #GObject that was removed
187 	 *     name = the name of the old child
188 	 */
189 	gulong addOnChildRemoved(void delegate(ObjectG, string, ChildProxyIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
190 	;
191 
192 }