Bug 762754 - rename nsXULTextAccessible files to XULEelementAccessibles, r=surkov

--HG--
rename : accessible/src/xul/nsXULTextAccessible.cpp => accessible/src/xul/XULElementAccessibles.cpp
rename : accessible/src/xul/nsXULTextAccessible.h => accessible/src/xul/XULElementAccessibles.h
This commit is contained in:
Mark Capella 2012-06-09 04:21:00 -04:00
parent 8934eee23b
commit 971b084ac9
4 changed files with 54 additions and 49 deletions

View File

@ -75,7 +75,7 @@
#include "nsXULMenuAccessibleWrap.h"
#include "nsXULSliderAccessible.h"
#include "nsXULTabAccessible.h"
#include "nsXULTextAccessible.h"
#include "XULElementAccessibles.h"
#include "XULTreeGridAccessibleWrap.h"
#endif
@ -1356,7 +1356,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
}
case nsIAccessibleProvider::XULLink:
accessible = new nsXULLinkAccessible(aContent, aDoc);
accessible = new XULLinkAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULListbox:
@ -1445,7 +1445,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
break;
case nsIAccessibleProvider::XULText:
accessible = new nsXULTextAccessible(aContent, aDoc);
accessible = new XULLabelAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTextBox:
@ -1476,7 +1476,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
break;
case nsIAccessibleProvider::XULTooltip:
accessible = new nsXULTooltipAccessible(aContent, aDoc);
accessible = new XULTooltipAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULToolbarButton:

View File

@ -26,7 +26,7 @@ CPPSRCS = \
nsXULMenuAccessible.cpp \
nsXULSliderAccessible.cpp \
nsXULTabAccessible.cpp \
nsXULTextAccessible.cpp \
XULElementAccessibles.cpp \
XULTreeAccessible.cpp \
XULTreeGridAccessible.cpp \
$(NULL)

View File

