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