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

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

Initial release

File size: 5.8 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.DBusInterfaceInfo;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.DBusMethodInfo;
26private import gio.DBusPropertyInfo;
27private import gio.DBusSignalInfo;
28private import glib.Str;
29private import glib.StringG;
30private import gobject.ObjectG;
31
32
33/**
34 * Information about a D-Bus interface.
35 *
36 * Since: 2.26
37 */
38public class DBusInterfaceInfo
39{
40        /** the main Gtk struct */
41        protected GDBusInterfaceInfo* gDBusInterfaceInfo;
42        protected bool ownedRef;
43
44        /** Get the main Gtk struct */
45        public GDBusInterfaceInfo* getDBusInterfaceInfoStruct()
46        {
47                return gDBusInterfaceInfo;
48        }
49
50        /** the main Gtk struct as a void* */
51        protected void* getStruct()
52        {
53                return cast(void*)gDBusInterfaceInfo;
54        }
55
56        /**
57         * Sets our main struct and passes it to the parent class.
58         */
59        public this (GDBusInterfaceInfo* gDBusInterfaceInfo, bool ownedRef = false)
60        {
61                this.gDBusInterfaceInfo = gDBusInterfaceInfo;
62                this.ownedRef = ownedRef;
63        }
64
65
66        /** */
67        public static GType getType()
68        {
69                return g_dbus_interface_info_get_type();
70        }
71
72        /**
73         * Builds a lookup-cache to speed up
74         * g_dbus_interface_info_lookup_method(),
75         * g_dbus_interface_info_lookup_signal() and
76         * g_dbus_interface_info_lookup_property().
77         *
78         * If this has already been called with @info, the existing cache is
79         * used and its use count is increased.
80         *
81         * Note that @info cannot be modified until
82         * g_dbus_interface_info_cache_release() is called.
83         *
84         * Since: 2.30
85         */
86        public void cacheBuild()
87        {
88                g_dbus_interface_info_cache_build(gDBusInterfaceInfo);
89        }
90
91        /**
92         * Decrements the usage count for the cache for @info built by
93         * g_dbus_interface_info_cache_build() (if any) and frees the
94         * resources used by the cache if the usage count drops to zero.
95         *
96         * Since: 2.30
97         */
98        public void cacheRelease()
99        {
100                g_dbus_interface_info_cache_release(gDBusInterfaceInfo);
101        }
102
103        /**
104         * Appends an XML representation of @info (and its children) to @string_builder.
105         *
106         * This function is typically used for generating introspection XML
107         * documents at run-time for handling the
108         * `org.freedesktop.DBus.Introspectable.Introspect`
109         * method.
110         *
111         * Params:
112         *     indent = Indentation level.
113         *     stringBuilder = A #GString to to append XML data to.
114         *
115         * Since: 2.26
116         */
117        public void generateXml(uint indent, out StringG stringBuilder)
118        {
119                GString* outstringBuilder = gMalloc!GString();
120               
121                g_dbus_interface_info_generate_xml(gDBusInterfaceInfo, indent, outstringBuilder);
122               
123                stringBuilder = new StringG(outstringBuilder, true);
124        }
125
126        /**
127         * Looks up information about a method.
128         *
129         * The cost of this function is O(n) in number of methods unless
130         * g_dbus_interface_info_cache_build() has been used on @info.
131         *
132         * Params:
133         *     name = A D-Bus method name (typically in CamelCase)
134         *
135         * Returns: A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
136         *
137         * Since: 2.26
138         */
139        public DBusMethodInfo lookupMethod(string name)
140        {
141                auto p = g_dbus_interface_info_lookup_method(gDBusInterfaceInfo, Str.toStringz(name));
142               
143                if(p is null)
144                {
145                        return null;
146                }
147               
148                return ObjectG.getDObject!(DBusMethodInfo)(cast(GDBusMethodInfo*) p);
149        }
150
151        /**
152         * Looks up information about a property.
153         *
154         * The cost of this function is O(n) in number of properties unless
155         * g_dbus_interface_info_cache_build() has been used on @info.
156         *
157         * Params:
158         *     name = A D-Bus property name (typically in CamelCase).
159         *
160         * Returns: A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
161         *
162         * Since: 2.26
163         */
164        public DBusPropertyInfo lookupProperty(string name)
165        {
166                auto p = g_dbus_interface_info_lookup_property(gDBusInterfaceInfo, Str.toStringz(name));
167               
168                if(p is null)
169                {
170                        return null;
171                }
172               
173                return ObjectG.getDObject!(DBusPropertyInfo)(cast(GDBusPropertyInfo*) p);
174        }
175
176        /**
177         * Looks up information about a signal.
178         *
179         * The cost of this function is O(n) in number of signals unless
180         * g_dbus_interface_info_cache_build() has been used on @info.
181         *
182         * Params:
183         *     name = A D-Bus signal name (typically in CamelCase)
184         *
185         * Returns: A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
186         *
187         * Since: 2.26
188         */
189        public DBusSignalInfo lookupSignal(string name)
190        {
191                auto p = g_dbus_interface_info_lookup_signal(gDBusInterfaceInfo, Str.toStringz(name));
192               
193                if(p is null)
194                {
195                        return null;
196                }
197               
198                return ObjectG.getDObject!(DBusSignalInfo)(cast(GDBusSignalInfo*) p);
199        }
200
201        /**
202         * If @info is statically allocated does nothing. Otherwise increases
203         * the reference count.
204         *
205         * Returns: The same @info.
206         *
207         * Since: 2.26
208         */
209        public DBusInterfaceInfo doref()
210        {
211                auto p = g_dbus_interface_info_ref(gDBusInterfaceInfo);
212               
213                if(p is null)
214                {
215                        return null;
216                }
217               
218                return ObjectG.getDObject!(DBusInterfaceInfo)(cast(GDBusInterfaceInfo*) p, true);
219        }
220
221        /**
222         * If @info is statically allocated, does nothing. Otherwise decreases
223         * the reference count of @info. When its reference count drops to 0,
224         * the memory used is freed.
225         *
226         * Since: 2.26
227         */
228        public void unref()
229        {
230                g_dbus_interface_info_unref(gDBusInterfaceInfo);
231        }
232}
Note: See TracBrowser for help on using the repository browser.