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 * Conversion parameters: 26 * inFile = GtkToolItemGroup.html 27 * outPack = gtk 28 * outFile = ToolItemGroup 29 * strct = GtkToolItemGroup 30 * realStrct= 31 * ctorStrct=GtkWidget 32 * clss = ToolItemGroup 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - ToolShellIF 40 * prefixes: 41 * - gtk_tool_item_group_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - gtk.ToolItem 49 * - gtk.Widget 50 * - gtk.ToolShellIF 51 * - gtk.ToolShellT 52 * structWrap: 53 * - GtkToolItem* -> ToolItem 54 * - GtkWidget* -> Widget 55 * module aliases: 56 * local aliases: 57 * overrides: 58 */ 59 60 module gtk.ToolItemGroup; 61 62 public import gtkc.gtktypes; 63 64 private import gtkc.gtk; 65 private import glib.ConstructionException; 66 private import gobject.ObjectG; 67 68 69 private import glib.Str; 70 private import gtk.ToolItem; 71 private import gtk.Widget; 72 private import gtk.ToolShellIF; 73 private import gtk.ToolShellT; 74 75 76 77 private import gtk.Container; 78 79 /** 80 * A GtkToolItemGroup is used together with GtkToolPalette to add 81 * GtkToolItems to a palette like container with different 82 * categories and drag and drop support. 83 */ 84 public class ToolItemGroup : Container, ToolShellIF 85 { 86 87 /** the main Gtk struct */ 88 protected GtkToolItemGroup* gtkToolItemGroup; 89 90 91 public GtkToolItemGroup* getToolItemGroupStruct() 92 { 93 return gtkToolItemGroup; 94 } 95 96 97 /** the main Gtk struct as a void* */ 98 protected override void* getStruct() 99 { 100 return cast(void*)gtkToolItemGroup; 101 } 102 103 /** 104 * Sets our main struct and passes it to the parent class 105 */ 106 public this (GtkToolItemGroup* gtkToolItemGroup) 107 { 108 super(cast(GtkContainer*)gtkToolItemGroup); 109 this.gtkToolItemGroup = gtkToolItemGroup; 110 } 111 112 protected override void setStruct(GObject* obj) 113 { 114 super.setStruct(obj); 115 gtkToolItemGroup = cast(GtkToolItemGroup*)obj; 116 } 117 118 // add the ToolShell capabilities 119 mixin ToolShellT!(GtkToolItemGroup); 120 121 /** 122 * Retrieves the current orientation for the tool shell. Tool items must not 123 * call this function directly, but rely on gtk_tool_item_get_orientation() 124 * instead. 125 * Since 2.14 126 * Returns: the current orientation of shell 127 */ 128 public GtkOrientation getOrientation() 129 { 130 // GtkOrientation gtk_tool_shell_get_orientation (GtkToolShell *shell); 131 return gtk_tool_shell_get_orientation(getToolShellTStruct()); 132 } 133 134 /** 135 */ 136 137 /** 138 * Gets whether group is collapsed or expanded. 139 * Since 2.20 140 * Returns: TRUE if group is collapsed, FALSE if it is expanded 141 */ 142 public int getCollapsed() 143 { 144 // gboolean gtk_tool_item_group_get_collapsed (GtkToolItemGroup *group); 145 return gtk_tool_item_group_get_collapsed(gtkToolItemGroup); 146 } 147 148 /** 149 * Gets the tool item at position (x, y). 150 * Since 2.20 151 * Params: 152 * x = the x position 153 * y = the y position 154 * Returns: the GtkToolItem at position (x, y). [transfer none] 155 */ 156 public ToolItem getDropItem(int x, int y) 157 { 158 // GtkToolItem * gtk_tool_item_group_get_drop_item (GtkToolItemGroup *group, gint x, gint y); 159 auto p = gtk_tool_item_group_get_drop_item(gtkToolItemGroup, x, y); 160 161 if(p is null) 162 { 163 return null; 164 } 165 166 return ObjectG.getDObject!(ToolItem)(cast(GtkToolItem*) p); 167 } 168 169 /** 170 * Gets the ellipsization mode of group. 171 * Since 2.20 172 * Returns: the PangoEllipsizeMode of group 173 */ 174 public PangoEllipsizeMode getEllipsize() 175 { 176 // PangoEllipsizeMode gtk_tool_item_group_get_ellipsize (GtkToolItemGroup *group); 177 return gtk_tool_item_group_get_ellipsize(gtkToolItemGroup); 178 } 179 180 /** 181 * Gets the position of item in group as index. 182 * Since 2.20 183 * Params: 184 * item = a GtkToolItem 185 * Returns: the index of item in group or -1 if item is no child of group 186 */ 187 public int getItemPosition(ToolItem item) 188 { 189 // gint gtk_tool_item_group_get_item_position (GtkToolItemGroup *group, GtkToolItem *item); 190 return gtk_tool_item_group_get_item_position(gtkToolItemGroup, (item is null) ? null : item.getToolItemStruct()); 191 } 192 193 /** 194 * Gets the number of tool items in group. 195 * Since 2.20 196 * Returns: the number of tool items in group 197 */ 198 public uint getNItems() 199 { 200 // guint gtk_tool_item_group_get_n_items (GtkToolItemGroup *group); 201 return gtk_tool_item_group_get_n_items(gtkToolItemGroup); 202 } 203 204 /** 205 * Gets the label of group. 206 * Since 2.20 207 * Returns: the label of group. The label is an internal string of group and must not be modified. Note that NULL is returned if a custom label has been set with gtk_tool_item_group_set_label_widget() 208 */ 209 public string getLabel() 210 { 211 // const gchar * gtk_tool_item_group_get_label (GtkToolItemGroup *group); 212 return Str.toString(gtk_tool_item_group_get_label(gtkToolItemGroup)); 213 } 214 215 /** 216 * Gets the label widget of group. 217 * See gtk_tool_item_group_set_label_widget(). 218 * Since 2.20 219 * Returns: the label widget of group. [transfer none] 220 */ 221 public Widget getLabelWidget() 222 { 223 // GtkWidget * gtk_tool_item_group_get_label_widget (GtkToolItemGroup *group); 224 auto p = gtk_tool_item_group_get_label_widget(gtkToolItemGroup); 225 226 if(p is null) 227 { 228 return null; 229 } 230 231 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 232 } 233 234 /** 235 * Gets the tool item at index in group. 236 * Since 2.20 237 * Params: 238 * index = the index 239 * Returns: the GtkToolItem at index. [transfer none] 240 */ 241 public ToolItem getNthItem(uint index) 242 { 243 // GtkToolItem * gtk_tool_item_group_get_nth_item (GtkToolItemGroup *group, guint index); 244 auto p = gtk_tool_item_group_get_nth_item(gtkToolItemGroup, index); 245 246 if(p is null) 247 { 248 return null; 249 } 250 251 return ObjectG.getDObject!(ToolItem)(cast(GtkToolItem*) p); 252 } 253 254 /** 255 * Gets the relief mode of the header button of group. 256 * Since 2.20 257 * Returns: the GtkReliefStyle 258 */ 259 public GtkReliefStyle getHeaderRelief() 260 { 261 // GtkReliefStyle gtk_tool_item_group_get_header_relief (GtkToolItemGroup *group); 262 return gtk_tool_item_group_get_header_relief(gtkToolItemGroup); 263 } 264 265 /** 266 * Inserts item at position in the list of children of group. 267 * Since 2.20 268 * Params: 269 * item = the GtkToolItem to insert into group 270 * position = the position of item in group, starting with 0. 271 * The position -1 means end of list. 272 */ 273 public void insert(ToolItem item, int position) 274 { 275 // void gtk_tool_item_group_insert (GtkToolItemGroup *group, GtkToolItem *item, gint position); 276 gtk_tool_item_group_insert(gtkToolItemGroup, (item is null) ? null : item.getToolItemStruct(), position); 277 } 278 279 /** 280 * Creates a new tool item group with label label. 281 * Since 2.20 282 * Params: 283 * label = the label of the new group 284 * Throws: ConstructionException GTK+ fails to create the object. 285 */ 286 public this (string label) 287 { 288 // GtkWidget * gtk_tool_item_group_new (const gchar *label); 289 auto p = gtk_tool_item_group_new(Str.toStringz(label)); 290 if(p is null) 291 { 292 throw new ConstructionException("null returned by gtk_tool_item_group_new(Str.toStringz(label))"); 293 } 294 this(cast(GtkToolItemGroup*) p); 295 } 296 297 /** 298 * Sets whether the group should be collapsed or expanded. 299 * Since 2.20 300 * Params: 301 * collapsed = whether the group should be collapsed or expanded 302 */ 303 public void setCollapsed(int collapsed) 304 { 305 // void gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group, gboolean collapsed); 306 gtk_tool_item_group_set_collapsed(gtkToolItemGroup, collapsed); 307 } 308 309 /** 310 * Sets the ellipsization mode which should be used by labels in group. 311 * Since 2.20 312 * Params: 313 * ellipsize = the PangoEllipsizeMode labels in group should use 314 */ 315 public void setEllipsize(PangoEllipsizeMode ellipsize) 316 { 317 // void gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group, PangoEllipsizeMode ellipsize); 318 gtk_tool_item_group_set_ellipsize(gtkToolItemGroup, ellipsize); 319 } 320 321 /** 322 * Sets the position of item in the list of children of group. 323 * Since 2.20 324 * Params: 325 * item = the GtkToolItem to move to a new position, should 326 * be a child of group. 327 * position = the new position of item in group, starting with 0. 328 * The position -1 means end of list. 329 */ 330 public void setItemPosition(ToolItem item, int position) 331 { 332 // void gtk_tool_item_group_set_item_position (GtkToolItemGroup *group, GtkToolItem *item, gint position); 333 gtk_tool_item_group_set_item_position(gtkToolItemGroup, (item is null) ? null : item.getToolItemStruct(), position); 334 } 335 336 /** 337 * Sets the label of the tool item group. The label is displayed in the header 338 * of the group. 339 * Since 2.20 340 * Params: 341 * label = the new human-readable label of of the group 342 */ 343 public void setLabel(string label) 344 { 345 // void gtk_tool_item_group_set_label (GtkToolItemGroup *group, const gchar *label); 346 gtk_tool_item_group_set_label(gtkToolItemGroup, Str.toStringz(label)); 347 } 348 349 /** 350 * Sets the label of the tool item group. 351 * The label widget is displayed in the header of the group, in place 352 * of the usual label. 353 * Since 2.20 354 * Params: 355 * labelWidget = the widget to be displayed in place of the usual label 356 */ 357 public void setLabelWidget(Widget labelWidget) 358 { 359 // void gtk_tool_item_group_set_label_widget (GtkToolItemGroup *group, GtkWidget *label_widget); 360 gtk_tool_item_group_set_label_widget(gtkToolItemGroup, (labelWidget is null) ? null : labelWidget.getWidgetStruct()); 361 } 362 363 /** 364 * Set the button relief of the group header. 365 * See gtk_button_set_relief() for details. 366 * Since 2.20 367 * Params: 368 * style = the GtkReliefStyle 369 */ 370 public void setHeaderRelief(GtkReliefStyle style) 371 { 372 // void gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group, GtkReliefStyle style); 373 gtk_tool_item_group_set_header_relief(gtkToolItemGroup, style); 374 } 375 }