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