alternative to assert
[gtkD.git] / gtkD / src / atk / Table.d
blob87ba130a88f931af2b7b50b2ba3aea8b61123e1c
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 * module aliases:
47 * local aliases:
50 module atk.Table;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.atktypes;
62 private import gtkc.atk;
65 private import glib.Str;
70 /**
71 * Description
72 * AtkTable should be implemented by components which present elements
73 * ordered via rows and columns. It may also be used to present
74 * tree-structured information if the nodes of the trees can be said to
75 * contain multiple "columns". Individual elements of an AtkTable are
76 * typically referred to as "cells", and these cells are exposed by
77 * AtkTable as child AtkObjects of the AtkTable. Both row/column and
78 * child-index-based access to these children is provided.
79 * Children of AtkTable are frequently "lightweight" objects, that is,
80 * they may not have backing widgets in the host UI toolkit. They are
81 * therefore often transient.
82 * Since tables are often very complex, AtkTable includes provision for
83 * offering simplified summary information, as well as row and column
84 * headers and captions. Headers and captions are AtkObjects which may
85 * implement other interfaces (AtkText, AtkImage, etc.) as appropriate.
86 * AtkTable summaries may themselves be (simplified) AtkTables, etc.
88 public class Table
91 /** the main Gtk struct */
92 protected AtkTable* atkTable;
95 public AtkTable* getTableStruct()
97 return atkTable;
101 /** the main Gtk struct as a void* */
102 protected void* getStruct()
104 return cast(void*)atkTable;
108 * Sets our main struct and passes it to the parent class
110 public this (AtkTable* atkTable)
112 version(noAssert)
114 if ( atkTable is null )
116 int zero = 0;
117 version(Tango)
119 Stdout("struct atkTable is null on constructor").newline;
121 else
123 printf("struct atkTable is null on constructor");
125 zero = zero / zero;
128 else
130 assert(atkTable !is null, "struct atkTable is null on constructor");
132 this.atkTable = atkTable;
138 // imports for the signal processing
139 private import gobject.Signals;
140 private import gtkc.gdktypes;
141 int[char[]] connectedSignals;
143 void delegate(gint, gint, Table)[] onColumnDeletedListeners;
144 void addOnColumnDeleted(void delegate(gint, gint, Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
146 if ( !("column-deleted" in connectedSignals) )
148 Signals.connectData(
149 getStruct(),
150 "column-deleted",
151 cast(GCallback)&callBackColumnDeleted,
152 cast(void*)this,
153 null,
154 connectFlags);
155 connectedSignals["column-deleted"] = 1;
157 onColumnDeletedListeners ~= dlg;
159 extern(C) static void callBackColumnDeleted(AtkTable* atktableStruct, gint arg1, gint arg2, Table table)
161 bool consumed = false;
163 foreach ( void delegate(gint, gint, Table) dlg ; table.onColumnDeletedListeners )
165 dlg(arg1, arg2, table);
168 return consumed;
171 void delegate(gint, gint, Table)[] onColumnInsertedListeners;
172 void addOnColumnInserted(void delegate(gint, gint, Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
174 if ( !("column-inserted" in connectedSignals) )
176 Signals.connectData(
177 getStruct(),
178 "column-inserted",
179 cast(GCallback)&callBackColumnInserted,
180 cast(void*)this,
181 null,
182 connectFlags);
183 connectedSignals["column-inserted"] = 1;
185 onColumnInsertedListeners ~= dlg;
187 extern(C) static void callBackColumnInserted(AtkTable* atktableStruct, gint arg1, gint arg2, Table table)
189 bool consumed = false;
191 foreach ( void delegate(gint, gint, Table) dlg ; table.onColumnInsertedListeners )
193 dlg(arg1, arg2, table);
196 return consumed;
199 void delegate(Table)[] onColumnReorderedListeners;
200 void addOnColumnReordered(void delegate(Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
202 if ( !("column-reordered" in connectedSignals) )
204 Signals.connectData(
205 getStruct(),
206 "column-reordered",
207 cast(GCallback)&callBackColumnReordered,
208 cast(void*)this,
209 null,
210 connectFlags);
211 connectedSignals["column-reordered"] = 1;
213 onColumnReorderedListeners ~= dlg;
215 extern(C) static void callBackColumnReordered(AtkTable* atktableStruct, Table table)
217 bool consumed = false;
219 foreach ( void delegate(Table) dlg ; table.onColumnReorderedListeners )
221 dlg(table);
224 return consumed;
227 void delegate(Table)[] onModelChangedListeners;
228 void addOnModelChanged(void delegate(Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
230 if ( !("model-changed" in connectedSignals) )
232 Signals.connectData(
233 getStruct(),
234 "model-changed",
235 cast(GCallback)&callBackModelChanged,
236 cast(void*)this,
237 null,
238 connectFlags);
239 connectedSignals["model-changed"] = 1;
241 onModelChangedListeners ~= dlg;
243 extern(C) static void callBackModelChanged(AtkTable* atktableStruct, Table table)
245 bool consumed = false;
247 foreach ( void delegate(Table) dlg ; table.onModelChangedListeners )
249 dlg(table);
252 return consumed;
255 void delegate(gint, gint, Table)[] onRowDeletedListeners;
256 void addOnRowDeleted(void delegate(gint, gint, Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
258 if ( !("row-deleted" in connectedSignals) )
260 Signals.connectData(
261 getStruct(),
262 "row-deleted",
263 cast(GCallback)&callBackRowDeleted,
264 cast(void*)this,
265 null,
266 connectFlags);
267 connectedSignals["row-deleted"] = 1;
269 onRowDeletedListeners ~= dlg;
271 extern(C) static void callBackRowDeleted(AtkTable* atktableStruct, gint arg1, gint arg2, Table table)
273 bool consumed = false;
275 foreach ( void delegate(gint, gint, Table) dlg ; table.onRowDeletedListeners )
277 dlg(arg1, arg2, table);
280 return consumed;
283 void delegate(gint, gint, Table)[] onRowInsertedListeners;
284 void addOnRowInserted(void delegate(gint, gint, Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
286 if ( !("row-inserted" in connectedSignals) )
288 Signals.connectData(
289 getStruct(),
290 "row-inserted",
291 cast(GCallback)&callBackRowInserted,
292 cast(void*)this,
293 null,
294 connectFlags);
295 connectedSignals["row-inserted"] = 1;
297 onRowInsertedListeners ~= dlg;
299 extern(C) static void callBackRowInserted(AtkTable* atktableStruct, gint arg1, gint arg2, Table table)
301 bool consumed = false;
303 foreach ( void delegate(gint, gint, Table) dlg ; table.onRowInsertedListeners )
305 dlg(arg1, arg2, table);
308 return consumed;
311 void delegate(Table)[] onRowReorderedListeners;
312 void addOnRowReordered(void delegate(Table) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
314 if ( !("row-reordered" in connectedSignals) )
316 Signals.connectData(
317 getStruct(),
318 "row-reordered",
319 cast(GCallback)&callBackRowReordered,
320 cast(void*)this,
321 null,
322 connectFlags);
323 connectedSignals["row-reordered"] = 1;
325 onRowReorderedListeners ~= dlg;
327 extern(C) static void callBackRowReordered(AtkTable* atktableStruct, Table table)
329 bool consumed = false;
331 foreach ( void delegate(Table) dlg ; table.onRowReorderedListeners )
333 dlg(table);
336 return consumed;
342 * Get a reference to the table cell at row, column.
343 * table:
344 * a GObject instance that implements AtkTableIface
345 * row:
346 * a gint representing a row in table
347 * column:
348 * a gint representing a column in table
349 * Returns:
350 * a AtkObject* representing the referred to accessible
352 public AtkObject* refAt(int row, int column)
354 // AtkObject* atk_table_ref_at (AtkTable *table, gint row, gint column);
355 return atk_table_ref_at(atkTable, row, column);
359 * Gets a gint representing the index at the specified row and column.
360 * table:
361 * a GObject instance that implements AtkTableIface
362 * row:
363 * a gint representing a row in table
364 * column:
365 * a gint representing a column in table
366 * Returns:
367 * a gint representing the index at specified position.
368 * The value -1 is returned if the object at row,column is not a child
369 * of table or table does not implement this interface.
371 public int getIndexAt(int row, int column)
373 // gint atk_table_get_index_at (AtkTable *table, gint row, gint column);
374 return atk_table_get_index_at(atkTable, row, column);
378 * Gets a gint representing the column at the specified index_.
379 * table:
380 * a GObject instance that implements AtkTableInterface
381 * index_:
382 * a gint representing an index in table
383 * Returns:
384 * a gint representing the column at the specified index,
385 * or -1 if the table does not implement this interface
387 public int getColumnAtIndex(int index)
389 // gint atk_table_get_column_at_index (AtkTable *table, gint index_);
390 return atk_table_get_column_at_index(atkTable, index);
394 * Gets a gint representing the row at the specified index_.
395 * table:
396 * a GObject instance that implements AtkTableInterface
397 * index_:
398 * a gint representing an index in table
399 * Returns:
400 * a gint representing the row at the specified index,
401 * or -1 if the table does not implement this interface
403 public int getRowAtIndex(int index)
405 // gint atk_table_get_row_at_index (AtkTable *table, gint index_);
406 return atk_table_get_row_at_index(atkTable, index);
410 * Gets the number of columns in the table.
411 * table:
412 * a GObject instance that implements AtkTableIface
413 * Returns:
414 * a gint representing the number of columns, or 0
415 * if value does not implement this interface.
417 public int getNColumns()
419 // gint atk_table_get_n_columns (AtkTable *table);
420 return atk_table_get_n_columns(atkTable);
424 * Gets the number of rows in the table.
425 * table:
426 * a GObject instance that implements AtkTableIface
427 * Returns:
428 * a gint representing the number of rows, or 0
429 * if value does not implement this interface.
431 public int getNRows()
433 // gint atk_table_get_n_rows (AtkTable *table);
434 return atk_table_get_n_rows(atkTable);
438 * Gets the number of columns occupied by the accessible object
439 * at the specified row and column in the table.
440 * table:
441 * a GObject instance that implements AtkTableIface
442 * row:
443 * a gint representing a row in table
444 * column:
445 * a gint representing a column in table
446 * Returns:
447 * a gint representing the column extent at specified position, or 0
448 * if value does not implement this interface.
450 public int getColumnExtentAt(int row, int column)
452 // gint atk_table_get_column_extent_at (AtkTable *table, gint row, gint column);
453 return atk_table_get_column_extent_at(atkTable, row, column);
457 * Gets the number of rows occupied by the accessible object
458 * at a specified row and column in the table.
459 * table:
460 * a GObject instance that implements AtkTableIface
461 * row:
462 * a gint representing a row in table
463 * column:
464 * a gint representing a column in table
465 * Returns:
466 * a gint representing the row extent at specified position, or 0
467 * if value does not implement this interface.
469 public int getRowExtentAt(int row, int column)
471 // gint atk_table_get_row_extent_at (AtkTable *table, gint row, gint column);
472 return atk_table_get_row_extent_at(atkTable, row, column);
476 * Gets the caption for the table.
477 * table:
478 * a GObject instance that implements AtkTableInterface
479 * Returns:
480 * a AtkObject* representing the table caption, or NULL
481 * if value does not implement this interface.
483 public AtkObject* getCaption()
485 // AtkObject* atk_table_get_caption (AtkTable *table);
486 return atk_table_get_caption(atkTable);
490 * Gets the description text of the specified column in the table
491 * table:
492 * a GObject instance that implements AtkTableIface
493 * column:
494 * a gint representing a column in table
495 * Returns:
496 * a gchar* representing the column description, or NULL
497 * if value does not implement this interface.
499 public char[] getColumnDescription(int column)
501 // const gchar* atk_table_get_column_description (AtkTable *table, gint column);
502 return Str.toString(atk_table_get_column_description(atkTable, column) );
506 * Gets the description text of the specified row in the table
507 * table:
508 * a GObject instance that implements AtkTableIface
509 * row:
510 * a gint representing a row in table
511 * Returns:
512 * a gchar* representing the row description, or NULL
513 * if value does not implement this interface.
515 public char[] getRowDescription(int row)
517 // const gchar* atk_table_get_row_description (AtkTable *table, gint row);
518 return Str.toString(atk_table_get_row_description(atkTable, row) );
522 * Gets the column header of a specified column in an accessible table.
523 * table:
524 * a GObject instance that implements AtkTableIface
525 * column:
526 * a gint representing a column in the table
527 * Returns:
528 * a AtkObject* representing the specified column header, or
529 * NULL if value does not implement this interface.
531 public AtkObject* getColumnHeader(int column)
533 // AtkObject* atk_table_get_column_header (AtkTable *table, gint column);
534 return atk_table_get_column_header(atkTable, column);
538 * Gets the row header of a specified row in an accessible table.
539 * table:
540 * a GObject instance that implements AtkTableIface
541 * row:
542 * a gint representing a row in the table
543 * Returns:
544 * a AtkObject* representing the specified row header, or
545 * NULL if value does not implement this interface.
547 public AtkObject* getRowHeader(int row)
549 // AtkObject* atk_table_get_row_header (AtkTable *table, gint row);
550 return atk_table_get_row_header(atkTable, row);
554 * Gets the summary description of the table.
555 * table:
556 * a GObject instance that implements AtkTableIface
557 * Returns:
558 * a AtkObject* representing a summary description of the table,
559 * or zero if value does not implement this interface.
561 public AtkObject* getSummary()
563 // AtkObject* atk_table_get_summary (AtkTable *table);
564 return atk_table_get_summary(atkTable);
568 * Sets the caption for the table.
569 * table:
570 * a GObject instance that implements AtkTableIface
571 * caption:
572 * a AtkObject representing the caption to set for table
574 public void setCaption(AtkObject* caption)
576 // void atk_table_set_caption (AtkTable *table, AtkObject *caption);
577 atk_table_set_caption(atkTable, caption);
581 * Sets the description text for the specified row of table.
582 * table:
583 * a GObject instance that implements AtkTableIface
584 * row:
585 * a gint representing a row in table
586 * description:
587 * a gchar representing the description text
588 * to set for the specified row of table
590 public void setRowDescription(int row, char[] description)
592 // void atk_table_set_row_description (AtkTable *table, gint row, const gchar *description);
593 atk_table_set_row_description(atkTable, row, Str.toStringz(description));
597 * Sets the description text for the specified column of the table.
598 * table:
599 * a GObject instance that implements AtkTableIface
600 * column:
601 * a gint representing a column in table
602 * description:
603 * a gchar representing the description text
604 * to set for the specified column of the table
606 public void setColumnDescription(int column, char[] description)
608 // void atk_table_set_column_description (AtkTable *table, gint column, const gchar *description);
609 atk_table_set_column_description(atkTable, column, Str.toStringz(description));
613 * Sets the specified row header to header.
614 * table:
615 * a GObject instance that implements AtkTableIface
616 * row:
617 * a gint representing a row in table
618 * header:
619 * an AtkTable
621 public void setRowHeader(int row, AtkObject* header)
623 // void atk_table_set_row_header (AtkTable *table, gint row, AtkObject *header);
624 atk_table_set_row_header(atkTable, row, header);
628 * Sets the specified column header to header.
629 * table:
630 * a GObject instance that implements AtkTableIface
631 * column:
632 * a gint representing a column in table
633 * header:
634 * an AtkTable
636 public void setColumnHeader(int column, AtkObject* header)
638 // void atk_table_set_column_header (AtkTable *table, gint column, AtkObject *header);
639 atk_table_set_column_header(atkTable, column, header);
643 * Sets the summary description of the table.
644 * table:
645 * a GObject instance that implements AtkTableIface
646 * accessible:
647 * an AtkObject representing the summary description
648 * to set for table
650 public void setSummary(AtkObject* accessible)
652 // void atk_table_set_summary (AtkTable *table, AtkObject *accessible);
653 atk_table_set_summary(atkTable, accessible);
657 * Gets the selected columns of the table by initializing **selected with
658 * the selected column numbers. This array should be freed by the caller.
659 * table:
660 * a GObject instance that implements AtkTableIface
661 * selected:
662 * a gint** that is to contain the selected columns numbers
663 * Returns:
664 * a gint representing the number of selected columns,
665 * or 0 if value does not implement this interface.
667 public int getSelectedColumns(int** selected)
669 // gint atk_table_get_selected_columns (AtkTable *table, gint **selected);
670 return atk_table_get_selected_columns(atkTable, selected);
674 * Gets the selected rows of the table by initializing **selected with
675 * the selected row numbers. This array should be freed by the caller.
676 * table:
677 * a GObject instance that implements AtkTableIface
678 * selected:
679 * a gint** that is to contain the selected row numbers
680 * Returns:
681 * a gint representing the number of selected rows,
682 * or zero if value does not implement this interface.
684 public int getSelectedRows(int** selected)
686 // gint atk_table_get_selected_rows (AtkTable *table, gint **selected);
687 return atk_table_get_selected_rows(atkTable, selected);
691 * Gets a boolean value indicating whether the specified column
692 * is selected
693 * table:
694 * a GObject instance that implements AtkTableIface
695 * column:
696 * a gint representing a column in table
697 * Returns:
698 * a gboolean representing if the column is selected, or 0
699 * if value does not implement this interface.
701 public int isColumnSelected(int column)
703 // gboolean atk_table_is_column_selected (AtkTable *table, gint column);
704 return atk_table_is_column_selected(atkTable, column);
708 * Gets a boolean value indicating whether the specified row
709 * is selected
710 * table:
711 * a GObject instance that implements AtkTableIface
712 * row:
713 * a gint representing a row in table
714 * Returns:
715 * a gboolean representing if the row is selected, or 0
716 * if value does not implement this interface.
718 public int isRowSelected(int row)
720 // gboolean atk_table_is_row_selected (AtkTable *table, gint row);
721 return atk_table_is_row_selected(atkTable, row);
725 * Gets a boolean value indicating whether the accessible object
726 * at the specified row and column is selected
727 * table:
728 * a GObject instance that implements AtkTableIface
729 * row:
730 * a gint representing a row in table
731 * column:
732 * a gint representing a column in table
733 * Returns:
734 * a gboolean representing if the cell is selected, or 0
735 * if value does not implement this interface.
737 public int isSelected(int row, int column)
739 // gboolean atk_table_is_selected (AtkTable *table, gint row, gint column);
740 return atk_table_is_selected(atkTable, row, column);
744 * Adds the specified column to the selection.
745 * table:
746 * a GObject instance that implements AtkTableIface
747 * column:
748 * a gint representing a column in table
749 * Returns:
750 * a gboolean representing if the column was successfully added to
751 * the selection, or 0 if value does not implement this interface.
753 public int addColumnSelection(int column)
755 // gboolean atk_table_add_column_selection (AtkTable *table, gint column);
756 return atk_table_add_column_selection(atkTable, column);
760 * Adds the specified row to the selection.
761 * table:
762 * a GObject instance that implements AtkTableIface
763 * row:
764 * a gint representing a row in table
765 * Returns:
766 * a gboolean representing if row was successfully added to selection,
767 * or 0 if value does not implement this interface.
769 public int addRowSelection(int row)
771 // gboolean atk_table_add_row_selection (AtkTable *table, gint row);
772 return atk_table_add_row_selection(atkTable, row);
776 * Adds the specified column to the selection.
777 * table:
778 * a GObject instance that implements AtkTableIface
779 * column:
780 * a gint representing a column in table
781 * Returns:
782 * a gboolean representing if the column was successfully removed from
783 * the selection, or 0 if value does not implement this interface.
785 public int removeColumnSelection(int column)
787 // gboolean atk_table_remove_column_selection (AtkTable *table, gint column);
788 return atk_table_remove_column_selection(atkTable, column);
792 * Removes the specified row from the selection.
793 * table:
794 * a GObject instance that implements AtkTableIface
795 * row:
796 * a gint representing a row in table
797 * Returns:
798 * a gboolean representing if the row was successfully removed from
799 * the selection, or 0 if value does not implement this interface.
800 * Signal Details
801 * The "column-deleted" signal
802 * void user_function (AtkTable *atktable,
803 * gint arg1,
804 * gint arg2,
805 * gpointer user_data) : Run Last
806 * The "column-deleted" signal is emitted by an object which implements the
807 * AtkTable interface when a column is deleted.
808 * atktable:
809 * the object which received the signal.
810 * arg1:
811 * The index of the first column deleted.
812 * arg2:
813 * The number of columns deleted.
814 * user_data:
815 * user data set when the signal handler was connected.
817 public int removeRowSelection(int row)
819 // gboolean atk_table_remove_row_selection (AtkTable *table, gint row);
820 return atk_table_remove_row_selection(atkTable, row);