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.PreferencesPage;
20 
21 private import glib.ConstructionException;
22 private import glib.Str;
23 private import gobject.ObjectG;
24 private import gtk.BuildableIF;
25 private import gtk.BuildableT;
26 private import gtk.ScrolledWindow;
27 private import handy.c.functions;
28 public  import handy.c.types;
29 
30 
31 /** */
32 public class PreferencesPage : ScrolledWindow
33 {
34 	/** the main Gtk struct */
35 	protected HdyPreferencesPage* hdyPreferencesPage;
36 
37 	/** Get the main Gtk struct */
38 	public HdyPreferencesPage* getPreferencesPageStruct(bool transferOwnership = false)
39 	{
40 		if (transferOwnership)
41 			ownedRef = false;
42 		return hdyPreferencesPage;
43 	}
44 
45 	/** the main Gtk struct as a void* */
46 	protected override void* getStruct()
47 	{
48 		return cast(void*)hdyPreferencesPage;
49 	}
50 
51 	/**
52 	 * Sets our main struct and passes it to the parent class.
53 	 */
54 	public this (HdyPreferencesPage* hdyPreferencesPage, bool ownedRef = false)
55 	{
56 		this.hdyPreferencesPage = hdyPreferencesPage;
57 		super(cast(GtkScrolledWindow*)hdyPreferencesPage, ownedRef);
58 	}
59 
60 
61 	/** */
62 	public static GType getType()
63 	{
64 		return hdy_preferences_page_get_type();
65 	}
66 
67 	/**
68 	 * Creates a new #HdyPreferencesPage.
69 	 *
70 	 * Returns: a new #HdyPreferencesPage
71 	 *
72 	 * Since: 0.0.10
73 	 *
74 	 * Throws: ConstructionException GTK+ fails to create the object.
75 	 */
76 	public this()
77 	{
78 		auto p = hdy_preferences_page_new();
79 
80 		if(p is null)
81 		{
82 			throw new ConstructionException("null returned by new");
83 		}
84 
85 		this(cast(HdyPreferencesPage*) p);
86 	}
87 
88 	/**
89 	 * Gets the icon name for @self, or %NULL.
90 	 *
91 	 * Returns: the icon name for @self, or %NULL.
92 	 *
93 	 * Since: 0.0.10
94 	 */
95 	public string getIconName()
96 	{
97 		return Str.toString(hdy_preferences_page_get_icon_name(hdyPreferencesPage));
98 	}
99 
100 	/**
101 	 * Gets the title of @self, or %NULL.
102 	 *
103 	 * Returns: the title of the @self, or %NULL.
104 	 *
105 	 * Since: 0.0.10
106 	 */
107 	public string getTitle()
108 	{
109 		return Str.toString(hdy_preferences_page_get_title(hdyPreferencesPage));
110 	}
111 
112 	/**
113 	 * Sets the icon name for @self.
114 	 *
115 	 * Params:
116 	 *     iconName = the icon name, or %NULL
117 	 *
118 	 * Since: 0.0.10
119 	 */
120 	public void setIconName(string iconName)
121 	{
122 		hdy_preferences_page_set_icon_name(hdyPreferencesPage, Str.toStringz(iconName));
123 	}
124 
125 	/**
126 	 * Sets the title of @self.
127 	 *
128 	 * Params:
129 	 *     title = the title of the page, or %NULL
130 	 *
131 	 * Since: 0.0.10
132 	 */
133 	public void setTitle(string title)
134 	{
135 		hdy_preferences_page_set_title(hdyPreferencesPage, Str.toStringz(title));
136 	}
137 }