@ -3,8 +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/. */
// NOTE: groups are alphabetically ordered
#include "nsXULTextAccessible.h"
#include "XULElementAccessibles.h"
#include "Accessible-inl.h"
#include "BaseAccessibles.h"
@ -24,17 +23,17 @@
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsXULTextAccessible
// XULLabelAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULTextAccessible::
nsXULTextAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULLabelAccessible::
XULLabelAccessible(nsIContent* aContent, DocAccessible* aDoc) :
HyperTextAccessibleWrap(aContent, aDoc)
{
}
nsresult
nsXULTextAccessible::GetNameInternal(nsAString& aName)
XULLabelAccessible::GetNameInternal(nsAString& aName)
{
// if the value attr doesn't exist, the screen reader must get the accessible text
// from the accessible text interface or from the children
@ -43,13 +42,13 @@ nsXULTextAccessible::GetNameInternal(nsAString& aName)
}
role
nsXULTextAccessible::NativeRole()
XULLabelAccessible::NativeRole()
{
return roles::LABEL;
}
PRUint64
nsXULTextAccessible::NativeState()
XULLabelAccessible::NativeState()
{
// Labels and description have read only state
// They are not focusable or selectable
@ -57,7 +56,7 @@ nsXULTextAccessible::NativeState()
}
Relation
nsXULTextAccessible::RelationByType(PRUint32 aType)
XULLabelAccessible::RelationByType(PRUint32 aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_LABEL_FOR) {
@ -75,47 +74,47 @@ nsXULTextAccessible::RelationByType(PRUint32 aType)
////////////////////////////////////////////////////////////////////////////////
// nsXULTooltipAccessible
// XULTooltipAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULTooltipAccessible::
nsXULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULTooltipAccessible::
XULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc) :
LeafAccessible(aContent, aDoc)
{
}
PRUint64
nsXULTooltipAccessible::NativeState()
XULTooltipAccessible::NativeState()
{
return LeafAccessible::NativeState() | states::READONLY;
}
role
nsXULTooltipAccessible::NativeRole()
XULTooltipAccessible::NativeRole()
{
return roles::TOOLTIP;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULLinkAccessible
// XULLinkAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULLinkAccessible::
nsXULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULLinkAccessible::
XULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc) :
HyperTextAccessibleWrap(aContent, aDoc)
{
}
// Expose nsIAccessibleHyperLink unconditionally
NS_IMPL_ISUPPORTS_INHERITED1(nsXULLinkAccessible, HyperTextAccessibleWrap,
NS_IMPL_ISUPPORTS_INHERITED1(XULLinkAccessible, HyperTextAccessibleWrap,
nsIAccessibleHyperLink)
////////////////////////////////////////////////////////////////////////////////
// nsXULLinkAccessible. nsIAccessible
// XULLinkAccessible. nsIAccessible
void
nsXULLinkAccessible::Value(nsString& aValue)
XULLinkAccessible::Value(nsString& aValue)
{
aValue.Truncate();
@ -123,7 +122,7 @@ nsXULLinkAccessible::Value(nsString& aValue)
}
nsresult
nsXULLinkAccessible::GetNameInternal(nsAString& aName)
XULLinkAccessible::GetNameInternal(nsAString& aName)
{
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
if (!aName.IsEmpty())
@ -133,38 +132,38 @@ nsXULLinkAccessible::GetNameInternal(nsAString& aName)
}
role
nsXULLinkAccessible::NativeRole()
XULLinkAccessible::NativeRole()
{
return roles::LINK;
}
PRUint64
nsXULLinkAccessible::NativeLinkState() const
XULLinkAccessible::NativeLinkState() const
{
return states::LINKED;
}
PRUint8
nsXULLinkAccessible::ActionCount()
XULLinkAccessible::ActionCount()
{
return 1;
}
NS_IMETHODIMP
nsXULLinkAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
XULLinkAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
aName.Truncate();
if (aIndex != eAction_Jump)
return NS_ERROR_INVALID_ARG;
aName.AssignLiteral("jump");
return NS_OK;
}
NS_IMETHODIMP
nsXULLinkAccessible::DoAction(PRUint8 aIndex)
XULLinkAccessible::DoAction(PRUint8 aIndex)
{
if (aIndex != eAction_Jump)
return NS_ERROR_INVALID_ARG;
@ -177,17 +176,17 @@ nsXULLinkAccessible::DoAction(PRUint8 aIndex)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULLinkAccessible: HyperLinkAccessible
// XULLinkAccessible: HyperLinkAccessible
bool
nsXULLinkAccessible::IsLink()
XULLinkAccessible::IsLink()
{
// Expose HyperLinkAccessible unconditionally.
return true;
}
PRUint32
nsXULLinkAccessible::StartOffset()
XULLinkAccessible::StartOffset()
{
// If XUL link accessible is not contained by hypertext accessible then
// start offset matches index in parent because the parent doesn't contains
@ -200,7 +199,7 @@ nsXULLinkAccessible::StartOffset()
}
PRUint32
nsXULLinkAccessible::EndOffset()
XULLinkAccessible::EndOffset()
{
if (Accessible::IsLink())
return Accessible::EndOffset();
@ -208,7 +207,7 @@ nsXULLinkAccessible::EndOffset()
}
already_AddRefed<nsIURI>
nsXULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
XULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
if (aAnchorIndex != 0)
return nsnull;

View File

@ -3,23 +3,26 @@
* 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 _nsXULTextAccessible_H_
#define _nsXULTextAccessible_H_
#ifndef mozilla_a11y_XULElementAccessibles_h__
#define mozilla_a11y_XULElementAccessibles_h__
#include "BaseAccessibles.h"
#include "HyperTextAccessibleWrap.h"
namespace mozilla {
namespace a11y {
/**
* Used for XUL description and label elements.
*/
class nsXULTextAccessible : public HyperTextAccessibleWrap
class XULLabelAccessible : public HyperTextAccessibleWrap
{
public:
nsXULTextAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULLabelAccessible(nsIContent* aContent, DocAccessible* aDoc);
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual Relation RelationByType(PRUint32 aRelationType);
};
@ -27,22 +30,22 @@ public:
/**
* Used for XUL tooltip element.
*/
class nsXULTooltipAccessible : public mozilla::a11y::LeafAccessible
class XULTooltipAccessible : public LeafAccessible
{
public:
nsXULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc);
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
};
class nsXULLinkAccessible : public HyperTextAccessibleWrap
class XULLinkAccessible : public HyperTextAccessibleWrap
{
public:
nsXULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
NS_DECL_ISUPPORTS_INHERITED
@ -53,7 +56,7 @@ public:
// Accessible
virtual void Value(nsString& aValue);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeLinkState() const;
// ActionAccessible
@ -70,4 +73,7 @@ protected:
};
#endif
} // namespace a11y
} // namespace mozilla
#endif