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

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

Initial release

File size: 3.0 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.IOModuleScope;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import glib.ConstructionException;
26private import glib.Str;
27private import gobject.ObjectG;
28
29
30/**
31 * Represents a scope for loading IO modules. A scope can be used for blocking
32 * duplicate modules, or blocking a module you don't want to load.
33 *
34 * The scope can be used with g_io_modules_load_all_in_directory_with_scope()
35 * or g_io_modules_scan_all_in_directory_with_scope().
36 *
37 * Since: 2.30
38 */
39public class IOModuleScope
40{
41        /** the main Gtk struct */
42        protected GIOModuleScope* gIOModuleScope;
43        protected bool ownedRef;
44
45        /** Get the main Gtk struct */
46        public GIOModuleScope* getIOModuleScopeStruct()
47        {
48                return gIOModuleScope;
49        }
50
51        /** the main Gtk struct as a void* */
52        protected void* getStruct()
53        {
54                return cast(void*)gIOModuleScope;
55        }
56
57        /**
58         * Sets our main struct and passes it to the parent class.
59         */
60        public this (GIOModuleScope* gIOModuleScope, bool ownedRef = false)
61        {
62                this.gIOModuleScope = gIOModuleScope;
63                this.ownedRef = ownedRef;
64        }
65
66
67        /**
68         * Block modules with the given @basename from being loaded when
69         * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
70         * or g_io_modules_load_all_in_directory_with_scope().
71         *
72         * Params:
73         *     basename = the basename to block
74         *
75         * Since: 2.30
76         */
77        public void block(string basename)
78        {
79                g_io_module_scope_block(gIOModuleScope, Str.toStringz(basename));
80        }
81
82        /**
83         * Free a module scope.
84         *
85         * Since: 2.30
86         */
87        public void free()
88        {
89                g_io_module_scope_free(gIOModuleScope);
90        }
91
92        /**
93         * Create a new scope for loading of IO modules. A scope can be used for
94         * blocking duplicate modules, or blocking a module you don't want to load.
95         *
96         * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
97         * which have the same base name as a module that has already been seen
98         * in this scope.
99         *
100         * Params:
101         *     flags = flags for the new scope
102         *
103         * Returns: the new module scope
104         *
105         * Since: 2.30
106         *
107         * Throws: ConstructionException GTK+ fails to create the object.
108         */
109        public this(GIOModuleScopeFlags flags)
110        {
111                auto p = g_io_module_scope_new(flags);
112               
113                if(p is null)
114                {
115                        throw new ConstructionException("null returned by new");
116                }
117               
118                this(cast(GIOModuleScope*) p);
119        }
120}
Note: See TracBrowser for help on using the repository browser.