Bug 762755 - de-ns-ify nsXULMenuAccessible and nsXULListboxAccessible classes, r=surkov

--HG--
rename : accessible/src/atk/nsXULListboxAccessibleWrap.h => accessible/src/atk/XULListboxAccessibleWrap.h
rename : accessible/src/atk/nsXULMenuAccessibleWrap.h => accessible/src/atk/XULMenuAccessibleWrap.h
rename : accessible/src/mac/nsXULListboxAccessibleWrap.h => accessible/src/mac/XULListboxAccessibleWrap.h
rename : accessible/src/mac/nsXULMenuAccessibleWrap.h => accessible/src/mac/XULMenuAccessibleWrap.h
rename : accessible/src/msaa/nsXULListboxAccessibleWrap.cpp => accessible/src/msaa/XULListboxAccessibleWrap.cpp
rename : accessible/src/msaa/nsXULListboxAccessibleWrap.h => accessible/src/msaa/XULListboxAccessibleWrap.h
rename : accessible/src/msaa/nsXULMenuAccessibleWrap.cpp => accessible/src/msaa/XULMenuAccessibleWrap.cpp
rename : accessible/src/msaa/nsXULMenuAccessibleWrap.h => accessible/src/msaa/XULMenuAccessibleWrap.h
rename : accessible/src/other/nsXULMenuAccessibleWrap.h => accessible/src/other/XULMenuAccessibleWrap.h
rename : accessible/src/xul/nsXULMenuAccessible.cpp => accessible/src/xul/XULMenuAccessible.cpp
rename : accessible/src/xul/nsXULMenuAccessible.h => accessible/src/xul/XULMenuAccessible.h
This commit is contained in:
Mark Capella 2012-06-09 04:21:07 -04:00
parent 971b084ac9
commit 44a5184840
27 changed files with 417 additions and 349 deletions

View File

