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  * Conversion parameters:
26  * inFile  = GtkSourceStyleSchemeManager.html
27  * outPack = gsv
28  * outFile = SourceStyleSchemeManager
29  * strct   = GtkSourceStyleSchemeManager
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceStyleSchemeManager
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_source_style_scheme_manager_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gsv.SourceStyleScheme
48  * structWrap:
49  * 	- GtkSourceStyleScheme* -> SourceStyleScheme
50  * 	- GtkSourceStyleSchemeManager* -> SourceStyleSchemeManager
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module gsv.SourceStyleSchemeManager;
57 
58 public  import gsvc.gsvtypes;
59 
60 private import gsvc.gsv;
61 private import glib.ConstructionException;
62 private import gobject.ObjectG;
63 
64 
65 private import glib.Str;
66 private import gsv.SourceStyleScheme;
67 
68 
69 
70 private import gobject.ObjectG;
71 
72 /**
73  * Object which provides access to GtkSourceStyleSchemes.
74  */
75 public class SourceStyleSchemeManager : ObjectG
76 {
77 	
78 	/** the main Gtk struct */
79 	protected GtkSourceStyleSchemeManager* gtkSourceStyleSchemeManager;
80 	
81 	
82 	public GtkSourceStyleSchemeManager* getSourceStyleSchemeManagerStruct()
83 	{
84 		return gtkSourceStyleSchemeManager;
85 	}
86 	
87 	
88 	/** the main Gtk struct as a void* */
89 	protected override void* getStruct()
90 	{
91 		return cast(void*)gtkSourceStyleSchemeManager;
92 	}
93 	
94 	/**
95 	 * Sets our main struct and passes it to the parent class
96 	 */
97 	public this (GtkSourceStyleSchemeManager* gtkSourceStyleSchemeManager)
98 	{
99 		super(cast(GObject*)gtkSourceStyleSchemeManager);
100 		this.gtkSourceStyleSchemeManager = gtkSourceStyleSchemeManager;
101 	}
102 	
103 	protected override void setStruct(GObject* obj)
104 	{
105 		super.setStruct(obj);
106 		gtkSourceStyleSchemeManager = cast(GtkSourceStyleSchemeManager*)obj;
107 	}
108 	
109 	/**
110 	 */
111 	
112 	/**
113 	 * Creates a new style manager. If you do not need more than one style
114 	 * manager then use gtk_source_style_scheme_manager_get_default() instead.
115 	 * Throws: ConstructionException GTK+ fails to create the object.
116 	 */
117 	public this ()
118 	{
119 		// GtkSourceStyleSchemeManager * gtk_source_style_scheme_manager_new  (void);
120 		auto p = gtk_source_style_scheme_manager_new();
121 		if(p is null)
122 		{
123 			throw new ConstructionException("null returned by gtk_source_style_scheme_manager_new()");
124 		}
125 		this(cast(GtkSourceStyleSchemeManager*) p);
126 	}
127 	
128 	/**
129 	 * Returns the default GtkSourceStyleSchemeManager instance.
130 	 * Returns: a GtkSourceStyleSchemeManager. Return value is owned by GtkSourceView library and must not be unref'ed. [transfer none]
131 	 */
132 	public static SourceStyleSchemeManager getDefault()
133 	{
134 		// GtkSourceStyleSchemeManager * gtk_source_style_scheme_manager_get_default  (void);
135 		auto p = gtk_source_style_scheme_manager_get_default();
136 		
137 		if(p is null)
138 		{
139 			return null;
140 		}
141 		
142 		return ObjectG.getDObject!(SourceStyleSchemeManager)(cast(GtkSourceStyleSchemeManager*) p);
143 	}
144 	
145 	/**
146 	 * Sets the list of directories where the manager looks for
147 	 * style scheme files.
148 	 * If path is NULL, the search path is reset to default.
149 	 * Params:
150 	 * path = a NULL-terminated array of strings or NULL. [array zero-terminated=1][allow-none]
151 	 */
152 	public void setSearchPath(string[] path)
153 	{
154 		// void gtk_source_style_scheme_manager_set_search_path  (GtkSourceStyleSchemeManager *manager,  gchar **path);
155 		gtk_source_style_scheme_manager_set_search_path(gtkSourceStyleSchemeManager, Str.toStringzArray(path));
156 	}
157 	
158 	/**
159 	 * Appends path to the list of directories where the manager looks for
160 	 * style scheme files.
161 	 * See gtk_source_style_scheme_manager_set_search_path() for details.
162 	 * Params:
163 	 * path = a directory or a filename.
164 	 */
165 	public void appendSearchPath(string path)
166 	{
167 		// void gtk_source_style_scheme_manager_append_search_path  (GtkSourceStyleSchemeManager *manager,  const gchar *path);
168 		gtk_source_style_scheme_manager_append_search_path(gtkSourceStyleSchemeManager, Str.toStringz(path));
169 	}
170 	
171 	/**
172 	 * Prepends path to the list of directories where the manager looks
173 	 * for style scheme files.
174 	 * See gtk_source_style_scheme_manager_set_search_path() for details.
175 	 * Params:
176 	 * path = a directory or a filename.
177 	 */
178 	public void prependSearchPath(string path)
179 	{
180 		// void gtk_source_style_scheme_manager_prepend_search_path  (GtkSourceStyleSchemeManager *manager,  const gchar *path);
181 		gtk_source_style_scheme_manager_prepend_search_path(gtkSourceStyleSchemeManager, Str.toStringz(path));
182 	}
183 	
184 	/**
185 	 * Returns the current search path for the manager.
186 	 * See gtk_source_style_scheme_manager_set_search_path() for details.
187 	 * Returns: a NULL-terminated array of string containing the search path. The array is owned by the manager and must not be modified. [array zero-terminated=1][transfer none]
188 	 */
189 	public string[] getSearchPath()
190 	{
191 		// const gchar * const * gtk_source_style_scheme_manager_get_search_path  (GtkSourceStyleSchemeManager *manager);
192 		return Str.toStringArray(gtk_source_style_scheme_manager_get_search_path(gtkSourceStyleSchemeManager));
193 	}
194 	
195 	/**
196 	 * Returns the ids of the available style schemes.
197 	 * Returns: a NULL-terminated array of string containing the ids of the available style schemes or NULL if no style scheme is available. The array is sorted alphabetically according to the scheme name. The array is owned by the manager and must not be modified. [array zero-terminated=1][transfer none]
198 	 */
199 	public string[] getSchemeIds()
200 	{
201 		// const gchar * const * gtk_source_style_scheme_manager_get_scheme_ids  (GtkSourceStyleSchemeManager *manager);
202 		return Str.toStringArray(gtk_source_style_scheme_manager_get_scheme_ids(gtkSourceStyleSchemeManager));
203 	}
204 	
205 	/**
206 	 * Looks up style scheme by id.
207 	 * Params:
208 	 * schemeId = style scheme id to find.
209 	 * Returns: a GtkSourceStyleScheme object. Returned value is owned by manager and must not be unref'ed. [transfer none]
210 	 */
211 	public SourceStyleScheme getScheme(string schemeId)
212 	{
213 		// GtkSourceStyleScheme * gtk_source_style_scheme_manager_get_scheme  (GtkSourceStyleSchemeManager *manager,  const gchar *scheme_id);
214 		auto p = gtk_source_style_scheme_manager_get_scheme(gtkSourceStyleSchemeManager, Str.toStringz(schemeId));
215 		
216 		if(p is null)
217 		{
218 			return null;
219 		}
220 		
221 		return ObjectG.getDObject!(SourceStyleScheme)(cast(GtkSourceStyleScheme*) p);
222 	}
223 	
224 	/**
225 	 * Mark any currently cached information about the available style scehems
226 	 * as invalid. All the available style schemes will be reloaded next time
227 	 * the manager is accessed.
228 	 */
229 	public void forceRescan()
230 	{
231 		// void gtk_source_style_scheme_manager_force_rescan  (GtkSourceStyleSchemeManager *manager);
232 		gtk_source_style_scheme_manager_force_rescan(gtkSourceStyleSchemeManager);
233 	}
234 }