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 = GtkTreeViewColumn.html 27 * outPack = gtk 28 * outFile = TreeViewColumn 29 * strct = GtkTreeViewColumn 30 * realStrct= 31 * ctorStrct= 32 * clss = TreeViewColumn 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - CellLayoutIF 40 * prefixes: 41 * - gtk_tree_view_column_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * - gtk_tree_view_column_pack_start 46 * - gtk_tree_view_column_pack_end 47 * - gtk_tree_view_column_clear 48 * - gtk_tree_view_column_add_attribute 49 * - gtk_tree_view_column_clear_attributes 50 * - gtk_tree_view_column_get_button 51 * - gtk_tree_view_column_get_tree_view 52 * - gtk_tree_view_column_new_with_attributes 53 * omit signals: 54 * imports: 55 * - glib.Str 56 * - gtk.Button 57 * - gtk.CellArea 58 * - gtk.CellRenderer 59 * - gtk.TreeIter 60 * - gtk.TreeModelIF 61 * - gtk.TreeView 62 * - gtk.Widget 63 * - gtk.CellLayoutIF 64 * - gtk.CellLayoutT 65 * structWrap: 66 * - GtkCellArea* -> CellArea 67 * - GtkCellRenderer* -> CellRenderer 68 * - GtkTreeIter* -> TreeIter 69 * - GtkTreeModel* -> TreeModelIF 70 * - GtkWidget* -> Widget 71 * module aliases: 72 * local aliases: 73 * overrides: 74 */ 75 76 module gtk.TreeViewColumn; 77 78 public import gtkc.gtktypes; 79 80 private import gtkc.gtk; 81 private import glib.ConstructionException; 82 private import gobject.ObjectG; 83 84 private import gobject.Signals; 85 public import gtkc.gdktypes; 86 87 private import glib.Str; 88 private import gtk.Button; 89 private import gtk.CellArea; 90 private import gtk.CellRenderer; 91 private import gtk.TreeIter; 92 private import gtk.TreeModelIF; 93 private import gtk.TreeView; 94 private import gtk.Widget; 95 private import gtk.CellLayoutIF; 96 private import gtk.CellLayoutT; 97 98 99 100 private import gobject.ObjectG; 101 102 /** 103 * The GtkTreeViewColumn object represents a visible column in a GtkTreeView widget. 104 * It allows to set properties of the column header, and functions as a holding pen for 105 * the cell renderers which determine how the data in the column is displayed. 106 * 107 * Please refer to the tree widget conceptual overview 108 * for an overview of all the objects and data types related to the tree widget and how 109 * they work together. 110 */ 111 public class TreeViewColumn : ObjectG, CellLayoutIF 112 { 113 114 /** the main Gtk struct */ 115 protected GtkTreeViewColumn* gtkTreeViewColumn; 116 117 118 public GtkTreeViewColumn* getTreeViewColumnStruct() 119 { 120 return gtkTreeViewColumn; 121 } 122 123 124 /** the main Gtk struct as a void* */ 125 protected override void* getStruct() 126 { 127 return cast(void*)gtkTreeViewColumn; 128 } 129 130 /** 131 * Sets our main struct and passes it to the parent class 132 */ 133 public this (GtkTreeViewColumn* gtkTreeViewColumn) 134 { 135 super(cast(GObject*)gtkTreeViewColumn); 136 this.gtkTreeViewColumn = gtkTreeViewColumn; 137 } 138 139 protected override void setStruct(GObject* obj) 140 { 141 super.setStruct(obj); 142 gtkTreeViewColumn = cast(GtkTreeViewColumn*)obj; 143 } 144 145 // add the CellLayout capabilities 146 mixin CellLayoutT!(GtkTreeViewColumn); 147 148 /** 149 * Creates a new Tree view column 150 * Params: 151 * header = th column header text 152 * renderer = the rederer for the column cells 153 * type = the type of data to be displayed (shouldn't this be on the renderer?) 154 * column = the column number 155 * Throws: ConstructionException GTK+ fails to create the object. 156 */ 157 this(string header, CellRenderer renderer, string type, int column) 158 { 159 auto p = gtk_tree_view_column_new_with_attributes( 160 Str.toStringz(header), 161 renderer.getCellRendererStruct(), 162 Str.toStringz(type), 163 column, 164 null); 165 166 if(p is null) 167 { 168 throw new ConstructionException("null returned by gtk_tree_view_column_new_with_attributes"); 169 } 170 171 this(p); 172 } 173 174 /** 175 * Returns the button used in the treeview column header 176 * Returns: The button for the column header. [transfer none] Since 3.0 177 */ 178 public Button getButton() 179 { 180 // GtkWidget * gtk_tree_view_column_get_button (GtkTreeViewColumn *tree_column); 181 auto p = gtk_tree_view_column_get_button(gtkTreeViewColumn); 182 if(p is null) 183 { 184 return null; 185 } 186 return new Button(cast(GtkButton*) p); 187 } 188 189 /** 190 * Returns the GtkTreeView wherein tree_column has been inserted. 191 * If column is currently not inserted in any tree view, NULL is 192 * returned. 193 * Since 2.12 194 * Returns: The tree view wherein column has been inserted if any, NULL otherwise. [transfer none] 195 */ 196 public TreeView getTreeView() 197 { 198 // GtkWidget * gtk_tree_view_column_get_tree_view (GtkTreeViewColumn *tree_column); 199 auto p = gtk_tree_view_column_get_tree_view(gtkTreeViewColumn); 200 if(p is null) 201 { 202 return null; 203 } 204 return new TreeView(cast(GtkTreeView*) p); 205 } 206 207 /** 208 */ 209 int[string] connectedSignals; 210 211 void delegate(TreeViewColumn)[] onClickedListeners; 212 /** 213 * See Also 214 * GtkTreeView, GtkTreeSelection, GtkTreeDnd, GtkTreeMode, GtkTreeSortable, 215 * GtkTreeModelSort, GtkListStore, GtkTreeStore, GtkCellRenderer, GtkCellEditable, 216 * GtkCellRendererPixbuf, GtkCellRendererText, GtkCellRendererToggle 217 */ 218 void addOnClicked(void delegate(TreeViewColumn) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 219 { 220 if ( !("clicked" in connectedSignals) ) 221 { 222 Signals.connectData( 223 getStruct(), 224 "clicked", 225 cast(GCallback)&callBackClicked, 226 cast(void*)this, 227 null, 228 connectFlags); 229 connectedSignals["clicked"] = 1; 230 } 231 onClickedListeners ~= dlg; 232 } 233 extern(C) static void callBackClicked(GtkTreeViewColumn* treeviewcolumnStruct, TreeViewColumn _treeViewColumn) 234 { 235 foreach ( void delegate(TreeViewColumn) dlg ; _treeViewColumn.onClickedListeners ) 236 { 237 dlg(_treeViewColumn); 238 } 239 } 240 241 242 /** 243 * Creates a new GtkTreeViewColumn. 244 * Throws: ConstructionException GTK+ fails to create the object. 245 */ 246 public this () 247 { 248 // GtkTreeViewColumn * gtk_tree_view_column_new (void); 249 auto p = gtk_tree_view_column_new(); 250 if(p is null) 251 { 252 throw new ConstructionException("null returned by gtk_tree_view_column_new()"); 253 } 254 this(cast(GtkTreeViewColumn*) p); 255 } 256 257 /** 258 * Creates a new GtkTreeViewColumn using area to render its cells. 259 * Params: 260 * area = the GtkCellArea that the newly created column should use to layout cells. 261 * Throws: ConstructionException GTK+ fails to create the object. 262 */ 263 public this (CellArea area) 264 { 265 // GtkTreeViewColumn * gtk_tree_view_column_new_with_area (GtkCellArea *area); 266 auto p = gtk_tree_view_column_new_with_area((area is null) ? null : area.getCellAreaStruct()); 267 if(p is null) 268 { 269 throw new ConstructionException("null returned by gtk_tree_view_column_new_with_area((area is null) ? null : area.getCellAreaStruct())"); 270 } 271 this(cast(GtkTreeViewColumn*) p); 272 } 273 274 /** 275 * Sets the GtkTreeCellDataFunc to use for the column. This 276 * function is used instead of the standard attributes mapping for 277 * setting the column value, and should set the value of tree_column's 278 * cell renderer as appropriate. func may be NULL to remove an 279 * older one. 280 * Params: 281 * cellRenderer = A GtkCellRenderer 282 * func = The GtkTreeCellDataFunc to use. [allow-none] 283 * funcData = The user data for func. 284 * destroy = The destroy notification for func_data 285 */ 286 public void setCellDataFunc(CellRenderer cellRenderer, GtkTreeCellDataFunc func, void* funcData, GDestroyNotify destroy) 287 { 288 // void gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell_renderer, GtkTreeCellDataFunc func, gpointer func_data, GDestroyNotify destroy); 289 gtk_tree_view_column_set_cell_data_func(gtkTreeViewColumn, (cellRenderer is null) ? null : cellRenderer.getCellRendererStruct(), func, funcData, destroy); 290 } 291 292 /** 293 * Sets the spacing field of tree_column, which is the number of pixels to 294 * place between cell renderers packed into it. 295 * Params: 296 * spacing = distance between cell renderers in pixels. 297 */ 298 public void setSpacing(int spacing) 299 { 300 // void gtk_tree_view_column_set_spacing (GtkTreeViewColumn *tree_column, gint spacing); 301 gtk_tree_view_column_set_spacing(gtkTreeViewColumn, spacing); 302 } 303 304 /** 305 * Returns the spacing of tree_column. 306 * Returns: the spacing of tree_column. 307 */ 308 public int getSpacing() 309 { 310 // gint gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column); 311 return gtk_tree_view_column_get_spacing(gtkTreeViewColumn); 312 } 313 314 /** 315 * Sets the visibility of tree_column. 316 * Params: 317 * visible = TRUE if the tree_column is visible. 318 */ 319 public void setVisible(int visible) 320 { 321 // void gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column, gboolean visible); 322 gtk_tree_view_column_set_visible(gtkTreeViewColumn, visible); 323 } 324 325 /** 326 * Returns TRUE if tree_column is visible. 327 * Returns: whether the column is visible or not. If it is visible, then the tree will show the column. 328 */ 329 public int getVisible() 330 { 331 // gboolean gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column); 332 return gtk_tree_view_column_get_visible(gtkTreeViewColumn); 333 } 334 335 /** 336 * If resizable is TRUE, then the user can explicitly resize the column by 337 * grabbing the outer edge of the column button. If resizable is TRUE and 338 * sizing mode of the column is GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing 339 * mode is changed to GTK_TREE_VIEW_COLUMN_GROW_ONLY. 340 * Params: 341 * resizable = TRUE, if the column can be resized 342 */ 343 public void setResizable(int resizable) 344 { 345 // void gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column, gboolean resizable); 346 gtk_tree_view_column_set_resizable(gtkTreeViewColumn, resizable); 347 } 348 349 /** 350 * Returns TRUE if the tree_column can be resized by the end user. 351 * Returns: TRUE, if the tree_column can be resized. 352 */ 353 public int getResizable() 354 { 355 // gboolean gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column); 356 return gtk_tree_view_column_get_resizable(gtkTreeViewColumn); 357 } 358 359 /** 360 * Sets the growth behavior of tree_column to type. 361 * Params: 362 * type = The GtkTreeViewColumnSizing. 363 */ 364 public void setSizing(GtkTreeViewColumnSizing type) 365 { 366 // void gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column, GtkTreeViewColumnSizing type); 367 gtk_tree_view_column_set_sizing(gtkTreeViewColumn, type); 368 } 369 370 /** 371 * Returns the current type of tree_column. 372 * Returns: The type of tree_column. 373 */ 374 public GtkTreeViewColumnSizing getSizing() 375 { 376 // GtkTreeViewColumnSizing gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column); 377 return gtk_tree_view_column_get_sizing(gtkTreeViewColumn); 378 } 379 380 /** 381 * Returns the current size of tree_column in pixels. 382 * Returns: The current width of tree_column. 383 */ 384 public int getWidth() 385 { 386 // gint gtk_tree_view_column_get_width (GtkTreeViewColumn *tree_column); 387 return gtk_tree_view_column_get_width(gtkTreeViewColumn); 388 } 389 390 /** 391 * Gets the fixed width of the column. This may not be the actual displayed 392 * width of the column; for that, use gtk_tree_view_column_get_width(). 393 * Returns: The fixed width of the column. 394 */ 395 public int getFixedWidth() 396 { 397 // gint gtk_tree_view_column_get_fixed_width (GtkTreeViewColumn *tree_column); 398 return gtk_tree_view_column_get_fixed_width(gtkTreeViewColumn); 399 } 400 401 /** 402 * If fixed_width is not -1, sets the fixed width of tree_column; otherwise 403 * unsets it. The effective value of fixed_width is clamped between the 404 * minumum and maximum width of the column; however, the value stored in the 405 * "fixed-width" property is not clamped. If the column sizing is 406 * GTK_TREE_VIEW_COLUMN_GROW_ONLY or GTK_TREE_VIEW_COLUMN_AUTOSIZE, setting a 407 * fixed width overrides the automatically calculated width. Note that 408 * fixed_width is only a hint to GTK+; the width actually allocated to the 409 * column may be greater or less than requested. 410 * Along with "expand", the "fixed-width" property changes when the column is 411 * resized by the user. 412 * Params: 413 * fixedWidth = The new fixed width, in pixels, or -1. 414 */ 415 public void setFixedWidth(int fixedWidth) 416 { 417 // void gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *tree_column, gint fixed_width); 418 gtk_tree_view_column_set_fixed_width(gtkTreeViewColumn, fixedWidth); 419 } 420 421 /** 422 * Sets the minimum width of the tree_column. If min_width is -1, then the 423 * minimum width is unset. 424 * Params: 425 * minWidth = The minimum width of the column in pixels, or -1. 426 */ 427 public void setMinWidth(int minWidth) 428 { 429 // void gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column, gint min_width); 430 gtk_tree_view_column_set_min_width(gtkTreeViewColumn, minWidth); 431 } 432 433 /** 434 * Returns the minimum width in pixels of the tree_column, or -1 if no minimum 435 * width is set. 436 * Returns: The minimum width of the tree_column. 437 */ 438 public int getMinWidth() 439 { 440 // gint gtk_tree_view_column_get_min_width (GtkTreeViewColumn *tree_column); 441 return gtk_tree_view_column_get_min_width(gtkTreeViewColumn); 442 } 443 444 /** 445 * Sets the maximum width of the tree_column. If max_width is -1, then the 446 * maximum width is unset. Note, the column can actually be wider than max 447 * width if it's the last column in a view. In this case, the column expands to 448 * fill any extra space. 449 * Params: 450 * maxWidth = The maximum width of the column in pixels, or -1. 451 */ 452 public void setMaxWidth(int maxWidth) 453 { 454 // void gtk_tree_view_column_set_max_width (GtkTreeViewColumn *tree_column, gint max_width); 455 gtk_tree_view_column_set_max_width(gtkTreeViewColumn, maxWidth); 456 } 457 458 /** 459 * Returns the maximum width in pixels of the tree_column, or -1 if no maximum 460 * width is set. 461 * Returns: The maximum width of the tree_column. 462 */ 463 public int getMaxWidth() 464 { 465 // gint gtk_tree_view_column_get_max_width (GtkTreeViewColumn *tree_column); 466 return gtk_tree_view_column_get_max_width(gtkTreeViewColumn); 467 } 468 469 /** 470 * Emits the "clicked" signal on the column. This function will only work if 471 * tree_column is clickable. 472 */ 473 public void clicked() 474 { 475 // void gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column); 476 gtk_tree_view_column_clicked(gtkTreeViewColumn); 477 } 478 479 /** 480 * Sets the title of the tree_column. If a custom widget has been set, then 481 * this value is ignored. 482 * Params: 483 * title = The title of the tree_column. 484 */ 485 public void setTitle(string title) 486 { 487 // void gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column, const gchar *title); 488 gtk_tree_view_column_set_title(gtkTreeViewColumn, Str.toStringz(title)); 489 } 490 491 /** 492 * Returns the title of the widget. 493 * Returns: the title of the column. This string should not be modified or freed. 494 */ 495 public string getTitle() 496 { 497 // const gchar * gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column); 498 return Str.toString(gtk_tree_view_column_get_title(gtkTreeViewColumn)); 499 } 500 501 /** 502 * Sets the column to take available extra space. This space is shared equally 503 * amongst all columns that have the expand set to TRUE. If no column has this 504 * option set, then the last column gets all extra space. By default, every 505 * column is created with this FALSE. 506 * Along with "fixed-width", the "expand" property changes when the column is 507 * resized by the user. 508 * Since 2.4 509 * Params: 510 * expand = TRUE if the column should expand to fill available space. 511 */ 512 public void setExpand(int expand) 513 { 514 // void gtk_tree_view_column_set_expand (GtkTreeViewColumn *tree_column, gboolean expand); 515 gtk_tree_view_column_set_expand(gtkTreeViewColumn, expand); 516 } 517 518 /** 519 * Returns TRUE if the column expands to fill available space. 520 * Since 2.4 521 * Returns: TRUE if the column expands to fill available space. 522 */ 523 public int getExpand() 524 { 525 // gboolean gtk_tree_view_column_get_expand (GtkTreeViewColumn *tree_column); 526 return gtk_tree_view_column_get_expand(gtkTreeViewColumn); 527 } 528 529 /** 530 * Sets the header to be active if clickable is TRUE. When the header is 531 * active, then it can take keyboard focus, and can be clicked. 532 * Params: 533 * clickable = TRUE if the header is active. 534 */ 535 public void setClickable(int clickable) 536 { 537 // void gtk_tree_view_column_set_clickable (GtkTreeViewColumn *tree_column, gboolean clickable); 538 gtk_tree_view_column_set_clickable(gtkTreeViewColumn, clickable); 539 } 540 541 /** 542 * Returns TRUE if the user can click on the header for the column. 543 * Returns: TRUE if user can click the column header. 544 */ 545 public int getClickable() 546 { 547 // gboolean gtk_tree_view_column_get_clickable (GtkTreeViewColumn *tree_column); 548 return gtk_tree_view_column_get_clickable(gtkTreeViewColumn); 549 } 550 551 /** 552 * Sets the widget in the header to be widget. If widget is NULL, then the 553 * header button is set with a GtkLabel set to the title of tree_column. 554 * Params: 555 * widget = A child GtkWidget, or NULL. [allow-none] 556 */ 557 public void setWidget(Widget widget) 558 { 559 // void gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column, GtkWidget *widget); 560 gtk_tree_view_column_set_widget(gtkTreeViewColumn, (widget is null) ? null : widget.getWidgetStruct()); 561 } 562 563 /** 564 * Returns the GtkWidget in the button on the column header. 565 * If a custom widget has not been set then NULL is returned. 566 * Returns: The GtkWidget in the column header, or NULL. [transfer none] 567 */ 568 public Widget getWidget() 569 { 570 // GtkWidget * gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column); 571 auto p = gtk_tree_view_column_get_widget(gtkTreeViewColumn); 572 573 if(p is null) 574 { 575 return null; 576 } 577 578 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 579 } 580 581 /** 582 * Sets the alignment of the title or custom widget inside the column header. 583 * The alignment determines its location inside the button -- 0.0 for left, 0.5 584 * for center, 1.0 for right. 585 * Params: 586 * xalign = The alignment, which is between [0.0 and 1.0] inclusive. 587 */ 588 public void setAlignment(float xalign) 589 { 590 // void gtk_tree_view_column_set_alignment (GtkTreeViewColumn *tree_column, gfloat xalign); 591 gtk_tree_view_column_set_alignment(gtkTreeViewColumn, xalign); 592 } 593 594 /** 595 * Returns the current x alignment of tree_column. This value can range 596 * between 0.0 and 1.0. 597 * Returns: The current alignent of tree_column. 598 */ 599 public float getAlignment() 600 { 601 // gfloat gtk_tree_view_column_get_alignment (GtkTreeViewColumn *tree_column); 602 return gtk_tree_view_column_get_alignment(gtkTreeViewColumn); 603 } 604 605 /** 606 * If reorderable is TRUE, then the column can be reordered by the end user 607 * dragging the header. 608 * Params: 609 * reorderable = TRUE, if the column can be reordered. 610 */ 611 public void setReorderable(int reorderable) 612 { 613 // void gtk_tree_view_column_set_reorderable (GtkTreeViewColumn *tree_column, gboolean reorderable); 614 gtk_tree_view_column_set_reorderable(gtkTreeViewColumn, reorderable); 615 } 616 617 /** 618 * Returns TRUE if the tree_column can be reordered by the user. 619 * Returns: TRUE if the tree_column can be reordered by the user. 620 */ 621 public int getReorderable() 622 { 623 // gboolean gtk_tree_view_column_get_reorderable (GtkTreeViewColumn *tree_column); 624 return gtk_tree_view_column_get_reorderable(gtkTreeViewColumn); 625 } 626 627 /** 628 * Sets the logical sort_column_id that this column sorts on when this column 629 * is selected for sorting. Doing so makes the column header clickable. 630 * Params: 631 * sortColumnId = The sort_column_id of the model to sort on. 632 */ 633 public void setSortColumnId(int sortColumnId) 634 { 635 // void gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column, gint sort_column_id); 636 gtk_tree_view_column_set_sort_column_id(gtkTreeViewColumn, sortColumnId); 637 } 638 639 /** 640 * Gets the logical sort_column_id that the model sorts on when this 641 * column is selected for sorting. 642 * See gtk_tree_view_column_set_sort_column_id(). 643 * Returns: the current sort_column_id for this column, or -1 if this column can't be used for sorting. 644 */ 645 public int getSortColumnId() 646 { 647 // gint gtk_tree_view_column_get_sort_column_id (GtkTreeViewColumn *tree_column); 648 return gtk_tree_view_column_get_sort_column_id(gtkTreeViewColumn); 649 } 650 651 /** 652 * Call this function with a setting of TRUE to display an arrow in 653 * the header button indicating the column is sorted. Call 654 * gtk_tree_view_column_set_sort_order() to change the direction of 655 * the arrow. 656 * Params: 657 * setting = TRUE to display an indicator that the column is sorted 658 */ 659 public void setSortIndicator(int setting) 660 { 661 // void gtk_tree_view_column_set_sort_indicator (GtkTreeViewColumn *tree_column, gboolean setting); 662 gtk_tree_view_column_set_sort_indicator(gtkTreeViewColumn, setting); 663 } 664 665 /** 666 * Gets the value set by gtk_tree_view_column_set_sort_indicator(). 667 * Returns: whether the sort indicator arrow is displayed 668 */ 669 public int getSortIndicator() 670 { 671 // gboolean gtk_tree_view_column_get_sort_indicator (GtkTreeViewColumn *tree_column); 672 return gtk_tree_view_column_get_sort_indicator(gtkTreeViewColumn); 673 } 674 675 /** 676 * Changes the appearance of the sort indicator. 677 * This does not actually sort the model. Use 678 * gtk_tree_view_column_set_sort_column_id() if you want automatic sorting 679 * support. This function is primarily for custom sorting behavior, and should 680 * be used in conjunction with gtk_tree_sortable_set_sort_column_id() to do 681 * that. For custom models, the mechanism will vary. 682 * The sort indicator changes direction to indicate normal sort or reverse sort. 683 * Note that you must have the sort indicator enabled to see anything when 684 * calling this function; see gtk_tree_view_column_set_sort_indicator(). 685 * Params: 686 * order = sort order that the sort indicator should indicate 687 */ 688 public void setSortOrder(GtkSortType order) 689 { 690 // void gtk_tree_view_column_set_sort_order (GtkTreeViewColumn *tree_column, GtkSortType order); 691 gtk_tree_view_column_set_sort_order(gtkTreeViewColumn, order); 692 } 693 694 /** 695 * Gets the value set by gtk_tree_view_column_set_sort_order(). 696 * Returns: the sort order the sort indicator is indicating 697 */ 698 public GtkSortType getSortOrder() 699 { 700 // GtkSortType gtk_tree_view_column_get_sort_order (GtkTreeViewColumn *tree_column); 701 return gtk_tree_view_column_get_sort_order(gtkTreeViewColumn); 702 } 703 704 /** 705 * Sets the cell renderer based on the tree_model and iter. That is, for 706 * every attribute mapping in tree_column, it will get a value from the set 707 * column on the iter, and use that value to set the attribute on the cell 708 * renderer. This is used primarily by the GtkTreeView. 709 * Params: 710 * treeModel = The GtkTreeModel to to get the cell renderers attributes from. 711 * iter = The GtkTreeIter to to get the cell renderer's attributes from. 712 * isExpander = TRUE, if the row has children 713 * isExpanded = TRUE, if the row has visible children 714 */ 715 public void cellSetCellData(TreeModelIF treeModel, TreeIter iter, int isExpander, int isExpanded) 716 { 717 // void gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column, GtkTreeModel *tree_model, GtkTreeIter *iter, gboolean is_expander, gboolean is_expanded); 718 gtk_tree_view_column_cell_set_cell_data(gtkTreeViewColumn, (treeModel is null) ? null : treeModel.getTreeModelTStruct(), (iter is null) ? null : iter.getTreeIterStruct(), isExpander, isExpanded); 719 } 720 721 /** 722 * Obtains the width and height needed to render the column. This is used 723 * primarily by the GtkTreeView. 724 * Params: 725 * cellArea = The area a cell in the column will be allocated, or NULL. [allow-none] 726 * xOffset = location to return x offset of a cell relative to cell_area, or NULL. [out][allow-none] 727 * yOffset = location to return y offset of a cell relative to cell_area, or NULL. [out][allow-none] 728 * width = location to return width needed to render a cell, or NULL. [out][allow-none] 729 * height = location to return height needed to render a cell, or NULL. [out][allow-none] 730 */ 731 public void cellGetSize(ref Rectangle cellArea, out int xOffset, out int yOffset, out int width, out int height) 732 { 733 // void gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column, const GdkRectangle *cell_area, gint *x_offset, gint *y_offset, gint *width, gint *height); 734 gtk_tree_view_column_cell_get_size(gtkTreeViewColumn, &cellArea, &xOffset, &yOffset, &width, &height); 735 } 736 737 /** 738 * Obtains the horizontal position and size of a cell in a column. If the 739 * cell is not found in the column, start_pos and width are not changed and 740 * FALSE is returned. 741 * Params: 742 * cellRenderer = a GtkCellRenderer 743 * xOffset = return location for the horizontal 744 * position of cell within tree_column, may be NULL. [out][allow-none] 745 * width = return location for the width of cell, 746 * may be NULL. [out][allow-none] 747 * Returns: TRUE if cell belongs to tree_column. 748 */ 749 public int cellGetPosition(CellRenderer cellRenderer, out int xOffset, out int width) 750 { 751 // gboolean gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell_renderer, gint *x_offset, gint *width); 752 return gtk_tree_view_column_cell_get_position(gtkTreeViewColumn, (cellRenderer is null) ? null : cellRenderer.getCellRendererStruct(), &xOffset, &width); 753 } 754 755 /** 756 * Returns TRUE if any of the cells packed into the tree_column are visible. 757 * For this to be meaningful, you must first initialize the cells with 758 * gtk_tree_view_column_cell_set_cell_data() 759 * Returns: TRUE, if any of the cells packed into the tree_column are currently visible 760 */ 761 public int cellIsVisible() 762 { 763 // gboolean gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *tree_column); 764 return gtk_tree_view_column_cell_is_visible(gtkTreeViewColumn); 765 } 766 767 /** 768 * Sets the current keyboard focus to be at cell, if the column contains 769 * 2 or more editable and activatable cells. 770 * Since 2.2 771 * Params: 772 * cell = A GtkCellRenderer 773 */ 774 public void focusCell(CellRenderer cell) 775 { 776 // void gtk_tree_view_column_focus_cell (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell); 777 gtk_tree_view_column_focus_cell(gtkTreeViewColumn, (cell is null) ? null : cell.getCellRendererStruct()); 778 } 779 780 /** 781 * Flags the column, and the cell renderers added to this column, to have 782 * their sizes renegotiated. 783 * Since 2.8 784 */ 785 public void queueResize() 786 { 787 // void gtk_tree_view_column_queue_resize (GtkTreeViewColumn *tree_column); 788 gtk_tree_view_column_queue_resize(gtkTreeViewColumn); 789 } 790 791 /** 792 * Returns the current X offset of tree_column in pixels. 793 * Returns: The current X offset of tree_column. Since 3.2 794 */ 795 public int getXOffset() 796 { 797 // gint gtk_tree_view_column_get_x_offset (GtkTreeViewColumn *tree_column); 798 return gtk_tree_view_column_get_x_offset(gtkTreeViewColumn); 799 } 800 }