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 67 public import gio.DBusInterfaceInfo; 68 public import gio.DBusObject; 69 public import gio.DBusObjectIF; 70 71 72 73 74 /** 75 * The GDBusInterface type is the base type for D-Bus interfaces both 76 * on the service side (see GDBusInterfaceSkeleton) and client side 77 * (see GDBusProxy). 78 */ 79 public template DBusInterfaceT(TStruct) 80 { 81 82 /** the main Gtk struct */ 83 protected GDBusInterface* gDBusInterface; 84 85 86 public GDBusInterface* getDBusInterfaceTStruct() 87 { 88 return cast(GDBusInterface*)getStruct(); 89 } 90 91 92 /** 93 */ 94 95 /** 96 * Gets D-Bus introspection information for the D-Bus interface 97 * implemented by interface_. 98 * Since 2.30 99 * Returns: A GDBusInterfaceInfo. Do not free. [transfer none] 100 */ 101 public DBusInterfaceInfo getInfo() 102 { 103 // GDBusInterfaceInfo * g_dbus_interface_get_info (GDBusInterface *interface_); 104 auto p = g_dbus_interface_get_info(getDBusInterfaceTStruct()); 105 106 if(p is null) 107 { 108 return null; 109 } 110 111 return ObjectG.getDObject!(DBusInterfaceInfo)(cast(GDBusInterfaceInfo*) p); 112 } 113 114 /** 115 * Gets the GDBusObject that interface_ belongs to, if any. 116 * Warning 117 * It is not safe to use the returned object if interface_ 118 * or the returned object is being used from other threads. See 119 * g_dbus_interface_dup_object() for a thread-safe 120 * alternative. 121 * Since 2.30 122 * Returns: A GDBusObject or NULL. The returned reference belongs to interface_ and should not be freed. [transfer none] 123 */ 124 public DBusObjectIF getObject() 125 { 126 // GDBusObject * g_dbus_interface_get_object (GDBusInterface *interface_); 127 auto p = g_dbus_interface_get_object(getDBusInterfaceTStruct()); 128 129 if(p is null) 130 { 131 return null; 132 } 133 134 return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p); 135 } 136 137 /** 138 * Gets the GDBusObject that interface_ belongs to, if any. 139 * Since 2.32 140 * Returns: A GDBusObject or NULL. The returned reference should be freed with g_object_unref(). [transfer full] 141 */ 142 public DBusObjectIF dupObject() 143 { 144 // GDBusObject * g_dbus_interface_dup_object (GDBusInterface *interface_); 145 auto p = g_dbus_interface_dup_object(getDBusInterfaceTStruct()); 146 147 if(p is null) 148 { 149 return null; 150 } 151 152 return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p); 153 } 154 155 /** 156 * Sets the GDBusObject for interface_ to object. 157 * Note that interface_ will hold a weak reference to object. 158 * Since 2.30 159 * Params: 160 * object = A GDBusObject or NULL. [allow-none] 161 */ 162 public void setObject(DBusObjectIF object) 163 { 164 // void g_dbus_interface_set_object (GDBusInterface *interface_, GDBusObject *object); 165 g_dbus_interface_set_object(getDBusInterfaceTStruct(), (object is null) ? null : object.getDBusObjectTStruct()); 166 } 167 }