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  = GtkSourceLanguage.html
27  * outPack = gsv
28  * outFile = SourceLanguage
29  * strct   = GtkSourceLanguage
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceLanguage
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_source_iter_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * structWrap:
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gsv.SourceLanguage;
54 
55 public  import gsvc.gsvtypes;
56 
57 private import gsvc.gsv;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 
62 private import glib.Str;
63 
64 
65 
66 private import gobject.ObjectG;
67 
68 /**
69  * Description
70  * GtkSourceLanguage encapsulates syntax and highlighting styles for a
71  * particular language. Use GtkSourceLanguageManager to obtain a
72  * GtkSourceLanguage instance, and gtk_source_buffer_set_language() to apply it
73  * to a GtkSourceBuffer.
74  */
75 public class SourceLanguage : ObjectG
76 {
77 	
78 	/** the main Gtk struct */
79 	protected GtkSourceLanguage* gtkSourceLanguage;
80 	
81 	
82 	public GtkSourceLanguage* getSourceLanguageStruct()
83 	{
84 		return gtkSourceLanguage;
85 	}
86 	
87 	
88 	/** the main Gtk struct as a void* */
89 	protected override void* getStruct()
90 	{
91 		return cast(void*)gtkSourceLanguage;
92 	}
93 	
94 	/**
95 	 * Sets our main struct and passes it to the parent class
96 	 */
97 	public this (GtkSourceLanguage* gtkSourceLanguage)
98 	{
99 		super(cast(GObject*)gtkSourceLanguage);
100 		this.gtkSourceLanguage = gtkSourceLanguage;
101 	}
102 	
103 	protected override void setStruct(GObject* obj)
104 	{
105 		super.setStruct(obj);
106 		gtkSourceLanguage = cast(GtkSourceLanguage*)obj;
107 	}
108 	
109 	/**
110 	 */
111 	
112 	/**
113 	 * Returns the ID of the language. The ID is not locale-dependent.
114 	 * Returns: the ID of language. The returned string is owned by language and should not be freed or modified.
115 	 */
116 	public string gtkSourceLanguageGetId()
117 	{
118 		// const gchar * gtk_source_language_get_id (GtkSourceLanguage *language);
119 		return Str.toString(gtk_source_language_get_id(gtkSourceLanguage));
120 	}
121 	
122 	/**
123 	 * Returns the localized name of the language.
124 	 * Returns: the name of language. The returned string is owned by language and should not be freed or modified.
125 	 */
126 	public string gtkSourceLanguageGetName()
127 	{
128 		// const gchar * gtk_source_language_get_name (GtkSourceLanguage *language);
129 		return Str.toString(gtk_source_language_get_name(gtkSourceLanguage));
130 	}
131 	
132 	/**
133 	 * Returns the localized section of the language.
134 	 * Each language belong to a section (ex. HTML belogs to the
135 	 * Markup section).
136 	 * Returns: the section of language. The returned string is owned by language and should not be freed or modified.
137 	 */
138 	public string gtkSourceLanguageGetSection()
139 	{
140 		// const gchar * gtk_source_language_get_section (GtkSourceLanguage *language);
141 		return Str.toString(gtk_source_language_get_section(gtkSourceLanguage));
142 	}
143 	
144 	/**
145 	 * Returns whether the language should be hidden from the user.
146 	 * Returns: TRUE if the language should be hidden, FALSE otherwise.
147 	 */
148 	public int gtkSourceLanguageGetHidden()
149 	{
150 		// gboolean gtk_source_language_get_hidden (GtkSourceLanguage *language);
151 		return gtk_source_language_get_hidden(gtkSourceLanguage);
152 	}
153 	
154 	/**
155 	 * Params:
156 	 * name = metadata property name.
157 	 * Returns: value of property name stored in the metadata of language or NULL if language doesn't contain that metadata property. The returned string is owned by language and should not be freed or modified.
158 	 */
159 	public string gtkSourceLanguageGetMetadata(string name)
160 	{
161 		// const gchar * gtk_source_language_get_metadata (GtkSourceLanguage *language,  const gchar *name);
162 		return Str.toString(gtk_source_language_get_metadata(gtkSourceLanguage, Str.toStringz(name)));
163 	}
164 	
165 	/**
166 	 * Returns the mime types associated to this language. This is just
167 	 * an utility wrapper around gtk_source_language_get_metadata() to
168 	 * retrieve the "mimetypes" metadata property and split it into an
169 	 * array.
170 	 * Returns: a newly-allocated NULL terminated array containing the mime types or NULL if no mime types are found. The returned array must be freed with g_strfreev().
171 	 */
172 	public string[] gtkSourceLanguageGetMimeTypes()
173 	{
174 		// gchar ** gtk_source_language_get_mime_types (GtkSourceLanguage *language);
175 		return Str.toStringArray(gtk_source_language_get_mime_types(gtkSourceLanguage));
176 	}
177 	
178 	/**
179 	 * Returns the globs associated to this language. This is just
180 	 * an utility wrapper around gtk_source_language_get_metadata() to
181 	 * retrieve the "globs" metadata property and split it into an array.
182 	 * Returns: a newly-allocated NULL terminated array containing the globs or NULL if no globs are found. The returned array must be freed with g_strfreev().
183 	 */
184 	public string[] gtkSourceLanguageGetGlobs()
185 	{
186 		// gchar ** gtk_source_language_get_globs (GtkSourceLanguage *language);
187 		return Str.toStringArray(gtk_source_language_get_globs(gtkSourceLanguage));
188 	}
189 	
190 	/**
191 	 * Returns the name of the style with ID style_id defined by this language.
192 	 * Params:
193 	 * styleId = a style ID
194 	 * Returns: the name of the style with ID style_id defined by this language or NULL if the style has no name or there is no style with ID style_id defined by this language. The returned string is owned by the language and must not be modified.
195 	 */
196 	public string gtkSourceLanguageGetStyleName(string styleId)
197 	{
198 		// const gchar * gtk_source_language_get_style_name (GtkSourceLanguage *language,  const gchar *style_id);
199 		return Str.toString(gtk_source_language_get_style_name(gtkSourceLanguage, Str.toStringz(styleId)));
200 	}
201 	
202 	/**
203 	 * Returns the ids of the styles defined by this language.
204 	 * Returns: a NULL terminated array containing ids of the styles defined by this language or NULL if no style is defined. The returned array must be freed with g_strfreev().
205 	 */
206 	public string[] gtkSourceLanguageGetStyleIds()
207 	{
208 		// gchar ** gtk_source_language_get_style_ids (GtkSourceLanguage *language);
209 		return Str.toStringArray(gtk_source_language_get_style_ids(gtkSourceLanguage));
210 	}
211 }