1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gio.IOExtensionPoint;
26 
27 private import gio.IOExtension;
28 private import gio.c.functions;
29 public  import gio.c.types;
30 private import glib.ListG;
31 private import glib.Str;
32 private import gobject.ObjectG;
33 
34 
35 /**
36  * #GIOExtensionPoint is an opaque data structure and can only be accessed
37  * using the following functions.
38  */
39 public class IOExtensionPoint
40 {
41 	/** the main Gtk struct */
42 	protected GIOExtensionPoint* gIOExtensionPoint;
43 	protected bool ownedRef;
44 
45 	/** Get the main Gtk struct */
46 	public GIOExtensionPoint* getIOExtensionPointStruct(bool transferOwnership = false)
47 	{
48 		if (transferOwnership)
49 			ownedRef = false;
50 		return gIOExtensionPoint;
51 	}
52 
53 	/** the main Gtk struct as a void* */
54 	protected void* getStruct()
55 	{
56 		return cast(void*)gIOExtensionPoint;
57 	}
58 
59 	/**
60 	 * Sets our main struct and passes it to the parent class.
61 	 */
62 	public this (GIOExtensionPoint* gIOExtensionPoint, bool ownedRef = false)
63 	{
64 		this.gIOExtensionPoint = gIOExtensionPoint;
65 		this.ownedRef = ownedRef;
66 	}
67 
68 
69 	/**
70 	 * Finds a #GIOExtension for an extension point by name.
71 	 *
72 	 * Params:
73 	 *     name = the name of the extension to get
74 	 *
75 	 * Returns: the #GIOExtension for @extension_point that has the
76 	 *     given name, or %NULL if there is no extension with that name
77 	 */
78 	public IOExtension getExtensionByName(string name)
79 	{
80 		auto __p = g_io_extension_point_get_extension_by_name(gIOExtensionPoint, Str.toStringz(name));
81 
82 		if(__p is null)
83 		{
84 			return null;
85 		}
86 
87 		return ObjectG.getDObject!(IOExtension)(cast(GIOExtension*) __p);
88 	}
89 
90 	/**
91 	 * Gets a list of all extensions that implement this extension point.
92 	 * The list is sorted by priority, beginning with the highest priority.
93 	 *
94 	 * Returns: a #GList of
95 	 *     #GIOExtensions. The list is owned by GIO and should not be
96 	 *     modified.
97 	 */
98 	public ListG getExtensions()
99 	{
100 		auto __p = g_io_extension_point_get_extensions(gIOExtensionPoint);
101 
102 		if(__p is null)
103 		{
104 			return null;
105 		}
106 
107 		return new ListG(cast(GList*) __p);
108 	}
109 
110 	/**
111 	 * Gets the required type for @extension_point.
112 	 *
113 	 * Returns: the #GType that all implementations must have,
114 	 *     or #G_TYPE_INVALID if the extension point has no required type
115 	 */
116 	public GType getRequiredType()
117 	{
118 		return g_io_extension_point_get_required_type(gIOExtensionPoint);
119 	}
120 
121 	/**
122 	 * Sets the required type for @extension_point to @type.
123 	 * All implementations must henceforth have this type.
124 	 *
125 	 * Params:
126 	 *     type = the #GType to require
127 	 */
128 	public void setRequiredType(GType type)
129 	{
130 		g_io_extension_point_set_required_type(gIOExtensionPoint, type);
131 	}
132 
133 	/**
134 	 * Registers @type as extension for the extension point with name
135 	 * @extension_point_name.
136 	 *
137 	 * If @type has already been registered as an extension for this
138 	 * extension point, the existing #GIOExtension object is returned.
139 	 *
140 	 * Params:
141 	 *     extensionPointName = the name of the extension point
142 	 *     type = the #GType to register as extension
143 	 *     extensionName = the name for the extension
144 	 *     priority = the priority for the extension
145 	 *
146 	 * Returns: a #GIOExtension object for #GType
147 	 */
148 	public static IOExtension implement(string extensionPointName, GType type, string extensionName, int priority)
149 	{
150 		auto __p = g_io_extension_point_implement(Str.toStringz(extensionPointName), type, Str.toStringz(extensionName), priority);
151 
152 		if(__p is null)
153 		{
154 			return null;
155 		}
156 
157 		return ObjectG.getDObject!(IOExtension)(cast(GIOExtension*) __p);
158 	}
159 
160 	/**
161 	 * Looks up an existing extension point.
162 	 *
163 	 * Params:
164 	 *     name = the name of the extension point
165 	 *
166 	 * Returns: the #GIOExtensionPoint, or %NULL if there
167 	 *     is no registered extension point with the given name.
168 	 */
169 	public static IOExtensionPoint lookup(string name)
170 	{
171 		auto __p = g_io_extension_point_lookup(Str.toStringz(name));
172 
173 		if(__p is null)
174 		{
175 			return null;
176 		}
177 
178 		return ObjectG.getDObject!(IOExtensionPoint)(cast(GIOExtensionPoint*) __p);
179 	}
180 
181 	/**
182 	 * Registers an extension point.
183 	 *
184 	 * Params:
185 	 *     name = The name of the extension point
186 	 *
187 	 * Returns: the new #GIOExtensionPoint. This object is
188 	 *     owned by GIO and should not be freed.
189 	 */
190 	public static IOExtensionPoint register(string name)
191 	{
192 		auto __p = g_io_extension_point_register(Str.toStringz(name));
193 
194 		if(__p is null)
195 		{
196 			return null;
197 		}
198 
199 		return ObjectG.getDObject!(IOExtensionPoint)(cast(GIOExtensionPoint*) __p);
200 	}
201 }