bug 671926 - dexpcom GetNumActions() r=surkov

This commit is contained in:
Trevor Saunders 2011-06-05 12:35:43 -07:00
parent 31c386763b
commit f791a8298f
45 changed files with 221 additions and 250 deletions

View File

@ -408,12 +408,9 @@ nsAccessibleWrap::CreateMaiInterfaces(void)
// the Component interface are supported by all nsIAccessible
interfacesBits |= 1 << MAI_INTERFACE_COMPONENT;
// Add Action interface if the action count is more than zero.
PRUint8 actionCount = 0;
nsresult rv = GetNumActions(&actionCount);
if (NS_SUCCEEDED(rv) && actionCount > 0) {
interfacesBits |= 1 << MAI_INTERFACE_ACTION;
}
// Add Action interface if the action count is more than zero.
if (ActionCount() > 0)
interfacesBits |= 1 << MAI_INTERFACE_ACTION;
//nsIAccessibleText
nsCOMPtr<nsIAccessibleText> accessInterfaceText;

View File

@ -73,13 +73,8 @@ doActionCB(AtkAction *aAction, gint aActionIndex)
gint
getActionCountCB(AtkAction *aAction)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!accWrap)
return 0;
PRUint8 num = 0;
nsresult rv = accWrap->GetNumActions(&num);
return (NS_FAILED(rv)) ? 0 : static_cast<gint>(num);
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
return accWrap ? accWrap->ActionCount() : 0;
}
const gchar *

View File

@ -1849,22 +1849,23 @@ nsAccessible::NativeRole()
// readonly attribute PRUint8 numActions
NS_IMETHODIMP
nsAccessible::GetNumActions(PRUint8 *aNumActions)
nsAccessible::GetNumActions(PRUint8* aActionCount)
{
NS_ENSURE_ARG_POINTER(aNumActions);
*aNumActions = 0;
NS_ENSURE_ARG_POINTER(aActionCount);
*aActionCount = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
PRUint32 actionRule = GetActionRule(State());
if (actionRule == eNoAction)
return NS_OK;
*aNumActions = 1;
*aActionCount = ActionCount();
return NS_OK;
}
PRUint8
nsAccessible::ActionCount()
{
return GetActionRule(State()) == eNoAction ? 0 : 1;
}
/* DOMString getAccActionName (in PRUint8 index); */
NS_IMETHODIMP
nsAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)

View File

@ -418,6 +418,11 @@ public:
//////////////////////////////////////////////////////////////////////////////
// ActionAccessible
/**
* Return the number of actions that can be performed on this accessible.
*/
virtual PRUint8 ActionCount();
/**
* Return access key, such as Alt+D.
*/
@ -676,7 +681,7 @@ protected:
/**
* Return the action rule based on ARIA enum constants EActionRule
* (see nsARIAMap.h). Used by GetNumActions() and GetActionName().
* (see nsARIAMap.h). Used by ActionCount() and GetActionName().
*
* @param aStates [in] states of the accessible
*/

View File

@ -237,12 +237,10 @@ nsApplicationAccessible::TakeFocus()
return NS_OK;
}
NS_IMETHODIMP
nsApplicationAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsApplicationAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
*aNumActions = 0;
return NS_OK;
return 0;
}
NS_IMETHODIMP

View File

@ -103,7 +103,6 @@ public:
NS_IMETHOD SetSelected(PRBool aIsSelected);
NS_IMETHOD TakeSelection();
NS_IMETHOD TakeFocus();
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString &aName);
NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString &aDescription);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -129,6 +128,7 @@ public:
virtual void InvalidateChildren();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual KeyBinding AccessKey() const;
protected:

View File

@ -138,13 +138,10 @@ nsLinkableAccessible::GetValue(nsAString& aValue)
}
NS_IMETHODIMP
nsLinkableAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsLinkableAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
*aNumActions = (mIsOnclick || mIsLink) ? 1 : 0;
return NS_OK;
return (mIsOnclick || mIsLink) ? 1 : 0;
}
NS_IMETHODIMP

View File

@ -87,7 +87,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetValue(nsAString& _retval);
@ -100,6 +99,7 @@ public:
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual KeyBinding AccessKey() const;
// HyperLinkAccessible

View File

@ -191,13 +191,10 @@ nsRadioButtonAccessible::
{
}
NS_IMETHODIMP
nsRadioButtonAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsRadioButtonAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
*aNumActions = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP nsRadioButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)

View File

