Fix for bug 379585 - implement IAccessibleTable, r=aaronlev

This commit is contained in:
surkov.alexander@gmail.com 2007-05-05 23:09:49 -07:00
parent eca0bc73e1
commit d3a20ef799
12 changed files with 966 additions and 4 deletions

View File

@ -97,6 +97,7 @@ EXPORTS = \
nsXULMenuAccessibleWrap.h \
nsXULTreeAccessibleWrap.h \
nsHyperTextAccessibleWrap.h \
nsHTMLTableAccessibleWrap \
$(NULL)
# we want to force the creation of a static lib.

View File

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NSHTMLTABLEACCESSIBLEWRAP_H
#define _NSHTMLTABLEACCESSIBLEWRAP_H
#include "nsHTMLTableAccessible.h"
typedef class nsHTMLTableAccessible nsHTMLTableAccessibleWrap;
typedef class nsHTMLTableHeadAccessible nsHTMLTableHeadAccessibleWrap;
#endif

View File

@ -45,7 +45,7 @@
#include "nsHTMLImageAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsHTMLSelectAccessible.h"
#include "nsHTMLTableAccessible.h"
#include "nsHTMLTableAccessibleWrap.h"
#include "nsHTMLTextAccessible.h"
#include "nsHyperTextAccessibleWrap.h"
#include "nsIAccessibilityService.h"
@ -746,7 +746,7 @@ nsAccessibilityService::CreateHTMLTableAccessible(nsISupports *aFrame, nsIAccess
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLTableAccessible(node, weakShell);
*_retval = new nsHTMLTableAccessibleWrap(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
@ -769,8 +769,8 @@ nsAccessibilityService::CreateHTMLTableHeadAccessible(nsIDOMNode *aDOMNode, nsIA
rv = GetShellFromNode(aDOMNode, getter_AddRefs(weakShell));
NS_ENSURE_SUCCESS(rv, rv);
nsHTMLTableHeadAccessible* accTableHead =
new nsHTMLTableHeadAccessible(aDOMNode, weakShell);
nsHTMLTableHeadAccessibleWrap* accTableHead =
new nsHTMLTableHeadAccessibleWrap(aDOMNode, weakShell);
NS_ENSURE_TRUE(accTableHead, NS_ERROR_OUT_OF_MEMORY);

View File

@ -82,6 +82,7 @@ EXPORTS = \
nsXULMenuAccessibleWrap.h \
nsXULTreeAccessibleWrap.h \
nsHyperTextAccessibleWrap.h \
nsHTMLTableAccessibleWrap.h \
mozDocAccessible.h \
mozAccessible.h \
mozAccessibleWrapper.h \

View File

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NSHTMLTABLEACCESSIBLEWRAP_H
#define _NSHTMLTABLEACCESSIBLEWRAP_H
#include "nsHTMLTableAccessible.h"
typedef class nsHTMLTableAccessible nsHTMLTableAccessibleWrap;
typedef class nsHTMLTableHeadAccessible nsHTMLTableHeadAccessibleWrap;
#endif

View File

@ -0,0 +1,495 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "CAccessibleTable.h"
#include "Accessible2.h"
#include "AccessibleTable_i.c"
#include "nsIAccessible.h"
#include "nsIAccessibleTable.h"
#include "nsIWinAccessNode.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#define CANT_QUERY_ASSERTION_MSG \
"Subclass of CAccessibleTable doesn't implement nsIAccessibleTable"\
// IUnknown
STDMETHODIMP
CAccessibleTable::QueryInterface(REFIID iid, void** ppv)
{
*ppv = NULL;
if (IID_IAccessibleTable == iid) {
*ppv = NS_STATIC_CAST(IAccessibleTable*, this);
(NS_REINTERPRET_CAST(IUnknown*, *ppv))->AddRef();
return S_OK;
}
return E_NOINTERFACE;
}
// IAccessibleTable
STDMETHODIMP
CAccessibleTable::get_accessibleAt(long aRow, long aColumn,
IUnknown **aAccessible)
{
*aAccessible = NULL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
nsCOMPtr<nsIAccessible> cell;
tableAcc->CellRefAt(aRow, aColumn, getter_AddRefs(cell));
nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryInterface(cell));
if (!winAccessNode)
return E_FAIL;
void *instancePtr = NULL;
nsresult rv = winAccessNode->QueryNativeInterface(IID_IAccessible2,
&instancePtr);
if (NS_FAILED(rv))
return E_FAIL;
*aAccessible = NS_STATIC_CAST(IUnknown*, instancePtr);
return S_OK;
}
STDMETHODIMP
CAccessibleTable::get_caption(IUnknown **aAccessible)
{
*aAccessible = NULL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
nsCOMPtr<nsIAccessible> caption;
tableAcc->GetCaption(getter_AddRefs(caption));
nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryInterface(caption));
if (!winAccessNode)
return E_FAIL;
void *instancePtr = NULL;
nsresult rv = winAccessNode->QueryNativeInterface(IID_IAccessible2,
&instancePtr);
if (NS_FAILED(rv))
return E_FAIL;
*aAccessible = NS_STATIC_CAST(IUnknown*, instancePtr);
return S_OK;
}
STDMETHODIMP
CAccessibleTable::get_childIndex(long aRowIndex, long aColumnIndex,
long *aChildIndex)
{
*aChildIndex = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRInt32 childIndex = 0;
nsresult rv = tableAcc->GetIndexAt(aRowIndex, aColumnIndex, &childIndex);
*aChildIndex = childIndex;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_columnDescription(long aColumn, BSTR *aDescription)
{
*aDescription = NULL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
nsAutoString descr;
nsresult rv = tableAcc->GetColumnDescription (aColumn, descr);
if (NS_FAILED(rv))
return E_FAIL;
return ::SysReAllocStringLen(aDescription, descr.get(), descr.Length());
}
STDMETHODIMP
CAccessibleTable::get_columnExtentAt(long aRow, long aColumn,
long *nColumnsSpanned)
{
*nColumnsSpanned = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRInt32 columnsSpanned = 0;
nsresult rv = tableAcc->GetColumnExtentAt(aRow, aColumn, &columnsSpanned);
*nColumnsSpanned = columnsSpanned;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_columnHeader(IAccessibleTable **aAccessibleTable,
long *aStartingRowIndex)
{
*aAccessibleTable = NULL;
// XXX: starting row index is always 0.
*aStartingRowIndex = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
nsCOMPtr<nsIAccessibleTable> header;
nsresult rv = tableAcc->GetColumnHeader(getter_AddRefs(header));
if (NS_FAILED(rv))
return E_FAIL;
nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryInterface(header));
if (!winAccessNode)
return E_FAIL;
void *instancePtr = NULL;
rv = winAccessNode->QueryNativeInterface(IID_IAccessibleTable, &instancePtr);
if (NS_FAILED(rv))
return E_FAIL;
*aAccessibleTable = NS_STATIC_CAST(IAccessibleTable*, instancePtr);
return S_OK;
}
STDMETHODIMP
CAccessibleTable::get_columnIndex(long aChildIndex, long *aColumnIndex)
{
*aColumnIndex = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRInt32 columnIndex = 0;
nsresult rv = tableAcc->GetColumnAtIndex(aChildIndex, &columnIndex);
*aColumnIndex = columnIndex;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_nColumns(long *aColumnCount)
{
*aColumnCount = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRInt32 columnCount = 0;
nsresult rv = tableAcc->GetColumns(&columnCount);
*aColumnCount = columnCount;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_nRows(long *aRowCount)
{
*aRowCount = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRInt32 rowCount = 0;
nsresult rv = tableAcc->GetRows(&rowCount);
*aRowCount = rowCount;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_nSelectedChildren(long *aChildCount)
{
*aChildCount = 0;
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_nSelectedColumns(long *aColumnCount)
{
*aColumnCount = 0;
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_nSelectedRows(long *aRowCount)
{
*aRowCount = 0;
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_rowDescription(long aRow, BSTR *aDescription)
{
*aDescription = NULL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
nsAutoString descr;
nsresult rv = tableAcc->GetRowDescription (aRow, descr);
if (NS_FAILED(rv))
return E_FAIL;
return ::SysReAllocStringLen(aDescription, descr.get(), descr.Length());
}
STDMETHODIMP
CAccessibleTable::get_rowExtentAt(long aRow, long aColumn, long *aNRowsSpanned)
{
*aNRowsSpanned = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRInt32 rowsSpanned = 0;
nsresult rv = tableAcc->GetRowExtentAt(aRow, aColumn, &rowsSpanned);
*aNRowsSpanned = rowsSpanned;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_rowHeader(IAccessibleTable **aAccessibleTable,
long *aStartingColumnIndex)
{
*aAccessibleTable = NULL;
// XXX: starting column index is always 0.
*aStartingColumnIndex = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
nsCOMPtr<nsIAccessibleTable> header;
nsresult rv = tableAcc->GetRowHeader(getter_AddRefs(header));
if (NS_FAILED(rv))
return E_FAIL;
nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryInterface(header));
if (!winAccessNode)
return E_FAIL;
void *instancePtr = NULL;
rv = winAccessNode->QueryNativeInterface(IID_IAccessibleTable,
&instancePtr);
if (NS_FAILED(rv))
return E_FAIL;
*aAccessibleTable = NS_STATIC_CAST(IAccessibleTable*, instancePtr);
return S_OK;
}
STDMETHODIMP
CAccessibleTable::get_rowIndex(long aChildIndex, long *aRowIndex)
{
*aRowIndex = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRInt32 rowIndex = 0;
nsresult rv = tableAcc->GetRowAtIndex(aChildIndex, &rowIndex);
*aRowIndex = rowIndex;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_selectedChildren(long aMaxChildren, long **aChildren,
long *nChildren)
{
*aChildren = NULL;
*nChildren = 0;
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_selectedColumns(long aMaxColumns, long **aColumns,
long *aNColumns)
{
*aColumns = NULL;
*aNColumns = 0;
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_selectedRows(long aMaxRows, long **aRows, long *aNRows)
{
*aRows = NULL;
*aNRows = 0;
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_summary(IUnknown **aAccessible)
{
*aAccessible = NULL;
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_isColumnSelected(long aColumn, boolean *aIsSelected)
{
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRBool isSelected = PR_FALSE;
nsresult rv = tableAcc->IsColumnSelected(aColumn, &isSelected);
*aIsSelected = isSelected;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_isRowSelected(long aRow, boolean *aIsSelected)
{
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRBool isSelected = PR_FALSE;
nsresult rv = tableAcc->IsRowSelected(aRow, &isSelected);
*aIsSelected = isSelected;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_isSelected(long aRow, long aColumn, boolean *aIsSelected)
{
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRBool isSelected = PR_FALSE;
nsresult rv = tableAcc->IsCellSelected(aRow, aColumn, &isSelected);
*aIsSelected = isSelected;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::selectRow(long aRow)
{
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::selectColumn(long aColumn)
{
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::unselectRow(long aRow)
{
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::unselectColumn(long aColumn)
{
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_rowColumnExtentsAtIndex(long aIndex, long *aRow,
long *aColumn,
long *aRowExtents,
long *aColumnExtents,
boolean *aIsSelected)
{
*aRow = 0;
*aColumn = 0;
*aRowExtents = 0;
*aColumnExtents = 0;
return E_NOTIMPL;
}
STDMETHODIMP
CAccessibleTable::get_modelChange(IA2TableModelChange *aModelChange)
{
aModelChange = NULL;
return E_NOTIMPL;
}

View File

@ -0,0 +1,175 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _ACCESSIBLE_TABLE_H
#define _ACCESSIBLE_TABLE_H
#include "nsISupports.h"
#include "AccessibleTable.h"
class CAccessibleTable: public nsISupports,
public IAccessibleTable
{
public:
// IUnknown
STDMETHODIMP QueryInterface(REFIID, void**);
// IAccessibleTable
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_accessibleAt(
/* [in] */ long row,
/* [in] */ long column,
/* [retval][out] */ IUnknown **accessible);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_caption(
/* [retval][out] */ IUnknown **accessible);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_childIndex(
/* [in] */ long rowIndex,
/* [in] */ long columnIndex,
/* [retval][out] */ long *childIndex);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnDescription(
/* [in] */ long column,
/* [retval][out] */ BSTR *description);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnExtentAt(
/* [in] */ long row,
/* [in] */ long column,
/* [retval][out] */ long *nColumnsSpanned);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnHeader(
/* [out] */ IAccessibleTable **accessibleTable,
/* [retval][out] */ long *startingRowIndex);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnIndex(
/* [in] */ long childIndex,
/* [retval][out] */ long *columnIndex);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nColumns(
/* [retval][out] */ long *columnCount);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nRows(
/* [retval][out] */ long *rowCount);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nSelectedChildren(
/* [retval][out] */ long *childCount);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nSelectedColumns(
/* [retval][out] */ long *columnCount);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nSelectedRows(
/* [retval][out] */ long *rowCount);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowDescription(
/* [in] */ long row,
/* [retval][out] */ BSTR *description);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowExtentAt(
/* [in] */ long row,
/* [in] */ long column,
/* [retval][out] */ long *nRowsSpanned);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowHeader(
/* [out] */ IAccessibleTable **accessibleTable,
/* [retval][out] */ long *startingColumnIndex);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowIndex(
/* [in] */ long childIndex,
/* [retval][out] */ long *rowIndex);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedChildren(
/* [in] */ long maxChildren,
/* [length_is][length_is][size_is][size_is][out] */ long **children,
/* [retval][out] */ long *nChildren);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedColumns(
/* [in] */ long maxColumns,
/* [length_is][length_is][size_is][size_is][out] */ long **columns,
/* [retval][out] */ long *nColumns);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedRows(
/* [in] */ long maxRows,
/* [length_is][length_is][size_is][size_is][out] */ long **rows,
/* [retval][out] */ long *nRows);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_summary(
/* [retval][out] */ IUnknown **accessible);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isColumnSelected(
/* [in] */ long column,
/* [retval][out] */ boolean *isSelected);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isRowSelected(
/* [in] */ long row,
/* [retval][out] */ boolean *isSelected);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isSelected(
/* [in] */ long row,
/* [in] */ long column,
/* [retval][out] */ boolean *isSelected);
virtual HRESULT STDMETHODCALLTYPE selectRow(
/* [in] */ long row);
virtual HRESULT STDMETHODCALLTYPE selectColumn(
/* [in] */ long column);
virtual HRESULT STDMETHODCALLTYPE unselectRow(
/* [in] */ long row);
virtual HRESULT STDMETHODCALLTYPE unselectColumn(
/* [in] */ long column);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowColumnExtentsAtIndex(
/* [in] */ long index,
/* [out] */ long *row,
/* [out] */ long *column,
/* [out] */ long *rowExtents,
/* [out] */ long *columnExtents,
/* [retval][out] */ boolean *isSelected);
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_modelChange(
/* [retval][out] */ IA2TableModelChange *modelChange);
};
#endif

View File

@ -76,8 +76,10 @@ CPPSRCS = \
nsXULMenuAccessibleWrap.cpp \
nsXULTreeAccessibleWrap.cpp \
nsHyperTextAccessibleWrap.cpp \
nsHTMLTableAccessibleWrap.cpp \
CAccessibleText.cpp \
CAccessibleEditableText.cpp \
CAccessibleTable.cpp \
$(NULL)
EXPORTS = \
@ -90,8 +92,10 @@ EXPORTS = \
nsXULMenuAccessibleWrap.h \
nsXULTreeAccessibleWrap.h \
nsHyperTextAccessibleWrap.h \
nsHTMLTableAccessibleWrap.h \
CAccessibleText.h \
CAccessibleEditableText.h \
CAccessibleTable.h \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.

View File

@ -0,0 +1,56 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLTableAccessibleWrap.h"
NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLTableAccessibleWrap,
nsHTMLTableAccessible)
IMPL_IUNKNOWN_INHERITED1(nsHTMLTableAccessibleWrap,
nsAccessibleWrap,
CAccessibleTable);
NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLTableHeadAccessibleWrap,
nsHTMLTableHeadAccessible)
IMPL_IUNKNOWN_INHERITED1(nsHTMLTableHeadAccessibleWrap,
nsAccessibleWrap,
CAccessibleTable);

View File

@ -0,0 +1,76 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NSHTMLTABLEACCESSIBLEWRAP_H
#define _NSHTMLTABLEACCESSIBLEWRAP_H
#include "nsHTMLTableAccessible.h"
#include "CAccessibleTable.h"
class nsHTMLTableAccessibleWrap : public nsHTMLTableAccessible,
public CAccessibleTable
{
public:
nsHTMLTableAccessibleWrap(nsIDOMNode* aNode, nsIWeakReference* aShell) :
nsHTMLTableAccessible(aNode, aShell){}
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
class nsHTMLTableHeadAccessibleWrap : public nsHTMLTableHeadAccessible,
public CAccessibleTable
{
public:
nsHTMLTableHeadAccessibleWrap(nsIDOMNode* aNode, nsIWeakReference* aShell) :
nsHTMLTableHeadAccessible(aNode, aShell){}
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
#endif

View File

@ -82,6 +82,7 @@ EXPORTS = \
nsXULMenuAccessibleWrap.h \
nsXULTreeAccessibleWrap.h \
nsHyperTextAccessibleWrap.h \
nsHTMLTableAccessibleWrap.h \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.

View File

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NSHTMLTABLEACCESSIBLEWRAP_H
#define _NSHTMLTABLEACCESSIBLEWRAP_H
#include "nsHTMLTableAccessible.h"
typedef class nsHTMLTableAccessible nsHTMLTableAccessibleWrap;
typedef class nsHTMLTableHeadAccessible nsHTMLTableHeadAccessibleWrap;
#endif