2009-05-18 01:35:21 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2009-05-18 01:35:21 -07:00
|
|
|
|
2012-04-09 03:18:03 -07:00
|
|
|
#ifndef MOZILLA_A11Y_ARIAGridAccessible_h_
|
|
|
|
#define MOZILLA_A11Y_ARIAGridAccessible_h_
|
2009-05-18 01:35:21 -07:00
|
|
|
|
|
|
|
#include "nsIAccessibleTable.h"
|
|
|
|
|
|
|
|
#include "nsHyperTextAccessibleWrap.h"
|
2012-03-27 17:53:58 -07:00
|
|
|
#include "TableAccessible.h"
|
|
|
|
#include "xpcAccessibleTable.h"
|
2009-05-18 01:35:21 -07:00
|
|
|
|
2012-04-09 03:18:03 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2009-05-18 01:35:21 -07:00
|
|
|
/**
|
|
|
|
* Accessible for ARIA grid and treegrid.
|
|
|
|
*/
|
2012-04-09 03:18:03 -07:00
|
|
|
class ARIAGridAccessible : public nsAccessibleWrap,
|
|
|
|
public xpcAccessibleTable,
|
|
|
|
public nsIAccessibleTable,
|
|
|
|
public TableAccessible
|
2009-05-18 01:35:21 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-05-18 01:35:21 -07:00
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// nsIAccessibleTable
|
2012-03-27 17:53:58 -07:00
|
|
|
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
|
|
|
|
|
|
|
|
// nsAccessible
|
|
|
|
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
|
|
|
|
|
|
|
|
// nsAccessNode
|
|
|
|
virtual void Shutdown();
|
2009-05-18 01:35:21 -07:00
|
|
|
|
2012-04-19 14:32:11 -07:00
|
|
|
// TableAccessible
|
|
|
|
virtual PRUint32 ColCount();
|
|
|
|
virtual PRUint32 RowCount();
|
2012-05-22 09:41:01 -07:00
|
|
|
virtual nsAccessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
|
2012-04-26 04:19:59 -07:00
|
|
|
virtual void UnselectCol(PRUint32 aColIdx);
|
|
|
|
virtual void UnselectRow(PRUint32 aRowIdx);
|
2012-04-19 14:32:11 -07:00
|
|
|
|
2009-05-18 01:35:21 -07:00
|
|
|
protected:
|
2009-06-12 05:52:29 -07:00
|
|
|
/**
|
|
|
|
* Return true if the given row index is valid.
|
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsValidRow(PRInt32 aRow);
|
2009-06-12 05:52:29 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrn true if the given column index is valid.
|
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsValidColumn(PRInt32 aColumn);
|
2009-06-12 05:52:29 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrun true if given row and column indexes are valid.
|
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn);
|
2009-06-12 05:52:29 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return row accessible at the given row index.
|
|
|
|
*/
|
2010-05-20 00:40:25 -07:00
|
|
|
nsAccessible *GetRowAt(PRInt32 aRow);
|
2009-06-12 05:52:29 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return cell accessible at the given column index in the row.
|
|
|
|
*/
|
2010-05-20 00:40:25 -07:00
|
|
|
nsAccessible *GetCellInRowAt(nsAccessible *aRow, PRInt32 aColumn);
|
2009-06-12 05:52:29 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set aria-selected attribute value on DOM node of the given accessible.
|
|
|
|
*
|
|
|
|
* @param aAccessible [in] accessible
|
|
|
|
* @param aIsSelected [in] new value of aria-selected attribute
|
|
|
|
* @param aNotify [in, optional] specifies if DOM should be notified
|
|
|
|
* about attribute change (used internally).
|
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
nsresult SetARIASelected(nsAccessible *aAccessible, bool aIsSelected,
|
|
|
|
bool aNotify = true);
|
2009-06-12 05:52:29 -07:00
|
|
|
|
|
|
|
/**
|
2009-09-10 18:07:56 -07:00
|
|
|
* Helper method for GetSelectedColumnCount and GetSelectedColumns.
|
2009-06-12 05:52:29 -07:00
|
|
|
*/
|
2009-09-10 18:07:56 -07:00
|
|
|
nsresult GetSelectedColumnsArray(PRUint32 *acolumnCount,
|
2009-06-12 05:52:29 -07:00
|
|
|
PRInt32 **aColumns = nsnull);
|
2009-05-18 01:35:21 -07:00
|
|
|
};
|
|
|
|
|
2009-06-12 05:52:29 -07:00
|
|
|
|
2009-05-18 01:35:21 -07:00
|
|
|
/**
|
|
|
|
* Accessible for ARIA gridcell and rowheader/columnheader.
|
|
|
|
*/
|
2012-04-09 03:18:03 -07:00
|
|
|
class ARIAGridCellAccessible : public nsHyperTextAccessibleWrap,
|
|
|
|
public nsIAccessibleTableCell
|
2009-05-18 01:35:21 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 02:01:40 -07:00
|
|
|
ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-05-18 01:35:21 -07:00
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2009-09-10 18:07:56 -07:00
|
|
|
// nsIAccessibleTableCell
|
|
|
|
NS_DECL_NSIACCESSIBLETABLECELL
|
|
|
|
|
2009-05-18 01:35:21 -07:00
|
|
|
// nsAccessible
|
2012-05-17 02:37:37 -07:00
|
|
|
virtual void ApplyARIAState(PRUint64* aState) const;
|
2009-05-18 01:35:21 -07:00
|
|
|
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
|
|
|
};
|
|
|
|
|
2012-04-09 03:18:03 -07:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2009-05-18 01:35:21 -07:00
|
|
|
#endif
|