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  = GDBusInterface.html
27  * outPack = gio
28  * outFile = DBusInterfaceT
29  * strct   = GDBusInterface
30  * realStrct=
31  * ctorStrct=
32  * clss    = DBusInterfaceT
33  * interf  = DBusInterfaceIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- g_dbus_interface_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gio.DBusInterfaceInfo
48  * 	- gio.DBusObject
49  * 	- gio.DBusObjectIF
50  * structWrap:
51  * 	- GDBusInterfaceInfo* -> DBusInterfaceInfo
52  * 	- GDBusObject* -> DBusObjectIF
53  * module aliases:
54  * local aliases:
55  * overrides:
56  */
57 
58 module gio.DBusInterfaceT;
59 
60 public  import gtkc.giotypes;
61 
62 public import gtkc.gio;
63 public import glib.ConstructionException;
64 public import gobject.ObjectG;
65 
66 public import gio.DBusInterfaceInfo;
67 public import gio.DBusObject;
68 public import gio.DBusObjectIF;
69 
70 
71 
72 /**
73  * The GDBusInterface type is the base type for D-Bus interfaces both
74  * on the service side (see GDBusInterfaceSkeleton) and client side
75  * (see GDBusProxy).
76  */
77 public template DBusInterfaceT(TStruct)
78 {
79 	
80 	/** the main Gtk struct */
81 	protected GDBusInterface* gDBusInterface;
82 	
83 	
84 	/** Get the main Gtk struct */
85 	public GDBusInterface* getDBusInterfaceTStruct()
86 	{
87 		return cast(GDBusInterface*)getStruct();
88 	}
89 	
90 	
91 	/**
92 	 */
93 	
94 	/**
95 	 * Gets D-Bus introspection information for the D-Bus interface
96 	 * implemented by interface_.
97 	 * Since 2.30
98 	 * Returns: A GDBusInterfaceInfo. Do not free. [transfer none]
99 	 */
100 	public DBusInterfaceInfo getInfo()
101 	{
102 		// GDBusInterfaceInfo * g_dbus_interface_get_info (GDBusInterface *interface_);
103 		auto p = g_dbus_interface_get_info(getDBusInterfaceTStruct());
104 		
105 		if(p is null)
106 		{
107 			return null;
108 		}
109 		
110 		return ObjectG.getDObject!(DBusInterfaceInfo)(cast(GDBusInterfaceInfo*) p);
111 	}
112 	
113 	/**
114 	 * Gets the GDBusObject that interface_ belongs to, if any.
115 	 * Warning
116 	 * It is not safe to use the returned object if interface_
117 	 * or the returned object is being used from other threads. See
118 	 * g_dbus_interface_dup_object() for a thread-safe
119 	 * alternative.
120 	 * Since 2.30
121 	 * Returns: A GDBusObject or NULL. The returned reference belongs to interface_ and should not be freed. [transfer none]
122 	 */
123 	public DBusObjectIF getObject()
124 	{
125 		// GDBusObject * g_dbus_interface_get_object (GDBusInterface *interface_);
126 		auto p = g_dbus_interface_get_object(getDBusInterfaceTStruct());
127 		
128 		if(p is null)
129 		{
130 			return null;
131 		}
132 		
133 		return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p);
134 	}
135 	
136 	/**
137 	 * Gets the GDBusObject that interface_ belongs to, if any.
138 	 * Since 2.32
139 	 * Returns: A GDBusObject or NULL. The returned reference should be freed with g_object_unref(). [transfer full]
140 	 */
141 	public DBusObjectIF dupObject()
142 	{
143 		// GDBusObject * g_dbus_interface_dup_object (GDBusInterface *interface_);
144 		auto p = g_dbus_interface_dup_object(getDBusInterfaceTStruct());
145 		
146 		if(p is null)
147 		{
148 			return null;
149 		}
150 		
151 		return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p);
152 	}
153 	
154 	/**
155 	 * Sets the GDBusObject for interface_ to object.
156 	 * Note that interface_ will hold a weak reference to object.
157 	 * Since 2.30
158 	 * Params:
159 	 * object = A GDBusObject or NULL. [allow-none]
160 	 */
161 	public void setObject(DBusObjectIF object)
162 	{
163 		// void g_dbus_interface_set_object (GDBusInterface *interface_,  GDBusObject *object);
164 		g_dbus_interface_set_object(getDBusInterfaceTStruct(), (object is null) ? null : object.getDBusObjectTStruct());
165 	}
166 }