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

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

Initial release

File size: 6.7 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.DBusObjectManagerServer;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.DBusConnection;
26private import gio.DBusObjectManagerIF;
27private import gio.DBusObjectManagerT;
28private import gio.DBusObjectSkeleton;
29private import glib.ConstructionException;
30private import glib.Str;
31private import gobject.ObjectG;
32
33
34/**
35 * #GDBusObjectManagerServer is used to export #GDBusObject instances using
36 * the standardized
37 * [org.freedesktop.DBus.ObjectManager](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager)
38 * interface. For example, remote D-Bus clients can get all objects
39 * and properties in a single call. Additionally, any change in the
40 * object hierarchy is broadcast using signals. This means that D-Bus
41 * clients can keep caches up to date by only listening to D-Bus
42 * signals.
43 *
44 * See #GDBusObjectManagerClient for the client-side code that is
45 * intended to be used with #GDBusObjectManagerServer or any D-Bus
46 * object implementing the org.freedesktop.DBus.ObjectManager
47 * interface.
48 *
49 * Since: 2.30
50 */
51public class DBusObjectManagerServer : ObjectG, DBusObjectManagerIF
52{
53        /** the main Gtk struct */
54        protected GDBusObjectManagerServer* gDBusObjectManagerServer;
55
56        /** Get the main Gtk struct */
57        public GDBusObjectManagerServer* getDBusObjectManagerServerStruct()
58        {
59                return gDBusObjectManagerServer;
60        }
61
62        /** the main Gtk struct as a void* */
63        protected override void* getStruct()
64        {
65                return cast(void*)gDBusObjectManagerServer;
66        }
67
68        protected override void setStruct(GObject* obj)
69        {
70                gDBusObjectManagerServer = cast(GDBusObjectManagerServer*)obj;
71                super.setStruct(obj);
72        }
73
74        /**
75         * Sets our main struct and passes it to the parent class.
76         */
77        public this (GDBusObjectManagerServer* gDBusObjectManagerServer, bool ownedRef = false)
78        {
79                this.gDBusObjectManagerServer = gDBusObjectManagerServer;
80                super(cast(GObject*)gDBusObjectManagerServer, ownedRef);
81        }
82
83        // add the DBusObjectManager capabilities
84        mixin DBusObjectManagerT!(GDBusObjectManagerServer);
85
86
87        /** */
88        public static GType getType()
89        {
90                return g_dbus_object_manager_server_get_type();
91        }
92
93        /**
94         * Creates a new #GDBusObjectManagerServer object.
95         *
96         * The returned server isn't yet exported on any connection. To do so,
97         * use g_dbus_object_manager_server_set_connection(). Normally you
98         * want to export all of your objects before doing so to avoid <ulink
99         * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
100         * signals being emitted.
101         *
102         * Params:
103         *     objectPath = The object path to export the manager object at.
104         *
105         * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
106         *
107         * Since: 2.30
108         *
109         * Throws: ConstructionException GTK+ fails to create the object.
110         */
111        public this(string objectPath)
112        {
113                auto p = g_dbus_object_manager_server_new(Str.toStringz(objectPath));
114               
115                if(p is null)
116                {
117                        throw new ConstructionException("null returned by new");
118                }
119               
120                this(cast(GDBusObjectManagerServer*) p, true);
121        }
122
123        /**
124         * Exports @object on @manager.
125         *
126         * If there is already a #GDBusObject exported at the object path,
127         * then the old object is removed.
128         *
129         * The object path for @object must be in the hierarchy rooted by the
130         * object path for @manager.
131         *
132         * Note that @manager will take a reference on @object for as long as
133         * it is exported.
134         *
135         * Params:
136         *     object = A #GDBusObjectSkeleton.
137         *
138         * Since: 2.30
139         */
140        public void expor(DBusObjectSkeleton object)
141        {
142                g_dbus_object_manager_server_export(gDBusObjectManagerServer, (object is null) ? null : object.getDBusObjectSkeletonStruct());
143        }
144
145        /**
146         * Like g_dbus_object_manager_server_export() but appends a string of
147         * the form _N (with N being a natural number) to @object's object path
148         * if an object with the given path already exists. As such, the
149         * #GDBusObjectProxy:g-object-path property of @object may be modified.
150         *
151         * Params:
152         *     object = An object.
153         *
154         * Since: 2.30
155         */
156        public void exportUniquely(DBusObjectSkeleton object)
157        {
158                g_dbus_object_manager_server_export_uniquely(gDBusObjectManagerServer, (object is null) ? null : object.getDBusObjectSkeletonStruct());
159        }
160
161        /**
162         * Gets the #GDBusConnection used by @manager.
163         *
164         * Returns: A #GDBusConnection object or %NULL if
165         *     @manager isn't exported on a connection. The returned object should
166         *     be freed with g_object_unref().
167         *
168         * Since: 2.30
169         */
170        public DBusConnection getConnection()
171        {
172                auto p = g_dbus_object_manager_server_get_connection(gDBusObjectManagerServer);
173               
174                if(p is null)
175                {
176                        return null;
177                }
178               
179                return ObjectG.getDObject!(DBusConnection)(cast(GDBusConnection*) p, true);
180        }
181
182        /**
183         * Returns whether @object is currently exported on @manager.
184         *
185         * Params:
186         *     object = An object.
187         *
188         * Returns: %TRUE if @object is exported
189         *
190         * Since: 2.34
191         */
192        public bool isExported(DBusObjectSkeleton object)
193        {
194                return g_dbus_object_manager_server_is_exported(gDBusObjectManagerServer, (object is null) ? null : object.getDBusObjectSkeletonStruct()) != 0;
195        }
196
197        /**
198         * Exports all objects managed by @manager on @connection. If
199         * @connection is %NULL, stops exporting objects.
200         *
201         * Params:
202         *     connection = A #GDBusConnection or %NULL.
203         */
204        public void setConnection(DBusConnection connection)
205        {
206                g_dbus_object_manager_server_set_connection(gDBusObjectManagerServer, (connection is null) ? null : connection.getDBusConnectionStruct());
207        }
208
209        /**
210         * If @manager has an object at @path, removes the object. Otherwise
211         * does nothing.
212         *
213         * Note that @object_path must be in the hierarchy rooted by the
214         * object path for @manager.
215         *
216         * Params:
217         *     objectPath = An object path.
218         *
219         * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
220         *
221         * Since: 2.30
222         */
223        public bool unexport(string objectPath)
224        {
225                return g_dbus_object_manager_server_unexport(gDBusObjectManagerServer, Str.toStringz(objectPath)) != 0;
226        }
227}
Note: See TracBrowser for help on using the repository browser.