source: appstream-generator/build/girepo/gio/DBusObjectProxy.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 3.2 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.DBusObjectProxy;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.DBusConnection;
26private import gio.DBusObjectIF;
27private import gio.DBusObjectT;
28private import glib.ConstructionException;
29private import glib.Str;
30private import gobject.ObjectG;
31
32
33/**
34 * A #GDBusObjectProxy is an object used to represent a remote object
35 * with one or more D-Bus interfaces. Normally, you don't instantiate
36 * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
37 * is used to obtain it.
38 *
39 * Since: 2.30
40 */
41public class DBusObjectProxy : ObjectG, DBusObjectIF
42{
43        /** the main Gtk struct */
44        protected GDBusObjectProxy* gDBusObjectProxy;
45
46        /** Get the main Gtk struct */
47        public GDBusObjectProxy* getDBusObjectProxyStruct()
48        {
49                return gDBusObjectProxy;
50        }
51
52        /** the main Gtk struct as a void* */
53        protected override void* getStruct()
54        {
55                return cast(void*)gDBusObjectProxy;
56        }
57
58        protected override void setStruct(GObject* obj)
59        {
60                gDBusObjectProxy = cast(GDBusObjectProxy*)obj;
61                super.setStruct(obj);
62        }
63
64        /**
65         * Sets our main struct and passes it to the parent class.
66         */
67        public this (GDBusObjectProxy* gDBusObjectProxy, bool ownedRef = false)
68        {
69                this.gDBusObjectProxy = gDBusObjectProxy;
70                super(cast(GObject*)gDBusObjectProxy, ownedRef);
71        }
72
73        // add the DBusObject capabilities
74        mixin DBusObjectT!(GDBusObjectProxy);
75
76
77        /** */
78        public static GType getType()
79        {
80                return g_dbus_object_proxy_get_type();
81        }
82
83        /**
84         * Creates a new #GDBusObjectProxy for the given connection and
85         * object path.
86         *
87         * Params:
88         *     connection = a #GDBusConnection
89         *     objectPath = the object path
90         *
91         * Returns: a new #GDBusObjectProxy
92         *
93         * Since: 2.30
94         *
95         * Throws: ConstructionException GTK+ fails to create the object.
96         */
97        public this(DBusConnection connection, string objectPath)
98        {
99                auto p = g_dbus_object_proxy_new((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(objectPath));
100               
101                if(p is null)
102                {
103                        throw new ConstructionException("null returned by new");
104                }
105               
106                this(cast(GDBusObjectProxy*) p, true);
107        }
108
109        /**
110         * Gets the connection that @proxy is for.
111         *
112         * Returns: A #GDBusConnection. Do not free, the
113         *     object is owned by @proxy.
114         *
115         * Since: 2.30
116         */
117        public DBusConnection getConnection()
118        {
119                auto p = g_dbus_object_proxy_get_connection(gDBusObjectProxy);
120               
121                if(p is null)
122                {
123                        return null;
124                }
125               
126                return ObjectG.getDObject!(DBusConnection)(cast(GDBusConnection*) p);
127        }
128}
Note: See TracBrowser for help on using the repository browser.