2001-12-17 01:21:29 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; 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/. */
|
2012-06-09 08:21:07 +00:00
|
|
|
|
|
|
|
#ifndef mozilla_a11y_XULListboxAccessible_h__
|
|
|
|
#define mozilla_a11y_XULListboxAccessible_h__
|
2001-12-17 01:21:29 +00:00
|
|
|
|
2012-06-04 12:32:29 +00:00
|
|
|
#include "BaseAccessibles.h"
|
2012-03-28 00:53:58 +00:00
|
|
|
#include "TableAccessible.h"
|
2012-07-24 15:58:25 +00:00
|
|
|
#include "TableCellAccessible.h"
|
2012-03-28 00:53:58 +00:00
|
|
|
#include "xpcAccessibleTable.h"
|
2012-07-24 15:58:25 +00:00
|
|
|
#include "xpcAccessibleTableCell.h"
|
2012-06-09 08:21:07 +00:00
|
|
|
#include "XULMenuAccessible.h"
|
2001-01-01 00:12:15 +00:00
|
|
|
#include "XULSelectControlAccessible.h"
|
2001-12-17 01:21:29 +00:00
|
|
|
|
2003-04-15 08:45:55 +00:00
|
|
|
class nsIWeakReference;
|
|
|
|
|
2012-06-09 08:21:07 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2001-12-17 01:21:29 +00:00
|
|
|
/**
|
2012-06-09 08:21:07 +00:00
|
|
|
* XULColumAccessible are accessible for list and tree columns elements
|
2007-09-19 03:31:14 +00:00
|
|
|
* (xul:treecols and xul:listcols).
|
|
|
|
*/
|
2012-06-09 08:21:07 +00:00
|
|
|
class XULColumAccessible : public AccessibleWrap
|
2007-09-19 03:31:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-06-09 08:21:07 +00:00
|
|
|
XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-09-19 03:31:14 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2007-09-19 03:31:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-09 08:21:07 +00:00
|
|
|
* XULColumnItemAccessible are accessibles for list and tree column elements
|
2007-09-19 03:31:14 +00:00
|
|
|
* (xul:listcol and xul:treecol).
|
|
|
|
*/
|
2012-06-09 08:21:07 +00:00
|
|
|
class XULColumnItemAccessible : public LeafAccessible
|
2007-09-19 03:31:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-06-09 08:21:07 +00:00
|
|
|
XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-09-19 03:31:14 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2008-10-10 12:26:55 +00:00
|
|
|
|
2011-06-05 19:35:43 +00:00
|
|
|
// ActionAccessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual uint8_t ActionCount() override;
|
|
|
|
virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
|
|
|
|
virtual bool DoAction(uint8_t aIndex) override;
|
2011-06-05 19:35:43 +00:00
|
|
|
|
2007-09-19 03:31:14 +00:00
|
|
|
enum { eAction_Click = 0 };
|
|
|
|
};
|
|
|
|
|
2001-12-17 01:21:29 +00:00
|
|
|
/*
|
|
|
|
* A class the represents the XUL Listbox widget.
|
|
|
|
*/
|
2012-06-09 08:21:07 +00:00
|
|
|
class XULListboxAccessible : public XULSelectControlAccessible,
|
|
|
|
public TableAccessible
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-06-09 08:21:07 +00:00
|
|
|
XULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2001-12-17 01:21:29 +00:00
|
|
|
|
2012-04-19 21:32:11 +00:00
|
|
|
// TableAccessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual uint32_t ColCount() override;
|
|
|
|
virtual uint32_t RowCount() override;
|
|
|
|
virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex) override;
|
|
|
|
virtual bool IsColSelected(uint32_t aColIdx) override;
|
|
|
|
virtual bool IsRowSelected(uint32_t aRowIdx) override;
|
|
|
|
virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx) override;
|
|
|
|
virtual uint32_t SelectedCellCount() override;
|
|
|
|
virtual uint32_t SelectedColCount() override;
|
|
|
|
virtual uint32_t SelectedRowCount() override;
|
|
|
|
virtual void SelectedCells(nsTArray<Accessible*>* aCells) override;
|
|
|
|
virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells) override;
|
|
|
|
virtual void SelectedColIndices(nsTArray<uint32_t>* aCols) override;
|
|
|
|
virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) override;
|
|
|
|
virtual void SelectRow(uint32_t aRowIdx) override;
|
|
|
|
virtual void UnselectRow(uint32_t aRowIdx) override;
|
|
|
|
virtual Accessible* AsAccessible() override { return this; }
|
2012-04-19 21:32:11 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void Value(nsString& aValue) override;
|
|
|
|
virtual TableAccessible* AsTable() override { return this; }
|
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2008-11-04 03:37:46 +00:00
|
|
|
|
2011-09-28 01:46:11 +00:00
|
|
|
// Widgets
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool IsWidget() const override;
|
|
|
|
virtual bool IsActiveWidget() const override;
|
|
|
|
virtual bool AreItemsOperable() const override;
|
2011-09-28 01:46:11 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual Accessible* ContainerWidget() const override;
|
2011-09-28 01:46:11 +00:00
|
|
|
|
2008-02-19 09:07:35 +00:00
|
|
|
protected:
|
2014-07-08 21:23:18 +00:00
|
|
|
virtual ~XULListboxAccessible() {}
|
|
|
|
|
2014-10-22 00:49:28 +00:00
|
|
|
bool IsMulticolumn() { return ColCount() > 1; }
|
2001-12-17 01:21:29 +00:00
|
|
|
};
|
|
|
|
|
2002-02-18 07:35:10 +00:00
|
|
|
/**
|
2012-06-09 08:21:07 +00:00
|
|
|
* Listitems -- used in listboxes
|
2002-02-18 07:35:10 +00:00
|
|
|
*/
|
2012-06-09 08:21:07 +00:00
|
|
|
class XULListitemAccessible : public XULMenuitemAccessible
|
2002-02-18 07:35:10 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-07-31 04:31:13 +00:00
|
|
|
enum { eAction_Click = 0 };
|
|
|
|
|
2002-02-18 07:35:10 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2012-06-09 08:21:07 +00:00
|
|
|
|
|
|
|
XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2002-02-18 07:35:10 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void Description(nsString& aDesc) override;
|
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
|
|
|
virtual uint64_t NativeInteractiveState() const override;
|
|
|
|
virtual bool CanHaveAnonChildren() override;
|
2008-02-19 13:47:19 +00:00
|
|
|
|
2014-09-16 17:30:23 +00:00
|
|
|
// Actions
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void ActionNameAt(uint8_t index, nsAString& aName) override;
|
2014-09-16 17:30:23 +00:00
|
|
|
|
2011-09-28 01:46:11 +00:00
|
|
|
// Widgets
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual Accessible* ContainerWidget() const override;
|
2011-09-28 01:46:11 +00:00
|
|
|
|
2008-02-19 09:07:35 +00:00
|
|
|
protected:
|
2014-07-08 21:23:18 +00:00
|
|
|
virtual ~XULListitemAccessible();
|
|
|
|
|
2012-10-14 04:18:39 +00:00
|
|
|
// Accessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) override;
|
2012-10-14 04:18:39 +00:00
|
|
|
|
|
|
|
// XULListitemAccessible
|
|
|
|
|
2010-04-24 00:40:51 +00:00
|
|
|
/**
|
|
|
|
* Return listbox accessible for the listitem.
|
|
|
|
*/
|
2014-09-16 17:30:23 +00:00
|
|
|
Accessible* GetListAccessible() const;
|
2008-02-19 09:07:35 +00:00
|
|
|
|
2004-06-09 04:11:01 +00:00
|
|
|
private:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIsCheckbox;
|
2002-02-18 07:35:10 +00:00
|
|
|
};
|
|
|
|
|
2008-02-19 09:07:35 +00:00
|
|
|
/**
|
|
|
|
* Class represents xul:listcell.
|
|
|
|
*/
|
2012-06-09 08:21:07 +00:00
|
|
|
class XULListCellAccessible : public HyperTextAccessibleWrap,
|
2014-10-22 00:49:28 +00:00
|
|
|
public TableCellAccessible
|
2008-02-19 09:07:35 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-06-09 08:21:07 +00:00
|
|
|
XULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-02-19 09:07:35 +00:00
|
|
|
|
2009-09-11 01:07:56 +00:00
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2008-11-01 03:58:07 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
// Accessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual TableCellAccessible* AsTableCell() override { return this; }
|
|
|
|
virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
|
|
|
|
virtual a11y::role NativeRole() override;
|
2012-08-09 06:24:31 +00:00
|
|
|
|
|
|
|
// TableCellAccessible
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual TableAccessible* Table() const override;
|
|
|
|
virtual uint32_t ColIdx() const override;
|
|
|
|
virtual uint32_t RowIdx() const override;
|
|
|
|
virtual void ColHeaderCells(nsTArray<Accessible*>* aHeaderCells) override;
|
|
|
|
virtual bool Selected() override;
|
2014-07-08 21:23:18 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~XULListCellAccessible() {}
|
2001-12-17 01:21:29 +00:00
|
|
|
};
|
|
|
|
|
2012-06-09 08:21:07 +00:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2002-01-11 03:48:02 +00:00
|
|
|
#endif
|