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