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