@ -75,13 +75,15 @@ public:
nsRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual PRUint32 NativeRole();
// ActionAccessible
virtual PRUint8 ActionCount();
enum { eAction_Click = 0 };
};

View File

@ -112,14 +112,11 @@ nsOuterDocAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
NS_IMETHODIMP
nsOuterDocAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsOuterDocAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
*aNumActions = 0;
// Internal frame, which is the doc's parent, should not have a click action.
return NS_OK;
return 0;
}
NS_IMETHODIMP

View File

@ -58,7 +58,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString& aDescription);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -77,6 +76,9 @@ public:
virtual PRBool AppendChild(nsAccessible *aAccessible);
virtual PRBool RemoveChild(nsAccessible *aAccessible);
// ActionAccessible
virtual PRUint8 ActionCount();
protected:
// nsAccessible
virtual void CacheChildren();

View File

@ -78,10 +78,10 @@ nsHTMLCheckboxAccessible::NativeRole()
return nsIAccessibleRole::ROLE_CHECKBUTTON;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsHTMLCheckboxAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
@ -237,10 +237,10 @@ nsHTMLButtonAccessible::
{
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsHTMLButtonAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
@ -325,10 +325,10 @@ nsHTML4ButtonAccessible::
{
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsHTML4ButtonAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;;
return 1;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
@ -514,10 +514,10 @@ nsHTMLTextFieldAccessible::NativeState()
return state;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsHTMLTextFieldAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;;
return 1;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)

View File

@ -59,13 +59,15 @@ public:
nsHTMLCheckboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};
@ -98,7 +100,6 @@ public:
nsHTMLButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -106,6 +107,9 @@ public:
virtual nsresult GetNameInternal(nsAString& aName);
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};
@ -121,13 +125,15 @@ public:
nsHTML4ButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};
@ -146,7 +152,6 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -157,6 +162,9 @@ public:
virtual nsresult GetNameInternal(nsAString& aName);
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};

View File

@ -131,22 +131,11 @@ nsHTMLImageAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
NS_IMETHODIMP
nsHTMLImageAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsHTMLImageAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
*aNumActions = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsresult rv= nsLinkableAccessible::GetNumActions(aNumActions);
NS_ENSURE_SUCCESS(rv, rv);
if (HasLongDesc())
(*aNumActions)++;
return NS_OK;
PRUint8 actionCount = nsLinkableAccessible::ActionCount();
return HasLongDesc() ? actionCount + 1 : actionCount;
}
NS_IMETHODIMP
@ -248,9 +237,5 @@ nsHTMLImageAccessible::IsValidLongDescIndex(PRUint8 aIndex)
if (!HasLongDesc())
return PR_FALSE;
PRUint8 numActions = 0;
nsresult rv = nsLinkableAccessible::GetNumActions(&numActions);
NS_ENSURE_SUCCESS(rv, PR_FALSE);
return (aIndex == numActions);
return aIndex == nsLinkableAccessible::ActionCount();
}

View File

@ -57,7 +57,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -70,6 +69,9 @@ public:
virtual PRUint64 NativeState();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
// ActionAccessible
virtual PRUint8 ActionCount();
private:
/**
* Determine if this image accessible has a longdesc attribute.

View File

@ -120,16 +120,10 @@ nsHTMLLinkAccessible::GetValue(nsAString& aValue)
return presShell->GetLinkLocation(DOMNode, aValue);
}
NS_IMETHODIMP
nsHTMLLinkAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsHTMLLinkAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
if (!IsLinked())
return nsHyperTextAccessible::GetNumActions(aNumActions);
*aNumActions = 1;
return NS_OK;
return IsLinked() ? 1 : nsHyperTextAccessible::ActionCount();
}
NS_IMETHODIMP

View File

@ -52,7 +52,6 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -60,6 +59,9 @@ public:
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
// HyperLinkAccessible
virtual bool IsLink();
virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);

View File

@ -371,10 +371,10 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetActionName(PRUint8 aIndex, nsAStr
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsHTMLSelectOptionAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::DoAction(PRUint8 index)
@ -616,9 +616,10 @@ NS_IMETHODIMP nsHTMLSelectOptGroupAccessible::GetActionName(PRUint8 aIndex, nsAS
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsHTMLSelectOptGroupAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsHTMLSelectOptGroupAccessible::ActionCount()
{
return NS_ERROR_NOT_IMPLEMENTED;
return 0;
}
////////////////////////////////////////////////////////////////////////////////
@ -773,11 +774,10 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetValue(nsAString& aValue)
return option ? option->GetName(aValue) : NS_OK;
}
/** Just one action ( click ). */
NS_IMETHODIMP nsHTMLComboboxAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsHTMLComboboxAccessible::ActionCount()
{
*aNumActions = 1;
return NS_OK;
return 1;
}
/**

View File

@ -108,7 +108,6 @@ public:
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD SetSelected(PRBool aSelect);
// nsAccessible
@ -120,6 +119,9 @@ public:
virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
PRInt32 *aSetSize);
// ActionAccessible
virtual PRUint8 ActionCount();
/**
* Return focused option if any.
*/
@ -154,12 +156,14 @@ public:
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
// nsAccessible
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
protected:
// nsAccessible
virtual void CacheChildren();
@ -185,7 +189,6 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessNode
@ -197,6 +200,9 @@ public:
virtual PRUint64 NativeState();
virtual void InvalidateChildren();
// ActionAccessible
virtual PRUint8 ActionCount();
protected:
// nsAccessible
virtual void CacheChildren();

