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.ExpanderRow;
20 
21 private import glib.ConstructionException;
22 private import gobject.ObjectG;
23 private import handy.ActionRow;
24 private import handy.c.functions;
25 public  import handy.c.types;
26 
27 
28 /** */
29 public class ExpanderRow : ActionRow
30 {
31 	/** the main Gtk struct */
32 	protected HdyExpanderRow* hdyExpanderRow;
33 
34 	/** Get the main Gtk struct */
35 	public HdyExpanderRow* getExpanderRowStruct(bool transferOwnership = false)
36 	{
37 		if (transferOwnership)
38 			ownedRef = false;
39 		return hdyExpanderRow;
40 	}
41 
42 	/** the main Gtk struct as a void* */
43 	protected override void* getStruct()
44 	{
45 		return cast(void*)hdyExpanderRow;
46 	}
47 
48 	/**
49 	 * Sets our main struct and passes it to the parent class.
50 	 */
51 	public this (HdyExpanderRow* hdyExpanderRow, bool ownedRef = false)
52 	{
53 		this.hdyExpanderRow = hdyExpanderRow;
54 		super(cast(HdyActionRow*)hdyExpanderRow, ownedRef);
55 	}
56 
57 
58 	/** */
59 	public static GType getType()
60 	{
61 		return hdy_expander_row_get_type();
62 	}
63 
64 	/**
65 	 * Creates a new #HdyExpanderRow.
66 	 *
67 	 * Returns: a new #HdyExpanderRow
68 	 *
69 	 * Since: 0.0.6
70 	 *
71 	 * Throws: ConstructionException GTK+ fails to create the object.
72 	 */
73 	public this()
74 	{
75 		auto p = hdy_expander_row_new();
76 
77 		if(p is null)
78 		{
79 			throw new ConstructionException("null returned by new");
80 		}
81 
82 		this(cast(HdyExpanderRow*) p);
83 	}
84 
85 	/**
86 	 * Gets whether the expansion of @self is enabled.
87 	 *
88 	 * Returns: whether the expansion of @self is enabled.
89 	 *
90 	 * Since: 0.0.6
91 	 */
92 	public bool getEnableExpansion()
93 	{
94 		return hdy_expander_row_get_enable_expansion(hdyExpanderRow) != 0;
95 	}
96 
97 	/** */
98 	public bool getExpanded()
99 	{
100 		return hdy_expander_row_get_expanded(hdyExpanderRow) != 0;
101 	}
102 
103 	/**
104 	 * Gets whether the switch enabling the expansion of @self is visible.
105 	 *
106 	 * Returns: whether the switch enabling the expansion of @self is visible.
107 	 *
108 	 * Since: 0.0.6
109 	 */
110 	public bool getShowEnableSwitch()
111 	{
112 		return hdy_expander_row_get_show_enable_switch(hdyExpanderRow) != 0;
113 	}
114 
115 	/**
116 	 * Sets whether the expansion of @self is enabled.
117 	 *
118 	 * Params:
119 	 *     enableExpansion = %TRUE to enable the expansion
120 	 *
121 	 * Since: 0.0.6
122 	 */
123 	public void setEnableExpansion(bool enableExpansion)
124 	{
125 		hdy_expander_row_set_enable_expansion(hdyExpanderRow, enableExpansion);
126 	}
127 
128 	/** */
129 	public void setExpanded(bool expanded)
130 	{
131 		hdy_expander_row_set_expanded(hdyExpanderRow, expanded);
132 	}
133 
134 	/**
135 	 * Sets whether the switch enabling the expansion of @self is visible.
136 	 *
137 	 * Params:
138 	 *     showEnableSwitch = %TRUE to show the switch enabling the expansion
139 	 *
140 	 * Since: 0.0.6
141 	 */
142 	public void setShowEnableSwitch(bool showEnableSwitch)
143 	{
144 		hdy_expander_row_set_show_enable_switch(hdyExpanderRow, showEnableSwitch);
145 	}
146 }