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 gsv.SourceStyleScheme;
26 
27 private import glib.Str;
28 private import gobject.ObjectG;
29 private import gsv.SourceStyle;
30 private import gsvc.gsv;
31 public  import gsvc.gsvtypes;
32 
33 
34 /** */
35 public class SourceStyleScheme : ObjectG
36 {
37 	/** the main Gtk struct */
38 	protected GtkSourceStyleScheme* gtkSourceStyleScheme;
39 
40 	/** Get the main Gtk struct */
41 	public GtkSourceStyleScheme* getSourceStyleSchemeStruct()
42 	{
43 		return gtkSourceStyleScheme;
44 	}
45 
46 	/** the main Gtk struct as a void* */
47 	protected override void* getStruct()
48 	{
49 		return cast(void*)gtkSourceStyleScheme;
50 	}
51 
52 	protected override void setStruct(GObject* obj)
53 	{
54 		gtkSourceStyleScheme = cast(GtkSourceStyleScheme*)obj;
55 		super.setStruct(obj);
56 	}
57 
58 	/**
59 	 * Sets our main struct and passes it to the parent class.
60 	 */
61 	public this (GtkSourceStyleScheme* gtkSourceStyleScheme, bool ownedRef = false)
62 	{
63 		this.gtkSourceStyleScheme = gtkSourceStyleScheme;
64 		super(cast(GObject*)gtkSourceStyleScheme, ownedRef);
65 	}
66 
67 
68 	/** */
69 	public static GType getType()
70 	{
71 		return gtk_source_style_scheme_get_type();
72 	}
73 
74 	/**
75 	 * Return: a
76 	 *     %NULL-terminated array containing the @scheme authors or %NULL if
77 	 *     no author is specified by the style scheme.
78 	 *
79 	 * Since: 2.0
80 	 */
81 	public string[] getAuthors()
82 	{
83 		return Str.toStringArray(gtk_source_style_scheme_get_authors(gtkSourceStyleScheme));
84 	}
85 
86 	/**
87 	 * Return: @scheme description (if defined), or %NULL.
88 	 *
89 	 * Since: 2.0
90 	 */
91 	public string getDescription()
92 	{
93 		return Str.toString(gtk_source_style_scheme_get_description(gtkSourceStyleScheme));
94 	}
95 
96 	/**
97 	 * Return: @scheme file name if the scheme was created
98 	 *     parsing a style scheme file or %NULL in the other cases.
99 	 *
100 	 * Since: 2.0
101 	 */
102 	public string getFilename()
103 	{
104 		return Str.toString(gtk_source_style_scheme_get_filename(gtkSourceStyleScheme));
105 	}
106 
107 	/**
108 	 * Return: @scheme id.
109 	 *
110 	 * Since: 2.0
111 	 */
112 	public string getId()
113 	{
114 		return Str.toString(gtk_source_style_scheme_get_id(gtkSourceStyleScheme));
115 	}
116 
117 	/**
118 	 * Return: @scheme name.
119 	 *
120 	 * Since: 2.0
121 	 */
122 	public string getName()
123 	{
124 		return Str.toString(gtk_source_style_scheme_get_name(gtkSourceStyleScheme));
125 	}
126 
127 	/**
128 	 *
129 	 * Params:
130 	 *     styleId = id of the style to retrieve.
131 	 * Return: style which corresponds to @style_id in
132 	 *     the @scheme, or %NULL when no style with this name found.  It is owned by
133 	 *     @scheme and may not be unref'ed.
134 	 *
135 	 * Since: 2.0
136 	 */
137 	public SourceStyle getStyle(string styleId)
138 	{
139 		auto p = gtk_source_style_scheme_get_style(gtkSourceStyleScheme, Str.toStringz(styleId));
140 		
141 		if(p is null)
142 		{
143 			return null;
144 		}
145 		
146 		return ObjectG.getDObject!(SourceStyle)(cast(GtkSourceStyle*) p);
147 	}
148 }