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