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

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

Initial release

File size: 3.5 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.DBusMenuModel;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.DBusConnection;
26private import gio.MenuModel;
27private import glib.ConstructionException;
28private import glib.Str;
29private import gobject.ObjectG;
30
31
32/**
33 * #GDBusMenuModel is an implementation of #GMenuModel that can be used
34 * as a proxy for a menu model that is exported over D-Bus with
35 * g_dbus_connection_export_menu_model().
36 */
37public class DBusMenuModel : MenuModel
38{
39        /** the main Gtk struct */
40        protected GDBusMenuModel* gDBusMenuModel;
41
42        /** Get the main Gtk struct */
43        public GDBusMenuModel* getDBusMenuModelStruct()
44        {
45                return gDBusMenuModel;
46        }
47
48        /** the main Gtk struct as a void* */
49        protected override void* getStruct()
50        {
51                return cast(void*)gDBusMenuModel;
52        }
53
54        protected override void setStruct(GObject* obj)
55        {
56                gDBusMenuModel = cast(GDBusMenuModel*)obj;
57                super.setStruct(obj);
58        }
59
60        /**
61         * Sets our main struct and passes it to the parent class.
62         */
63        public this (GDBusMenuModel* gDBusMenuModel, bool ownedRef = false)
64        {
65                this.gDBusMenuModel = gDBusMenuModel;
66                super(cast(GMenuModel*)gDBusMenuModel, ownedRef);
67        }
68
69        /**
70         * See_Also: get().
71         */
72        this(DBusConnection connection, string busName, string objectPath)
73        {
74                auto p =  g_dbus_menu_model_get((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(busName), Str.toStringz(objectPath));
75               
76                if(p is null)
77                {
78                        throw new ConstructionException("null returned by g_dbus_menu_model_get");
79                }
80               
81                this(cast(GDBusMenuModel*) p, true);
82        }
83
84        /**
85         */
86
87        /** */
88        public static GType getType()
89        {
90                return g_dbus_menu_model_get_type();
91        }
92
93        /**
94         * Obtains a #GDBusMenuModel for the menu model which is exported
95         * at the given @bus_name and @object_path.
96         *
97         * The thread default main context is taken at the time of this call.
98         * All signals on the menu model (and any linked models) are reported
99         * with respect to this context.  All calls on the returned menu model
100         * (and linked models) must also originate from this same context, with
101         * the thread default main context unchanged.
102         *
103         * Params:
104         *     connection = a #GDBusConnection
105         *     busName = the bus name which exports the menu model
106         *     objectPath = the object path at which the menu model is exported
107         *
108         * Returns: a #GDBusMenuModel object. Free with
109         *     g_object_unref().
110         *
111         * Since: 2.32
112         */
113        public static DBusMenuModel get(DBusConnection connection, string busName, string objectPath)
114        {
115                auto p = g_dbus_menu_model_get((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(busName), Str.toStringz(objectPath));
116               
117                if(p is null)
118                {
119                        return null;
120                }
121               
122                return ObjectG.getDObject!(DBusMenuModel)(cast(GDBusMenuModel*) p, true);
123        }
124}
Note: See TracBrowser for help on using the repository browser.