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  * Conversion parameters:
26  * inFile  = GstImplementsInterface.html
27  * outPack = gstreamer
28  * outFile = ImplementsInterface
29  * strct   = GstImplementsInterface
30  * realStrct=
31  * ctorStrct=
32  * clss    = ImplementsInterface
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gst_element_
41  * 	- gst_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gstreamer.Element
48  * structWrap:
49  * 	- GstElement* -> Element
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gstreamer.ImplementsInterface;
56 
57 public  import gstreamerc.gstreamertypes;
58 
59 private import gstreamerc.gstreamer;
60 private import glib.ConstructionException;
61 private import gobject.ObjectG;
62 
63 
64 private import gstreamer.Element;
65 
66 
67 
68 
69 /**
70  * Description
71  * Provides interface functionality on per instance basis and not per class
72  * basis, which is the case for gobject.
73  */
74 public class ImplementsInterface
75 {
76 	
77 	/** the main Gtk struct */
78 	protected GstImplementsInterface* gstImplementsInterface;
79 	
80 	
81 	public GstImplementsInterface* getImplementsInterfaceStruct()
82 	{
83 		return gstImplementsInterface;
84 	}
85 	
86 	
87 	/** the main Gtk struct as a void* */
88 	protected void* getStruct()
89 	{
90 		return cast(void*)gstImplementsInterface;
91 	}
92 	
93 	/**
94 	 * Sets our main struct and passes it to the parent class
95 	 */
96 	public this (GstImplementsInterface* gstImplementsInterface)
97 	{
98 		this.gstImplementsInterface = gstImplementsInterface;
99 	}
100 	
101 	/**
102 	 */
103 	
104 	/**
105 	 * Test whether the given element implements a certain interface of type
106 	 * iface_type, and test whether it is supported for this specific instance.
107 	 * Params:
108 	 * element = GstElement to check for the implementation of the interface
109 	 * ifaceType = (final) type of the interface which we want to be implemented
110 	 * Returns: whether or not the element implements the interface.
111 	 */
112 	public static int implementsInterface(Element element, GType ifaceType)
113 	{
114 		// gboolean gst_element_implements_interface (GstElement *element,  GType iface_type);
115 		return gst_element_implements_interface((element is null) ? null : element.getElementStruct(), ifaceType);
116 	}
117 	
118 	/**
119 	 * cast a given object to an interface type, and check whether this
120 	 * interface is supported for this specific instance.
121 	 * Params:
122 	 * from = the object (any sort) from which to cast to the interface
123 	 * type = the interface type to cast to
124 	 * Returns: a gpointer to the interface type
125 	 */
126 	public static void* implementsInterfaceCast(void* from, GType type)
127 	{
128 		// gpointer gst_implements_interface_cast (gpointer from,  GType type);
129 		return gst_implements_interface_cast(from, type);
130 	}
131 	
132 	/**
133 	 * check a given object for an interface implementation, and check
134 	 * whether this interface is supported for this specific instance.
135 	 * Params:
136 	 * from = the object (any sort) from which to check from for the interface
137 	 * type = the interface type to check for
138 	 * Returns: whether or not the object implements the given interface
139 	 */
140 	public static int implementsInterfaceCheck(void* from, GType type)
141 	{
142 		// gboolean gst_implements_interface_check (gpointer from,  GType type);
143 		return gst_implements_interface_check(from, type);
144 	}
145 }