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

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

Initial release

File size: 2.6 KB
RevLine 
[4841]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.SimplePermission;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Permission;
26private import glib.ConstructionException;
27private import gobject.ObjectG;
28
29
30/**
31 * #GSimplePermission is a trivial implementation of #GPermission that
32 * represents a permission that is either always or never allowed.  The
33 * value is given at construction and doesn't change.
34 *
35 * Calling request or release will result in errors.
36 */
37public class SimplePermission : Permission
38{
39        /** the main Gtk struct */
40        protected GSimplePermission* gSimplePermission;
41
42        /** Get the main Gtk struct */
43        public GSimplePermission* getSimplePermissionStruct()
44        {
45                return gSimplePermission;
46        }
47
48        /** the main Gtk struct as a void* */
49        protected override void* getStruct()
50        {
51                return cast(void*)gSimplePermission;
52        }
53
54        protected override void setStruct(GObject* obj)
55        {
56                gSimplePermission = cast(GSimplePermission*)obj;
57                super.setStruct(obj);
58        }
59
60        /**
61         * Sets our main struct and passes it to the parent class.
62         */
63        public this (GSimplePermission* gSimplePermission, bool ownedRef = false)
64        {
65                this.gSimplePermission = gSimplePermission;
66                super(cast(GPermission*)gSimplePermission, ownedRef);
67        }
68
69
70        /** */
71        public static GType getType()
72        {
73                return g_simple_permission_get_type();
74        }
75
76        /**
77         * Creates a new #GPermission instance that represents an action that is
78         * either always or never allowed.
79         *
80         * Params:
81         *     allowed = %TRUE if the action is allowed
82         *
83         * Returns: the #GSimplePermission, as a #GPermission
84         *
85         * Since: 2.26
86         *
87         * Throws: ConstructionException GTK+ fails to create the object.
88         */
89        public this(bool allowed)
90        {
91                auto p = g_simple_permission_new(allowed);
92               
93                if(p is null)
94                {
95                        throw new ConstructionException("null returned by new");
96                }
97               
98                this(cast(GSimplePermission*) p, true);
99        }
100}
Note: See TracBrowser for help on using the repository browser.