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