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 protected override void setStruct(GObject* obj) 70 { 71 gtkActionBar = cast(GtkActionBar*)obj; 72 super.setStruct(obj); 73 } 74 75 /** 76 * Sets our main struct and passes it to the parent class. 77 */ 78 public this (GtkActionBar* gtkActionBar, bool ownedRef = false) 79 { 80 this.gtkActionBar = gtkActionBar; 81 super(cast(GtkBin*)gtkActionBar, ownedRef); 82 } 83 84 85 /** */ 86 public static GType getType() 87 { 88 return gtk_action_bar_get_type(); 89 } 90 91 /** 92 * Creates a new #GtkActionBar widget. 93 * 94 * Returns: a new #GtkActionBar 95 * 96 * Since: 3.12 97 * 98 * Throws: ConstructionException GTK+ fails to create the object. 99 */ 100 public this() 101 { 102 auto p = gtk_action_bar_new(); 103 104 if(p is null) 105 { 106 throw new ConstructionException("null returned by new"); 107 } 108 109 this(cast(GtkActionBar*) p); 110 } 111 112 /** 113 * Retrieves the center bar widget of the bar. 114 * 115 * Returns: the center #GtkWidget or %NULL. 116 * 117 * Since: 3.12 118 */ 119 public Widget getCenterWidget() 120 { 121 auto p = gtk_action_bar_get_center_widget(gtkActionBar); 122 123 if(p is null) 124 { 125 return null; 126 } 127 128 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 129 } 130 131 /** 132 * Adds @child to @action_bar, packed with reference to the 133 * end of the @action_bar. 134 * 135 * Params: 136 * child = the #GtkWidget to be added to @action_bar 137 * 138 * Since: 3.12 139 */ 140 public void packEnd(Widget child) 141 { 142 gtk_action_bar_pack_end(gtkActionBar, (child is null) ? null : child.getWidgetStruct()); 143 } 144 145 /** 146 * Adds @child to @action_bar, packed with reference to the 147 * start of the @action_bar. 148 * 149 * Params: 150 * child = the #GtkWidget to be added to @action_bar 151 * 152 * Since: 3.12 153 */ 154 public void packStart(Widget child) 155 { 156 gtk_action_bar_pack_start(gtkActionBar, (child is null) ? null : child.getWidgetStruct()); 157 } 158 159 /** 160 * Sets the center widget for the #GtkActionBar. 161 * 162 * Params: 163 * centerWidget = a widget to use for the center 164 * 165 * Since: 3.12 166 */ 167 public void setCenterWidget(Widget centerWidget) 168 { 169 gtk_action_bar_set_center_widget(gtkActionBar, (centerWidget is null) ? null : centerWidget.getWidgetStruct()); 170 } 171 }