View File

@ -63,21 +63,19 @@ CAccessibleAction::QueryInterface(REFIID iid, void** ppv)
// IAccessibleAction
STDMETHODIMP
CAccessibleAction::nActions(long *aNumActions)
CAccessibleAction::nActions(long* aActionCount)
{
__try {
*aNumActions = 0;
if (!aActionCount)
return E_INVALIDARG;
nsCOMPtr<nsIAccessible> acc(do_QueryObject(this));
if (!acc)
*aActionCount = 0;
nsRefPtr<nsAccessible> acc(do_QueryObject(this));
if (!acc || acc->IsDefunct())
return E_FAIL;
PRUint8 count = 0;
nsresult rv = acc->GetNumActions(&count);
if (NS_FAILED(rv))
return GetHRESULT(rv);
*aNumActions = count;
*aActionCount = acc->ActionCount();
return S_OK;
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }

View File

@ -545,13 +545,10 @@ nsXFormsSelectableItemAccessible::GetValue(nsAString& aValue)
return sXFormsService->GetValue(DOMNode, aValue);
}
NS_IMETHODIMP
nsXFormsSelectableItemAccessible::GetNumActions(PRUint8 *aCount)
PRUint8
nsXFormsSelectableItemAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP

View File

@ -190,9 +190,11 @@ public:
nsIWeakReference *aShell);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD DoAction(PRUint8 aIndex);
// ActionAccessible
virtual PRUint8 ActionCount();
protected:
bool IsSelected();
};

View File

@ -115,13 +115,10 @@ nsXFormsTriggerAccessible::GetValue(nsAString& aValue)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsTriggerAccessible::GetNumActions(PRUint8 *aCount)
PRUint8
nsXFormsTriggerAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP
@ -163,13 +160,10 @@ nsXFormsInputAccessible::NativeRole()
return nsIAccessibleRole::ROLE_ENTRY;
}
NS_IMETHODIMP
nsXFormsInputAccessible::GetNumActions(PRUint8* aCount)
PRUint8
nsXFormsInputAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP
@ -225,13 +219,10 @@ nsXFormsInputBooleanAccessible::NativeState()
return state;
}
NS_IMETHODIMP
nsXFormsInputBooleanAccessible::GetNumActions(PRUint8 *aCount)
PRUint8
nsXFormsInputBooleanAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP

View File

