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 = GDBusObjectManager.html 27 * outPack = gio 28 * outFile = DBusObjectManagerT 29 * strct = GDBusObjectManager 30 * realStrct= 31 * ctorStrct= 32 * clss = DBusObjectManagerT 33 * interf = DBusObjectManagerIF 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * - TStruct 38 * extend = 39 * implements: 40 * prefixes: 41 * - g_dbus_object_manager_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - glib.ListG 49 * - gio.DBusInterface 50 * - gio.DBusInterfaceIF 51 * - gio.DBusObject 52 * - gio.DBusObjectIF 53 * structWrap: 54 * - GDBusInterface* -> DBusInterfaceIF 55 * - GDBusObject* -> DBusObjectIF 56 * - GList* -> ListG 57 * module aliases: 58 * local aliases: 59 * overrides: 60 */ 61 62 module gio.DBusObjectManagerT; 63 64 public import gtkc.giotypes; 65 66 public import gtkc.gio; 67 public import glib.ConstructionException; 68 public import gobject.ObjectG; 69 70 public import gobject.Signals; 71 public import gtkc.gdktypes; 72 public import glib.Str; 73 public import glib.ListG; 74 public import gio.DBusInterface; 75 public import gio.DBusInterfaceIF; 76 public import gio.DBusObject; 77 public import gio.DBusObjectIF; 78 79 80 81 /** 82 * The GDBusObjectManager type is the base type for service- and 83 * client-side implementations of the standardized org.freedesktop.DBus.ObjectManager 84 * interface. 85 * 86 * See GDBusObjectManagerClient for the client-side implementation 87 * and GDBusObjectManagerServer for the service-side implementation. 88 */ 89 public template DBusObjectManagerT(TStruct) 90 { 91 92 /** the main Gtk struct */ 93 protected GDBusObjectManager* gDBusObjectManager; 94 95 96 /** Get the main Gtk struct */ 97 public GDBusObjectManager* getDBusObjectManagerTStruct() 98 { 99 return cast(GDBusObjectManager*)getStruct(); 100 } 101 102 103 /** 104 */ 105 int[string] connectedSignals; 106 107 void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF)[] _onInterfaceAddedListeners; 108 @property void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF)[] onInterfaceAddedListeners() 109 { 110 return _onInterfaceAddedListeners; 111 } 112 /** 113 * Emitted when interface is added to object. 114 * This signal exists purely as a convenience to avoid having to 115 * connect signals to all objects managed by manager. 116 * Since 2.30 117 */ 118 void addOnInterfaceAdded(void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 119 { 120 if ( !("interface-added" in connectedSignals) ) 121 { 122 Signals.connectData( 123 getStruct(), 124 "interface-added", 125 cast(GCallback)&callBackInterfaceAdded, 126 cast(void*)cast(DBusObjectManagerIF)this, 127 null, 128 connectFlags); 129 connectedSignals["interface-added"] = 1; 130 } 131 _onInterfaceAddedListeners ~= dlg; 132 } 133 extern(C) static void callBackInterfaceAdded(GDBusObjectManager* managerStruct, GDBusObject* object, GDBusInterface* iface, DBusObjectManagerIF _dBusObjectManagerIF) 134 { 135 foreach ( void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg ; _dBusObjectManagerIF.onInterfaceAddedListeners ) 136 { 137 dlg(ObjectG.getDObject!(DBusObject, DBusObjectIF)(object), ObjectG.getDObject!(DBusInterface, DBusInterfaceIF)(iface), _dBusObjectManagerIF); 138 } 139 } 140 141 void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF)[] _onInterfaceRemovedListeners; 142 @property void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF)[] onInterfaceRemovedListeners() 143 { 144 return _onInterfaceRemovedListeners; 145 } 146 /** 147 * Emitted when interface has been removed from object. 148 * This signal exists purely as a convenience to avoid having to 149 * connect signals to all objects managed by manager. 150 * Since 2.30 151 */ 152 void addOnInterfaceRemoved(void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 153 { 154 if ( !("interface-removed" in connectedSignals) ) 155 { 156 Signals.connectData( 157 getStruct(), 158 "interface-removed", 159 cast(GCallback)&callBackInterfaceRemoved, 160 cast(void*)cast(DBusObjectManagerIF)this, 161 null, 162 connectFlags); 163 connectedSignals["interface-removed"] = 1; 164 } 165 _onInterfaceRemovedListeners ~= dlg; 166 } 167 extern(C) static void callBackInterfaceRemoved(GDBusObjectManager* managerStruct, GDBusObject* object, GDBusInterface* iface, DBusObjectManagerIF _dBusObjectManagerIF) 168 { 169 foreach ( void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg ; _dBusObjectManagerIF.onInterfaceRemovedListeners ) 170 { 171 dlg(ObjectG.getDObject!(DBusObject, DBusObjectIF)(object), ObjectG.getDObject!(DBusInterface, DBusInterfaceIF)(iface), _dBusObjectManagerIF); 172 } 173 } 174 175 void delegate(DBusObjectIF, DBusObjectManagerIF)[] _onObjectAddedListeners; 176 @property void delegate(DBusObjectIF, DBusObjectManagerIF)[] onObjectAddedListeners() 177 { 178 return _onObjectAddedListeners; 179 } 180 /** 181 * Emitted when object is added to manager. 182 * Since 2.30 183 */ 184 void addOnObjectAdded(void delegate(DBusObjectIF, DBusObjectManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 185 { 186 if ( !("object-added" in connectedSignals) ) 187 { 188 Signals.connectData( 189 getStruct(), 190 "object-added", 191 cast(GCallback)&callBackObjectAdded, 192 cast(void*)cast(DBusObjectManagerIF)this, 193 null, 194 connectFlags); 195 connectedSignals["object-added"] = 1; 196 } 197 _onObjectAddedListeners ~= dlg; 198 } 199 extern(C) static void callBackObjectAdded(GDBusObjectManager* managerStruct, GDBusObject* object, DBusObjectManagerIF _dBusObjectManagerIF) 200 { 201 foreach ( void delegate(DBusObjectIF, DBusObjectManagerIF) dlg ; _dBusObjectManagerIF.onObjectAddedListeners ) 202 { 203 dlg(ObjectG.getDObject!(DBusObject, DBusObjectIF)(object), _dBusObjectManagerIF); 204 } 205 } 206 207 void delegate(DBusObjectIF, DBusObjectManagerIF)[] _onObjectRemovedListeners; 208 @property void delegate(DBusObjectIF, DBusObjectManagerIF)[] onObjectRemovedListeners() 209 { 210 return _onObjectRemovedListeners; 211 } 212 /** 213 * Emitted when object is removed from manager. 214 * Since 2.30 215 */ 216 void addOnObjectRemoved(void delegate(DBusObjectIF, DBusObjectManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 217 { 218 if ( !("object-removed" in connectedSignals) ) 219 { 220 Signals.connectData( 221 getStruct(), 222 "object-removed", 223 cast(GCallback)&callBackObjectRemoved, 224 cast(void*)cast(DBusObjectManagerIF)this, 225 null, 226 connectFlags); 227 connectedSignals["object-removed"] = 1; 228 } 229 _onObjectRemovedListeners ~= dlg; 230 } 231 extern(C) static void callBackObjectRemoved(GDBusObjectManager* managerStruct, GDBusObject* object, DBusObjectManagerIF _dBusObjectManagerIF) 232 { 233 foreach ( void delegate(DBusObjectIF, DBusObjectManagerIF) dlg ; _dBusObjectManagerIF.onObjectRemovedListeners ) 234 { 235 dlg(ObjectG.getDObject!(DBusObject, DBusObjectIF)(object), _dBusObjectManagerIF); 236 } 237 } 238 239 240 /** 241 * Gets the object path that manager is for. 242 * Since 2.30 243 * Returns: A string owned by manager. Do not free. 244 */ 245 public string getObjectPath() 246 { 247 // const gchar * g_dbus_object_manager_get_object_path (GDBusObjectManager *manager); 248 return Str.toString(g_dbus_object_manager_get_object_path(getDBusObjectManagerTStruct())); 249 } 250 251 /** 252 * Gets all GDBusObject objects known to manager. 253 * Since 2.30 254 * Returns: A list of GDBusObject objects. The returned list should be freed with g_list_free() after each element has been freed with g_object_unref(). [transfer full][element-type GDBusObject] 255 */ 256 public ListG getObjects() 257 { 258 // GList * g_dbus_object_manager_get_objects (GDBusObjectManager *manager); 259 auto p = g_dbus_object_manager_get_objects(getDBusObjectManagerTStruct()); 260 261 if(p is null) 262 { 263 return null; 264 } 265 266 return ObjectG.getDObject!(ListG)(cast(GList*) p); 267 } 268 269 /** 270 * Gets the GDBusObjectProxy at object_path, if any. 271 * Since 2.30 272 * Params: 273 * objectPath = Object path to lookup. 274 * Returns: A GDBusObject or NULL. Free with g_object_unref(). [transfer full] 275 */ 276 public DBusObjectIF getObject(string objectPath) 277 { 278 // GDBusObject * g_dbus_object_manager_get_object (GDBusObjectManager *manager, const gchar *object_path); 279 auto p = g_dbus_object_manager_get_object(getDBusObjectManagerTStruct(), Str.toStringz(objectPath)); 280 281 if(p is null) 282 { 283 return null; 284 } 285 286 return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p); 287 } 288 289 /** 290 * Gets the interface proxy for interface_name at object_path, if 291 * any. 292 * Since 2.30 293 * Signal Details 294 * The "interface-added" signal 295 * void user_function (GDBusObjectManager *manager, 296 * GDBusObject *object, 297 * GDBusInterface *interface, 298 * gpointer user_data) : Run Last 299 * Emitted when interface is added to object. 300 * This signal exists purely as a convenience to avoid having to 301 * connect signals to all objects managed by manager. 302 * Since 2.30 303 * Params: 304 * objectPath = Object path to lookup. 305 * interfaceName = D-Bus interface name to lookup. 306 * object = The GDBusObject on which an interface was added. 307 * interface = The GDBusInterface that was added. 308 * Returns: A GDBusInterface instance or NULL. Free with g_object_unref(). [transfer full] 309 */ 310 public DBusInterfaceIF getInterface(string objectPath, string interfaceName) 311 { 312 // GDBusInterface * g_dbus_object_manager_get_interface (GDBusObjectManager *manager, const gchar *object_path, const gchar *interface_name); 313 auto p = g_dbus_object_manager_get_interface(getDBusObjectManagerTStruct(), Str.toStringz(objectPath), Str.toStringz(interfaceName)); 314 315 if(p is null) 316 { 317 return null; 318 } 319 320 return ObjectG.getDObject!(DBusInterface, DBusInterfaceIF)(cast(GDBusInterface*) p); 321 } 322 }