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