@ -81,12 +81,14 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual PRUint32 NativeRole();
// ActionAccessible
virtual PRUint8 ActionCount();
};
/**
@ -101,12 +103,14 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual PRUint32 NativeRole();
// ActionAccessible
virtual PRUint8 ActionCount();
};
/**
@ -119,13 +123,15 @@ public:
nsXFormsInputBooleanAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};
/**

View File

@ -70,13 +70,10 @@ nsXFormsDropmarkerWidgetAccessible::NativeState()
return isOpen ? states::PRESSED: 0;
}
NS_IMETHODIMP
nsXFormsDropmarkerWidgetAccessible::GetNumActions(PRUint8 *aCount)
PRUint8
nsXFormsDropmarkerWidgetAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP

View File

@ -55,13 +55,15 @@ public:
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};

View File

@ -151,15 +151,11 @@ nsXULComboboxAccessible::GetAllowsAnonChildAccessibles()
// menuitems
return PR_FALSE;
}
NS_IMETHODIMP
nsXULComboboxAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsXULComboboxAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
// Just one action (click).
*aNumActions = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP

View File

@ -56,7 +56,6 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD DoAction(PRUint8 aIndex);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessible
@ -64,6 +63,9 @@ public:
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
virtual PRBool GetAllowsAnonChildAccessibles();
// ActionAccessible
virtual PRUint8 ActionCount();
};
#endif

View File

@ -82,13 +82,10 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsXULButtonAccessible, nsAccessible)
////////////////////////////////////////////////////////////////////////////////
// nsXULButtonAccessible: nsIAccessible
NS_IMETHODIMP
nsXULButtonAccessible::GetNumActions(PRUint8 *aCount)
PRUint8
nsXULButtonAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP
@ -249,10 +246,10 @@ nsXULDropmarkerAccessible::
{
}
NS_IMETHODIMP nsXULDropmarkerAccessible::GetNumActions(PRUint8 *aResult)
PRUint8
nsXULDropmarkerAccessible::ActionCount()
{
*aResult = 1;
return NS_OK;
return 1;
}
PRBool nsXULDropmarkerAccessible::DropmarkerOpen(PRBool aToggleOpen)
@ -320,7 +317,6 @@ nsXULDropmarkerAccessible::NativeState()
return DropmarkerOpen(PR_FALSE) ? states::PRESSED : 0;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULCheckboxAccessible
////////////////////////////////////////////////////////////////////////////////
@ -337,10 +333,10 @@ nsXULCheckboxAccessible::NativeRole()
return nsIAccessibleRole::ROLE_CHECKBUTTON;
}
NS_IMETHODIMP nsXULCheckboxAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsXULCheckboxAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;
return 1;
}
/**
@ -753,14 +749,13 @@ nsXULTextFieldAccessible::NativeRole()
return nsIAccessibleRole::ROLE_ENTRY;
}
/**
* Only one actions available
*/
NS_IMETHODIMP nsXULTextFieldAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsXULTextFieldAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;
return 1;
}
/**

View File

@ -67,7 +67,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -75,6 +74,9 @@ public:
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
protected:
// nsAccessible
@ -95,13 +97,15 @@ public:
nsXULCheckboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};
/**
@ -114,7 +118,6 @@ public:
nsXULDropmarkerAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -122,6 +125,9 @@ public:
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
private:
PRBool DropmarkerOpen(PRBool aToggleOpen);
};
@ -240,7 +246,6 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -253,6 +258,9 @@ public:
virtual PRUint64 NativeState();
virtual PRBool GetAllowsAnonChildAccessibles();
// ActionAccessible
virtual PRUint8 ActionCount();
protected:
// nsAccessible
virtual void CacheChildren();

View File

@ -95,13 +95,10 @@ nsXULColumnItemAccessible::NativeState()
return states::READONLY;
}
NS_IMETHODIMP
nsXULColumnItemAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsXULColumnItemAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
*aNumActions = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP

View File

@ -72,7 +72,6 @@ public:
nsXULColumnItemAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -80,6 +79,9 @@ public:
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
enum { eAction_Click = 0 };
};

View File

@ -565,10 +565,10 @@ NS_IMETHODIMP nsXULMenuitemAccessible::GetActionName(PRUint8 aIndex, nsAString&
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsXULMenuitemAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsXULMenuitemAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;
return 1;
}
@ -612,12 +612,12 @@ NS_IMETHODIMP nsXULMenuSeparatorAccessible::GetActionName(PRUint8 aIndex, nsAStr
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsXULMenuSeparatorAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsXULMenuSeparatorAccessible::ActionCount()
{
return NS_ERROR_NOT_IMPLEMENTED;
return 0;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULMenupopupAccessible
////////////////////////////////////////////////////////////////////////////////

View File

@ -84,7 +84,6 @@ public:
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
// nsAccessible
virtual void Description(nsString& aDescription);
@ -98,6 +97,7 @@ public:
virtual PRBool GetAllowsAnonChildAccessibles();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual KeyBinding AccessKey() const;
virtual KeyBinding KeyboardShortcut() const;
};
@ -113,12 +113,14 @@ public:
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};

View File

@ -97,13 +97,10 @@ nsXULSliderAccessible::GetValue(nsAString& aValue)
return GetSliderAttr(nsAccessibilityAtoms::curpos, aValue);
}
NS_IMETHODIMP
nsXULSliderAccessible::GetNumActions(PRUint8 *aCount)
PRUint8
nsXULSliderAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP

View File

@ -56,7 +56,6 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -68,6 +67,9 @@ public:
virtual PRUint64 NativeState();
virtual PRBool GetAllowsAnonChildAccessibles();
// ActionAccessible
virtual PRUint8 ActionCount();
protected:
already_AddRefed<nsIContent> GetSliderNode();

View File

@ -65,10 +65,10 @@ nsXULTabAccessible::
////////////////////////////////////////////////////////////////////////////////
// nsXULTabAccessible: nsIAccessible
NS_IMETHODIMP nsXULTabAccessible::GetNumActions(PRUint8 *_retval)
PRUint8
nsXULTabAccessible::ActionCount()
{
*_retval = 1;
return NS_OK;
return 1;
}
/** Return the name of our only action */
@ -191,13 +191,10 @@ nsXULTabsAccessible::NativeRole()
return nsIAccessibleRole::ROLE_PAGETABLIST;
}
NS_IMETHODIMP
nsXULTabsAccessible::GetNumActions(PRUint8 *aCount)
PRUint8
nsXULTabsAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
return NS_OK;
return 0;
}
/** no value */

