1 /*
2  * This file is part of d-handy.
3  *
4  * d-handy 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  * d-handy 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 d-handy; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 module handy.PreferencesGroup;
20 
21 private import glib.ConstructionException;
22 private import glib.Str;
23 private import gobject.ObjectG;
24 private import gtk.Bin;
25 private import gtk.BuildableIF;
26 private import gtk.BuildableT;
27 private import gtk.Widget;
28 private import handy.c.functions;
29 public  import handy.c.types;
30 
31 
32 /** */
33 public class PreferencesGroup : Bin
34 {
35 	/** the main Gtk struct */
36 	protected HdyPreferencesGroup* hdyPreferencesGroup;
37 
38 	/** Get the main Gtk struct */
39 	public HdyPreferencesGroup* getPreferencesGroupStruct(bool transferOwnership = false)
40 	{
41 		if (transferOwnership)
42 			ownedRef = false;
43 		return hdyPreferencesGroup;
44 	}
45 
46 	/** the main Gtk struct as a void* */
47 	protected override void* getStruct()
48 	{
49 		return cast(void*)hdyPreferencesGroup;
50 	}
51 
52 	/**
53 	 * Sets our main struct and passes it to the parent class.
54 	 */
55 	public this (HdyPreferencesGroup* hdyPreferencesGroup, bool ownedRef = false)
56 	{
57 		this.hdyPreferencesGroup = hdyPreferencesGroup;
58 		super(cast(GtkBin*)hdyPreferencesGroup, ownedRef);
59 	}
60 
61 
62 	/** */
63 	public static GType getType()
64 	{
65 		return hdy_preferences_group_get_type();
66 	}
67 
68 	/**
69 	 * Creates a new #HdyPreferencesGroup.
70 	 *
71 	 * Returns: a new #HdyPreferencesGroup
72 	 *
73 	 * Since: 0.0.10
74 	 *
75 	 * Throws: ConstructionException GTK+ fails to create the object.
76 	 */
77 	public this()
78 	{
79 		auto __p = hdy_preferences_group_new();
80 
81 		if(__p is null)
82 		{
83 			throw new ConstructionException("null returned by new");
84 		}
85 
86 		this(cast(HdyPreferencesGroup*) __p);
87 	}
88 
89 	/**
90 	 * Returns: the description of @self.
91 	 *
92 	 * Since: 0.0.10
93 	 */
94 	public string getDescription()
95 	{
96 		return Str.toString(hdy_preferences_group_get_description(hdyPreferencesGroup));
97 	}
98 
99 	/**
100 	 * Gets the title of @self.
101 	 *
102 	 * Returns: the title of @self.
103 	 *
104 	 * Since: 0.0.10
105 	 */
106 	public string getTitle()
107 	{
108 		return Str.toString(hdy_preferences_group_get_title(hdyPreferencesGroup));
109 	}
110 
111 	/**
112 	 * Sets the description for @self.
113 	 *
114 	 * Params:
115 	 *     description = the description
116 	 *
117 	 * Since: 0.0.10
118 	 */
119 	public void setDescription(string description)
120 	{
121 		hdy_preferences_group_set_description(hdyPreferencesGroup, Str.toStringz(description));
122 	}
123 
124 	/**
125 	 * Sets the title for @self.
126 	 *
127 	 * Params:
128 	 *     title = the title
129 	 *
130 	 * Since: 0.0.10
131 	 */
132 	public void setTitle(string title)
133 	{
134 		hdy_preferences_group_set_title(hdyPreferencesGroup, Str.toStringz(title));
135 	}
136 }