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  = GDBusObjectProxy.html
27  * outPack = gio
28  * outFile = DBusObjectProxy
29  * strct   = GDBusObjectProxy
30  * realStrct=
31  * ctorStrct=
32  * clss    = DBusObjectProxy
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- DBusObjectIF
40  * prefixes:
41  * 	- g_dbus_object_proxy_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gio.DBusConnection
49  * 	- gio.DBusObjectT
50  * 	- gio.DBusObjectIF
51  * structWrap:
52  * 	- GDBusConnection* -> DBusConnection
53  * module aliases:
54  * local aliases:
55  * overrides:
56  */
57 
58 module gio.DBusObjectProxy;
59 
60 public  import gtkc.giotypes;
61 
62 private import gtkc.gio;
63 private import glib.ConstructionException;
64 private import gobject.ObjectG;
65 
66 private import glib.Str;
67 private import gio.DBusConnection;
68 private import gio.DBusObjectT;
69 private import gio.DBusObjectIF;
70 
71 
72 private import gobject.ObjectG;
73 
74 /**
75  * A GDBusObjectProxy is an object used to represent a remote object
76  * with one or more D-Bus interfaces. Normally, you don't instantiate
77  * a GDBusObjectProxy yourself - typically GDBusObjectManagerClient
78  * is used to obtain it.
79  */
80 public class DBusObjectProxy : ObjectG, DBusObjectIF
81 {
82 	
83 	/** the main Gtk struct */
84 	protected GDBusObjectProxy* gDBusObjectProxy;
85 	
86 	
87 	/** Get the main Gtk struct */
88 	public GDBusObjectProxy* getDBusObjectProxyStruct()
89 	{
90 		return gDBusObjectProxy;
91 	}
92 	
93 	
94 	/** the main Gtk struct as a void* */
95 	protected override void* getStruct()
96 	{
97 		return cast(void*)gDBusObjectProxy;
98 	}
99 	
100 	/**
101 	 * Sets our main struct and passes it to the parent class
102 	 */
103 	public this (GDBusObjectProxy* gDBusObjectProxy)
104 	{
105 		super(cast(GObject*)gDBusObjectProxy);
106 		this.gDBusObjectProxy = gDBusObjectProxy;
107 	}
108 	
109 	protected override void setStruct(GObject* obj)
110 	{
111 		super.setStruct(obj);
112 		gDBusObjectProxy = cast(GDBusObjectProxy*)obj;
113 	}
114 	
115 	// add the DBusObject capabilities
116 	mixin DBusObjectT!(GDBusObjectProxy);
117 	
118 	/**
119 	 */
120 	
121 	/**
122 	 * Creates a new GDBusObjectProxy for the given connection and
123 	 * object path.
124 	 * Since 2.30
125 	 * Params:
126 	 * connection = a GDBusConnection
127 	 * objectPath = the object path
128 	 * Throws: ConstructionException GTK+ fails to create the object.
129 	 */
130 	public this (DBusConnection connection, string objectPath)
131 	{
132 		// GDBusObjectProxy * g_dbus_object_proxy_new (GDBusConnection *connection,  const gchar *object_path);
133 		auto p = g_dbus_object_proxy_new((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(objectPath));
134 		if(p is null)
135 		{
136 			throw new ConstructionException("null returned by g_dbus_object_proxy_new((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(objectPath))");
137 		}
138 		this(cast(GDBusObjectProxy*) p);
139 	}
140 	
141 	/**
142 	 * Gets the connection that proxy is for.
143 	 * Since 2.30
144 	 * Returns: A GDBusConnection. Do not free, the object is owned by proxy. [transfer none]
145 	 */
146 	public DBusConnection getConnection()
147 	{
148 		// GDBusConnection * g_dbus_object_proxy_get_connection (GDBusObjectProxy *proxy);
149 		auto p = g_dbus_object_proxy_get_connection(gDBusObjectProxy);
150 		
151 		if(p is null)
152 		{
153 			return null;
154 		}
155 		
156 		return ObjectG.getDObject!(DBusConnection)(cast(GDBusConnection*) p);
157 	}
158 }