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  = 
27  * outPack = gio
28  * outFile = DBusInterfaceInfo
29  * strct   = GDBusInterfaceInfo
30  * realStrct=
31  * ctorStrct=
32  * clss    = DBusInterfaceInfo
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_dbus_interface_info_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- glib.StringG
48  * 	- gio.DBusMethodInfo
49  * 	- gio.DBusPropertyInfo
50  * 	- gio.DBusSignalInfo
51  * structWrap:
52  * 	- GDBusInterfaceInfo* -> DBusInterfaceInfo
53  * 	- GDBusMethodInfo* -> DBusMethodInfo
54  * 	- GDBusPropertyInfo* -> DBusPropertyInfo
55  * 	- GDBusSignalInfo* -> DBusSignalInfo
56  * 	- GString* -> StringG
57  * module aliases:
58  * local aliases:
59  * overrides:
60  */
61 
62 module gio.DBusInterfaceInfo;
63 
64 public  import gtkc.giotypes;
65 
66 private import gtkc.gio;
67 private import glib.ConstructionException;
68 private import gobject.ObjectG;
69 
70 
71 private import glib.Str;
72 private import glib.StringG;
73 private import gio.DBusMethodInfo;
74 private import gio.DBusPropertyInfo;
75 private import gio.DBusSignalInfo;
76 
77 
78 
79 
80 /**
81  * Various data structures and convenience routines to parse and
82  * generate D-Bus introspection XML. Introspection information is
83  * used when registering objects with g_dbus_connection_register_object().
84  *
85  * The format of D-Bus introspection XML is specified in the
86  * D-Bus specification.
87  */
88 public class DBusInterfaceInfo
89 {
90 	
91 	/** the main Gtk struct */
92 	protected GDBusInterfaceInfo* gDBusInterfaceInfo;
93 	
94 	
95 	public GDBusInterfaceInfo* getDBusInterfaceInfoStruct()
96 	{
97 		return gDBusInterfaceInfo;
98 	}
99 	
100 	
101 	/** the main Gtk struct as a void* */
102 	protected void* getStruct()
103 	{
104 		return cast(void*)gDBusInterfaceInfo;
105 	}
106 	
107 	/**
108 	 * Sets our main struct and passes it to the parent class
109 	 */
110 	public this (GDBusInterfaceInfo* gDBusInterfaceInfo)
111 	{
112 		this.gDBusInterfaceInfo = gDBusInterfaceInfo;
113 	}
114 	
115 	/**
116 	 */
117 	
118 	/**
119 	 * Looks up information about a method.
120 	 * The cost of this function is O(n) in number of methods unless
121 	 * g_dbus_interface_info_cache_build() has been used on info.
122 	 * Since 2.26
123 	 * Params:
124 	 * name = A D-Bus method name (typically in CamelCase)
125 	 * Returns: A GDBusMethodInfo or NULL if not found. Do not free, it is owned by info. [transfer none]
126 	 */
127 	public DBusMethodInfo lookupMethod(string name)
128 	{
129 		// GDBusMethodInfo * g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,  const gchar *name);
130 		auto p = g_dbus_interface_info_lookup_method(gDBusInterfaceInfo, Str.toStringz(name));
131 		
132 		if(p is null)
133 		{
134 			return null;
135 		}
136 		
137 		return ObjectG.getDObject!(DBusMethodInfo)(cast(GDBusMethodInfo*) p);
138 	}
139 	
140 	/**
141 	 * Looks up information about a signal.
142 	 * The cost of this function is O(n) in number of signals unless
143 	 * g_dbus_interface_info_cache_build() has been used on info.
144 	 * Since 2.26
145 	 * Params:
146 	 * name = A D-Bus signal name (typically in CamelCase)
147 	 * Returns: A GDBusSignalInfo or NULL if not found. Do not free, it is owned by info. [transfer none]
148 	 */
149 	public DBusSignalInfo lookupSignal(string name)
150 	{
151 		// GDBusSignalInfo * g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,  const gchar *name);
152 		auto p = g_dbus_interface_info_lookup_signal(gDBusInterfaceInfo, Str.toStringz(name));
153 		
154 		if(p is null)
155 		{
156 			return null;
157 		}
158 		
159 		return ObjectG.getDObject!(DBusSignalInfo)(cast(GDBusSignalInfo*) p);
160 	}
161 	
162 	/**
163 	 * Looks up information about a property.
164 	 * The cost of this function is O(n) in number of properties unless
165 	 * g_dbus_interface_info_cache_build() has been used on info.
166 	 * Since 2.26
167 	 * Params:
168 	 * name = A D-Bus property name (typically in CamelCase).
169 	 * Returns: A GDBusPropertyInfo or NULL if not found. Do not free, it is owned by info. [transfer none]
170 	 */
171 	public DBusPropertyInfo lookupProperty(string name)
172 	{
173 		// GDBusPropertyInfo * g_dbus_interface_info_lookup_property  (GDBusInterfaceInfo *info,  const gchar *name);
174 		auto p = g_dbus_interface_info_lookup_property(gDBusInterfaceInfo, Str.toStringz(name));
175 		
176 		if(p is null)
177 		{
178 			return null;
179 		}
180 		
181 		return ObjectG.getDObject!(DBusPropertyInfo)(cast(GDBusPropertyInfo*) p);
182 	}
183 	
184 	/**
185 	 * Builds a lookup-cache to speed up
186 	 * g_dbus_interface_info_lookup_method(),
187 	 * g_dbus_interface_info_lookup_signal() and
188 	 * g_dbus_interface_info_lookup_property().
189 	 * If this has already been called with info, the existing cache is
190 	 * used and its use count is increased.
191 	 * Note that info cannot be modified until
192 	 * g_dbus_interface_info_cache_release() is called.
193 	 * Since 2.30
194 	 */
195 	public void cacheBuild()
196 	{
197 		// void g_dbus_interface_info_cache_build (GDBusInterfaceInfo *info);
198 		g_dbus_interface_info_cache_build(gDBusInterfaceInfo);
199 	}
200 	
201 	/**
202 	 * Decrements the usage count for the cache for info built by
203 	 * g_dbus_interface_info_cache_build() (if any) and frees the
204 	 * resources used by the cache if the usage count drops to zero.
205 	 * Since 2.30
206 	 */
207 	public void cacheRelease()
208 	{
209 		// void g_dbus_interface_info_cache_release (GDBusInterfaceInfo *info);
210 		g_dbus_interface_info_cache_release(gDBusInterfaceInfo);
211 	}
212 	
213 	/**
214 	 * Appends an XML representation of info (and its children) to string_builder.
215 	 * This function is typically used for generating introspection XML
216 	 * documents at run-time for handling the
217 	 * org.freedesktop.DBus.Introspectable.Introspect
218 	 * method.
219 	 * Since 2.26
220 	 * Params:
221 	 * indent = Indentation level.
222 	 * stringBuilder = A GString to to append XML data to. [out]
223 	 */
224 	public void generateXml(uint indent, StringG stringBuilder)
225 	{
226 		// void g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info,  guint indent,  GString *string_builder);
227 		g_dbus_interface_info_generate_xml(gDBusInterfaceInfo, indent, (stringBuilder is null) ? null : stringBuilder.getStringGStruct());
228 	}
229 	
230 	/**
231 	 * If info is statically allocated does nothing. Otherwise increases
232 	 * the reference count.
233 	 * Since 2.26
234 	 * Returns: The same info.
235 	 */
236 	public DBusInterfaceInfo doref()
237 	{
238 		// GDBusInterfaceInfo * g_dbus_interface_info_ref (GDBusInterfaceInfo *info);
239 		auto p = g_dbus_interface_info_ref(gDBusInterfaceInfo);
240 		
241 		if(p is null)
242 		{
243 			return null;
244 		}
245 		
246 		return ObjectG.getDObject!(DBusInterfaceInfo)(cast(GDBusInterfaceInfo*) p);
247 	}
248 	
249 	/**
250 	 * If info is statically allocated, does nothing. Otherwise decreases
251 	 * the reference count of info. When its reference count drops to 0,
252 	 * the memory used is freed.
253 	 * Since 2.26
254 	 */
255 	public void unref()
256 	{
257 		// void g_dbus_interface_info_unref (GDBusInterfaceInfo *info);
258 		g_dbus_interface_info_unref(gDBusInterfaceInfo);
259 	}
260 }