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