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