зеркало из https://github.com/mozilla/pjs.git
Bug 369777. Separate programmatic action name from localized description. Patch by david.bolter@utoronto.ca. r=aaronlev
This commit is contained in:
Родитель
58ec5a85e9
Коммит
5d4566f142
|
@ -56,7 +56,7 @@ interface nsIPersistentProperties;
|
|||
*
|
||||
* @status UNDER_REVIEW
|
||||
*/
|
||||
[scriptable, uuid(c711b078-e76a-4136-9d51-e38b6c3a4cec)]
|
||||
[scriptable, uuid(813fbabc-5307-4b76-9ac9-3036df0cf58e)]
|
||||
interface nsIAccessible : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -253,6 +253,11 @@ interface nsIAccessible : nsISupports
|
|||
*/
|
||||
AString getActionName(in PRUint8 index);
|
||||
|
||||
/**
|
||||
* The description of the accessible action at the given zero-based index
|
||||
*/
|
||||
AString getActionDescription(in PRUint8 aIndex);
|
||||
|
||||
/**
|
||||
* Perform the accessible action at the given zero-based index
|
||||
* Action number 0 is the default action
|
||||
|
|
|
@ -79,8 +79,13 @@ getActionCountCB(AtkAction *aAction)
|
|||
const gchar *
|
||||
getActionDescriptionCB(AtkAction *aAction, gint aActionIndex)
|
||||
{
|
||||
// use getActionName as default description
|
||||
return getActionNameCB(aAction, aActionIndex);
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
|
||||
NS_ENSURE_TRUE(accWrap, nsnull);
|
||||
|
||||
nsAutoString description;
|
||||
nsresult rv = accWrap->GetActionDescription(aActionIndex, description);
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
return nsAccessibleWrap::ReturnString(description);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
|
|
|
@ -2228,6 +2228,17 @@ NS_IMETHODIMP nsAccessible::GetActionName(PRUint8 index, nsAString& aName)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* DOMString getActionDescription (in PRUint8 index); */
|
||||
NS_IMETHODIMP nsAccessible::GetActionDescription(PRUint8 aIndex, nsAString& aDescription)
|
||||
{
|
||||
// default to localized action name.
|
||||
nsAutoString name;
|
||||
nsresult rv = GetActionName(aIndex, name);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return GetTranslatedString(name, aDescription);
|
||||
}
|
||||
|
||||
/* void doAction (in PRUint8 index); */
|
||||
NS_IMETHODIMP nsAccessible::DoAction(PRUint8 index)
|
||||
{
|
||||
|
|
|
@ -178,17 +178,19 @@ NS_IMETHODIMP nsLinkableAccessible::GetNumActions(PRUint8 *aNumActions)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* wstring getAccActionName (in PRUint8 index); */
|
||||
NS_IMETHODIMP nsLinkableAccessible::GetActionName(PRUint8 index, nsAString& aActionName)
|
||||
/* nsAString GetActionName (in PRUint8 Aindex); */
|
||||
NS_IMETHODIMP nsLinkableAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
// Action 0 (default action): Jump to link
|
||||
aActionName.Truncate();
|
||||
if (index == eAction_Jump) {
|
||||
aName.Truncate();
|
||||
if (aIndex == eAction_Jump) {
|
||||
if (mIsLink) {
|
||||
return nsAccessible::GetTranslatedString(NS_LITERAL_STRING("jump"), aActionName);
|
||||
aName.AssignLiteral("jump");
|
||||
return NS_OK;
|
||||
}
|
||||
else if (mIsOnclick) {
|
||||
return nsAccessible::GetTranslatedString(NS_LITERAL_STRING("click"), aActionName);
|
||||
aName.AssignLiteral("click");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
nsLinkableAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetValue(nsAString& _retval);
|
||||
|
|
|
@ -65,10 +65,10 @@ NS_IMETHODIMP nsRadioButtonAccessible::GetNumActions(PRUint8 *_retval)
|
|||
/**
|
||||
*
|
||||
*/
|
||||
NS_IMETHODIMP nsRadioButtonAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsRadioButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("select"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("select");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
nsRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
|
||||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 aIndex);
|
||||
enum { eAction_Click = 0 };
|
||||
};
|
||||
|
|
|
@ -70,17 +70,17 @@ NS_IMETHODIMP nsHTMLCheckboxAccessible::GetNumActions(PRUint8 *_retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) { // 0 is the magic value for default action
|
||||
if (aIndex == eAction_Click) { // 0 is the magic value for default action
|
||||
// check or uncheck
|
||||
PRUint32 state;
|
||||
GetState(&state);
|
||||
|
||||
if (state & STATE_CHECKED)
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("uncheck"), _retval);
|
||||
aName.AssignLiteral("uncheck");
|
||||
else
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("check"), _retval);
|
||||
aName.AssignLiteral("check");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -145,10 +145,10 @@ NS_IMETHODIMP nsHTMLButtonAccessible::GetNumActions(PRUint8 *_retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLButtonAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTMLButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("press"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("press");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -239,10 +239,10 @@ NS_IMETHODIMP nsHTML4ButtonAccessible::GetNumActions(PRUint8 *_retval)
|
|||
return NS_OK;;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTML4ButtonAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTML4ButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("press"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("press");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -419,10 +419,10 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible::GetNumActions(PRUint8 *_retval)
|
|||
return NS_OK;;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("activate"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("activate");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
|
||||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetState(PRUint32 *aState);
|
||||
};
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetName(nsAString& _retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
};
|
||||
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetName(nsAString& aName) { aName.Truncate(); return GetHTMLName(aName, PR_TRUE); }
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
};
|
||||
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
NS_IMETHOD GetValue(nsAString& _retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetExtState(PRUint32 *aExtState);
|
||||
|
||||
|
|
|
@ -595,10 +595,10 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetState(PRUint32 *_retval)
|
|||
}
|
||||
|
||||
/** select us! close combo box if necessary*/
|
||||
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Select) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("select"), _retval);
|
||||
if (aIndex == eAction_Select) {
|
||||
aName.AssignLiteral("select");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -784,7 +784,7 @@ NS_IMETHODIMP nsHTMLSelectOptGroupAccessible::DoAction(PRUint8 index)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLSelectOptGroupAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTMLSelectOptGroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -990,7 +990,7 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::DoAction(PRUint8 aIndex)
|
|||
* if we are open -> closed is our name.
|
||||
* Uses the frame to get the state, updated on every click
|
||||
*/
|
||||
NS_IMETHODIMP nsHTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aActionName)
|
||||
NS_IMETHODIMP nsHTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (aIndex != nsHTMLComboboxAccessible::eAction_Click) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -1005,9 +1005,9 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString&
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
if (comboFrame->IsDroppedDown())
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("close"), aActionName);
|
||||
aName.AssignLiteral("close");
|
||||
else
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("open"), aActionName);
|
||||
aName.AssignLiteral("open");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1128,7 +1128,7 @@ NS_IMETHODIMP nsHTMLComboboxButtonAccessible::DoAction(PRUint8 aIndex)
|
|||
* if we are open -> closed is our name.
|
||||
* Uses the frame to get the state, updated on every click
|
||||
*/
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
nsIFrame *boundsFrame = GetBoundsFrame();
|
||||
nsIComboboxControlFrame* comboFrame;
|
||||
|
@ -1137,9 +1137,9 @@ NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetActionName(PRUint8 aIndex, nsAS
|
|||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (comboFrame->IsDroppedDown())
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("close"), _retval);
|
||||
aName.AssignLiteral("close");
|
||||
else
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("open"), _retval);
|
||||
aName.AssignLiteral("open");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1186,9 +1186,9 @@ NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetParent(nsIAccessible **aParent)
|
|||
/**
|
||||
* Gets the name from GetActionName()
|
||||
*/
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetName(nsAString& _retval)
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetName(nsAString& aName)
|
||||
{
|
||||
return GetActionName(eAction_Click, _retval);
|
||||
return GetActionName(eAction_Click, aName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -159,7 +159,7 @@ public:
|
|||
|
||||
/* ----- nsIAccessible ----- */
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetRole(PRUint32 *aRole);
|
||||
|
@ -182,7 +182,7 @@ public:
|
|||
/* ----- nsIAccessible ----- */
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
};
|
||||
|
||||
|
@ -208,7 +208,7 @@ public:
|
|||
NS_IMETHOD GetDescription(nsAString& aDescription);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& aActionName);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
|
||||
void CacheChildren();
|
||||
|
||||
|
@ -252,7 +252,7 @@ public:
|
|||
/* ----- nsIAccessible ----- */
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD GetParent(nsIAccessible **_retval);
|
||||
NS_IMETHOD GetName(nsAString& _retval);
|
||||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
|
|
|
@ -128,7 +128,7 @@ NS_IMETHODIMP
|
|||
nsXFormsTriggerAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (aIndex == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("press"), aName);
|
||||
aName.AssignLiteral("press");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -175,7 +175,7 @@ nsXFormsInputAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
|||
if (aIndex != eAction_Click)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("activate"), aName);
|
||||
aName.AssignLiteral("activate");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -241,9 +241,9 @@ nsXFormsInputBooleanAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (value.EqualsLiteral("true"))
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("uncheck"), aName);
|
||||
aName.AssignLiteral("uncheck");
|
||||
else
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("check"), aName);
|
||||
aName.AssignLiteral("check");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -515,9 +515,9 @@ nsXFormsItemCheckgroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
if (IsItemSelected())
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("uncheck"), aName);
|
||||
aName.AssignLiteral("uncheck");
|
||||
else
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("check"), aName);
|
||||
aName.AssignLiteral("check");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -558,7 +558,7 @@ nsXFormsItemRadiogroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName
|
|||
if (aIndex != eAction_Click)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("select"), aName);
|
||||
aName.AssignLiteral("select");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -648,7 +648,7 @@ nsXFormsItemComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
|||
if (aIndex != eAction_Click)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("select"), aName);
|
||||
aName.AssignLiteral("select");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,10 +81,10 @@ NS_IMETHODIMP nsXULButtonAccessible::GetNumActions(PRUint8 *_retval)
|
|||
/**
|
||||
* Return the name of our only action
|
||||
*/
|
||||
NS_IMETHODIMP nsXULButtonAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("press"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("press");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -245,13 +245,13 @@ PRBool nsXULDropmarkerAccessible::DropmarkerOpen(PRBool aToggleOpen)
|
|||
/**
|
||||
* Return the name of our only action
|
||||
*/
|
||||
NS_IMETHODIMP nsXULDropmarkerAccessible::GetActionName(PRUint8 index, nsAString& aResult)
|
||||
NS_IMETHODIMP nsXULDropmarkerAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
if (aIndex == eAction_Click) {
|
||||
if (DropmarkerOpen(PR_FALSE))
|
||||
aResult.AssignLiteral("close");
|
||||
aName.AssignLiteral("close");
|
||||
else
|
||||
aResult.AssignLiteral("open");
|
||||
aName.AssignLiteral("open");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -322,17 +322,17 @@ NS_IMETHODIMP nsXULCheckboxAccessible::GetNumActions(PRUint8 *_retval)
|
|||
/**
|
||||
* Return the name of our only action
|
||||
*/
|
||||
NS_IMETHODIMP nsXULCheckboxAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULCheckboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
if (aIndex == eAction_Click) {
|
||||
// check or uncheck
|
||||
PRUint32 state;
|
||||
GetState(&state);
|
||||
|
||||
if (state & STATE_CHECKED)
|
||||
_retval.AssignLiteral("uncheck");
|
||||
aName.AssignLiteral("uncheck");
|
||||
else
|
||||
_retval.AssignLiteral("check");
|
||||
aName.AssignLiteral("check");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -779,10 +779,10 @@ NS_IMETHODIMP nsXULTextFieldAccessible::GetNumActions(PRUint8 *_retval)
|
|||
/**
|
||||
* Return the name of our only action
|
||||
*/
|
||||
NS_IMETHODIMP nsXULTextFieldAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULTextFieldAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("activate"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("activate");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
void CacheChildren();
|
||||
};
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
nsXULCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
|
||||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
};
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
|
||||
private:
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
NS_IMETHOD GetExtState(PRUint32 *aExtState);
|
||||
NS_IMETHOD GetRole(PRUint32 *aRole);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
|
||||
|
||||
|
|
|
@ -449,10 +449,10 @@ NS_IMETHODIMP nsXULMenuitemAccessible::DoAction(PRUint8 index)
|
|||
}
|
||||
|
||||
/** select us! close combo box if necessary*/
|
||||
NS_IMETHODIMP nsXULMenuitemAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULMenuitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("click"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("click");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -498,7 +498,7 @@ NS_IMETHODIMP nsXULMenuSeparatorAccessible::DoAction(PRUint8 index)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULMenuSeparatorAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULMenuSeparatorAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
|
||||
};
|
||||
|
@ -97,7 +97,7 @@ public:
|
|||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
};
|
||||
|
||||
|
|
|
@ -196,17 +196,17 @@ NS_IMETHODIMP nsXULListitemAccessible::GetState(PRUint32 *aState)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULListitemAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULListitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click && mIsCheckbox) {
|
||||
if (aIndex == eAction_Click && mIsCheckbox) {
|
||||
// check or uncheck
|
||||
PRUint32 state;
|
||||
GetState(&state);
|
||||
|
||||
if (state & STATE_CHECKED)
|
||||
_retval = NS_LITERAL_STRING("uncheck");
|
||||
aName.AssignLiteral("uncheck");
|
||||
else
|
||||
_retval = NS_LITERAL_STRING("check");
|
||||
aName.AssignLiteral("check");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ NS_IMETHODIMP nsXULComboboxAccessible::DoAction(PRUint8 aIndex)
|
|||
* if we are open -> closed is our name.
|
||||
* Uses the frame to get the state, updated on every click
|
||||
*/
|
||||
NS_IMETHODIMP nsXULComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aActionName)
|
||||
NS_IMETHODIMP nsXULComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (aIndex != nsXULComboboxAccessible::eAction_Click) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -381,9 +381,9 @@ NS_IMETHODIMP nsXULComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString&
|
|||
PRBool isDroppedDown;
|
||||
menuList->GetOpen(&isDroppedDown);
|
||||
if (isDroppedDown)
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("close"), aActionName);
|
||||
aName.AssignLiteral("close");
|
||||
else
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("open"), aActionName);
|
||||
aName.AssignLiteral("open");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
NS_IMETHOD GetName(nsAString& _retval);
|
||||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& aName);
|
||||
// Don't use XUL menuitems's description attribute
|
||||
NS_IMETHOD GetDescription(nsAString& aDesc) { return nsAccessibleWrap::GetDescription(aDesc); }
|
||||
|
||||
|
@ -129,7 +129,7 @@ public:
|
|||
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& aActionName);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& aName);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -62,10 +62,10 @@ NS_IMETHODIMP nsXULTabAccessible::GetNumActions(PRUint8 *_retval)
|
|||
}
|
||||
|
||||
/** Return the name of our only action */
|
||||
NS_IMETHODIMP nsXULTabAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULTabAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Switch) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("switch"), _retval);
|
||||
if (aIndex == eAction_Switch) {
|
||||
aName.AssignLiteral("switch");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
};
|
||||
|
||||
|
|
|
@ -637,30 +637,30 @@ NS_IMETHODIMP nsXULTreeitemAccessible::GetNumActions(PRUint8 *_retval)
|
|||
}
|
||||
|
||||
// Return the name of our actions
|
||||
NS_IMETHODIMP nsXULTreeitemAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULTreeitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
NS_ENSURE_TRUE(mColumn && mTree && mTreeView, NS_ERROR_FAILURE);
|
||||
|
||||
if (index == eAction_Click) {
|
||||
if (aIndex == eAction_Click) {
|
||||
PRBool isCycler;
|
||||
mColumn->GetCycler(&isCycler);
|
||||
if (isCycler) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("cycle"), _retval);
|
||||
aName.AssignLiteral("cycle");
|
||||
}
|
||||
else {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("activate"), _retval);
|
||||
aName.AssignLiteral("activate");
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
else if (index == eAction_Expand) {
|
||||
else if (aIndex == eAction_Expand) {
|
||||
PRBool isContainer, isContainerOpen;
|
||||
mTreeView->IsContainer(mRow, &isContainer);
|
||||
if (isContainer) {
|
||||
mTreeView->IsContainerOpen(mRow, &isContainerOpen);
|
||||
if (isContainerOpen)
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("collapse"), _retval);
|
||||
aName.AssignLiteral("collapse");
|
||||
else
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("expand"), _retval);
|
||||
aName.AssignLiteral("expand");
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -934,10 +934,10 @@ NS_IMETHODIMP nsXULTreeColumnsAccessible::GetNumActions(PRUint8 *_retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULTreeColumnsAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULTreeColumnsAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("click"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("click");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1016,10 +1016,10 @@ NS_IMETHODIMP nsXULTreeColumnitemAccessible::GetNumActions(PRUint8 *_retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULTreeColumnitemAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
NS_IMETHODIMP nsXULTreeColumnitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("click"), _retval);
|
||||
if (aIndex == eAction_Click) {
|
||||
aName.AssignLiteral("click");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ public:
|
|||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
|
||||
NS_IMETHOD GetParent(nsIAccessible **_retval);
|
||||
NS_IMETHOD GetNextSibling(nsIAccessible **_retval);
|
||||
|
@ -145,7 +145,7 @@ public:
|
|||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
|
||||
NS_IMETHOD GetNextSibling(nsIAccessible **_retval);
|
||||
NS_IMETHOD GetPreviousSibling(nsIAccessible **_retval);
|
||||
|
@ -168,7 +168,7 @@ public:
|
|||
NS_IMETHOD GetRole(PRUint32 *_retval);
|
||||
NS_IMETHOD GetState(PRUint32 *_retval);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче