2009-05-18 08:35:21 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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/. */
|
2009-05-18 08:35:21 +00:00
|
|
|
|
2012-04-09 10:18:03 +00:00
|
|
|
#ifndef MOZILLA_A11Y_ARIAGridAccessible_h_
|
|
|
|
#define MOZILLA_A11Y_ARIAGridAccessible_h_
|
2009-05-18 08:35:21 +00:00
|
|
|
|
|
|
|
#include "nsIAccessibleTable.h"
|
|
|
|
|
2012-05-31 08:04:41 +00:00
|
|
|
#include "HyperTextAccessibleWrap.h"
|
2012-03-28 00:53:58 +00:00
|
|
|
#include "TableAccessible.h"
|
|
|
|
#include "xpcAccessibleTable.h"
|
2009-05-18 08:35:21 +00:00
|
|
|
|
2012-04-09 10:18:03 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2009-05-18 08:35:21 +00:00
|
|
|
/**
|
|
|
|
* Accessible for ARIA grid and treegrid.
|
|
|
|
*/
|
2012-05-29 01:18:45 +00:00
|
|
|
class ARIAGridAccessible : public AccessibleWrap,
|
2012-04-09 10:18:03 +00:00
|
|
|
public xpcAccessibleTable,
|
|
|
|
public nsIAccessibleTable,
|
|
|
|
public TableAccessible
|
2009-05-18 08:35:21 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 09:01:40 +00:00
|
|
|
ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-05-18 08:35:21 +00:00
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// nsIAccessibleTable
|
2012-03-28 00:53:58 +00:00
|
|
|
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
|
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2012-03-28 00:53:58 +00:00
|
|
|
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
|
|
|
|
|
|
|
|
// nsAccessNode
|
|
|
|
virtual void Shutdown();
|
2009-05-18 08:35:21 +00:00
|
|
|
|
2012-04-19 21:32:11 +00:00
|
|
|
// TableAccessible
|
|
|
|
virtual PRUint32 ColCount();
|
|
|
|
virtual PRUint32 RowCount();
|
2012-05-29 01:18:45 +00:00
|
|
|
virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
|
2012-06-11 05:25:07 +00:00
|
|
|
virtual void SelectCol(PRUint32 aColIdx);
|
|
|
|
virtual void SelectRow(PRUint32 aRowIdx);
|
2012-04-26 11:19:59 +00:00
|
|
|
virtual void UnselectCol(PRUint32 aColIdx);
|
|
|
|
virtual void UnselectRow(PRUint32 aRowIdx);
|
2012-04-19 21:32:11 +00:00
|
|
|
|
2009-05-18 08:35:21 +00:00
|
|
|
protected:
|
2009-06-12 12:52:29 +00:00
|
|
|
/**
|
|
|
|
* Return true if the given row index is valid.
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsValidRow(PRInt32 aRow);
|
2009-06-12 12:52:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrn true if the given column index is valid.
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsValidColumn(PRInt32 aColumn);
|
2009-06-12 12:52:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return row accessible at the given row index.
|
|
|
|
*/
|
2012-05-29 01:18:45 +00:00
|
|
|
Accessible* GetRowAt(PRInt32 aRow);
|
2009-06-12 12:52:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return cell accessible at the given column index in the row.
|
|
|
|
*/
|
2012-05-29 01:18:45 +00:00
|
|
|
Accessible* GetCellInRowAt(Accessible* aRow, PRInt32 aColumn);
|
2009-06-12 12:52:29 +00: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).
|
|
|
|
*/
|
2012-05-29 01:18:45 +00:00
|
|
|
nsresult SetARIASelected(Accessible* aAccessible, bool aIsSelected,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aNotify = true);
|
2009-06-12 12:52:29 +00:00
|
|
|
|
|
|
|
/**
|
2009-09-11 01:07:56 +00:00
|
|
|
* Helper method for GetSelectedColumnCount and GetSelectedColumns.
|
2009-06-12 12:52:29 +00:00
|
|
|
*/
|
2009-09-11 01:07:56 +00:00
|
|
|
nsresult GetSelectedColumnsArray(PRUint32 *acolumnCount,
|
2009-06-12 12:52:29 +00:00
|
|
|
PRInt32 **aColumns = nsnull);
|
2009-05-18 08:35:21 +00:00
|
|
|
};
|
|
|
|
|
2009-06-12 12:52:29 +00:00
|
|
|
|
2009-05-18 08:35:21 +00:00
|
|
|
/**
|
|
|
|
* Accessible for ARIA gridcell and rowheader/columnheader.
|
|
|
|
*/
|
2012-05-31 08:04:41 +00:00
|
|
|
class ARIAGridCellAccessible : public HyperTextAccessibleWrap,
|
2012-04-09 10:18:03 +00:00
|
|
|
public nsIAccessibleTableCell
|
2009-05-18 08:35:21 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 09:01:40 +00:00
|
|
|
ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-05-18 08:35:21 +00:00
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2009-09-11 01:07:56 +00:00
|
|
|
// nsIAccessibleTableCell
|
|
|
|
NS_DECL_NSIACCESSIBLETABLECELL
|
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2012-05-17 09:37:37 +00:00
|
|
|
virtual void ApplyARIAState(PRUint64* aState) const;
|
2009-05-18 08:35:21 +00:00
|
|
|
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
|
|
|
};
|
|
|
|
|
2012-04-09 10:18:03 +00:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2009-05-18 08:35:21 +00:00
|
|
|
#endif
|