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.PreferencesGroup; 20 21 private import glib.ConstructionException; 22 private import glib.Str; 23 private import gobject.ObjectG; 24 private import gtk.Box; 25 private import gtk.BuildableIF; 26 private import gtk.BuildableT; 27 private import gtk.OrientableIF; 28 private import gtk.OrientableT; 29 private import handy.c.functions; 30 public import handy.c.types; 31 32 33 /** */ 34 public class PreferencesGroup : Box 35 { 36 /** the main Gtk struct */ 37 protected HdyPreferencesGroup* hdyPreferencesGroup; 38 39 /** Get the main Gtk struct */ 40 public HdyPreferencesGroup* getPreferencesGroupStruct(bool transferOwnership = false) 41 { 42 if (transferOwnership) 43 ownedRef = false; 44 return hdyPreferencesGroup; 45 } 46 47 /** the main Gtk struct as a void* */ 48 protected override void* getStruct() 49 { 50 return cast(void*)hdyPreferencesGroup; 51 } 52 53 /** 54 * Sets our main struct and passes it to the parent class. 55 */ 56 public this (HdyPreferencesGroup* hdyPreferencesGroup, bool ownedRef = false) 57 { 58 this.hdyPreferencesGroup = hdyPreferencesGroup; 59 super(cast(GtkBox*)hdyPreferencesGroup, ownedRef); 60 } 61 62 63 /** */ 64 public static GType getType() 65 { 66 return hdy_preferences_group_get_type(); 67 } 68 69 /** 70 * Creates a new #HdyPreferencesGroup. 71 * 72 * Returns: a new #HdyPreferencesGroup 73 * 74 * Since: 0.0.10 75 * 76 * Throws: ConstructionException GTK+ fails to create the object. 77 */ 78 public this() 79 { 80 auto p = hdy_preferences_group_new(); 81 82 if(p is null) 83 { 84 throw new ConstructionException("null returned by new"); 85 } 86 87 this(cast(HdyPreferencesGroup*) p); 88 } 89 90 /** 91 * Returns: the description of @self. 92 * 93 * Since: 0.0.10 94 */ 95 public string getDescription() 96 { 97 return Str.toString(hdy_preferences_group_get_description(hdyPreferencesGroup)); 98 } 99 100 /** 101 * Gets the title of @self. 102 * 103 * Returns: the title of @self. 104 * 105 * Since: 0.0.10 106 */ 107 public string getTitle() 108 { 109 return Str.toString(hdy_preferences_group_get_title(hdyPreferencesGroup)); 110 } 111 112 /** 113 * Sets the description for @self. 114 * 115 * Params: 116 * description = the description 117 * 118 * Since: 0.0.10 119 */ 120 public void setDescription(string description) 121 { 122 hdy_preferences_group_set_description(hdyPreferencesGroup, Str.toStringz(description)); 123 } 124 125 /** 126 * Sets the title for @self. 127 * 128 * Params: 129 * title = the title 130 * 131 * Since: 0.0.10 132 */ 133 public void setTitle(string title) 134 { 135 hdy_preferences_group_set_title(hdyPreferencesGroup, Str.toStringz(title)); 136 } 137 }