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 gtk.StackSidebar;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Bin;
30 private import gtk.Stack;
31 private import gtk.Widget;
32 private import gtkc.gtk;
33 public  import gtkc.gtktypes;
34 
35 
36 /**
37  * A GtkStackSidebar enables you to quickly and easily provide a
38  * consistent "sidebar" object for your user interface.
39  * 
40  * In order to use a GtkStackSidebar, you simply use a GtkStack to
41  * organize your UI flow, and add the sidebar to your sidebar area. You
42  * can use gtk_stack_sidebar_set_stack() to connect the #GtkStackSidebar
43  * to the #GtkStack.
44  */
45 public class StackSidebar : Bin
46 {
47 	/** the main Gtk struct */
48 	protected GtkStackSidebar* gtkStackSidebar;
49 
50 	/** Get the main Gtk struct */
51 	public GtkStackSidebar* getStackSidebarStruct()
52 	{
53 		return gtkStackSidebar;
54 	}
55 
56 	/** the main Gtk struct as a void* */
57 	protected override void* getStruct()
58 	{
59 		return cast(void*)gtkStackSidebar;
60 	}
61 
62 	protected override void setStruct(GObject* obj)
63 	{
64 		gtkStackSidebar = cast(GtkStackSidebar*)obj;
65 		super.setStruct(obj);
66 	}
67 
68 	/**
69 	 * Sets our main struct and passes it to the parent class.
70 	 */
71 	public this (GtkStackSidebar* gtkStackSidebar, bool ownedRef = false)
72 	{
73 		this.gtkStackSidebar = gtkStackSidebar;
74 		super(cast(GtkBin*)gtkStackSidebar, ownedRef);
75 	}
76 
77 	/**
78 	 */
79 
80 	public static GType getType()
81 	{
82 		return gtk_stack_sidebar_get_type();
83 	}
84 
85 	/**
86 	 * Creates a new sidebar.
87 	 *
88 	 * Return: the new #GtkStackSidebar
89 	 *
90 	 * Since: 3.16
91 	 *
92 	 * Throws: ConstructionException GTK+ fails to create the object.
93 	 */
94 	public this()
95 	{
96 		auto p = gtk_stack_sidebar_new();
97 		
98 		if(p is null)
99 		{
100 			throw new ConstructionException("null returned by new");
101 		}
102 		
103 		this(cast(GtkStackSidebar*) p);
104 	}
105 
106 	/**
107 	 * Retrieves the stack.
108 	 * See gtk_stack_sidebar_set_stack().
109 	 *
110 	 * Return: the associated #GtkStack or
111 	 *     %NULL if none has been set explicitly
112 	 *
113 	 * Since: 3.16
114 	 */
115 	public Stack getStack()
116 	{
117 		auto p = gtk_stack_sidebar_get_stack(gtkStackSidebar);
118 		
119 		if(p is null)
120 		{
121 			return null;
122 		}
123 		
124 		return ObjectG.getDObject!(Stack)(cast(GtkStack*) p, true);
125 	}
126 
127 	/**
128 	 * Set the #GtkStack associated with this #GtkStackSidebar.
129 	 *
130 	 * The sidebar widget will automatically update according to the order
131 	 * (packing) and items within the given #GtkStack.
132 	 *
133 	 * Params:
134 	 *     stack = a #GtkStack
135 	 *
136 	 * Since: 3.16
137 	 */
138 	public void setStack(Stack stack)
139 	{
140 		gtk_stack_sidebar_set_stack(gtkStackSidebar, (stack is null) ? null : stack.getStackStruct());
141 	}
142 }