diff --git a/accessible/public/nsIAccessible.idl b/accessible/public/nsIAccessible.idl index 4452f98f7c8..ca1fe49b547 100644 --- a/accessible/public/nsIAccessible.idl +++ b/accessible/public/nsIAccessible.idl @@ -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 diff --git a/accessible/src/atk/nsMaiInterfaceAction.cpp b/accessible/src/atk/nsMaiInterfaceAction.cpp index 0c905acf0a9..d13fd39e28c 100644 --- a/accessible/src/atk/nsMaiInterfaceAction.cpp +++ b/accessible/src/atk/nsMaiInterfaceAction.cpp @@ -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 * diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index f8eaf4b4e6c..db1c639e971 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -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) { diff --git a/accessible/src/base/nsBaseWidgetAccessible.cpp b/accessible/src/base/nsBaseWidgetAccessible.cpp index c2acbaa4893..29d34f7e834 100644 --- a/accessible/src/base/nsBaseWidgetAccessible.cpp +++ b/accessible/src/base/nsBaseWidgetAccessible.cpp @@ -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; } diff --git a/accessible/src/base/nsBaseWidgetAccessible.h b/accessible/src/base/nsBaseWidgetAccessible.h index a728fec8a61..89e9bf0e067 100644 --- a/accessible/src/base/nsBaseWidgetAccessible.h +++ b/accessible/src/base/nsBaseWidgetAccessible.h @@ -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); diff --git a/accessible/src/base/nsFormControlAccessible.cpp b/accessible/src/base/nsFormControlAccessible.cpp index 2da828e1335..230ead49cf0 100644 --- a/accessible/src/base/nsFormControlAccessible.cpp +++ b/accessible/src/base/nsFormControlAccessible.cpp @@ -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; diff --git a/accessible/src/base/nsFormControlAccessible.h b/accessible/src/base/nsFormControlAccessible.h index 3d4c838be81..c05948c3126 100644 --- a/accessible/src/base/nsFormControlAccessible.h +++ b/accessible/src/base/nsFormControlAccessible.h @@ -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 }; }; diff --git a/accessible/src/html/nsHTMLFormControlAccessible.cpp b/accessible/src/html/nsHTMLFormControlAccessible.cpp index fb8fe4cb6bc..14ebdd7d592 100644 --- a/accessible/src/html/nsHTMLFormControlAccessible.cpp +++ b/accessible/src/html/nsHTMLFormControlAccessible.cpp @@ -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; diff --git a/accessible/src/html/nsHTMLFormControlAccessible.h b/accessible/src/html/nsHTMLFormControlAccessible.h index ee3ce62994b..769914e9e36 100644 --- a/accessible/src/html/nsHTMLFormControlAccessible.h +++ b/accessible/src/html/nsHTMLFormControlAccessible.h @@ -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); diff --git a/accessible/src/html/nsHTMLSelectAccessible.cpp b/accessible/src/html/nsHTMLSelectAccessible.cpp index d2175251e7c..ce60d2d9dea 100644 --- a/accessible/src/html/nsHTMLSelectAccessible.cpp +++ b/accessible/src/html/nsHTMLSelectAccessible.cpp @@ -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); } /** diff --git a/accessible/src/html/nsHTMLSelectAccessible.h b/accessible/src/html/nsHTMLSelectAccessible.h index 78a61de126a..e3b5cd9f22e 100644 --- a/accessible/src/html/nsHTMLSelectAccessible.h +++ b/accessible/src/html/nsHTMLSelectAccessible.h @@ -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); diff --git a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp index 18cdc369a7c..ffeddc5412d 100755 --- a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp +++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp @@ -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; } diff --git a/accessible/src/xul/nsXULFormControlAccessible.cpp b/accessible/src/xul/nsXULFormControlAccessible.cpp index cacfd82fd1b..dfde067cf76 100644 --- a/accessible/src/xul/nsXULFormControlAccessible.cpp +++ b/accessible/src/xul/nsXULFormControlAccessible.cpp @@ -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; diff --git a/accessible/src/xul/nsXULFormControlAccessible.h b/accessible/src/xul/nsXULFormControlAccessible.h index bcd0a83d47a..2b5332fc7d9 100644 --- a/accessible/src/xul/nsXULFormControlAccessible.h +++ b/accessible/src/xul/nsXULFormControlAccessible.h @@ -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); diff --git a/accessible/src/xul/nsXULMenuAccessible.cpp b/accessible/src/xul/nsXULMenuAccessible.cpp index 74b207e719c..ffeca886670 100644 --- a/accessible/src/xul/nsXULMenuAccessible.cpp +++ b/accessible/src/xul/nsXULMenuAccessible.cpp @@ -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; } diff --git a/accessible/src/xul/nsXULMenuAccessible.h b/accessible/src/xul/nsXULMenuAccessible.h index 7195251736a..d3923dc2af4 100644 --- a/accessible/src/xul/nsXULMenuAccessible.h +++ b/accessible/src/xul/nsXULMenuAccessible.h @@ -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); }; diff --git a/accessible/src/xul/nsXULSelectAccessible.cpp b/accessible/src/xul/nsXULSelectAccessible.cpp index 6233c4ddb2a..d6984c17ffa 100644 --- a/accessible/src/xul/nsXULSelectAccessible.cpp +++ b/accessible/src/xul/nsXULSelectAccessible.cpp @@ -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; } diff --git a/accessible/src/xul/nsXULSelectAccessible.h b/accessible/src/xul/nsXULSelectAccessible.h index 2feb45ff17b..e1a970bd3b5 100644 --- a/accessible/src/xul/nsXULSelectAccessible.h +++ b/accessible/src/xul/nsXULSelectAccessible.h @@ -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 diff --git a/accessible/src/xul/nsXULTabAccessible.cpp b/accessible/src/xul/nsXULTabAccessible.cpp index 7c7bdad5a02..6c573fc4974 100644 --- a/accessible/src/xul/nsXULTabAccessible.cpp +++ b/accessible/src/xul/nsXULTabAccessible.cpp @@ -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; diff --git a/accessible/src/xul/nsXULTabAccessible.h b/accessible/src/xul/nsXULTabAccessible.h index a0b5ff1311d..fe7add388b4 100644 --- a/accessible/src/xul/nsXULTabAccessible.h +++ b/accessible/src/xul/nsXULTabAccessible.h @@ -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); }; diff --git a/accessible/src/xul/nsXULTreeAccessible.cpp b/accessible/src/xul/nsXULTreeAccessible.cpp index 4f1b0ed1915..7c723396598 100644 --- a/accessible/src/xul/nsXULTreeAccessible.cpp +++ b/accessible/src/xul/nsXULTreeAccessible.cpp @@ -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; } diff --git a/accessible/src/xul/nsXULTreeAccessible.h b/accessible/src/xul/nsXULTreeAccessible.h index 2e5810e7fdd..9b6bcd5eacb 100644 --- a/accessible/src/xul/nsXULTreeAccessible.h +++ b/accessible/src/xul/nsXULTreeAccessible.h @@ -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); };