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 = AtkTable.html 27 * outPack = atk 28 * outFile = Table 29 * strct = AtkTable 30 * realStrct= 31 * ctorStrct= 32 * clss = Table 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - atk_table_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - atk.ObjectAtk 47 * - glib.Str 48 * structWrap: 49 * - AtkObject* -> ObjectAtk 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module atk.Table; 56 57 public import gtkc.atktypes; 58 59 private import gtkc.atk; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 private import gobject.Signals; 64 public import gtkc.gdktypes; 65 private import atk.ObjectAtk; 66 private import glib.Str; 67 68 69 70 /** 71 * AtkTable should be implemented by components which present 72 * elements ordered via rows and columns. It may also be used to 73 * present tree-structured information if the nodes of the trees can 74 * be said to contain multiple "columns". Individual elements of an 75 * AtkTable are typically referred to as "cells", and these cells are 76 * exposed by AtkTable as child AtkObjects of the AtkTable. Both 77 * row/column and child-index-based access to these children is 78 * provided. 79 * 80 * Children of AtkTable are frequently "lightweight" objects, that 81 * is, they may not have backing widgets in the host UI toolkit. They 82 * are therefore often transient. 83 * Since tables are often very complex, AtkTable includes provision 84 * for offering simplified summary information, as well as row and 85 * column headers and captions. Headers and captions are AtkObjects 86 * which may implement other interfaces (AtkText, AtkImage, etc.) as 87 * appropriate. AtkTable summaries may themselves be (simplified) 88 * AtkTables, etc. 89 */ 90 public class Table 91 { 92 93 /** the main Gtk struct */ 94 protected AtkTable* atkTable; 95 96 97 /** Get the main Gtk struct */ 98 public AtkTable* getTableStruct() 99 { 100 return atkTable; 101 } 102 103 104 /** the main Gtk struct as a void* */ 105 protected void* getStruct() 106 { 107 return cast(void*)atkTable; 108 } 109 110 /** 111 * Sets our main struct and passes it to the parent class 112 */ 113 public this (AtkTable* atkTable) 114 { 115 this.atkTable = atkTable; 116 } 117 118 /** 119 */ 120 int[string] connectedSignals; 121 122 void delegate(gint, gint, Table)[] onColumnDeletedListeners; 123 /** 124 * The "column-deleted" signal is emitted by an object which 125 * implements the AtkTable interface when a column is deleted. 126 */ 127 void addOnColumnDeleted(void delegate(gint, gint, Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 128 { 129 if ( !("column-deleted" in connectedSignals) ) 130 { 131 Signals.connectData( 132 getStruct(), 133 "column-deleted", 134 cast(GCallback)&callBackColumnDeleted, 135 cast(void*)this, 136 null, 137 connectFlags); 138 connectedSignals["column-deleted"] = 1; 139 } 140 onColumnDeletedListeners ~= dlg; 141 } 142 extern(C) static void callBackColumnDeleted(AtkTable* atktableStruct, gint arg1, gint arg2, Table _table) 143 { 144 foreach ( void delegate(gint, gint, Table) dlg ; _table.onColumnDeletedListeners ) 145 { 146 dlg(arg1, arg2, _table); 147 } 148 } 149 150 void delegate(gint, gint, Table)[] onColumnInsertedListeners; 151 /** 152 * The "column-inserted" signal is emitted by an object which 153 * implements the AtkTable interface when a column is inserted. 154 */ 155 void addOnColumnInserted(void delegate(gint, gint, Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 156 { 157 if ( !("column-inserted" in connectedSignals) ) 158 { 159 Signals.connectData( 160 getStruct(), 161 "column-inserted", 162 cast(GCallback)&callBackColumnInserted, 163 cast(void*)this, 164 null, 165 connectFlags); 166 connectedSignals["column-inserted"] = 1; 167 } 168 onColumnInsertedListeners ~= dlg; 169 } 170 extern(C) static void callBackColumnInserted(AtkTable* atktableStruct, gint arg1, gint arg2, Table _table) 171 { 172 foreach ( void delegate(gint, gint, Table) dlg ; _table.onColumnInsertedListeners ) 173 { 174 dlg(arg1, arg2, _table); 175 } 176 } 177 178 void delegate(Table)[] onColumnReorderedListeners; 179 /** 180 * The "column-reordered" signal is emitted by an object which 181 * implements the AtkTable interface when the columns are 182 * reordered. 183 */ 184 void addOnColumnReordered(void delegate(Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 185 { 186 if ( !("column-reordered" in connectedSignals) ) 187 { 188 Signals.connectData( 189 getStruct(), 190 "column-reordered", 191 cast(GCallback)&callBackColumnReordered, 192 cast(void*)this, 193 null, 194 connectFlags); 195 connectedSignals["column-reordered"] = 1; 196 } 197 onColumnReorderedListeners ~= dlg; 198 } 199 extern(C) static void callBackColumnReordered(AtkTable* atktableStruct, Table _table) 200 { 201 foreach ( void delegate(Table) dlg ; _table.onColumnReorderedListeners ) 202 { 203 dlg(_table); 204 } 205 } 206 207 void delegate(Table)[] onModelChangedListeners; 208 /** 209 * The "model-changed" signal is emitted by an object which 210 * implements the AtkTable interface when the model displayed by 211 * the table changes. 212 */ 213 void addOnModelChanged(void delegate(Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 214 { 215 if ( !("model-changed" in connectedSignals) ) 216 { 217 Signals.connectData( 218 getStruct(), 219 "model-changed", 220 cast(GCallback)&callBackModelChanged, 221 cast(void*)this, 222 null, 223 connectFlags); 224 connectedSignals["model-changed"] = 1; 225 } 226 onModelChangedListeners ~= dlg; 227 } 228 extern(C) static void callBackModelChanged(AtkTable* atktableStruct, Table _table) 229 { 230 foreach ( void delegate(Table) dlg ; _table.onModelChangedListeners ) 231 { 232 dlg(_table); 233 } 234 } 235 236 void delegate(gint, gint, Table)[] onRowDeletedListeners; 237 /** 238 * The "row-deleted" signal is emitted by an object which 239 * implements the AtkTable interface when a row is deleted. 240 */ 241 void addOnRowDeleted(void delegate(gint, gint, Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 242 { 243 if ( !("row-deleted" in connectedSignals) ) 244 { 245 Signals.connectData( 246 getStruct(), 247 "row-deleted", 248 cast(GCallback)&callBackRowDeleted, 249 cast(void*)this, 250 null, 251 connectFlags); 252 connectedSignals["row-deleted"] = 1; 253 } 254 onRowDeletedListeners ~= dlg; 255 } 256 extern(C) static void callBackRowDeleted(AtkTable* atktableStruct, gint arg1, gint arg2, Table _table) 257 { 258 foreach ( void delegate(gint, gint, Table) dlg ; _table.onRowDeletedListeners ) 259 { 260 dlg(arg1, arg2, _table); 261 } 262 } 263 264 void delegate(gint, gint, Table)[] onRowInsertedListeners; 265 /** 266 * The "row-inserted" signal is emitted by an object which 267 * implements the AtkTable interface when a row is inserted. 268 */ 269 void addOnRowInserted(void delegate(gint, gint, Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 270 { 271 if ( !("row-inserted" in connectedSignals) ) 272 { 273 Signals.connectData( 274 getStruct(), 275 "row-inserted", 276 cast(GCallback)&callBackRowInserted, 277 cast(void*)this, 278 null, 279 connectFlags); 280 connectedSignals["row-inserted"] = 1; 281 } 282 onRowInsertedListeners ~= dlg; 283 } 284 extern(C) static void callBackRowInserted(AtkTable* atktableStruct, gint arg1, gint arg2, Table _table) 285 { 286 foreach ( void delegate(gint, gint, Table) dlg ; _table.onRowInsertedListeners ) 287 { 288 dlg(arg1, arg2, _table); 289 } 290 } 291 292 void delegate(Table)[] onRowReorderedListeners; 293 /** 294 * The "row-reordered" signal is emitted by an object which 295 * implements the AtkTable interface when the rows are 296 * reordered. 297 */ 298 void addOnRowReordered(void delegate(Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 299 { 300 if ( !("row-reordered" in connectedSignals) ) 301 { 302 Signals.connectData( 303 getStruct(), 304 "row-reordered", 305 cast(GCallback)&callBackRowReordered, 306 cast(void*)this, 307 null, 308 connectFlags); 309 connectedSignals["row-reordered"] = 1; 310 } 311 onRowReorderedListeners ~= dlg; 312 } 313 extern(C) static void callBackRowReordered(AtkTable* atktableStruct, Table _table) 314 { 315 foreach ( void delegate(Table) dlg ; _table.onRowReorderedListeners ) 316 { 317 dlg(_table); 318 } 319 } 320 321 322 /** 323 * Get a reference to the table cell at row, column. 324 * Params: 325 * row = a gint representing a row in table 326 * column = a gint representing a column in table 327 * Returns: a AtkObject* representing the referred to accessible. [transfer full] 328 */ 329 public ObjectAtk refAt(int row, int column) 330 { 331 // AtkObject * atk_table_ref_at (AtkTable *table, gint row, gint column); 332 auto p = atk_table_ref_at(atkTable, row, column); 333 334 if(p is null) 335 { 336 return null; 337 } 338 339 return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p); 340 } 341 342 /** 343 * Gets a gint representing the index at the specified row and column. 344 * Params: 345 * row = a gint representing a row in table 346 * column = a gint representing a column in table 347 * Returns: a gint representing the index at specified position. The value -1 is returned if the object at row,column is not a child of table or table does not implement this interface. 348 */ 349 public int getIndexAt(int row, int column) 350 { 351 // gint atk_table_get_index_at (AtkTable *table, gint row, gint column); 352 return atk_table_get_index_at(atkTable, row, column); 353 } 354 355 /** 356 * Gets a gint representing the column at the specified index_. 357 * Params: 358 * index = a gint representing an index in table 359 * Returns: a gint representing the column at the specified index, or -1 if the table does not implement this interface 360 */ 361 public int getColumnAtIndex(int index) 362 { 363 // gint atk_table_get_column_at_index (AtkTable *table, gint index_); 364 return atk_table_get_column_at_index(atkTable, index); 365 } 366 367 /** 368 * Gets a gint representing the row at the specified index_. 369 * Params: 370 * index = a gint representing an index in table 371 * Returns: a gint representing the row at the specified index, or -1 if the table does not implement this interface 372 */ 373 public int getRowAtIndex(int index) 374 { 375 // gint atk_table_get_row_at_index (AtkTable *table, gint index_); 376 return atk_table_get_row_at_index(atkTable, index); 377 } 378 379 /** 380 * Gets the number of columns in the table. 381 * Returns: a gint representing the number of columns, or 0 if value does not implement this interface. 382 */ 383 public int getNColumns() 384 { 385 // gint atk_table_get_n_columns (AtkTable *table); 386 return atk_table_get_n_columns(atkTable); 387 } 388 389 /** 390 * Gets the number of rows in the table. 391 * Returns: a gint representing the number of rows, or 0 if value does not implement this interface. 392 */ 393 public int getNRows() 394 { 395 // gint atk_table_get_n_rows (AtkTable *table); 396 return atk_table_get_n_rows(atkTable); 397 } 398 399 /** 400 * Gets the number of columns occupied by the accessible object 401 * at the specified row and column in the table. 402 * Params: 403 * row = a gint representing a row in table 404 * column = a gint representing a column in table 405 * Returns: a gint representing the column extent at specified position, or 0 if value does not implement this interface. 406 */ 407 public int getColumnExtentAt(int row, int column) 408 { 409 // gint atk_table_get_column_extent_at (AtkTable *table, gint row, gint column); 410 return atk_table_get_column_extent_at(atkTable, row, column); 411 } 412 413 /** 414 * Gets the number of rows occupied by the accessible object 415 * at a specified row and column in the table. 416 * Params: 417 * row = a gint representing a row in table 418 * column = a gint representing a column in table 419 * Returns: a gint representing the row extent at specified position, or 0 if value does not implement this interface. 420 */ 421 public int getRowExtentAt(int row, int column) 422 { 423 // gint atk_table_get_row_extent_at (AtkTable *table, gint row, gint column); 424 return atk_table_get_row_extent_at(atkTable, row, column); 425 } 426 427 /** 428 * Gets the caption for the table. 429 * Returns: a AtkObject* representing the table caption, or NULL if value does not implement this interface. [transfer none] 430 */ 431 public ObjectAtk getCaption() 432 { 433 // AtkObject * atk_table_get_caption (AtkTable *table); 434 auto p = atk_table_get_caption(atkTable); 435 436 if(p is null) 437 { 438 return null; 439 } 440 441 return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p); 442 } 443 444 /** 445 * Gets the description text of the specified column in the table 446 * Params: 447 * column = a gint representing a column in table 448 * Returns: a gchar* representing the column description, or NULL if value does not implement this interface. 449 */ 450 public string getColumnDescription(int column) 451 { 452 // const gchar * atk_table_get_column_description (AtkTable *table, gint column); 453 return Str.toString(atk_table_get_column_description(atkTable, column)); 454 } 455 456 /** 457 * Gets the description text of the specified row in the table 458 * Params: 459 * row = a gint representing a row in table 460 * Returns: a gchar* representing the row description, or NULL if value does not implement this interface. 461 */ 462 public string getRowDescription(int row) 463 { 464 // const gchar * atk_table_get_row_description (AtkTable *table, gint row); 465 return Str.toString(atk_table_get_row_description(atkTable, row)); 466 } 467 468 /** 469 * Gets the column header of a specified column in an accessible table. 470 * Params: 471 * column = a gint representing a column in the table 472 * Returns: a AtkObject* representing the specified column header, or NULL if value does not implement this interface. [transfer none] 473 */ 474 public ObjectAtk getColumnHeader(int column) 475 { 476 // AtkObject * atk_table_get_column_header (AtkTable *table, gint column); 477 auto p = atk_table_get_column_header(atkTable, column); 478 479 if(p is null) 480 { 481 return null; 482 } 483 484 return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p); 485 } 486 487 /** 488 * Gets the row header of a specified row in an accessible table. 489 * Params: 490 * row = a gint representing a row in the table 491 * Returns: a AtkObject* representing the specified row header, or NULL if value does not implement this interface. [transfer none] 492 */ 493 public ObjectAtk getRowHeader(int row) 494 { 495 // AtkObject * atk_table_get_row_header (AtkTable *table, gint row); 496 auto p = atk_table_get_row_header(atkTable, row); 497 498 if(p is null) 499 { 500 return null; 501 } 502 503 return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p); 504 } 505 506 /** 507 * Gets the summary description of the table. 508 * Returns: a AtkObject* representing a summary description of the table, or zero if value does not implement this interface. [transfer full] 509 */ 510 public ObjectAtk getSummary() 511 { 512 // AtkObject * atk_table_get_summary (AtkTable *table); 513 auto p = atk_table_get_summary(atkTable); 514 515 if(p is null) 516 { 517 return null; 518 } 519 520 return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p); 521 } 522 523 /** 524 * Sets the caption for the table. 525 * Params: 526 * caption = a AtkObject representing the caption to set for table 527 */ 528 public void setCaption(ObjectAtk caption) 529 { 530 // void atk_table_set_caption (AtkTable *table, AtkObject *caption); 531 atk_table_set_caption(atkTable, (caption is null) ? null : caption.getObjectAtkStruct()); 532 } 533 534 /** 535 * Sets the description text for the specified row of table. 536 * Params: 537 * row = a gint representing a row in table 538 * description = a gchar representing the description text 539 * to set for the specified row of table 540 */ 541 public void setRowDescription(int row, string description) 542 { 543 // void atk_table_set_row_description (AtkTable *table, gint row, const gchar *description); 544 atk_table_set_row_description(atkTable, row, Str.toStringz(description)); 545 } 546 547 /** 548 * Sets the description text for the specified column of the table. 549 * Params: 550 * column = a gint representing a column in table 551 * description = a gchar representing the description text 552 * to set for the specified column of the table 553 */ 554 public void setColumnDescription(int column, string description) 555 { 556 // void atk_table_set_column_description (AtkTable *table, gint column, const gchar *description); 557 atk_table_set_column_description(atkTable, column, Str.toStringz(description)); 558 } 559 560 /** 561 * Sets the specified row header to header. 562 * Params: 563 * row = a gint representing a row in table 564 * header = an AtkTable 565 */ 566 public void setRowHeader(int row, ObjectAtk header) 567 { 568 // void atk_table_set_row_header (AtkTable *table, gint row, AtkObject *header); 569 atk_table_set_row_header(atkTable, row, (header is null) ? null : header.getObjectAtkStruct()); 570 } 571 572 /** 573 * Sets the specified column header to header. 574 * Params: 575 * column = a gint representing a column in table 576 * header = an AtkTable 577 */ 578 public void setColumnHeader(int column, ObjectAtk header) 579 { 580 // void atk_table_set_column_header (AtkTable *table, gint column, AtkObject *header); 581 atk_table_set_column_header(atkTable, column, (header is null) ? null : header.getObjectAtkStruct()); 582 } 583 584 /** 585 * Sets the summary description of the table. 586 * Params: 587 * accessible = an AtkObject representing the summary description 588 * to set for table 589 */ 590 public void setSummary(ObjectAtk accessible) 591 { 592 // void atk_table_set_summary (AtkTable *table, AtkObject *accessible); 593 atk_table_set_summary(atkTable, (accessible is null) ? null : accessible.getObjectAtkStruct()); 594 } 595 596 /** 597 * Gets the selected columns of the table by initializing **selected with 598 * the selected column numbers. This array should be freed by the caller. 599 * Params: 600 * selected = a gint** that is to contain the selected columns numbers 601 * Returns: a gint representing the number of selected columns, or 0 if value does not implement this interface. 602 */ 603 public int getSelectedColumns(out int[] selected) 604 { 605 // gint atk_table_get_selected_columns (AtkTable *table, gint **selected); 606 gint* outselected = null; 607 608 auto p = atk_table_get_selected_columns(atkTable, &outselected); 609 610 selected = outselected[0 .. p]; 611 return p; 612 } 613 614 /** 615 * Gets the selected rows of the table by initializing **selected with 616 * the selected row numbers. This array should be freed by the caller. 617 * Params: 618 * selected = a gint** that is to contain the selected row numbers 619 * Returns: a gint representing the number of selected rows, or zero if value does not implement this interface. 620 */ 621 public int getSelectedRows(out int[] selected) 622 { 623 // gint atk_table_get_selected_rows (AtkTable *table, gint **selected); 624 gint* outselected = null; 625 626 auto p = atk_table_get_selected_rows(atkTable, &outselected); 627 628 selected = outselected[0 .. p]; 629 return p; 630 } 631 632 /** 633 * Gets a boolean value indicating whether the specified column 634 * is selected 635 * Params: 636 * column = a gint representing a column in table 637 * Returns: a gboolean representing if the column is selected, or 0 if value does not implement this interface. 638 */ 639 public int isColumnSelected(int column) 640 { 641 // gboolean atk_table_is_column_selected (AtkTable *table, gint column); 642 return atk_table_is_column_selected(atkTable, column); 643 } 644 645 /** 646 * Gets a boolean value indicating whether the specified row 647 * is selected 648 * Params: 649 * row = a gint representing a row in table 650 * Returns: a gboolean representing if the row is selected, or 0 if value does not implement this interface. 651 */ 652 public int isRowSelected(int row) 653 { 654 // gboolean atk_table_is_row_selected (AtkTable *table, gint row); 655 return atk_table_is_row_selected(atkTable, row); 656 } 657 658 /** 659 * Gets a boolean value indicating whether the accessible object 660 * at the specified row and column is selected 661 * Params: 662 * row = a gint representing a row in table 663 * column = a gint representing a column in table 664 * Returns: a gboolean representing if the cell is selected, or 0 if value does not implement this interface. 665 */ 666 public int isSelected(int row, int column) 667 { 668 // gboolean atk_table_is_selected (AtkTable *table, gint row, gint column); 669 return atk_table_is_selected(atkTable, row, column); 670 } 671 672 /** 673 * Adds the specified column to the selection. 674 * Params: 675 * column = a gint representing a column in table 676 * Returns: a gboolean representing if the column was successfully added to the selection, or 0 if value does not implement this interface. 677 */ 678 public int addColumnSelection(int column) 679 { 680 // gboolean atk_table_add_column_selection (AtkTable *table, gint column); 681 return atk_table_add_column_selection(atkTable, column); 682 } 683 684 /** 685 * Adds the specified row to the selection. 686 * Params: 687 * row = a gint representing a row in table 688 * Returns: a gboolean representing if row was successfully added to selection, or 0 if value does not implement this interface. 689 */ 690 public int addRowSelection(int row) 691 { 692 // gboolean atk_table_add_row_selection (AtkTable *table, gint row); 693 return atk_table_add_row_selection(atkTable, row); 694 } 695 696 /** 697 * Adds the specified column to the selection. 698 * Params: 699 * column = a gint representing a column in table 700 * Returns: a gboolean representing if the column was successfully removed from the selection, or 0 if value does not implement this interface. 701 */ 702 public int removeColumnSelection(int column) 703 { 704 // gboolean atk_table_remove_column_selection (AtkTable *table, gint column); 705 return atk_table_remove_column_selection(atkTable, column); 706 } 707 708 /** 709 * Removes the specified row from the selection. 710 * Params: 711 * row = a gint representing a row in table 712 * Returns: a gboolean representing if the row was successfully removed from the selection, or 0 if value does not implement this interface. Signal Details The "column-deleted" signal void user_function (AtkTable *atktable, gint arg1, gint arg2, gpointer user_data) : Run Last The "column-deleted" signal is emitted by an object which implements the AtkTable interface when a column is deleted. 713 */ 714 public int removeRowSelection(int row) 715 { 716 // gboolean atk_table_remove_row_selection (AtkTable *table, gint row); 717 return atk_table_remove_row_selection(atkTable, row); 718 } 719 }