source: appstream-generator/build/girepo/gio/DBusInterfaceT.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.DBusInterfaceT;
22
23public  import gi.gio;
24public  import gi.giotypes;
25public  import gio.DBusInterfaceInfo;
26public  import gio.DBusObject;
27public  import gio.DBusObjectIF;
28public  import gobject.ObjectG;
29
30
31/**
32 * The #GDBusInterface type is the base type for D-Bus interfaces both
33 * on the service side (see #GDBusInterfaceSkeleton) and client side
34 * (see #GDBusProxy).
35 *
36 * Since: 2.30
37 */
38public template DBusInterfaceT(TStruct)
39{
40        /** Get the main Gtk struct */
41        public GDBusInterface* getDBusInterfaceStruct()
42        {
43                return cast(GDBusInterface*)getStruct();
44        }
45
46
47        /**
48         * Gets the #GDBusObject that @interface_ belongs to, if any.
49         *
50         * Returns: A #GDBusObject or %NULL. The returned
51         *     reference should be freed with g_object_unref().
52         *
53         * Since: 2.32
54         */
55        public DBusObjectIF dupObject()
56        {
57                auto p = g_dbus_interface_dup_object(getDBusInterfaceStruct());
58               
59                if(p is null)
60                {
61                        return null;
62                }
63               
64                return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p, true);
65        }
66
67        /**
68         * Gets D-Bus introspection information for the D-Bus interface
69         * implemented by @interface_.
70         *
71         * Returns: A #GDBusInterfaceInfo. Do not free.
72         *
73         * Since: 2.30
74         */
75        public DBusInterfaceInfo getInfo()
76        {
77                auto p = g_dbus_interface_get_info(getDBusInterfaceStruct());
78               
79                if(p is null)
80                {
81                        return null;
82                }
83               
84                return ObjectG.getDObject!(DBusInterfaceInfo)(cast(GDBusInterfaceInfo*) p);
85        }
86
87        /**
88         * Gets the #GDBusObject that @interface_ belongs to, if any.
89         *
90         * It is not safe to use the returned object if @interface_ or
91         * the returned object is being used from other threads. See
92         * g_dbus_interface_dup_object() for a thread-safe alternative.
93         *
94         * Returns: A #GDBusObject or %NULL. The returned
95         *     reference belongs to @interface_ and should not be freed.
96         *
97         * Since: 2.30
98         */
99        public DBusObjectIF getObject()
100        {
101                auto p = g_dbus_interface_get_object(getDBusInterfaceStruct());
102               
103                if(p is null)
104                {
105                        return null;
106                }
107               
108                return ObjectG.getDObject!(DBusObject, DBusObjectIF)(cast(GDBusObject*) p);
109        }
110
111        /**
112         * Sets the #GDBusObject for @interface_ to @object.
113         *
114         * Note that @interface_ will hold a weak reference to @object.
115         *
116         * Params:
117         *     object = A #GDBusObject or %NULL.
118         *
119         * Since: 2.30
120         */
121        public void setObject(DBusObjectIF object)
122        {
123                g_dbus_interface_set_object(getDBusInterfaceStruct(), (object is null) ? null : object.getDBusObjectStruct());
124        }
125}
Note: See TracBrowser for help on using the repository browser.