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