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 module gtk.ActionBar; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import gtk.Bin; 30 private import gtk.Widget; 31 private import gtk.c.functions; 32 public import gtk.c.types; 33 public import gtkc.gtktypes; 34 35 36 /** 37 * GtkActionBar is designed to present contextual actions. It is 38 * expected to be displayed below the content and expand horizontally 39 * to fill the area. 40 * 41 * It allows placing children at the start or the end. In addition, it 42 * contains an internal centered box which is centered with respect to 43 * the full width of the box, even if the children at either side take 44 * up different amounts of space. 45 * 46 * # CSS nodes 47 * 48 * GtkActionBar has a single CSS node with name actionbar. 49 */ 50 public class ActionBar : Bin 51 { 52 /** the main Gtk struct */ 53 protected GtkActionBar* gtkActionBar; 54 55 /** Get the main Gtk struct */ 56 public GtkActionBar* getActionBarStruct(bool transferOwnership = false) 57 { 58 if (transferOwnership) 59 ownedRef = false; 60 return gtkActionBar; 61 } 62 63 /** the main Gtk struct as a void* */ 64 protected override void* getStruct() 65 { 66 return cast(void*)gtkActionBar; 67 } 68 69 /** 70 * Sets our main struct and passes it to the parent class. 71 */ 72 public this (GtkActionBar* gtkActionBar, bool ownedRef = false) 73 { 74 this.gtkActionBar = gtkActionBar; 75 super(cast(GtkBin*)gtkActionBar, ownedRef); 76 } 77 78 79 /** */ 80 public static GType getType() 81 { 82 return gtk_action_bar_get_type(); 83 } 84 85 /** 86 * Creates a new #GtkActionBar widget. 87 * 88 * Returns: a new #GtkActionBar 89 * 90 * Since: 3.12 91 * 92 * Throws: ConstructionException GTK+ fails to create the object. 93 */ 94 public this() 95 { 96 auto p = gtk_action_bar_new(); 97 98 if(p is null) 99 { 100 throw new ConstructionException("null returned by new"); 101 } 102 103 this(cast(GtkActionBar*) p); 104 } 105 106 /** 107 * Retrieves the center bar widget of the bar. 108 * 109 * Returns: the center #GtkWidget or %NULL. 110 * 111 * Since: 3.12 112 */ 113 public Widget getCenterWidget() 114 { 115 auto p = gtk_action_bar_get_center_widget(gtkActionBar); 116 117 if(p is null) 118 { 119 return null; 120 } 121 122 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 123 } 124 125 /** 126 * Adds @child to @action_bar, packed with reference to the 127 * end of the @action_bar. 128 * 129 * Params: 130 * child = the #GtkWidget to be added to @action_bar 131 * 132 * Since: 3.12 133 */ 134 public void packEnd(Widget child) 135 { 136 gtk_action_bar_pack_end(gtkActionBar, (child is null) ? null : child.getWidgetStruct()); 137 } 138 139 /** 140 * Adds @child to @action_bar, packed with reference to the 141 * start of the @action_bar. 142 * 143 * Params: 144 * child = the #GtkWidget to be added to @action_bar 145 * 146 * Since: 3.12 147 */ 148 public void packStart(Widget child) 149 { 150 gtk_action_bar_pack_start(gtkActionBar, (child is null) ? null : child.getWidgetStruct()); 151 } 152 153 /** 154 * Sets the center widget for the #GtkActionBar. 155 * 156 * Params: 157 * centerWidget = a widget to use for the center 158 * 159 * Since: 3.12 160 */ 161 public void setCenterWidget(Widget centerWidget) 162 { 163 gtk_action_bar_set_center_widget(gtkActionBar, (centerWidget is null) ? null : centerWidget.getWidgetStruct()); 164 } 165 }