@ -0,0 +1,21 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
#define mozilla_a11y_XULListboxAccessibleWrap_h__
#include "XULListboxAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULListboxAccessible XULListboxAccessibleWrap;
typedef class XULListCellAccessible XULListCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -4,12 +4,17 @@
* 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/. */
#ifndef __nsXULListboxAccessibleWrap_h__
#define __nsXULListboxAccessibleWrap_h__
#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
#define mozilla_a11y_XULMenuAccessibleWrap_h__
#include "nsXULListboxAccessible.h"
#include "XULMenuAccessible.h"
typedef class nsXULListboxAccessible nsXULListboxAccessibleWrap;
typedef class nsXULListCellAccessible nsXULListCellAccessibleWrap;
namespace mozilla {
namespace a11y {
typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,14 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef __nsXULMenuAccessibleWrap_h__
#define __nsXULMenuAccessibleWrap_h__
#include "nsXULMenuAccessible.h"
typedef class nsXULMenuitemAccessible nsXULMenuitemAccessibleWrap;
#endif

View File

@ -70,12 +70,12 @@
#include "nsXULAlertAccessible.h"
#include "nsXULColorPickerAccessible.h"
#include "nsXULComboboxAccessible.h"
#include "XULFormControlAccessible.h"
#include "nsXULListboxAccessibleWrap.h"
#include "nsXULMenuAccessibleWrap.h"
#include "nsXULSliderAccessible.h"
#include "nsXULTabAccessible.h"
#include "XULElementAccessibles.h"
#include "XULFormControlAccessible.h"
#include "XULListboxAccessibleWrap.h"
#include "XULMenuAccessibleWrap.h"
#include "XULTreeGridAccessibleWrap.h"
#endif
@ -1360,31 +1360,31 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
break;
case nsIAccessibleProvider::XULListbox:
accessible = new nsXULListboxAccessibleWrap(aContent, aDoc);
accessible = new XULListboxAccessibleWrap(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListCell:
accessible = new nsXULListCellAccessibleWrap(aContent, aDoc);
accessible = new XULListCellAccessibleWrap(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListHead:
accessible = new nsXULColumAccessible(aContent, aDoc);
accessible = new XULColumAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListHeader:
accessible = new nsXULColumnItemAccessible(aContent, aDoc);
accessible = new XULColumnItemAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListitem:
accessible = new nsXULListitemAccessible(aContent, aDoc);
accessible = new XULListitemAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULMenubar:
accessible = new nsXULMenubarAccessible(aContent, aDoc);
accessible = new XULMenubarAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULMenuitem:
accessible = new nsXULMenuitemAccessibleWrap(aContent, aDoc);
accessible = new XULMenuitemAccessibleWrap(aContent, aDoc);
break;
case nsIAccessibleProvider::XULMenupopup:
@ -1400,12 +1400,12 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
kNameSpaceID_XUL))
return nsnull;
#endif
accessible = new nsXULMenupopupAccessible(aContent, aDoc);
accessible = new XULMenupopupAccessible(aContent, aDoc);
break;
}
case nsIAccessibleProvider::XULMenuSeparator:
accessible = new nsXULMenuSeparatorAccessible(aContent, aDoc);
accessible = new XULMenuSeparatorAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULPane:
@ -1464,7 +1464,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
break;
case nsIAccessibleProvider::XULTreeColumnItem:
accessible = new nsXULColumnItemAccessible(aContent, aDoc);
accessible = new XULColumnItemAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULToolbar:

View File

@ -345,7 +345,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
// radiogroup in prefWindow is exposed as a list,
// and panebutton is exposed as XULListitem in A11y.
// nsXULListitemAccessible::GetStateInternal uses STATE_SELECTED in this case,
// XULListitemAccessible::GetStateInternal uses STATE_SELECTED in this case,
// so we need to check states::SELECTED also.
bool isEnabled = (state & (states::CHECKED | states::SELECTED)) != 0;

View File

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
#define mozilla_a11y_XULListboxAccessibleWrap_h__
#include "XULListboxAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULListboxAccessible XULListboxAccessibleWrap;
typedef class XULListCellAccessible XULListCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -3,12 +3,17 @@
* 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/. */
#ifndef __nsXULListboxAccessibleWrap_h__
#define __nsXULListboxAccessibleWrap_h__
#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
#define mozilla_a11y_XULMenuAccessibleWrap_h__
#include "nsXULListboxAccessible.h"
#include "XULMenuAccessible.h"
typedef class nsXULListboxAccessible nsXULListboxAccessibleWrap;
typedef class nsXULListCellAccessible nsXULListCellAccessibleWrap;
namespace mozilla {
namespace a11y {
typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,13 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef __nsXULMenuAccessibleWrap_h__
#define __nsXULMenuAccessibleWrap_h__
#include "nsXULMenuAccessible.h"
typedef class nsXULMenuitemAccessible nsXULMenuitemAccessibleWrap;
#endif

View File

@ -25,8 +25,6 @@ CPPSRCS = \
ImageAccessibleWrap.cpp \
nsAccessNodeWrap.cpp \
nsHTMLWin32ObjectAccessible.cpp \
nsXULMenuAccessibleWrap.cpp \
nsXULListboxAccessibleWrap.cpp \
nsWinUtils.cpp \
CAccessibleText.cpp \
CAccessibleEditableText.cpp \
@ -47,6 +45,8 @@ CPPSRCS = \
ifdef MOZ_XUL
CPPSRCS += \
XULListboxAccessibleWrap.cpp \
XULMenuAccessibleWrap.cpp \
XULTreeGridAccessibleWrap.cpp \
$(NULL)
endif

View File

@ -3,40 +3,42 @@
* 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/. */
#include "nsXULListboxAccessibleWrap.h"
#include "XULListboxAccessibleWrap.h"
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsXULListboxAccessibleWrap
// XULListboxAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
nsXULListboxAccessibleWrap::
nsXULListboxAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
nsXULListboxAccessible(aContent, aDoc)
XULListboxAccessibleWrap::
XULListboxAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
XULListboxAccessible(aContent, aDoc)
{
}
NS_IMPL_ISUPPORTS_INHERITED0(nsXULListboxAccessibleWrap,
nsXULListboxAccessible)
NS_IMPL_ISUPPORTS_INHERITED0(XULListboxAccessibleWrap,
XULListboxAccessible)
IMPL_IUNKNOWN_QUERY_HEAD(nsXULListboxAccessibleWrap)
IMPL_IUNKNOWN_QUERY_HEAD(XULListboxAccessibleWrap)
IMPL_IUNKNOWN_QUERY_ENTRY_COND(CAccessibleTable, IsMulticolumn());
IMPL_IUNKNOWN_QUERY_ENTRY(AccessibleWrap)
IMPL_IUNKNOWN_QUERY_TAIL
////////////////////////////////////////////////////////////////////////////////
// nsXULListCellAccessibleWrap
// XULListCellAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
nsXULListCellAccessibleWrap::
nsXULListCellAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
nsXULListCellAccessible(aContent, aDoc)
XULListCellAccessibleWrap::
XULListCellAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
XULListCellAccessible(aContent, aDoc)
{
}
NS_IMPL_ISUPPORTS_INHERITED0(nsXULListCellAccessibleWrap,
nsXULListCellAccessible)
NS_IMPL_ISUPPORTS_INHERITED0(XULListCellAccessibleWrap,
XULListCellAccessible)
IMPL_IUNKNOWN_INHERITED1(nsXULListCellAccessibleWrap,
IMPL_IUNKNOWN_INHERITED1(XULListCellAccessibleWrap,
HyperTextAccessibleWrap,
CAccessibleTableCell)

View File

@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
#define mozilla_a11y_XULListboxAccessibleWrap_h__
#include "XULListboxAccessible.h"
#include "CAccessibleTable.h"
#include "CAccessibleTableCell.h"
namespace mozilla {
namespace a11y {
/**
* IA2 wrapper class for XULListboxAccessible class implementing
* IAccessibleTable and IAccessibleTable2 interfaces.
*/
class XULListboxAccessibleWrap : public XULListboxAccessible,
public CAccessibleTable
{
public:
XULListboxAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
/**
* IA2 wrapper class for XULListCellAccessible class, implements
* IAccessibleTableCell interface.
*/
class XULListCellAccessibleWrap : public XULListCellAccessible,
public CAccessibleTableCell
{
public:
XULListCellAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -3,27 +3,27 @@
* 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/. */
#include "nsXULMenuAccessibleWrap.h"
#include "XULMenuAccessibleWrap.h"
#include "nsINameSpaceManager.h"
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsXULMenuAccessibleWrap
// XULMenuAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
nsXULMenuitemAccessibleWrap::
nsXULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
nsXULMenuitemAccessible(aContent, aDoc)
XULMenuitemAccessibleWrap::
XULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
XULMenuitemAccessible(aContent, aDoc)
{
}
ENameValueFlag
nsXULMenuitemAccessibleWrap::Name(nsString& aName)
XULMenuitemAccessibleWrap::Name(nsString& aName)
{
// XXX This should be done in get_accName() so that nsIAccessible::GetName()]
// provides the same results on all platforms
nsXULMenuitemAccessible::Name(aName);
XULMenuitemAccessible::Name(aName);
if (aName.IsEmpty())
return eNameOK;

View File

@ -3,19 +3,25 @@
* 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/. */
#ifndef __nsXULMenuAccessibleWrap_h__
#define __nsXULMenuAccessibleWrap_h__
#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
#define mozilla_a11y_XULMenuAccessibleWrap_h__
#include "nsXULMenuAccessible.h"
#include "XULMenuAccessible.h"
class nsXULMenuitemAccessibleWrap : public nsXULMenuitemAccessible
namespace mozilla {
namespace a11y {
class XULMenuitemAccessibleWrap : public XULMenuitemAccessible
{
public:
nsXULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
virtual ~nsXULMenuitemAccessibleWrap() {}
XULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
virtual ~XULMenuitemAccessibleWrap() {}
// nsIAccessible
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,48 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef __nsXULListboxAccessibleWrap_h__
#define __nsXULListboxAccessibleWrap_h__
#include "nsXULListboxAccessible.h"
#include "CAccessibleTable.h"
#include "CAccessibleTableCell.h"
/**
* IA2 wrapper class for nsXULListboxAccessible class implementing
* IAccessibleTable and IAccessibleTable2 interfaces.
*/
class nsXULListboxAccessibleWrap : public nsXULListboxAccessible,
public CAccessibleTable
{
public:
nsXULListboxAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
/**
* IA2 wrapper class for nsXULListCellAccessible class, implements
* IAccessibleTableCell interface.
*/
class nsXULListCellAccessibleWrap : public nsXULListCellAccessible,
public CAccessibleTableCell
{
public:
nsXULListCellAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
#endif

View File

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
#define mozilla_a11y_XULListboxAccessibleWrap_h__
#include "XULListboxAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULListboxAccessible XULListboxAccessibleWrap;
typedef class XULListCellAccessible XULListCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -3,12 +3,17 @@
* 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/. */
#ifndef __nsXULListboxAccessibleWrap_h__
#define __nsXULListboxAccessibleWrap_h__
#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
#define mozilla_a11y_XULMenuAccessibleWrap_h__
#include "nsXULListboxAccessible.h"
#include "XULMenuAccessible.h"
typedef class nsXULListboxAccessible nsXULListboxAccessibleWrap;
typedef class nsXULListCellAccessible nsXULListCellAccessibleWrap;
namespace mozilla {
namespace a11y {
typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,13 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef __nsXULMenuAccessibleWrap_h__
#define __nsXULMenuAccessibleWrap_h__
#include "nsXULMenuAccessible.h"
typedef class nsXULMenuitemAccessible nsXULMenuitemAccessibleWrap;
#endif

View File

@ -17,16 +17,16 @@ LIBXUL_LIBRARY = 1
CPPSRCS = \
XULSelectControlAccessible.cpp \
nsXULAlertAccessible.cpp \
nsXULColorPickerAccessible.cpp \
nsXULComboboxAccessible.cpp \
XULFormControlAccessible.cpp \
nsXULListboxAccessible.cpp \
nsXULMenuAccessible.cpp \
nsXULSliderAccessible.cpp \
nsXULTabAccessible.cpp \
XULElementAccessibles.cpp \
XULFormControlAccessible.cpp \
XULListboxAccessible.cpp \
XULMenuAccessible.cpp \
XULSelectControlAccessible.cpp \
XULTreeAccessible.cpp \
XULTreeGridAccessible.cpp \
$(NULL)

View File

@ -12,10 +12,10 @@
#include "nsCoreUtils.h"
#include "DocAccessible.h"
#include "nsIAccessibleRelation.h"
#include "nsXULMenuAccessible.h"
#include "Relation.h"
#include "Role.h"
#include "States.h"
#include "XULMenuAccessible.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMNSEditableElement.h"

View File

@ -3,7 +3,7 @@
* 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/. */
#include "nsXULListboxAccessible.h"
#include "XULListboxAccessible.h"
#include "Accessible-inl.h"
#include "nsAccessibilityService.h"
@ -24,58 +24,58 @@
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsXULColumAccessible
// XULColumAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULColumAccessible::
nsXULColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULColumAccessible::
XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
}
role
nsXULColumAccessible::NativeRole()
XULColumAccessible::NativeRole()
{
return roles::LIST;
}
PRUint64
nsXULColumAccessible::NativeState()
XULColumAccessible::NativeState()
{
return states::READONLY;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULColumnItemAccessible
// XULColumnItemAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULColumnItemAccessible::
nsXULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULColumnItemAccessible::
XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
LeafAccessible(aContent, aDoc)
{
}
role
nsXULColumnItemAccessible::NativeRole()
XULColumnItemAccessible::NativeRole()
{
return roles::COLUMNHEADER;
}
PRUint64
nsXULColumnItemAccessible::NativeState()
XULColumnItemAccessible::NativeState()
{
return states::READONLY;
}
PRUint8
nsXULColumnItemAccessible::ActionCount()
XULColumnItemAccessible::ActionCount()
{
return 1;
}
NS_IMETHODIMP
nsXULColumnItemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
XULColumnItemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
if (aIndex != eAction_Click)
return NS_ERROR_INVALID_ARG;
@ -85,7 +85,7 @@ nsXULColumnItemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
nsXULColumnItemAccessible::DoAction(PRUint8 aIndex)
XULColumnItemAccessible::DoAction(PRUint8 aIndex)
{
if (aIndex != eAction_Click)
return NS_ERROR_INVALID_ARG;
@ -95,11 +95,11 @@ nsXULColumnItemAccessible::DoAction(PRUint8 aIndex)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListboxAccessible
// XULListboxAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULListboxAccessible::
nsXULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULListboxAccessible::
XULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULSelectControlAccessible(aContent, aDoc), xpcAccessibleTable(this)
{
nsIContent* parentContent = mContent->GetParent();
@ -111,11 +111,11 @@ nsXULListboxAccessible::
}
}
NS_IMPL_ADDREF_INHERITED(nsXULListboxAccessible, XULSelectControlAccessible)
NS_IMPL_RELEASE_INHERITED(nsXULListboxAccessible, XULSelectControlAccessible)
NS_IMPL_ADDREF_INHERITED(XULListboxAccessible, XULSelectControlAccessible)
NS_IMPL_RELEASE_INHERITED(XULListboxAccessible, XULSelectControlAccessible)
nsresult
nsXULListboxAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
XULListboxAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
nsresult rv = XULSelectControlAccessible::QueryInterface(aIID, aInstancePtr);
if (*aInstancePtr)
@ -134,14 +134,14 @@ nsXULListboxAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
//nsAccessNode
void
nsXULListboxAccessible::Shutdown()
XULListboxAccessible::Shutdown()
{
mTable = nsnull;
XULSelectControlAccessible::Shutdown();
}
bool
nsXULListboxAccessible::IsMulticolumn()
XULListboxAccessible::IsMulticolumn()
{
PRInt32 numColumns = 0;
nsresult rv = GetColumnCount(&numColumns);
@ -152,12 +152,12 @@ nsXULListboxAccessible::IsMulticolumn()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListboxAccessible. nsIAccessible
// XULListboxAccessible. nsIAccessible
PRUint64
nsXULListboxAccessible::NativeState()
XULListboxAccessible::NativeState()
{
// As a nsXULListboxAccessible we can have the following states:
// As a XULListboxAccessible we can have the following states:
// FOCUSED, READONLY, FOCUSABLE
// Get focus status from base class
@ -177,7 +177,7 @@ nsXULListboxAccessible::NativeState()
* Our value is the label of our ( first ) selected child.
*/
void
nsXULListboxAccessible::Value(nsString& aValue)
XULListboxAccessible::Value(nsString& aValue)
{
aValue.Truncate();
@ -191,7 +191,7 @@ nsXULListboxAccessible::Value(nsString& aValue)
}
role
nsXULListboxAccessible::NativeRole()
XULListboxAccessible::NativeRole()
{
// A richlistbox is used with the new autocomplete URL bar, and has a parent
// popup <panel>.
@ -204,10 +204,10 @@ nsXULListboxAccessible::NativeRole()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListboxAccessible. nsIAccessibleTable
// XULListboxAccessible. nsIAccessibleTable
PRUint32
nsXULListboxAccessible::ColCount()
XULListboxAccessible::ColCount()
{
nsIContent* headContent = nsnull;
for (nsIContent* childContent = mContent->GetFirstChild(); childContent;
@ -233,7 +233,7 @@ nsXULListboxAccessible::ColCount()
}
PRUint32
nsXULListboxAccessible::RowCount()
XULListboxAccessible::RowCount()
{
nsCOMPtr<nsIDOMXULSelectControlElement> element(do_QueryInterface(mContent));
@ -245,7 +245,7 @@ nsXULListboxAccessible::RowCount()
}
Accessible*
nsXULListboxAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
XULListboxAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
{
nsCOMPtr<nsIDOMXULSelectControlElement> control =
do_QueryInterface(mContent);
@ -267,7 +267,7 @@ nsXULListboxAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
}
NS_IMETHODIMP
nsXULListboxAccessible::GetColumnIndexAt(PRInt32 aIndex, PRInt32 *aColumn)
XULListboxAccessible::GetColumnIndexAt(PRInt32 aIndex, PRInt32* aColumn)
{
NS_ENSURE_ARG_POINTER(aColumn);
*aColumn = -1;
@ -281,7 +281,7 @@ nsXULListboxAccessible::GetColumnIndexAt(PRInt32 aIndex, PRInt32 *aColumn)
}
NS_IMETHODIMP
nsXULListboxAccessible::GetRowIndexAt(PRInt32 aIndex, PRInt32 *aRow)
XULListboxAccessible::GetRowIndexAt(PRInt32 aIndex, PRInt32* aRow)
{
NS_ENSURE_ARG_POINTER(aRow);
*aRow = -1;
@ -295,9 +295,9 @@ nsXULListboxAccessible::GetRowIndexAt(PRInt32 aIndex, PRInt32 *aRow)
}
NS_IMETHODIMP
nsXULListboxAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
PRInt32* aRowIndex,
PRInt32* aColumnIndex)
XULListboxAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
PRInt32* aRowIndex,
PRInt32* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -317,22 +317,22 @@ nsXULListboxAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
}
NS_IMETHODIMP
nsXULListboxAccessible::GetColumnDescription(PRInt32 aColumn,
nsAString& aDescription)
XULListboxAccessible::GetColumnDescription(PRInt32 aColumn,
nsAString& aDescription)
{
aDescription.Truncate();
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::GetRowDescription(PRInt32 aRow, nsAString& aDescription)
XULListboxAccessible::GetRowDescription(PRInt32 aRow, nsAString& aDescription)
{
aDescription.Truncate();
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
XULListboxAccessible::IsColumnSelected(PRInt32 aColumn, bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -358,7 +358,7 @@ nsXULListboxAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
}
NS_IMETHODIMP
nsXULListboxAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
XULListboxAccessible::IsRowSelected(PRInt32 aRow, bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -379,14 +379,14 @@ nsXULListboxAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
}
NS_IMETHODIMP
nsXULListboxAccessible::IsCellSelected(PRInt32 aRowIndex, PRInt32 aColumnIndex,
bool *aIsSelected)
XULListboxAccessible::IsCellSelected(PRInt32 aRowIndex, PRInt32 aColumnIndex,
bool* aIsSelected)
{
return IsRowSelected(aRowIndex, aIsSelected);
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedCellCount(PRUint32* aCount)
XULListboxAccessible::GetSelectedCellCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -417,7 +417,7 @@ nsXULListboxAccessible::GetSelectedCellCount(PRUint32* aCount)
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedColumnCount(PRUint32* aCount)
XULListboxAccessible::GetSelectedColumnCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -450,7 +450,7 @@ nsXULListboxAccessible::GetSelectedColumnCount(PRUint32* aCount)
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedRowCount(PRUint32* aCount)
XULListboxAccessible::GetSelectedRowCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -472,7 +472,7 @@ nsXULListboxAccessible::GetSelectedRowCount(PRUint32* aCount)
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedCells(nsIArray **aCells)
XULListboxAccessible::GetSelectedCells(nsIArray** aCells)
{
NS_ENSURE_ARG_POINTER(aCells);
*aCells = nsnull;
@ -522,8 +522,8 @@ nsXULListboxAccessible::GetSelectedCells(nsIArray **aCells)
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedCellIndices(PRUint32 *aNumCells,
PRInt32 **aCells)
XULListboxAccessible::GetSelectedCellIndices(PRUint32* aNumCells,
PRInt32** aCells)
{
NS_ENSURE_ARG_POINTER(aNumCells);
*aNumCells = 0;
@ -582,8 +582,8 @@ nsXULListboxAccessible::GetSelectedCellIndices(PRUint32 *aNumCells,
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedColumnIndices(PRUint32 *aNumColumns,
PRInt32 **aColumns)
XULListboxAccessible::GetSelectedColumnIndices(PRUint32* aNumColumns,
PRInt32** aColumns)
{
NS_ENSURE_ARG_POINTER(aNumColumns);
*aNumColumns = 0;
@ -615,8 +615,8 @@ nsXULListboxAccessible::GetSelectedColumnIndices(PRUint32 *aNumColumns,
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedRowIndices(PRUint32 *aNumRows,
PRInt32 **aRows)
XULListboxAccessible::GetSelectedRowIndices(PRUint32* aNumRows,
PRInt32** aRows)
{
NS_ENSURE_ARG_POINTER(aNumRows);
*aNumRows = 0;
@ -669,7 +669,7 @@ nsXULListboxAccessible::GetSelectedRowIndices(PRUint32 *aNumRows,
}
NS_IMETHODIMP
nsXULListboxAccessible::SelectRow(PRInt32 aRow)
XULListboxAccessible::SelectRow(PRInt32 aRow)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -687,14 +687,14 @@ nsXULListboxAccessible::SelectRow(PRInt32 aRow)
}
NS_IMETHODIMP
nsXULListboxAccessible::SelectColumn(PRInt32 aColumn)
XULListboxAccessible::SelectColumn(PRInt32 aColumn)
{
// xul:listbox and xul:richlistbox support row selection only.
return NS_OK;
}
void
nsXULListboxAccessible::UnselectRow(PRUint32 aRowIdx)
XULListboxAccessible::UnselectRow(PRUint32 aRowIdx)
{
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mContent);
@ -709,16 +709,16 @@ nsXULListboxAccessible::UnselectRow(PRUint32 aRowIdx)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListboxAccessible: Widgets
// XULListboxAccessible: Widgets
bool
nsXULListboxAccessible::IsWidget() const
XULListboxAccessible::IsWidget() const
{
return true;
}
bool
nsXULListboxAccessible::IsActiveWidget() const
XULListboxAccessible::IsActiveWidget() const
{
if (IsAutoCompletePopup()) {
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
@ -734,7 +734,7 @@ nsXULListboxAccessible::IsActiveWidget() const
}
bool
nsXULListboxAccessible::AreItemsOperable() const
XULListboxAccessible::AreItemsOperable() const
{
if (IsAutoCompletePopup()) {
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
@ -750,7 +750,7 @@ nsXULListboxAccessible::AreItemsOperable() const
}
Accessible*
nsXULListboxAccessible::ContainerWidget() const
XULListboxAccessible::ContainerWidget() const
{
if (IsAutoCompletePopup()) {
// This works for XUL autocompletes. It doesn't work for HTML forms
@ -776,12 +776,12 @@ nsXULListboxAccessible::ContainerWidget() const
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListitemAccessible
// XULListitemAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULListitemAccessible::
nsXULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
nsXULMenuitemAccessible(aContent, aDoc)
XULListitemAccessible::
XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULMenuitemAccessible(aContent, aDoc)
{
mIsCheckbox = mContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::type,
@ -789,10 +789,10 @@ nsXULListitemAccessible::
eCaseMatters);
}
NS_IMPL_ISUPPORTS_INHERITED0(nsXULListitemAccessible, Accessible)
NS_IMPL_ISUPPORTS_INHERITED0(XULListitemAccessible, Accessible)
Accessible*
nsXULListitemAccessible::GetListAccessible()
XULListitemAccessible::GetListAccessible()
{
if (IsDefunct())
return nsnull;
@ -813,23 +813,23 @@ nsXULListitemAccessible::GetListAccessible()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListitemAccessible Accessible
// XULListitemAccessible Accessible
void
nsXULListitemAccessible::Description(nsString& aDesc)
XULListitemAccessible::Description(nsString& aDesc)
{
AccessibleWrap::Description(aDesc);
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListitemAccessible. nsIAccessible
// XULListitemAccessible. nsIAccessible
/**
* If there is a Listcell as a child ( not anonymous ) use it, otherwise
* default to getting the name from GetXULName
*/
nsresult
nsXULListitemAccessible::GetNameInternal(nsAString& aName)
XULListitemAccessible::GetNameInternal(nsAString& aName)
{
nsIContent* childContent = mContent->GetFirstChild();
if (childContent) {
@ -843,7 +843,7 @@ nsXULListitemAccessible::GetNameInternal(nsAString& aName)
}
role
nsXULListitemAccessible::NativeRole()
XULListitemAccessible::NativeRole()
{
Accessible* list = GetListAccessible();
if (!list) {
@ -864,10 +864,10 @@ nsXULListitemAccessible::NativeRole()
}
PRUint64
nsXULListitemAccessible::NativeState()
XULListitemAccessible::NativeState()
{
if (mIsCheckbox)
return nsXULMenuitemAccessible::NativeState();
return XULMenuitemAccessible::NativeState();
PRUint64 states = NativeInteractiveState();
@ -888,13 +888,14 @@ nsXULListitemAccessible::NativeState()
}
PRUint64
nsXULListitemAccessible::NativeInteractiveState() const
XULListitemAccessible::NativeInteractiveState() const
{
return NativelyUnavailable() || (mParent && mParent->NativelyUnavailable()) ?
states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
}
NS_IMETHODIMP nsXULListitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
NS_IMETHODIMP
XULListitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
if (aIndex == eAction_Click && mIsCheckbox) {
// check or uncheck
@ -911,28 +912,28 @@ NS_IMETHODIMP nsXULListitemAccessible::GetActionName(PRUint8 aIndex, nsAString&
}
bool
nsXULListitemAccessible::CanHaveAnonChildren()
XULListitemAccessible::CanHaveAnonChildren()
{
// That indicates we should walk anonymous children for listitems
return true;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListitemAccessible: Widgets
// XULListitemAccessible: Widgets
Accessible*
nsXULListitemAccessible::ContainerWidget() const
XULListitemAccessible::ContainerWidget() const
{
return Parent();
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListCellAccessible
// XULListCellAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULListCellAccessible::
nsXULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULListCellAccessible::
XULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc) :
HyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -940,15 +941,15 @@ nsXULListCellAccessible::
////////////////////////////////////////////////////////////////////////////////
// nsISupports
NS_IMPL_ISUPPORTS_INHERITED1(nsXULListCellAccessible,
NS_IMPL_ISUPPORTS_INHERITED1(XULListCellAccessible,
HyperTextAccessible,
nsIAccessibleTableCell)
////////////////////////////////////////////////////////////////////////////////
// nsXULListCellAccessible: nsIAccessibleTableCell implementation
// XULListCellAccessible: nsIAccessibleTableCell implementation
NS_IMETHODIMP
nsXULListCellAccessible::GetTable(nsIAccessibleTable **aTable)
XULListCellAccessible::GetTable(nsIAccessibleTable** aTable)
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nsnull;
@ -969,7 +970,7 @@ nsXULListCellAccessible::GetTable(nsIAccessibleTable **aTable)
}
NS_IMETHODIMP
nsXULListCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
XULListCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
@ -996,7 +997,7 @@ nsXULListCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
}
NS_IMETHODIMP
nsXULListCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
XULListCellAccessible::GetRowIndex(PRInt32* aRowIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -1025,7 +1026,7 @@ nsXULListCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
}
NS_IMETHODIMP
nsXULListCellAccessible::GetColumnExtent(PRInt32 *aExtentCount)
XULListCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
@ -1038,7 +1039,7 @@ nsXULListCellAccessible::GetColumnExtent(PRInt32 *aExtentCount)
}
NS_IMETHODIMP
nsXULListCellAccessible::GetRowExtent(PRInt32 *aExtentCount)
XULListCellAccessible::GetRowExtent(PRInt32* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
@ -1051,7 +1052,7 @@ nsXULListCellAccessible::GetRowExtent(PRInt32 *aExtentCount)
}
NS_IMETHODIMP
nsXULListCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
XULListCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
@ -1100,7 +1101,7 @@ nsXULListCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
}
NS_IMETHODIMP
nsXULListCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
XULListCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
@ -1119,7 +1120,7 @@ nsXULListCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
}
NS_IMETHODIMP
nsXULListCellAccessible::IsSelected(bool *aIsSelected)
XULListCellAccessible::IsSelected(bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -1138,16 +1139,16 @@ nsXULListCellAccessible::IsSelected(bool *aIsSelected)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULListCellAccessible. Accessible implementation
// XULListCellAccessible. Accessible implementation
role
nsXULListCellAccessible::NativeRole()
XULListCellAccessible::NativeRole()
{
return roles::CELL;
}
nsresult
nsXULListCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
XULListCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);

View File

@ -2,47 +2,51 @@
/* 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/. */
#ifndef __nsXULListboxAccessible_h__
#define __nsXULListboxAccessible_h__
#ifndef mozilla_a11y_XULListboxAccessible_h__
#define mozilla_a11y_XULListboxAccessible_h__
#include "BaseAccessibles.h"
#include "nsXULMenuAccessible.h"
#include "nsIAccessibleTable.h"
#include "TableAccessible.h"
#include "xpcAccessibleTable.h"
#include "XULMenuAccessible.h"
#include "XULSelectControlAccessible.h"
class nsIWeakReference;
namespace mozilla {
namespace a11y {
/**
* nsXULColumAccessible are accessible for list and tree columns elements
* XULColumAccessible are accessible for list and tree columns elements
* (xul:treecols and xul:listcols).
*/
class nsXULColumAccessible : public AccessibleWrap
class XULColumAccessible : public AccessibleWrap
{
public:
nsXULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
};
/**
* nsXULColumnAccessible are accessibles for list and tree column elements
* XULColumnItemAccessible are accessibles for list and tree column elements
* (xul:listcol and xul:treecol).
*/
class nsXULColumnItemAccessible : public mozilla::a11y::LeafAccessible
class XULColumnItemAccessible : public LeafAccessible
{
public:
nsXULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
@ -54,14 +58,14 @@ public:
/*
* A class the represents the XUL Listbox widget.
*/
class nsXULListboxAccessible : public XULSelectControlAccessible,
public xpcAccessibleTable,
public nsIAccessibleTable,
public mozilla::a11y::TableAccessible
class XULListboxAccessible : public XULSelectControlAccessible,
public xpcAccessibleTable,
public nsIAccessibleTable,
public TableAccessible
{
public:
nsXULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
virtual ~nsXULListboxAccessible() {}
XULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
virtual ~XULListboxAccessible() {}
NS_DECL_ISUPPORTS_INHERITED
@ -79,8 +83,8 @@ public:
// Accessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
virtual mozilla::a11y::role NativeRole();
virtual TableAccessible* AsTable() { return this; }
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
// Widgets
@ -95,17 +99,17 @@ protected:
};
/**
* Listitems -- used in listboxes
* Listitems -- used in listboxes
*/
class nsXULListitemAccessible : public nsXULMenuitemAccessible
class XULListitemAccessible : public XULMenuitemAccessible
{
public:
enum { eAction_Click = 0 };
NS_DECL_ISUPPORTS_INHERITED
nsXULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
virtual ~nsXULListitemAccessible() {}
XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
virtual ~XULListitemAccessible() {}
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 index, nsAString& aName);
@ -114,7 +118,7 @@ public:
// Accessible
virtual void Description(nsString& aDesc);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual PRUint64 NativeInteractiveState() const;
virtual bool CanHaveAnonChildren();
@ -135,11 +139,11 @@ private:
/**
* Class represents xul:listcell.
*/
class nsXULListCellAccessible : public HyperTextAccessibleWrap,
public nsIAccessibleTableCell
class XULListCellAccessible : public HyperTextAccessibleWrap,
public nsIAccessibleTableCell
{
public:
nsXULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -149,7 +153,10 @@ public:
// Accessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -3,7 +3,7 @@
* 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/. */
#include "nsXULMenuAccessible.h"
#include "XULMenuAccessible.h"
#include "Accessible-inl.h"
#include "nsAccessibilityService.h"
@ -35,17 +35,17 @@ using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsXULMenuitemAccessible
// XULMenuitemAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULMenuitemAccessible::
nsXULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULMenuitemAccessible::
XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
}
PRUint64
nsXULMenuitemAccessible::NativeState()
XULMenuitemAccessible::NativeState()
{
PRUint64 state = Accessible::NativeState();
@ -114,7 +114,7 @@ nsXULMenuitemAccessible::NativeState()
}
PRUint64
nsXULMenuitemAccessible::NativeInteractiveState() const
XULMenuitemAccessible::NativeInteractiveState() const
{
if (NativelyUnavailable()) {
// Note: keep in sinc with nsXULPopupManager::IsValidMenuItem() logic.
@ -135,21 +135,21 @@ nsXULMenuitemAccessible::NativeInteractiveState() const
}
nsresult
nsXULMenuitemAccessible::GetNameInternal(nsAString& aName)
XULMenuitemAccessible::GetNameInternal(nsAString& aName)
{
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
return NS_OK;
}
void
nsXULMenuitemAccessible::Description(nsString& aDescription)
XULMenuitemAccessible::Description(nsString& aDescription)
{
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::description,
aDescription);
}
KeyBinding
nsXULMenuitemAccessible::AccessKey() const
XULMenuitemAccessible::AccessKey() const
{
// Return menu accesskey: N or Alt+F.
static PRInt32 gMenuAccesskeyModifier = -1; // magic value of -1 indicates unitialized state
@ -192,7 +192,7 @@ nsXULMenuitemAccessible::AccessKey() const
}
KeyBinding
nsXULMenuitemAccessible::KeyboardShortcut() const
XULMenuitemAccessible::KeyboardShortcut() const
{
nsAutoString keyElmId;
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyElmId);
@ -256,7 +256,7 @@ nsXULMenuitemAccessible::KeyboardShortcut() const
}
role
nsXULMenuitemAccessible::NativeRole()
XULMenuitemAccessible::NativeRole()
{
nsCOMPtr<nsIDOMXULContainerElement> xulContainer(do_QueryInterface(mContent));
if (xulContainer)
@ -278,19 +278,20 @@ nsXULMenuitemAccessible::NativeRole()
}
PRInt32
nsXULMenuitemAccessible::GetLevelInternal()
XULMenuitemAccessible::GetLevelInternal()
{
return nsAccUtils::GetLevelForXULContainerItem(mContent);
}
bool
nsXULMenuitemAccessible::CanHaveAnonChildren()
XULMenuitemAccessible::CanHaveAnonChildren()
{
// That indicates we don't walk anonymous children for menuitems
return false;
}
NS_IMETHODIMP nsXULMenuitemAccessible::DoAction(PRUint8 index)
NS_IMETHODIMP
XULMenuitemAccessible::DoAction(PRUint8 index)
{
if (index == eAction_Click) { // default action
DoCommand();
@ -301,7 +302,8 @@ NS_IMETHODIMP nsXULMenuitemAccessible::DoAction(PRUint8 index)
}
/** select us! close combo box if necessary*/
NS_IMETHODIMP nsXULMenuitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
NS_IMETHODIMP
XULMenuitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
if (aIndex == eAction_Click) {
aName.AssignLiteral("click");
@ -311,16 +313,16 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetActionName(PRUint8 aIndex, nsAString&
}
PRUint8
nsXULMenuitemAccessible::ActionCount()
XULMenuitemAccessible::ActionCount()
{
return 1;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULMenuitemAccessible: Widgets
// XULMenuitemAccessible: Widgets
bool
nsXULMenuitemAccessible::IsActiveWidget() const
XULMenuitemAccessible::IsActiveWidget() const
{
// Parent menu item is a widget, it's active when its popup is open.
nsIContent* menuPopupContent = mContent->GetFirstChild();
@ -333,7 +335,7 @@ nsXULMenuitemAccessible::IsActiveWidget() const
}
bool
nsXULMenuitemAccessible::AreItemsOperable() const
XULMenuitemAccessible::AreItemsOperable() const
{
// Parent menu item is a widget, its items are operable when its popup is open.
nsIContent* menuPopupContent = mContent->GetFirstChild();
@ -346,7 +348,7 @@ nsXULMenuitemAccessible::AreItemsOperable() const
}
Accessible*
nsXULMenuitemAccessible::ContainerWidget() const
XULMenuitemAccessible::ContainerWidget() const
{
nsMenuFrame* menuFrame = do_QueryFrame(GetFrame());
if (menuFrame) {
@ -368,57 +370,59 @@ nsXULMenuitemAccessible::ContainerWidget() const
////////////////////////////////////////////////////////////////////////////////
// nsXULMenuSeparatorAccessible
// XULMenuSeparatorAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULMenuSeparatorAccessible::
nsXULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc) :
nsXULMenuitemAccessible(aContent, aDoc)
XULMenuSeparatorAccessible::
XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULMenuitemAccessible(aContent, aDoc)
{
}
PRUint64
nsXULMenuSeparatorAccessible::NativeState()
XULMenuSeparatorAccessible::NativeState()
{
// Isn't focusable, but can be offscreen/invisible -- only copy those states
return nsXULMenuitemAccessible::NativeState() &
return XULMenuitemAccessible::NativeState() &
(states::OFFSCREEN | states::INVISIBLE);
}
nsresult
nsXULMenuSeparatorAccessible::GetNameInternal(nsAString& aName)
XULMenuSeparatorAccessible::GetNameInternal(nsAString& aName)
{
return NS_OK;
}
role
nsXULMenuSeparatorAccessible::NativeRole()
XULMenuSeparatorAccessible::NativeRole()
{
return roles::SEPARATOR;
}
NS_IMETHODIMP nsXULMenuSeparatorAccessible::DoAction(PRUint8 index)
NS_IMETHODIMP
XULMenuSeparatorAccessible::DoAction(PRUint8 index)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsXULMenuSeparatorAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
NS_IMETHODIMP
XULMenuSeparatorAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
PRUint8
nsXULMenuSeparatorAccessible::ActionCount()
XULMenuSeparatorAccessible::ActionCount()
{
return 0;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULMenupopupAccessible
// XULMenupopupAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULMenupopupAccessible::
nsXULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULMenupopupAccessible::
XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULSelectControlAccessible(aContent, aDoc)
{
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
@ -430,7 +434,7 @@ nsXULMenupopupAccessible::
}
PRUint64
nsXULMenupopupAccessible::NativeState()
XULMenupopupAccessible::NativeState()
{
PRUint64 state = Accessible::NativeState();
@ -457,7 +461,7 @@ nsXULMenupopupAccessible::NativeState()
}
nsresult
nsXULMenupopupAccessible::GetNameInternal(nsAString& aName)
XULMenupopupAccessible::GetNameInternal(nsAString& aName)
{
nsIContent *content = mContent;
while (content && aName.IsEmpty()) {
@ -469,7 +473,7 @@ nsXULMenupopupAccessible::GetNameInternal(nsAString& aName)
}
role
nsXULMenupopupAccessible::NativeRole()
XULMenupopupAccessible::NativeRole()
{
// If accessible is not bound to the tree (this happens while children are
// cached) return general role.
@ -490,16 +494,16 @@ nsXULMenupopupAccessible::NativeRole()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULMenupopupAccessible: Widgets
// XULMenupopupAccessible: Widgets
bool
nsXULMenupopupAccessible::IsWidget() const
XULMenupopupAccessible::IsWidget() const
{
return true;
}
bool
nsXULMenupopupAccessible::IsActiveWidget() const
XULMenupopupAccessible::IsActiveWidget() const
{
// If menupopup is a widget (the case of context menus) then active when open.
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
@ -507,14 +511,14 @@ nsXULMenupopupAccessible::IsActiveWidget() const
}
bool
nsXULMenupopupAccessible::AreItemsOperable() const
XULMenupopupAccessible::AreItemsOperable() const
{
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
return menuPopupFrame && menuPopupFrame->IsOpen();
}
Accessible*
nsXULMenupopupAccessible::ContainerWidget() const
XULMenupopupAccessible::ContainerWidget() const
{
DocAccessible* document = Document();
@ -550,46 +554,46 @@ nsXULMenupopupAccessible::ContainerWidget() const
}
////////////////////////////////////////////////////////////////////////////////
// nsXULMenubarAccessible
// XULMenubarAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULMenubarAccessible::
nsXULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULMenubarAccessible::
XULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
}
nsresult
nsXULMenubarAccessible::GetNameInternal(nsAString& aName)
XULMenubarAccessible::GetNameInternal(nsAString& aName)
{
aName.AssignLiteral("Application");
return NS_OK;
}
role
nsXULMenubarAccessible::NativeRole()
XULMenubarAccessible::NativeRole()
{
return roles::MENUBAR;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULMenubarAccessible: Widgets
// XULMenubarAccessible: Widgets
bool
nsXULMenubarAccessible::IsActiveWidget() const
XULMenubarAccessible::IsActiveWidget() const
{
nsMenuBarFrame* menuBarFrame = do_QueryFrame(GetFrame());
return menuBarFrame && menuBarFrame->IsActive();
}
bool
nsXULMenubarAccessible::AreItemsOperable() const
XULMenubarAccessible::AreItemsOperable() const
{
return true;
}
Accessible*
nsXULMenubarAccessible::CurrentItem()
XULMenubarAccessible::CurrentItem()
{
nsMenuBarFrame* menuBarFrame = do_QueryFrame(GetFrame());
if (menuBarFrame) {
@ -603,7 +607,7 @@ nsXULMenubarAccessible::CurrentItem()
}
void
nsXULMenubarAccessible::SetCurrentItem(Accessible* aItem)
XULMenubarAccessible::SetCurrentItem(Accessible* aItem)
{
NS_ERROR("nsXULMenubarAccessible::SetCurrentItem not implemented");
NS_ERROR("XULMenubarAccessible::SetCurrentItem not implemented");
}

View File

@ -3,22 +3,25 @@
* 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/. */
#ifndef _nsXULMenuAccessible_H_
#define _nsXULMenuAccessible_H_
#ifndef mozilla_a11y_XULMenuAccessible_h__
#define mozilla_a11y_XULMenuAccessible_h__
#include "AccessibleWrap.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "XULSelectControlAccessible.h"
namespace mozilla {
namespace a11y {
/**
* Used for XUL menu, menuitem elements.
*/
class nsXULMenuitemAccessible : public AccessibleWrap
class XULMenuitemAccessible : public AccessibleWrap
{
public:
enum { eAction_Click = 0 };
nsXULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
@ -27,7 +30,7 @@ public:
// Accessible
virtual void Description(nsString& aDescription);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual PRUint64 NativeInteractiveState() const;
virtual PRInt32 GetLevelInternal();
@ -48,10 +51,10 @@ public:
/**
* Used for XUL menuseparator element.
*/
class nsXULMenuSeparatorAccessible : public nsXULMenuitemAccessible
class XULMenuSeparatorAccessible : public XULMenuitemAccessible
{
public:
nsXULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
@ -59,7 +62,7 @@ public:
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
@ -70,14 +73,14 @@ public:
/**
* Used for XUL menupopup and panel.
*/
class nsXULMenupopupAccessible : public XULSelectControlAccessible
class XULMenupopupAccessible : public XULSelectControlAccessible
{
public:
nsXULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc);
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
// Widgets
@ -91,14 +94,14 @@ public:
/**
* Used for XUL menubar element.
*/
class nsXULMenubarAccessible : public AccessibleWrap
class XULMenubarAccessible : public AccessibleWrap
{
public:
nsXULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc);
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
// Widget
virtual bool IsActiveWidget() const;
@ -107,4 +110,7 @@ public:
virtual void SetCurrentItem(Accessible* aItem);
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1205,7 +1205,7 @@ XULTreeItemAccessible::CacheChildren()
XULTreeColumAccessible::
XULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
nsXULColumAccessible(aContent, aDoc)
XULColumAccessible(aContent, aDoc)
{
}
@ -1214,7 +1214,7 @@ XULTreeColumAccessible::GetSiblingAtOffset(PRInt32 aOffset,
nsresult* aError) const
{
if (aOffset < 0)
return nsXULColumAccessible::GetSiblingAtOffset(aOffset, aError);
return XULColumAccessible::GetSiblingAtOffset(aOffset, aError);
if (aError)
*aError = NS_OK; // fail peacefully

View File

@ -9,7 +9,7 @@
#include "nsITreeBoxObject.h"
#include "nsITreeView.h"
#include "nsITreeColumns.h"
#include "nsXULListboxAccessible.h"
#include "XULListboxAccessible.h"
namespace mozilla {
namespace a11y {
@ -259,7 +259,7 @@ protected:
/**
* Accessible class for columns element of XUL tree.
*/
class XULTreeColumAccessible : public nsXULColumAccessible
class XULTreeColumAccessible : public XULColumAccessible
{
public:
XULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc);

View File

@ -6,7 +6,7 @@
#ifndef __nsXULComboboxAccessible_h__
#define __nsXULComboboxAccessible_h__
#include "nsXULMenuAccessible.h"
#include "XULMenuAccessible.h"
/**
* Used for XUL comboboxes like xul:menulist and autocomplete textbox.

View File

@ -7,7 +7,7 @@
#define _nsXULTabAccessible_H_
// NOTE: alphabetically ordered
#include "nsXULMenuAccessible.h"
#include "XULMenuAccessible.h"
#include "XULSelectControlAccessible.h"
/**