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  * Conversion parameters:
26  * inFile  = GtkStackSwitcher.html
27  * outPack = gtk
28  * outFile = StackSwitcher
29  * strct   = GtkStackSwitcher
30  * realStrct=
31  * ctorStrct=
32  * clss    = StackSwitcher
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_stack_switcher_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- gtk.Stack
47  * structWrap:
48  * 	- GtkStack* -> Stack
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module gtk.StackSwitcher;
55 
56 public  import gtkc.gtktypes;
57 
58 private import gtkc.gtk;
59 private import glib.ConstructionException;
60 private import gobject.ObjectG;
61 
62 
63 private import gtk.Stack;
64 
65 
66 
67 private import gtk.Box;
68 
69 /**
70  * The GtkStackSwitcher widget acts as a controller for a
71  * GtkStack; it shows a row of buttons to switch between
72  * the various pages of the associated stack widget.
73  *
74  * All the content for the buttons comes from the child properties
75  * of the GtkStack.
76  *
77  * It is possible to associate multiple GtkStackSwitcher widgets
78  * with the same stack widget.
79  *
80  * The GtkStackSwitcher widget was added in 3.10.
81  */
82 public class StackSwitcher : Box
83 {
84 	
85 	/** the main Gtk struct */
86 	protected GtkStackSwitcher* gtkStackSwitcher;
87 	
88 	
89 	public GtkStackSwitcher* getStackSwitcherStruct()
90 	{
91 		return gtkStackSwitcher;
92 	}
93 	
94 	
95 	/** the main Gtk struct as a void* */
96 	protected override void* getStruct()
97 	{
98 		return cast(void*)gtkStackSwitcher;
99 	}
100 	
101 	/**
102 	 * Sets our main struct and passes it to the parent class
103 	 */
104 	public this (GtkStackSwitcher* gtkStackSwitcher)
105 	{
106 		super(cast(GtkBox*)gtkStackSwitcher);
107 		this.gtkStackSwitcher = gtkStackSwitcher;
108 	}
109 	
110 	protected override void setStruct(GObject* obj)
111 	{
112 		super.setStruct(obj);
113 		gtkStackSwitcher = cast(GtkStackSwitcher*)obj;
114 	}
115 	
116 	/**
117 	 */
118 	
119 	/**
120 	 * Create a new GtkStackSwitcher.
121 	 * Throws: ConstructionException GTK+ fails to create the object.
122 	 */
123 	public this ()
124 	{
125 		// GtkWidget * gtk_stack_switcher_new (void);
126 		auto p = gtk_stack_switcher_new();
127 		if(p is null)
128 		{
129 			throw new ConstructionException("null returned by gtk_stack_switcher_new()");
130 		}
131 		this(cast(GtkStackSwitcher*) p);
132 	}
133 	
134 	/**
135 	 * Sets the stack to control.
136 	 * Params:
137 	 * stack = a GtkStack. [allow-none]
138 	 * Since 3.10
139 	 */
140 	public void setStack(Stack stack)
141 	{
142 		// void gtk_stack_switcher_set_stack (GtkStackSwitcher *switcher,  GtkStack *stack);
143 		gtk_stack_switcher_set_stack(gtkStackSwitcher, (stack is null) ? null : stack.getStackStruct());
144 	}
145 	
146 	/**
147 	 * Retrieves the stack.
148 	 * See gtk_stack_switcher_set_stack().
149 	 * Returns: the stack, or NULL if none has been set explicitly. [transfer none] Since 3.10
150 	 */
151 	public Stack getStack()
152 	{
153 		// GtkStack * gtk_stack_switcher_get_stack (GtkStackSwitcher *switcher);
154 		auto p = gtk_stack_switcher_get_stack(gtkStackSwitcher);
155 		
156 		if(p is null)
157 		{
158 			return null;
159 		}
160 		
161 		return ObjectG.getDObject!(Stack)(cast(GtkStack*) p);
162 	}
163 }