2011-04-27 13:42:27 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2011-05-27 22:37:24 +00:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
#include "InterfaceInitFuncs.h"
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2012-10-05 14:20:12 +00:00
|
|
|
#include "Accessible-inl.h"
|
2012-05-29 01:18:45 +00:00
|
|
|
#include "AccessibleWrap.h"
|
2010-04-27 06:52:03 +00:00
|
|
|
#include "nsAccUtils.h"
|
2012-03-28 00:53:58 +00:00
|
|
|
#include "TableAccessible.h"
|
2012-08-20 14:54:33 +00:00
|
|
|
#include "TableCellAccessible.h"
|
2012-03-20 04:02:50 +00:00
|
|
|
#include "nsMai.h"
|
2015-10-06 19:36:29 +00:00
|
|
|
#include "ProxyAccessible.h"
|
2009-09-11 01:07:56 +00:00
|
|
|
#include "nsArrayUtils.h"
|
|
|
|
|
2012-10-26 13:32:10 +00:00
|
|
|
#include "mozilla/Likely.h"
|
|
|
|
|
2012-03-28 00:53:58 +00:00
|
|
|
using namespace mozilla::a11y;
|
2012-03-28 00:32:49 +00:00
|
|
|
|
2012-03-28 00:53:58 +00:00
|
|
|
extern "C" {
|
2012-03-20 04:02:50 +00:00
|
|
|
static AtkObject*
|
2012-08-20 14:54:33 +00:00
|
|
|
refAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2015-10-06 19:36:29 +00:00
|
|
|
if (aRowIdx < 0 || aColIdx < 0) {
|
2012-08-20 14:54:33 +00:00
|
|
|
return nullptr;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2012-08-20 14:54:33 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
AtkObject* cellAtkObj = nullptr;
|
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
|
|
|
if (accWrap) {
|
|
|
|
Accessible* cell = accWrap->AsTable()->CellAt(aRowIdx, aColIdx);
|
|
|
|
if (!cell) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
cellAtkObj = AccessibleWrap::GetAtkObject(cell);
|
|
|
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
ProxyAccessible* cell = proxy->TableCellAt(aRowIdx, aColIdx);
|
|
|
|
if (!cell) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
cellAtkObj = GetWrapperFor(cell);
|
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
if (cellAtkObj) {
|
2012-08-20 14:54:33 +00:00
|
|
|
g_object_ref(cellAtkObj);
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2012-08-20 14:54:33 +00:00
|
|
|
|
|
|
|
return cellAtkObj;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2012-08-20 14:54:33 +00:00
|
|
|
getIndexAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2015-10-06 19:36:29 +00:00
|
|
|
if (aRowIdx < 0 || aColIdx < 0) {
|
2012-05-08 20:50:46 +00:00
|
|
|
return -1;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
|
|
|
if (accWrap) {
|
|
|
|
return static_cast<gint>(accWrap->AsTable()->CellIndexAt(aRowIdx, aColIdx));
|
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gint>(proxy->TableCellIndexAt(aRowIdx, aColIdx));
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2012-08-20 14:54:33 +00:00
|
|
|
getColumnAtIndexCB(AtkTable *aTable, gint aIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2015-10-06 19:36:29 +00:00
|
|
|
if (aIdx < 0) {
|
2012-05-29 01:18:45 +00:00
|
|
|
return -1;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
|
|
|
if (accWrap) {
|
2012-08-20 14:54:33 +00:00
|
|
|
return static_cast<gint>(accWrap->AsTable()->ColIndexAt(aIdx));
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gint>(proxy->TableColumnIndexAt(aIdx));
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2012-08-20 14:54:33 +00:00
|
|
|
getRowAtIndexCB(AtkTable *aTable, gint aIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2015-10-06 19:36:29 +00:00
|
|
|
if (aIdx < 0) {
|
2012-05-29 01:18:45 +00:00
|
|
|
return -1;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
|
|
|
if (accWrap) {
|
2012-08-20 14:54:33 +00:00
|
|
|
return static_cast<gint>(accWrap->AsTable()->RowIndexAt(aIdx));
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gint>(proxy->TableRowIndexAt(aIdx));
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2003-05-06 02:23:50 +00:00
|
|
|
getColumnCountCB(AtkTable *aTable)
|
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
2012-08-20 14:54:33 +00:00
|
|
|
return static_cast<gint>(accWrap->AsTable()->ColCount());
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gint>(proxy->TableColumnCount());
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2003-05-06 02:23:50 +00:00
|
|
|
getRowCountCB(AtkTable *aTable)
|
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
2012-08-20 14:54:33 +00:00
|
|
|
return static_cast<gint>(accWrap->AsTable()->RowCount());
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gint>(proxy->TableRowCount());
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2012-08-20 14:54:33 +00:00
|
|
|
getColumnExtentAtCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2015-10-06 19:36:29 +00:00
|
|
|
if (aRowIdx < 0 || aColIdx < 0) {
|
2012-05-29 01:18:45 +00:00
|
|
|
return -1;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
|
|
|
if (accWrap) {
|
2012-08-20 14:54:33 +00:00
|
|
|
return static_cast<gint>(accWrap->AsTable()->ColExtentAt(aRowIdx, aColIdx));
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gint>(proxy->TableColumnExtentAt(aRowIdx, aColIdx));
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2012-08-20 14:54:33 +00:00
|
|
|
getRowExtentAtCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
return static_cast<gint>(accWrap->AsTable()->RowExtentAt(aRowIdx, aColIdx));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gint>(proxy->TableRowExtentAt(aRowIdx, aColIdx));
|
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
return -1;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static AtkObject*
|
2012-03-28 00:53:58 +00:00
|
|
|
getCaptionCB(AtkTable* aTable)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
Accessible* caption = accWrap->AsTable()->Caption();
|
|
|
|
return caption ? AccessibleWrap::GetAtkObject(caption) : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
ProxyAccessible* caption = proxy->TableCaption();
|
|
|
|
return caption ? GetWrapperFor(caption) : nullptr;
|
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
return nullptr;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static const gchar*
|
2003-05-06 02:23:50 +00:00
|
|
|
getColumnDescriptionCB(AtkTable *aTable, gint aColumn)
|
|
|
|
{
|
2015-10-06 19:36:29 +00:00
|
|
|
nsAutoString autoStr;
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
accWrap->AsTable()->ColDescription(aColumn, autoStr);
|
|
|
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
proxy->TableColumnDescription(aColumn, autoStr);
|
|
|
|
} else {
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2006-05-29 05:46:38 +00:00
|
|
|
|
2012-08-20 14:54:33 +00:00
|
|
|
return AccessibleWrap::ReturnString(autoStr);
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static AtkObject*
|
2012-08-20 14:54:33 +00:00
|
|
|
getColumnHeaderCB(AtkTable *aTable, gint aColIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
Accessible* header =
|
|
|
|
AccessibleWrap::GetColumnHeader(accWrap->AsTable(), aColIdx);
|
|
|
|
return header ? AccessibleWrap::GetAtkObject(header) : nullptr;
|
|
|
|
}
|
2009-09-11 01:07:56 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
ProxyAccessible* header = proxy->AtkTableColumnHeader(aColIdx);
|
|
|
|
return header ? GetWrapperFor(header) : nullptr;
|
|
|
|
}
|
2012-08-20 14:54:33 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
return nullptr;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static const gchar*
|
2003-05-06 02:23:50 +00:00
|
|
|
getRowDescriptionCB(AtkTable *aTable, gint aRow)
|
|
|
|
{
|
2015-10-06 19:36:29 +00:00
|
|
|
nsAutoString autoStr;
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
accWrap->AsTable()->RowDescription(aRow, autoStr);
|
|
|
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
proxy->TableRowDescription(aRow, autoStr);
|
|
|
|
} else {
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2012-08-20 14:54:33 +00:00
|
|
|
return AccessibleWrap::ReturnString(autoStr);
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static AtkObject*
|
2012-08-20 14:54:33 +00:00
|
|
|
getRowHeaderCB(AtkTable *aTable, gint aRowIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
Accessible* header =
|
|
|
|
AccessibleWrap::GetRowHeader(accWrap->AsTable(), aRowIdx);
|
|
|
|
return header ? AccessibleWrap::GetAtkObject(header) : nullptr;
|
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
ProxyAccessible* header = proxy->AtkTableRowHeader(aRowIdx);
|
|
|
|
return header ? GetWrapperFor(header) : nullptr;
|
|
|
|
}
|
2012-08-20 14:54:33 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
return nullptr;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static AtkObject*
|
2003-05-06 02:23:50 +00:00
|
|
|
getSummaryCB(AtkTable *aTable)
|
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
// Neither html:table nor xul:tree nor ARIA grid/tree have an ability to
|
|
|
|
// link an accessible object to specify a summary. There is closes method
|
2012-08-20 14:54:33 +00:00
|
|
|
// in TableAccessible::summary to get a summary as a string which is not
|
2012-05-29 01:18:45 +00:00
|
|
|
// mapped directly to ATK.
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2012-08-20 14:54:33 +00:00
|
|
|
getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2012-08-20 14:54:33 +00:00
|
|
|
*aSelected = nullptr;
|
|
|
|
|
2016-02-02 15:36:30 +00:00
|
|
|
AutoTArray<uint32_t, 10> cols;
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
accWrap->AsTable()->SelectedColIndices(&cols);
|
|
|
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
proxy->TableSelectedColumnIndices(&cols);
|
|
|
|
} else {
|
2012-05-29 01:18:45 +00:00
|
|
|
return 0;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2012-08-20 14:54:33 +00:00
|
|
|
if (cols.IsEmpty())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
gint* atkColumns = g_new(gint, cols.Length());
|
|
|
|
if (!atkColumns) {
|
|
|
|
NS_WARNING("OUT OF MEMORY");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
memcpy(atkColumns, cols.Elements(), cols.Length() * sizeof(uint32_t));
|
|
|
|
*aSelected = atkColumns;
|
|
|
|
return cols.Length();
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gint
|
2003-05-06 02:23:50 +00:00
|
|
|
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
|
|
|
|
{
|
2016-02-02 15:36:30 +00:00
|
|
|
AutoTArray<uint32_t, 10> rows;
|
2012-08-20 14:54:33 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
accWrap->AsTable()->SelectedRowIndices(&rows);
|
|
|
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
proxy->TableSelectedRowIndices(&rows);
|
|
|
|
} else {
|
2012-08-20 14:54:33 +00:00
|
|
|
return 0;
|
2015-10-06 19:36:29 +00:00
|
|
|
}
|
2012-08-20 14:54:33 +00:00
|
|
|
|
|
|
|
gint* atkRows = g_new(gint, rows.Length());
|
|
|
|
if (!atkRows) {
|
|
|
|
NS_WARNING("OUT OF MEMORY");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
memcpy(atkRows, rows.Elements(), rows.Length() * sizeof(uint32_t));
|
|
|
|
*aSelected = atkRows;
|
|
|
|
return rows.Length();
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gboolean
|
2012-08-20 14:54:33 +00:00
|
|
|
isColumnSelectedCB(AtkTable *aTable, gint aColIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2012-08-20 14:54:33 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
return static_cast<gboolean>(accWrap->AsTable()->IsColSelected(aColIdx));
|
|
|
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gboolean>(proxy->TableColumnSelected(aColIdx));
|
|
|
|
}
|
2012-08-20 14:54:33 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
return FALSE;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gboolean
|
2012-08-20 14:54:33 +00:00
|
|
|
isRowSelectedCB(AtkTable *aTable, gint aRowIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
|
|
|
return static_cast<gboolean>(accWrap->AsTable()->IsRowSelected(aRowIdx));
|
|
|
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gboolean>(proxy->TableRowSelected(aRowIdx));
|
|
|
|
}
|
2003-05-06 02:23:50 +00:00
|
|
|
|
2015-10-06 19:36:29 +00:00
|
|
|
return FALSE;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
|
|
|
|
2012-03-20 04:02:50 +00:00
|
|
|
static gboolean
|
2012-08-20 14:54:33 +00:00
|
|
|
isCellSelectedCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
|
2003-05-06 02:23:50 +00:00
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
|
2015-10-06 19:36:29 +00:00
|
|
|
if (accWrap) {
|
2012-08-20 14:54:33 +00:00
|
|
|
return static_cast<gboolean>(accWrap->AsTable()->
|
|
|
|
IsCellSelected(aRowIdx, aColIdx));
|
2015-10-06 19:36:29 +00:00
|
|
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
|
|
|
|
return static_cast<gboolean>(proxy->TableCellSelected(aRowIdx, aColIdx));
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
2003-05-06 02:23:50 +00:00
|
|
|
}
|
2012-03-20 04:02:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tableInterfaceInitCB(AtkTableIface* aIface)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aIface, "no interface!");
|
2012-10-26 13:32:10 +00:00
|
|
|
if (MOZ_UNLIKELY(!aIface))
|
2012-03-20 04:02:50 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
aIface->ref_at = refAtCB;
|
|
|
|
aIface->get_index_at = getIndexAtCB;
|
|
|
|
aIface->get_column_at_index = getColumnAtIndexCB;
|
|
|
|
aIface->get_row_at_index = getRowAtIndexCB;
|
|
|
|
aIface->get_n_columns = getColumnCountCB;
|
|
|
|
aIface->get_n_rows = getRowCountCB;
|
|
|
|
aIface->get_column_extent_at = getColumnExtentAtCB;
|
|
|
|
aIface->get_row_extent_at = getRowExtentAtCB;
|
|
|
|
aIface->get_caption = getCaptionCB;
|
|
|
|
aIface->get_column_description = getColumnDescriptionCB;
|
|
|
|
aIface->get_column_header = getColumnHeaderCB;
|
|
|
|
aIface->get_row_description = getRowDescriptionCB;
|
|
|
|
aIface->get_row_header = getRowHeaderCB;
|
|
|
|
aIface->get_summary = getSummaryCB;
|
|
|
|
aIface->get_selected_columns = getSelectedColumnsCB;
|
|
|
|
aIface->get_selected_rows = getSelectedRowsCB;
|
|
|
|
aIface->is_column_selected = isColumnSelectedCB;
|
|
|
|
aIface->is_row_selected = isRowSelectedCB;
|
|
|
|
aIface->is_selected = isCellSelectedCB;
|
|
|
|
}
|