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