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 gio.DBusInterfaceT;
26 
27 public  import gio.DBusInterfaceInfo;
28 public  import gio.DBusObject;
29 public  import gio.DBusObjectIF;
30 public  import gobject.ObjectG;
31 public  import gtkc.gio;
32 public  import gtkc.giotypes;
33 
34 
35 /**
36  * The #GDBusInterface type is the base type for D-Bus interfaces both
37  * on the service side (see #GDBusInterfaceSkeleton) and client side
38  * (see #GDBusProxy).
39  *
40  * Since: 2.30
41  */
42 public template DBusInterfaceT(TStruct)
43 {
44 	/** Get the main Gtk struct */
45 	public GDBusInterface* getDBusInterfaceStruct()
46 	{
47 		return cast(GDBusInterface*)getStruct();
48 	}
49 
50 
51 	/**
52 	 * Gets the #GDBusObject that @interface_ belongs to, if any.
53 	 *
54 	 * Return: A #GDBusObject or %NULL. The returned
55 	 *     reference should be freed with g_object_unref().
56 	 *
57 	 * Since: 2.32
58 	 */
59 	public DBusObjectIF dupObject()
60 	{
61 		auto p = g_dbus_interface_dup_object(getDBusInterfaceStruct());
62 		
63 		if(p is null)
64 		{
65 			return null;
66 		}
67 		
68 		return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p);
69 	}
70 
71 	/**
72 	 * Gets D-Bus introspection information for the D-Bus interface
73 	 * implemented by @interface_.
74 	 *
75 	 * Return: A #GDBusInterfaceInfo. Do not free.
76 	 *
77 	 * Since: 2.30
78 	 */
79 	public DBusInterfaceInfo getInfo()
80 	{
81 		auto p = g_dbus_interface_get_info(getDBusInterfaceStruct());
82 		
83 		if(p is null)
84 		{
85 			return null;
86 		}
87 		
88 		return ObjectG.getDObject!(DBusInterfaceInfo)(cast(GDBusInterfaceInfo*) p);
89 	}
90 
91 	/**
92 	 * Gets the #GDBusObject that @interface_ belongs to, if any.
93 	 *
94 	 * It is not safe to use the returned object if @interface_ or
95 	 * the returned object is being used from other threads. See
96 	 * g_dbus_interface_dup_object() for a thread-safe alternative.
97 	 *
98 	 * Return: A #GDBusObject or %NULL. The returned
99 	 *     reference belongs to @interface_ and should not be freed.
100 	 *
101 	 * Since: 2.30
102 	 */
103 	public DBusObjectIF getObject()
104 	{
105 		auto p = g_dbus_interface_get_object(getDBusInterfaceStruct());
106 		
107 		if(p is null)
108 		{
109 			return null;
110 		}
111 		
112 		return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p);
113 	}
114 
115 	/**
116 	 * Sets the #GDBusObject for @interface_ to @object.
117 	 *
118 	 * Note that @interface_ will hold a weak reference to @object.
119 	 *
120 	 * Params:
121 	 *     object = A #GDBusObject or %NULL.
122 	 *
123 	 * Since: 2.30
124 	 */
125 	public void setObject(DBusObjectIF object)
126 	{
127 		g_dbus_interface_set_object(getDBusInterfaceStruct(), (object is null) ? null : object.getDBusObjectStruct());
128 	}
129 }