View File

@ -54,7 +54,6 @@ public:
nsXULTabAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
@ -65,6 +64,9 @@ public:
PRInt32 *aSetSize);
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
};
@ -77,12 +79,14 @@ public:
nsXULTabsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetValue(nsAString& _retval);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual PRUint32 NativeRole();
// ActionAccessible
virtual PRUint8 ActionCount();
};

View File

@ -189,13 +189,10 @@ nsXULLinkAccessible::NativeState()
return nsHyperTextAccessible::NativeState() | states::LINKED;
}
NS_IMETHODIMP
nsXULLinkAccessible::GetNumActions(PRUint8 *aNumActions)
PRUint8
nsXULLinkAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aNumActions);
*aNumActions = 1;
return NS_OK;
return 1;
}
NS_IMETHODIMP

View File

@ -87,7 +87,6 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -96,6 +95,9 @@ public:
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
// HyperLinkAccessible
virtual bool IsLink();
virtual PRUint32 StartOffset();

View File

@ -784,19 +784,12 @@ nsXULTreeItemAccessibleBase::GetRelationByType(PRUint32 aRelationType,
return nsAccessible::GetRelationByType(aRelationType, aRelation);
}
NS_IMETHODIMP
nsXULTreeItemAccessibleBase::GetNumActions(PRUint8 *aActionsCount)
PRUint8
nsXULTreeItemAccessibleBase::ActionCount()
{
NS_ENSURE_ARG_POINTER(aActionsCount);
*aActionsCount = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
// "activate" action is available for all treeitems, "expand/collapse" action
// is avaible for treeitem which is container.
*aActionsCount = IsExpandable() ? 2 : 1;
return NS_OK;
return IsExpandable() ? 2 : 1;
}
NS_IMETHODIMP

View File

@ -195,7 +195,6 @@ public:
PRInt32 *aSimilarItemsInGroup,
PRInt32 *aPositionInGroup);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -209,6 +208,9 @@ public:
virtual PRInt32 IndexInParent() const;
virtual nsAccessible* FocusedChild();
// ActionAccessible
virtual PRUint8 ActionCount();
// nsXULTreeItemAccessibleBase
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)

View File

@ -919,28 +919,20 @@ nsXULTreeGridCellAccessible::GetBounds(PRInt32 *aX, PRInt32 *aY,
return NS_OK;
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetNumActions(PRUint8 *aActionsCount)
PRUint8
nsXULTreeGridCellAccessible::ActionCount()
{
NS_ENSURE_ARG_POINTER(aActionsCount);
*aActionsCount = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
PRBool isCycler = PR_FALSE;
mColumn->GetCycler(&isCycler);
if (isCycler) {
*aActionsCount = 1;
return NS_OK;
}
if (isCycler)
return 1;
PRInt16 type;
mColumn->GetType(&type);
if (type == nsITreeColumn::TYPE_CHECKBOX && IsEditable())
*aActionsCount = 1;
return 1;
return NS_OK;
return 0;
}
NS_IMETHODIMP

View File

@ -148,7 +148,6 @@ public:
NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
PRInt32 *aWidth, PRInt32 *aHeight);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -163,9 +162,12 @@ public:
// nsAccessible
virtual nsAccessible* FocusedChild();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual PRInt32 IndexInParent() const;
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
virtual PRInt32 IndexInParent() const;
// ActionAccessible
virtual PRUint8 ActionCount();
// nsXULTreeGridCellAccessible
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID)