1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983
|
/* ATK - Accessibility Toolkit
* Copyright 2001 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "atktable.h"
#include "atkmarshal.h"
/**
* SECTION:atktable
* @Short_description: The ATK interface implemented for UI components
* which contain tabular or row/column information.
* @Title:AtkTable
*
* #AtkTable should be implemented by components which present
* elements ordered via rows and columns. It may also be used to
* present tree-structured information if the nodes of the trees can
* be said to contain multiple "columns". Individual elements of an
* #AtkTable are typically referred to as "cells". Those cells should
* implement the interface #AtkTableCell, but #Atk doesn't require
* them to be direct children of the current #AtkTable. They can be
* grand-children, grand-grand-children etc. #AtkTable provides the
* API needed to get a individual cell based on the row and column
* numbers.
*
* Children of #AtkTable are frequently "lightweight" objects, that
* is, they may not have backing widgets in the host UI toolkit. They
* are therefore often transient.
*
* Since tables are often very complex, #AtkTable includes provision
* for offering simplified summary information, as well as row and
* column headers and captions. Headers and captions are #AtkObjects
* which may implement other interfaces (#AtkText, #AtkImage, etc.) as
* appropriate. #AtkTable summaries may themselves be (simplified)
* #AtkTables, etc.
*
* Note for implementors: in the past, #AtkTable required that all the
* cells should be direct children of #AtkTable, and provided some
* index based methods to request the cells. The practice showed that
* that forcing made #AtkTable implementation complex, and hard to
* expose other kind of children, like rows or captions. Right now,
* index-based methods are deprecated.
*/
enum {
ROW_INSERTED,
ROW_DELETED,
COLUMN_INSERTED,
COLUMN_DELETED,
ROW_REORDERED,
COLUMN_REORDERED,
MODEL_CHANGED,
LAST_SIGNAL
};
static void atk_table_base_init (gpointer *g_class);
static guint atk_table_signals[LAST_SIGNAL] = { 0 };
GType
atk_table_get_type (void)
{
static GType type = 0;
if (!type) {
GTypeInfo tinfo =
{
sizeof (AtkTableIface),
(GBaseInitFunc) atk_table_base_init,
(GBaseFinalizeFunc) NULL,
};
type = g_type_register_static (G_TYPE_INTERFACE, "AtkTable", &tinfo, 0);
}
return type;
}
static void
atk_table_base_init (gpointer *g_class)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* AtkTable::row-inserted:
* @atktable: the object which received the signal.
* @arg1: The index of the first row inserted.
* @arg2: The number of rows inserted.
*
* The "row-inserted" signal is emitted by an object which
* implements the AtkTable interface when a row is inserted.
*/
atk_table_signals[ROW_INSERTED] =
g_signal_new ("row_inserted",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, row_inserted),
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__INT_INT,
G_TYPE_NONE,
2, G_TYPE_INT, G_TYPE_INT);
/**
* AtkTable::column-inserted:
* @atktable: the object which received the signal.
* @arg1: The index of the column inserted.
* @arg2: The number of colums inserted.
*
* The "column-inserted" signal is emitted by an object which
* implements the AtkTable interface when a column is inserted.
*/
atk_table_signals[COLUMN_INSERTED] =
g_signal_new ("column_inserted",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, column_inserted),
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__INT_INT,
G_TYPE_NONE,
2, G_TYPE_INT, G_TYPE_INT);
/**
* AtkTable::row-deleted:
* @atktable: the object which received the signal.
* @arg1: The index of the first row deleted.
* @arg2: The number of rows deleted.
*
* The "row-deleted" signal is emitted by an object which
* implements the AtkTable interface when a row is deleted.
*/
atk_table_signals[ROW_DELETED] =
g_signal_new ("row_deleted",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, row_deleted),
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__INT_INT,
G_TYPE_NONE,
2, G_TYPE_INT, G_TYPE_INT);
/**
* AtkTable::column-deleted:
* @atktable: the object which received the signal.
* @arg1: The index of the first column deleted.
* @arg2: The number of columns deleted.
*
* The "column-deleted" signal is emitted by an object which
* implements the AtkTable interface when a column is deleted.
*/
atk_table_signals[COLUMN_DELETED] =
g_signal_new ("column_deleted",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, column_deleted),
(GSignalAccumulator) NULL, NULL,
atk_marshal_VOID__INT_INT,
G_TYPE_NONE,
2, G_TYPE_INT, G_TYPE_INT);
/**
* AtkTable::row-reordered:
* @atktable: the object which received the signal.
*
* The "row-reordered" signal is emitted by an object which
* implements the AtkTable interface when the rows are
* reordered.
*/
atk_table_signals[ROW_REORDERED] =
g_signal_new ("row_reordered",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, row_reordered),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
/**
* AtkTable::column-reordered:
* @atktable: the object which received the signal.
*
* The "column-reordered" signal is emitted by an object which
* implements the AtkTable interface when the columns are
* reordered.
*/
atk_table_signals[COLUMN_REORDERED] =
g_signal_new ("column_reordered",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, column_reordered),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
/**
* AtkTable::model-changed:
* @atktable: the object which received the signal.
*
* The "model-changed" signal is emitted by an object which
* implements the AtkTable interface when the model displayed by
* the table changes.
*/
atk_table_signals[MODEL_CHANGED] =
g_signal_new ("model_changed",
ATK_TYPE_TABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AtkTableIface, model_changed),
(GSignalAccumulator) NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
}
/**
* atk_table_ref_at:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Get a reference to the table cell at @row, @column. This cell
* should implement the interface #AtkTableCell
*
* Returns: (transfer full): an #AtkObject representing the referred
* to accessible
**/
AtkObject*
atk_table_ref_at (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
g_return_val_if_fail (row >= 0, NULL);
g_return_val_if_fail (column >= 0, NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->ref_at)
return (iface->ref_at) (table, row, column);
else
return NULL;
}
/**
* atk_table_get_index_at:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Gets a #gint representing the index at the specified @row and
* @column.
*
* Deprecated: Since 2.12. Use atk_table_ref_at() in order to get the
* accessible that represents the cell at (@row, @column)
*
* 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.
**/
gint
atk_table_get_index_at (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), -1);
g_return_val_if_fail (row >= 0, -1);
g_return_val_if_fail (column >= 0, -1);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_index_at)
return (iface->get_index_at) (table, row, column);
else
return -1;
}
/**
* atk_table_get_row_at_index:
* @table: a GObject instance that implements AtkTableInterface
* @index_: a #gint representing an index in @table
*
* Gets a #gint representing the row at the specified @index_.
*
* Deprecated: since 2.12.
*
* Returns: a gint representing the row at the specified index,
* or -1 if the table does not implement this method.
**/
gint
atk_table_get_row_at_index (AtkTable *table,
gint index)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), -1);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_row_at_index)
return (iface->get_row_at_index) (table, index);
else
return -1;
}
/**
* atk_table_get_column_at_index:
* @table: a GObject instance that implements AtkTableInterface
* @index_: a #gint representing an index in @table
*
* Gets a #gint representing the column at the specified @index_.
*
* Deprecated: Since 2.12.
*
* Returns: a gint representing the column at the specified index,
* or -1 if the table does not implement this method.
**/
gint
atk_table_get_column_at_index (AtkTable *table,
gint index)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_column_at_index)
return (iface->get_column_at_index) (table, index);
else
return -1;
}
/**
* atk_table_get_caption:
* @table: a GObject instance that implements AtkTableInterface
*
* Gets the caption for the @table.
*
* Returns: (nullable) (transfer none): a AtkObject* representing the
* table caption, or %NULL if value does not implement this interface.
**/
AtkObject*
atk_table_get_caption (AtkTable *table)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_caption)
return (iface->get_caption) (table);
else
return NULL;
}
/**
* atk_table_get_n_columns:
* @table: a GObject instance that implements AtkTableIface
*
* Gets the number of columns in the table.
*
* Returns: a gint representing the number of columns, or 0
* if value does not implement this interface.
**/
gint
atk_table_get_n_columns (AtkTable *table)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_n_columns)
return (iface->get_n_columns) (table);
else
return 0;
}
/**
* atk_table_get_column_description:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
*
* Gets the description text of the specified @column in the table
*
* Returns: a gchar* representing the column description, or %NULL
* if value does not implement this interface.
**/
const gchar*
atk_table_get_column_description (AtkTable *table,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_column_description)
return (iface->get_column_description) (table, column);
else
return NULL;
}
/**
* atk_table_get_column_extent_at:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Gets the number of columns occupied by the accessible object
* at the specified @row and @column in the @table.
*
* Returns: a gint representing the column extent at specified position, or 0
* if value does not implement this interface.
**/
gint
atk_table_get_column_extent_at (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_column_extent_at)
return (iface->get_column_extent_at) (table, row, column);
else
return 0;
}
/**
* atk_table_get_column_header:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in the table
*
* Gets the column header of a specified column in an accessible table.
*
* Returns: (nullable) (transfer none): a AtkObject* representing the
* specified column header, or %NULL if value does not implement this
* interface.
**/
AtkObject*
atk_table_get_column_header (AtkTable *table, gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_column_header)
return (iface->get_column_header) (table, column);
else
return NULL;
}
/**
* atk_table_get_n_rows:
* @table: a GObject instance that implements AtkTableIface
*
* Gets the number of rows in the table.
*
* Returns: a gint representing the number of rows, or 0
* if value does not implement this interface.
**/
gint
atk_table_get_n_rows (AtkTable *table)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_n_rows)
return (iface->get_n_rows) (table);
else
return 0;
}
/**
* atk_table_get_row_description:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
*
* Gets the description text of the specified row in the table
*
* Returns: (nullable): a gchar* representing the row description, or
* %NULL if value does not implement this interface.
**/
const gchar*
atk_table_get_row_description (AtkTable *table,
gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_row_description)
return (iface->get_row_description) (table, row);
else
return NULL;
}
/**
* atk_table_get_row_extent_at:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Gets the number of rows occupied by the accessible object
* at a specified @row and @column in the @table.
*
* Returns: a gint representing the row extent at specified position, or 0
* if value does not implement this interface.
**/
gint
atk_table_get_row_extent_at (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_row_extent_at)
return (iface->get_row_extent_at) (table, row, column);
else
return 0;
}
/**
* atk_table_get_row_header:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in the table
*
* Gets the row header of a specified row in an accessible table.
*
* Returns: (nullable) (transfer none): a AtkObject* representing the
* specified row header, or %NULL if value does not implement this
* interface.
**/
AtkObject*
atk_table_get_row_header (AtkTable *table, gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_row_header)
return (iface->get_row_header) (table, row);
else
return NULL;
}
/**
* atk_table_get_summary:
* @table: a GObject instance that implements AtkTableIface
*
* Gets the summary description of the table.
*
* Returns: (transfer full): a AtkObject* representing a summary description
* of the table, or zero if value does not implement this interface.
**/
AtkObject*
atk_table_get_summary (AtkTable *table)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_summary)
return (iface->get_summary) (table);
else
return NULL;
}
/**
* atk_table_get_selected_rows:
* @table: a GObject instance that implements AtkTableIface
* @selected: a #gint** that is to contain the selected row numbers
*
* Gets the selected rows of the table by initializing **selected with
* the selected row numbers. This array should be freed by the caller.
*
* Returns: a gint representing the number of selected rows,
* or zero if value does not implement this interface.
**/
gint
atk_table_get_selected_rows (AtkTable *table, gint **selected)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_selected_rows)
return (iface->get_selected_rows) (table, selected);
else
return 0;
}
/**
* atk_table_get_selected_columns:
* @table: a GObject instance that implements AtkTableIface
* @selected: a #gint** that is to contain the selected columns numbers
*
* Gets the selected columns of the table by initializing **selected with
* the selected column numbers. This array should be freed by the caller.
*
* Returns: a gint representing the number of selected columns,
* or %0 if value does not implement this interface.
**/
gint
atk_table_get_selected_columns (AtkTable *table, gint **selected)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), 0);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->get_selected_columns)
return (iface->get_selected_columns) (table, selected);
else
return 0;
}
/**
* atk_table_is_column_selected:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
*
* Gets a boolean value indicating whether the specified @column
* is selected
*
* Returns: a gboolean representing if the column is selected, or 0
* if value does not implement this interface.
**/
gboolean
atk_table_is_column_selected (AtkTable *table,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->is_column_selected)
return (iface->is_column_selected) (table, column);
else
return FALSE;
}
/**
* atk_table_is_row_selected:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
*
* Gets a boolean value indicating whether the specified @row
* is selected
*
* Returns: a gboolean representing if the row is selected, or 0
* if value does not implement this interface.
**/
gboolean
atk_table_is_row_selected (AtkTable *table,
gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->is_row_selected)
return (iface->is_row_selected) (table, row);
else
return FALSE;
}
/**
* atk_table_is_selected:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @column: a #gint representing a column in @table
*
* Gets a boolean value indicating whether the accessible object
* at the specified @row and @column is selected
*
* Returns: a gboolean representing if the cell is selected, or 0
* if value does not implement this interface.
**/
gboolean
atk_table_is_selected (AtkTable *table,
gint row,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->is_selected)
return (iface->is_selected) (table, row, column);
else
return FALSE;
}
/**
* atk_table_add_row_selection:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
*
* Adds the specified @row to the selection.
*
* Returns: a gboolean representing if row was successfully added to selection,
* or 0 if value does not implement this interface.
**/
gboolean
atk_table_add_row_selection (AtkTable *table,
gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->add_row_selection)
return (iface->add_row_selection) (table, row);
else
return FALSE;
}
/**
* atk_table_remove_row_selection:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
*
* Removes the specified @row from the selection.
*
* Returns: a gboolean representing if the row was successfully removed from
* the selection, or 0 if value does not implement this interface.
**/
gboolean
atk_table_remove_row_selection (AtkTable *table,
gint row)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->remove_row_selection)
return (iface->remove_row_selection) (table, row);
else
return FALSE;
}
/**
* atk_table_add_column_selection:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
*
* Adds the specified @column to the selection.
*
* Returns: a gboolean representing if the column was successfully added to
* the selection, or 0 if value does not implement this interface.
**/
gboolean
atk_table_add_column_selection (AtkTable *table,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->add_column_selection)
return (iface->add_column_selection) (table, column);
else
return FALSE;
}
/**
* atk_table_remove_column_selection:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
*
* Adds the specified @column to the selection.
*
* Returns: a gboolean representing if the column was successfully removed from
* the selection, or 0 if value does not implement this interface.
**/
gboolean
atk_table_remove_column_selection (AtkTable *table,
gint column)
{
AtkTableIface *iface;
g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
iface = ATK_TABLE_GET_IFACE (table);
if (iface->remove_column_selection)
return (iface->remove_column_selection) (table, column);
else
return FALSE;
}
/**
* atk_table_set_caption:
* @table: a GObject instance that implements AtkTableIface
* @caption: a #AtkObject representing the caption to set for @table
*
* Sets the caption for the table.
**/
void
atk_table_set_caption (AtkTable *table,
AtkObject *caption)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_caption)
(iface->set_caption) (table, caption);
}
/**
* atk_table_set_column_description:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
* @description: a #gchar representing the description text
* to set for the specified @column of the @table
*
* Sets the description text for the specified @column of the @table.
**/
void
atk_table_set_column_description (AtkTable *table,
gint column,
const gchar *description)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_column_description)
(iface->set_column_description) (table, column, description);
}
/**
* atk_table_set_column_header:
* @table: a GObject instance that implements AtkTableIface
* @column: a #gint representing a column in @table
* @header: an #AtkTable
*
* Sets the specified column header to @header.
**/
void
atk_table_set_column_header (AtkTable *table,
gint column,
AtkObject *header)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_column_header)
(iface->set_column_header) (table, column, header);
}
/**
* atk_table_set_row_description:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @description: a #gchar representing the description text
* to set for the specified @row of @table
*
* Sets the description text for the specified @row of @table.
**/
void
atk_table_set_row_description (AtkTable *table,
gint row,
const gchar *description)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_row_description)
(iface->set_row_description) (table, row, description);
}
/**
* atk_table_set_row_header:
* @table: a GObject instance that implements AtkTableIface
* @row: a #gint representing a row in @table
* @header: an #AtkTable
*
* Sets the specified row header to @header.
**/
void
atk_table_set_row_header (AtkTable *table,
gint row,
AtkObject *header)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_row_header)
(iface->set_row_header) (table, row, header);
}
/**
* atk_table_set_summary:
* @table: a GObject instance that implements AtkTableIface
* @accessible: an #AtkObject representing the summary description
* to set for @table
*
* Sets the summary description of the table.
**/
void
atk_table_set_summary (AtkTable *table,
AtkObject *accessible)
{
AtkTableIface *iface;
g_return_if_fail (ATK_IS_TABLE (table));
iface = ATK_TABLE_GET_IFACE (table);
if (iface->set_summary)
(iface->set_summary) (table, accessible);
}
|