alternative to assert
[gtkD.git] / src / atk / Table.d
blob9caed3f14cc456cc8a1e1c48efaf45af6fc5f489
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = AtkTable.html
26 * outPack = atk
27 * outFile = Table
28 * strct = AtkTable
29 * realStrct=
30 * ctorStrct=
31 * clss = Table
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_table_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * local aliases:
49 module atk.Table;
51 private import atk.atktypes;
53 private import lib.atk;
55 private import glib.Str;
57 /**
58 * Description
59 * AtkTable should be implemented by components which present elements
60 * ordered via rows and columns. It may also be used to present
61 * tree-structured information if the nodes of the trees can be said to
62 * contain multiple "columns". Individual elements of an AtkTable are
63 * typically referred to as "cells", and these cells are exposed by
64 * AtkTable as child AtkObjects of the AtkTable. Both row/column and
65 * child-index-based access to these children is provided.
66 * Children of AtkTable are frequently "lightweight" objects, that is,
67 * they may not have backing widgets in the host UI toolkit. They are
68 * therefore often transient.
69 * Since tables are often very complex, AtkTable includes provision for
70 * offering simplified summary information, as well as row and column
71 * headers and captions. Headers and captions are AtkObjects which may
72 * implement other interfaces (AtkText, AtkImage, etc.) as appropriate.
73 * AtkTable summaries may themselves be (simplified) AtkTables, etc.
75 public class Table
78 /** the main Gtk struct */
79 protected AtkTable* atkTable;
82 public AtkTable* getTableStruct()
84 return atkTable;
88 /** the main Gtk struct as a void* */
89 protected void* getStruct()
91 return cast(void*)atkTable;
94 /**
95 * Sets our main struct and passes it to the parent class
97 public this (AtkTable* atkTable)
99 this.atkTable = atkTable;
105 // imports for the signal processing
106 private import gobject.Signals;
107 private import gdk.gdktypes;
108 int[char[]] connectedSignals;
110 void delegate(gint, gint, Table)[] onColumnDeletedListeners;
111 void addOnColumnDeleted(void delegate(gint, gint, Table) dlg)
113 if ( !("column-deleted" in connectedSignals) )
115 Signals.connectData(
116 getStruct(),
117 "column-deleted",
118 cast(GCallback)&callBackColumnDeleted,
119 this,
120 null,
121 cast(ConnectFlags)0);
122 connectedSignals["column-deleted"] = 1;
124 onColumnDeletedListeners ~= dlg;
126 extern(C) static void callBackColumnDeleted(AtkTable* atktableStruct, gint arg1, gint arg2, Table table)
128 bit consumed = false;
130 foreach ( void delegate(gint, gint, Table) dlg ; table.onColumnDeletedListeners )
132 dlg(arg1, arg2, table);
135 return consumed;
138 void delegate(gint, gint, Table)[] onColumnInsertedListeners;
139 void addOnColumnInserted(void delegate(gint, gint, Table) dlg)
141 if ( !("column-inserted" in connectedSignals) )
143 Signals.connectData(
144 getStruct(),
145 "column-inserted",
146 cast(GCallback)&callBackColumnInserted,
147 this,
148 null,
149 cast(ConnectFlags)0);
150 connectedSignals["column-inserted"] = 1;
152 onColumnInsertedListeners ~= dlg;
154 extern(C) static void callBackColumnInserted(AtkTable* atktableStruct, gint arg1, gint arg2, Table table)
156 bit consumed = false;
158 foreach ( void delegate(gint, gint, Table) dlg ; table.onColumnInsertedListeners )
160 dlg(arg1, arg2, table);
163 return consumed;
166 void delegate(Table)[] onColumnReorderedListeners;
167 void addOnColumnReordered(void delegate(Table) dlg)
169 if ( !("column-reordered" in connectedSignals) )
171 Signals.connectData(
172 getStruct(),
173 "column-reordered",
174 cast(GCallback)&callBackColumnReordered,
175 this,
176 null,
177 cast(ConnectFlags)0);
178 connectedSignals["column-reordered"] = 1;
180 onColumnReorderedListeners ~= dlg;
182 extern(C) static void callBackColumnReordered(AtkTable* atktableStruct, Table table)
184 bit consumed = false;
186 foreach ( void delegate(Table) dlg ; table.onColumnReorderedListeners )
188 dlg(table);
191 return consumed;
194 void delegate(Table)[] onModelChangedListeners;
195 void addOnModelChanged(void delegate(Table) dlg)
197 if ( !("model-changed" in connectedSignals) )
199 Signals.connectData(
200 getStruct(),
201 "model-changed",
202 cast(GCallback)&callBackModelChanged,
203 this,
204 null,
205 cast(ConnectFlags)0);
206 connectedSignals["model-changed"] = 1;
208 onModelChangedListeners ~= dlg;
210 extern(C) static void callBackModelChanged(AtkTable* atktableStruct, Table table)
212 bit consumed = false;
214 foreach ( void delegate(Table) dlg ; table.onModelChangedListeners )
216 dlg(table);
219 return consumed;
222 void delegate(gint, gint, Table)[] onRowDeletedListeners;
223 void addOnRowDeleted(void delegate(gint, gint, Table) dlg)
225 if ( !("row-deleted" in connectedSignals) )
227 Signals.connectData(
228 getStruct(),
229 "row-deleted",
230 cast(GCallback)&callBackRowDeleted,
231 this,
232 null,
233 cast(ConnectFlags)0);
234 connectedSignals["row-deleted"] = 1;
236 onRowDeletedListeners ~= dlg;
238 extern(C) static void callBackRowDeleted(AtkTable* atktableStruct, gint arg1, gint arg2, Table table)
240 bit consumed = false;
242 foreach ( void delegate(gint, gint, Table) dlg ; table.onRowDeletedListeners )
244 dlg(arg1, arg2, table);
247 return consumed;
250 void delegate(gint, gint, Table)[] onRowInsertedListeners;
251 void addOnRowInserted(void delegate(gint, gint, Table) dlg)
253 if ( !("row-inserted" in connectedSignals) )
255 Signals.connectData(
256 getStruct(),
257 "row-inserted",
258 cast(GCallback)&callBackRowInserted,
259 this,
260 null,
261 cast(ConnectFlags)0);
262 connectedSignals["row-inserted"] = 1;
264 onRowInsertedListeners ~= dlg;
266 extern(C) static void callBackRowInserted(AtkTable* atktableStruct, gint arg1, gint arg2, Table table)
268 bit consumed = false;
270 foreach ( void delegate(gint, gint, Table) dlg ; table.onRowInsertedListeners )
272 dlg(arg1, arg2, table);
275 return consumed;
278 void delegate(Table)[] onRowReorderedListeners;
279 void addOnRowReordered(void delegate(Table) dlg)
281 if ( !("row-reordered" in connectedSignals) )
283 Signals.connectData(
284 getStruct(),
285 "row-reordered",
286 cast(GCallback)&callBackRowReordered,
287 this,
288 null,
289 cast(ConnectFlags)0);
290 connectedSignals["row-reordered"] = 1;
292 onRowReorderedListeners ~= dlg;
294 extern(C) static void callBackRowReordered(AtkTable* atktableStruct, Table table)
296 bit consumed = false;
298 foreach ( void delegate(Table) dlg ; table.onRowReorderedListeners )
300 dlg(table);
303 return consumed;
309 * Get a reference to the table cell at row, column.
310 * table:
311 * a GObject instance that implements AtkTableIface
312 * row:
313 * a gint representing a row in table
314 * column:
315 * a gint representing a column in table
316 * Returns:
317 * a AtkObject* representing the referred to accessible
319 public AtkObject* refAt(int row, int column)
321 // AtkObject* atk_table_ref_at (AtkTable *table, gint row, gint column);
322 return atk_table_ref_at(atkTable, row, column);
326 * Gets a gint representing the index at the specified row and column.
327 * table:
328 * a GObject instance that implements AtkTableIface
329 * row:
330 * a gint representing a row in table
331 * column:
332 * a gint representing a column in table
333 * Returns:
334 * a gint representing the index at specified position.
335 * The value -1 is returned if the object at row,column is not a child
336 * of table or table does not implement this interface.
338 public int getIndexAt(int row, int column)
340 // gint atk_table_get_index_at (AtkTable *table, gint row, gint column);
341 return atk_table_get_index_at(atkTable, row, column);
345 * Gets a gint representing the column at the specified index_.
346 * table:
347 * a GObject instance that implements AtkTableInterface
348 * index_:
349 * a gint representing an index in table
350 * Returns:
351 * a gint representing the column at the specified index,
352 * or -1 if the table does not implement this interface
354 public int getColumnAtIndex(int index)
356 // gint atk_table_get_column_at_index (AtkTable *table, gint index_);
357 return atk_table_get_column_at_index(atkTable, index);
361 * Gets a gint representing the row at the specified index_.
362 * table:
363 * a GObject instance that implements AtkTableInterface
364 * index_:
365 * a gint representing an index in table
366 * Returns:
367 * a gint representing the row at the specified index,
368 * or -1 if the table does not implement this interface
370 public int getRowAtIndex(int index)
372 // gint atk_table_get_row_at_index (AtkTable *table, gint index_);
373 return atk_table_get_row_at_index(atkTable, index);
377 * Gets the number of columns in the table.
378 * table:
379 * a GObject instance that implements AtkTableIface
380 * Returns:
381 * a gint representing the number of columns, or 0
382 * if value does not implement this interface.
384 public int getNColumns()
386 // gint atk_table_get_n_columns (AtkTable *table);
387 return atk_table_get_n_columns(atkTable);
391 * Gets the number of rows in the table.
392 * table:
393 * a GObject instance that implements AtkTableIface
394 * Returns:
395 * a gint representing the number of rows, or 0
396 * if value does not implement this interface.
398 public int getNRows()
400 // gint atk_table_get_n_rows (AtkTable *table);
401 return atk_table_get_n_rows(atkTable);
405 * Gets the number of columns occupied by the accessible object
406 * at the specified row and column in the table.
407 * table:
408 * a GObject instance that implements AtkTableIface
409 * row:
410 * a gint representing a row in table
411 * column:
412 * a gint representing a column in table
413 * Returns:
414 * a gint representing the column extent at specified position, or 0
415 * if value does not implement this interface.
417 public int getColumnExtentAt(int row, int column)
419 // gint atk_table_get_column_extent_at (AtkTable *table, gint row, gint column);
420 return atk_table_get_column_extent_at(atkTable, row, column);
424 * Gets the number of rows occupied by the accessible object
425 * at a specified row and column in the table.
426 * table:
427 * a GObject instance that implements AtkTableIface
428 * row:
429 * a gint representing a row in table
430 * column:
431 * a gint representing a column in table
432 * Returns:
433 * a gint representing the row extent at specified position, or 0
434 * if value does not implement this interface.
436 public int getRowExtentAt(int row, int column)
438 // gint atk_table_get_row_extent_at (AtkTable *table, gint row, gint column);
439 return atk_table_get_row_extent_at(atkTable, row, column);
443 * Gets the caption for the table.
444 * table:
445 * a GObject instance that implements AtkTableInterface
446 * Returns:
447 * a AtkObject* representing the table caption, or NULL
448 * if value does not implement this interface.
450 public AtkObject* getCaption()
452 // AtkObject* atk_table_get_caption (AtkTable *table);
453 return atk_table_get_caption(atkTable);
457 * Gets the description text of the specified column in the table
458 * table:
459 * a GObject instance that implements AtkTableIface
460 * column:
461 * a gint representing a column in table
462 * Returns:
463 * a gchar* representing the column description, or NULL
464 * if value does not implement this interface.
466 public char[] getColumnDescription(int column)
468 // const gchar* atk_table_get_column_description (AtkTable *table, gint column);
469 return Str.toString(atk_table_get_column_description(atkTable, column) );
473 * Gets the description text of the specified row in the table
474 * table:
475 * a GObject instance that implements AtkTableIface
476 * row:
477 * a gint representing a row in table
478 * Returns:
479 * a gchar* representing the row description, or NULL
480 * if value does not implement this interface.
482 public char[] getRowDescription(int row)
484 // const gchar* atk_table_get_row_description (AtkTable *table, gint row);
485 return Str.toString(atk_table_get_row_description(atkTable, row) );
489 * Gets the column header of a specified column in an accessible table.
490 * table:
491 * a GObject instance that implements AtkTableIface
492 * column:
493 * a gint representing a column in the table
494 * Returns:
495 * a AtkObject* representing the specified column header, or
496 * NULL if value does not implement this interface.
498 public AtkObject* getColumnHeader(int column)
500 // AtkObject* atk_table_get_column_header (AtkTable *table, gint column);
501 return atk_table_get_column_header(atkTable, column);
505 * Gets the row header of a specified row in an accessible table.
506 * table:
507 * a GObject instance that implements AtkTableIface
508 * row:
509 * a gint representing a row in the table
510 * Returns:
511 * a AtkObject* representing the specified row header, or
512 * NULL if value does not implement this interface.
514 public AtkObject* getRowHeader(int row)
516 // AtkObject* atk_table_get_row_header (AtkTable *table, gint row);
517 return atk_table_get_row_header(atkTable, row);
521 * Gets the summary description of the table.
522 * table:
523 * a GObject instance that implements AtkTableIface
524 * Returns:
525 * a AtkObject* representing a summary description of the table,
526 * or zero if value does not implement this interface.
528 public AtkObject* getSummary()
530 // AtkObject* atk_table_get_summary (AtkTable *table);
531 return atk_table_get_summary(atkTable);
535 * Sets the caption for the table.
536 * table:
537 * a GObject instance that implements AtkTableIface
538 * caption:
539 * a AtkObject representing the caption to set for table
541 public void setCaption(AtkObject* caption)
543 // void atk_table_set_caption (AtkTable *table, AtkObject *caption);
544 atk_table_set_caption(atkTable, caption);
548 * Sets the description text for the specified row of table.
549 * table:
550 * a GObject instance that implements AtkTableIface
551 * row:
552 * a gint representing a row in table
553 * description:
554 * a gchar representing the description text
555 * to set for the specified row of table
557 public void setRowDescription(int row, char[] description)
559 // void atk_table_set_row_description (AtkTable *table, gint row, const gchar *description);
560 atk_table_set_row_description(atkTable, row, Str.toStringz(description));
564 * Sets the description text for the specified column of the table.
565 * table:
566 * a GObject instance that implements AtkTableIface
567 * column:
568 * a gint representing a column in table
569 * description:
570 * a gchar representing the description text
571 * to set for the specified column of the table
573 public void setColumnDescription(int column, char[] description)
575 // void atk_table_set_column_description (AtkTable *table, gint column, const gchar *description);
576 atk_table_set_column_description(atkTable, column, Str.toStringz(description));
580 * Sets the specified row header to header.
581 * table:
582 * a GObject instance that implements AtkTableIface
583 * row:
584 * a gint representing a row in table
585 * header:
586 * an AtkTable
588 public void setRowHeader(int row, AtkObject* header)
590 // void atk_table_set_row_header (AtkTable *table, gint row, AtkObject *header);
591 atk_table_set_row_header(atkTable, row, header);
595 * Sets the specified column header to header.
596 * table:
597 * a GObject instance that implements AtkTableIface
598 * column:
599 * a gint representing a column in table
600 * header:
601 * an AtkTable
603 public void setColumnHeader(int column, AtkObject* header)
605 // void atk_table_set_column_header (AtkTable *table, gint column, AtkObject *header);
606 atk_table_set_column_header(atkTable, column, header);
610 * Sets the summary description of the table.
611 * table:
612 * a GObject instance that implements AtkTableIface
613 * accessible:
614 * an AtkObject representing the summary description
615 * to set for table
617 public void setSummary(AtkObject* accessible)
619 // void atk_table_set_summary (AtkTable *table, AtkObject *accessible);
620 atk_table_set_summary(atkTable, accessible);
624 * Gets the selected columns of the table by initializing **selected with
625 * the selected column numbers. This array should be freed by the caller.
626 * table:
627 * a GObject instance that implements AtkTableIface
628 * selected:
629 * a gint** that is to contain the selected columns numbers
630 * Returns:
631 * a gint representing the number of selected columns,
632 * or 0 if value does not implement this interface.
634 public int getSelectedColumns(int** selected)
636 // gint atk_table_get_selected_columns (AtkTable *table, gint **selected);
637 return atk_table_get_selected_columns(atkTable, selected);
641 * Gets the selected rows of the table by initializing **selected with
642 * the selected row numbers. This array should be freed by the caller.
643 * table:
644 * a GObject instance that implements AtkTableIface
645 * selected:
646 * a gint** that is to contain the selected row numbers
647 * Returns:
648 * a gint representing the number of selected rows,
649 * or zero if value does not implement this interface.
651 public int getSelectedRows(int** selected)
653 // gint atk_table_get_selected_rows (AtkTable *table, gint **selected);
654 return atk_table_get_selected_rows(atkTable, selected);
658 * Gets a boolean value indicating whether the specified column
659 * is selected
660 * table:
661 * a GObject instance that implements AtkTableIface
662 * column:
663 * a gint representing a column in table
664 * Returns:
665 * a gboolean representing if the column is selected, or 0
666 * if value does not implement this interface.
668 public int isColumnSelected(int column)
670 // gboolean atk_table_is_column_selected (AtkTable *table, gint column);
671 return atk_table_is_column_selected(atkTable, column);
675 * Gets a boolean value indicating whether the specified row
676 * is selected
677 * table:
678 * a GObject instance that implements AtkTableIface
679 * row:
680 * a gint representing a row in table
681 * Returns:
682 * a gboolean representing if the row is selected, or 0
683 * if value does not implement this interface.
685 public int isRowSelected(int row)
687 // gboolean atk_table_is_row_selected (AtkTable *table, gint row);
688 return atk_table_is_row_selected(atkTable, row);
692 * Gets a boolean value indicating whether the accessible object
693 * at the specified row and column is selected
694 * table:
695 * a GObject instance that implements AtkTableIface
696 * row:
697 * a gint representing a row in table
698 * column:
699 * a gint representing a column in table
700 * Returns:
701 * a gboolean representing if the cell is selected, or 0
702 * if value does not implement this interface.
704 public int isSelected(int row, int column)
706 // gboolean atk_table_is_selected (AtkTable *table, gint row, gint column);
707 return atk_table_is_selected(atkTable, row, column);
711 * Adds the specified column to the selection.
712 * table:
713 * a GObject instance that implements AtkTableIface
714 * column:
715 * a gint representing a column in table
716 * Returns:
717 * a gboolean representing if the column was successfully added to
718 * the selection, or 0 if value does not implement this interface.
720 public int addColumnSelection(int column)
722 // gboolean atk_table_add_column_selection (AtkTable *table, gint column);
723 return atk_table_add_column_selection(atkTable, column);
727 * Adds the specified row to the selection.
728 * table:
729 * a GObject instance that implements AtkTableIface
730 * row:
731 * a gint representing a row in table
732 * Returns:
733 * a gboolean representing if row was successfully added to selection,
734 * or 0 if value does not implement this interface.
736 public int addRowSelection(int row)
738 // gboolean atk_table_add_row_selection (AtkTable *table, gint row);
739 return atk_table_add_row_selection(atkTable, row);
743 * Adds the specified column to the selection.
744 * table:
745 * a GObject instance that implements AtkTableIface
746 * column:
747 * a gint representing a column in table
748 * Returns:
749 * a gboolean representing if the column was successfully removed from
750 * the selection, or 0 if value does not implement this interface.
752 public int removeColumnSelection(int column)
754 // gboolean atk_table_remove_column_selection (AtkTable *table, gint column);
755 return atk_table_remove_column_selection(atkTable, column);
759 * Removes the specified row from the selection.
760 * table:
761 * a GObject instance that implements AtkTableIface
762 * row:
763 * a gint representing a row in table
764 * Returns:
765 * a gboolean representing if the row was successfully removed from
766 * the selection, or 0 if value does not implement this interface.
767 * Signal Details
768 * The "column-deleted" signal
769 * void user_function (AtkTable *atktable,
770 * gint arg1,
771 * gint arg2,
772 * gpointer user_data) : Run last
773 * The "column-deleted" signal is emitted by an object which implements the
774 * AtkTable interface when a column is deleted.
775 * atktable:
776 * the object which received the signal.
777 * arg1:
778 * The index of the first column deleted.
779 * arg2:
780 * The number of columns deleted.
781 * user_data:
782 * user data set when the signal handler was connected.
784 public int removeRowSelection(int row)
786 // gboolean atk_table_remove_row_selection (AtkTable *table, gint row);
787 return atk_table_remove_row_selection(atkTable, row);