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

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

Initial release

File size: 5.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.IOExtensionPoint;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.IOExtension;
26private import glib.ListG;
27private import glib.Str;
28private import gobject.ObjectG;
29
30
31/**
32 * #GIOExtensionPoint is an opaque data structure and can only be accessed
33 * using the following functions.
34 */
35public class IOExtensionPoint
36{
37        /** the main Gtk struct */
38        protected GIOExtensionPoint* gIOExtensionPoint;
39        protected bool ownedRef;
40
41        /** Get the main Gtk struct */
42        public GIOExtensionPoint* getIOExtensionPointStruct()
43        {
44                return gIOExtensionPoint;
45        }
46
47        /** the main Gtk struct as a void* */
48        protected void* getStruct()
49        {
50                return cast(void*)gIOExtensionPoint;
51        }
52
53        /**
54         * Sets our main struct and passes it to the parent class.
55         */
56        public this (GIOExtensionPoint* gIOExtensionPoint, bool ownedRef = false)
57        {
58                this.gIOExtensionPoint = gIOExtensionPoint;
59                this.ownedRef = ownedRef;
60        }
61
62
63        /**
64         * Finds a #GIOExtension for an extension point by name.
65         *
66         * Params:
67         *     name = the name of the extension to get
68         *
69         * Returns: the #GIOExtension for @extension_point that has the
70         *     given name, or %NULL if there is no extension with that name
71         */
72        public IOExtension getExtensionByName(string name)
73        {
74                auto p = g_io_extension_point_get_extension_by_name(gIOExtensionPoint, Str.toStringz(name));
75               
76                if(p is null)
77                {
78                        return null;
79                }
80               
81                return ObjectG.getDObject!(IOExtension)(cast(GIOExtension*) p);
82        }
83
84        /**
85         * Gets a list of all extensions that implement this extension point.
86         * The list is sorted by priority, beginning with the highest priority.
87         *
88         * Returns: a #GList of
89         *     #GIOExtensions. The list is owned by GIO and should not be
90         *     modified.
91         */
92        public ListG getExtensions()
93        {
94                auto p = g_io_extension_point_get_extensions(gIOExtensionPoint);
95               
96                if(p is null)
97                {
98                        return null;
99                }
100               
101                return new ListG(cast(GList*) p);
102        }
103
104        /**
105         * Gets the required type for @extension_point.
106         *
107         * Returns: the #GType that all implementations must have,
108         *     or #G_TYPE_INVALID if the extension point has no required type
109         */
110        public GType getRequiredType()
111        {
112                return g_io_extension_point_get_required_type(gIOExtensionPoint);
113        }
114
115        /**
116         * Sets the required type for @extension_point to @type.
117         * All implementations must henceforth have this type.
118         *
119         * Params:
120         *     type = the #GType to require
121         */
122        public void setRequiredType(GType type)
123        {
124                g_io_extension_point_set_required_type(gIOExtensionPoint, type);
125        }
126
127        /**
128         * Registers @type as extension for the extension point with name
129         * @extension_point_name.
130         *
131         * If @type has already been registered as an extension for this
132         * extension point, the existing #GIOExtension object is returned.
133         *
134         * Params:
135         *     extensionPointName = the name of the extension point
136         *     type = the #GType to register as extension
137         *     extensionName = the name for the extension
138         *     priority = the priority for the extension
139         *
140         * Returns: a #GIOExtension object for #GType
141         */
142        public static IOExtension implement(string extensionPointName, GType type, string extensionName, int priority)
143        {
144                auto p = g_io_extension_point_implement(Str.toStringz(extensionPointName), type, Str.toStringz(extensionName), priority);
145               
146                if(p is null)
147                {
148                        return null;
149                }
150               
151                return ObjectG.getDObject!(IOExtension)(cast(GIOExtension*) p);
152        }
153
154        /**
155         * Looks up an existing extension point.
156         *
157         * Params:
158         *     name = the name of the extension point
159         *
160         * Returns: the #GIOExtensionPoint, or %NULL if there
161         *     is no registered extension point with the given name.
162         */
163        public static IOExtensionPoint lookup(string name)
164        {
165                auto p = g_io_extension_point_lookup(Str.toStringz(name));
166               
167                if(p is null)
168                {
169                        return null;
170                }
171               
172                return ObjectG.getDObject!(IOExtensionPoint)(cast(GIOExtensionPoint*) p);
173        }
174
175        /**
176         * Registers an extension point.
177         *
178         * Params:
179         *     name = The name of the extension point
180         *
181         * Returns: the new #GIOExtensionPoint. This object is
182         *     owned by GIO and should not be freed.
183         */
184        public static IOExtensionPoint register(string name)
185        {
186                auto p = g_io_extension_point_register(Str.toStringz(name));
187               
188                if(p is null)
189                {
190                        return null;
191                }
192               
193                return ObjectG.getDObject!(IOExtensionPoint)(cast(GIOExtensionPoint*) p);
194        }
195}
Note: See TracBrowser for help on using the repository browser.