1 /*
2  * This file is part of d-dazzle.
3  *
4  * d-dazzle 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-dazzle 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-dazzle; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 module dazzle.PreferencesView;
20 
21 private import dazzle.PreferencesIF;
22 private import dazzle.PreferencesT;
23 private import dazzle.c.functions;
24 public  import dazzle.c.types;
25 private import glib.ConstructionException;
26 private import gobject.ObjectG;
27 private import gtk.Bin;
28 private import gtk.BuildableIF;
29 private import gtk.BuildableT;
30 private import gtk.Widget;
31 
32 
33 /** */
34 public class PreferencesView : Bin, PreferencesIF
35 {
36 	/** the main Gtk struct */
37 	protected DzlPreferencesView* dzlPreferencesView;
38 
39 	/** Get the main Gtk struct */
40 	public DzlPreferencesView* getPreferencesViewStruct(bool transferOwnership = false)
41 	{
42 		if (transferOwnership)
43 			ownedRef = false;
44 		return dzlPreferencesView;
45 	}
46 
47 	/** the main Gtk struct as a void* */
48 	protected override void* getStruct()
49 	{
50 		return cast(void*)dzlPreferencesView;
51 	}
52 
53 	/**
54 	 * Sets our main struct and passes it to the parent class.
55 	 */
56 	public this (DzlPreferencesView* dzlPreferencesView, bool ownedRef = false)
57 	{
58 		this.dzlPreferencesView = dzlPreferencesView;
59 		super(cast(GtkBin*)dzlPreferencesView, ownedRef);
60 	}
61 
62 	// add the Preferences capabilities
63 	mixin PreferencesT!(DzlPreferencesView);
64 
65 
66 	/** */
67 	public static GType getType()
68 	{
69 		return dzl_preferences_view_get_type();
70 	}
71 
72 	/** */
73 	public this()
74 	{
75 		auto p = dzl_preferences_view_new();
76 
77 		if(p is null)
78 		{
79 			throw new ConstructionException("null returned by new");
80 		}
81 
82 		this(cast(DzlPreferencesView*) p);
83 	}
84 
85 	/** */
86 	public bool getShowSearchEntry()
87 	{
88 		return dzl_preferences_view_get_show_search_entry(dzlPreferencesView) != 0;
89 	}
90 
91 	/** */
92 	public bool getUseSidebar()
93 	{
94 		return dzl_preferences_view_get_use_sidebar(dzlPreferencesView) != 0;
95 	}
96 
97 	/** */
98 	public void reapplyFilter()
99 	{
100 		dzl_preferences_view_reapply_filter(dzlPreferencesView);
101 	}
102 
103 	/** */
104 	public void setShowSearchEntry(bool showSearchEntry)
105 	{
106 		dzl_preferences_view_set_show_search_entry(dzlPreferencesView, showSearchEntry);
107 	}
108 
109 	/** */
110 	public void setUseSidebar(bool useSidebar)
111 	{
112 		dzl_preferences_view_set_use_sidebar(dzlPreferencesView, useSidebar);
113 	}
114 }