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 private import gtk.Stack;
63 
64 
65 private import gtk.Box;
66 
67 /**
68  * The GtkStackSwitcher widget acts as a controller for a
69  * GtkStack; it shows a row of buttons to switch between
70  * the various pages of the associated stack widget.
71  *
72  * All the content for the buttons comes from the child properties
73  * of the GtkStack.
74  *
75  * It is possible to associate multiple GtkStackSwitcher widgets
76  * with the same stack widget.
77  *
78  * The GtkStackSwitcher widget was added in 3.10.
79  */
80 public class StackSwitcher : Box
81 {
82 	
83 	/** the main Gtk struct */
84 	protected GtkStackSwitcher* gtkStackSwitcher;
85 	
86 	
87 	/** Get the main Gtk struct */
88 	public GtkStackSwitcher* getStackSwitcherStruct()
89 	{
90 		return gtkStackSwitcher;
91 	}
92 	
93 	
94 	/** the main Gtk struct as a void* */
95 	protected override void* getStruct()
96 	{
97 		return cast(void*)gtkStackSwitcher;
98 	}
99 	
100 	/**
101 	 * Sets our main struct and passes it to the parent class
102 	 */
103 	public this (GtkStackSwitcher* gtkStackSwitcher)
104 	{
105 		super(cast(GtkBox*)gtkStackSwitcher);
106 		this.gtkStackSwitcher = gtkStackSwitcher;
107 	}
108 	
109 	protected override void setStruct(GObject* obj)
110 	{
111 		super.setStruct(obj);
112 		gtkStackSwitcher = cast(GtkStackSwitcher*)obj;
113 	}
114 	
115 	/**
116 	 */
117 	
118 	/**
119 	 * Create a new GtkStackSwitcher.
120 	 * Throws: ConstructionException GTK+ fails to create the object.
121 	 */
122 	public this ()
123 	{
124 		// GtkWidget * gtk_stack_switcher_new (void);
125 		auto p = gtk_stack_switcher_new();
126 		if(p is null)
127 		{
128 			throw new ConstructionException("null returned by gtk_stack_switcher_new()");
129 		}
130 		this(cast(GtkStackSwitcher*) p);
131 	}
132 	
133 	/**
134 	 * Sets the stack to control.
135 	 * Params:
136 	 * stack = a GtkStack. [allow-none]
137 	 * Since 3.10
138 	 */
139 	public void setStack(Stack stack)
140 	{
141 		// void gtk_stack_switcher_set_stack (GtkStackSwitcher *switcher,  GtkStack *stack);
142 		gtk_stack_switcher_set_stack(gtkStackSwitcher, (stack is null) ? null : stack.getStackStruct());
143 	}
144 	
145 	/**
146 	 * Retrieves the stack.
147 	 * See gtk_stack_switcher_set_stack().
148 	 * Returns: the stack, or NULL if none has been set explicitly. [transfer none] Since 3.10
149 	 */
150 	public Stack getStack()
151 	{
152 		// GtkStack * gtk_stack_switcher_get_stack (GtkStackSwitcher *switcher);
153 		auto p = gtk_stack_switcher_get_stack(gtkStackSwitcher);
154 		
155 		if(p is null)
156 		{
157 			return null;
158 		}
159 		
160 		return ObjectG.getDObject!(Stack)(cast(GtkStack*) p);
161 	}
162 }