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.CarouselIndicatorLines;
20 
21 private import glib.ConstructionException;
22 private import gobject.ObjectG;
23 private import gtk.BuildableIF;
24 private import gtk.BuildableT;
25 private import gtk.DrawingArea;
26 private import gtk.OrientableIF;
27 private import gtk.OrientableT;
28 private import gtk.Widget;
29 private import handy.Carousel;
30 private import handy.c.functions;
31 public  import handy.c.types;
32 
33 
34 /** */
35 public class CarouselIndicatorLines : DrawingArea, OrientableIF
36 {
37 	/** the main Gtk struct */
38 	protected HdyCarouselIndicatorLines* hdyCarouselIndicatorLines;
39 
40 	/** Get the main Gtk struct */
41 	public HdyCarouselIndicatorLines* getCarouselIndicatorLinesStruct(bool transferOwnership = false)
42 	{
43 		if (transferOwnership)
44 			ownedRef = false;
45 		return hdyCarouselIndicatorLines;
46 	}
47 
48 	/** the main Gtk struct as a void* */
49 	protected override void* getStruct()
50 	{
51 		return cast(void*)hdyCarouselIndicatorLines;
52 	}
53 
54 	/**
55 	 * Sets our main struct and passes it to the parent class.
56 	 */
57 	public this (HdyCarouselIndicatorLines* hdyCarouselIndicatorLines, bool ownedRef = false)
58 	{
59 		this.hdyCarouselIndicatorLines = hdyCarouselIndicatorLines;
60 		super(cast(GtkDrawingArea*)hdyCarouselIndicatorLines, ownedRef);
61 	}
62 
63 	// add the Orientable capabilities
64 	mixin OrientableT!(HdyCarouselIndicatorLines);
65 
66 
67 	/** */
68 	public static GType getType()
69 	{
70 		return hdy_carousel_indicator_lines_get_type();
71 	}
72 
73 	/**
74 	 * Create a new #HdyCarouselIndicatorLines widget.
75 	 *
76 	 * Returns: The newly created #HdyCarouselIndicatorLines widget
77 	 *
78 	 * Since: 1.0
79 	 *
80 	 * Throws: ConstructionException GTK+ fails to create the object.
81 	 */
82 	public this()
83 	{
84 		auto __p = hdy_carousel_indicator_lines_new();
85 
86 		if(__p is null)
87 		{
88 			throw new ConstructionException("null returned by new");
89 		}
90 
91 		this(cast(HdyCarouselIndicatorLines*) __p, true);
92 	}
93 
94 	/**
95 	 * Get the #HdyCarousel the indicator uses.
96 	 *
97 	 * See: hdy_carousel_indicator_lines_set_carousel()
98 	 *
99 	 * Returns: the #HdyCarousel, or %NULL if none has been set
100 	 *
101 	 * Since: 1.0
102 	 */
103 	public Carousel getCarousel()
104 	{
105 		auto __p = hdy_carousel_indicator_lines_get_carousel(hdyCarouselIndicatorLines);
106 
107 		if(__p is null)
108 		{
109 			return null;
110 		}
111 
112 		return ObjectG.getDObject!(Carousel)(cast(HdyCarousel*) __p);
113 	}
114 
115 	/**
116 	 * Sets the #HdyCarousel to use.
117 	 *
118 	 * Params:
119 	 *     carousel = a #HdyCarousel
120 	 *
121 	 * Since: 1.0
122 	 */
123 	public void setCarousel(Carousel carousel)
124 	{
125 		hdy_carousel_indicator_lines_set_carousel(hdyCarouselIndicatorLines, (carousel is null) ? null : carousel.getCarouselStruct());
126 	}
127 }