Bug 540281 - rename nsAccessible::FireAccessibleEvent into HandleAccEvent, r=davidb

This commit is contained in:
Alexander Surkov 2010-01-19 12:23:44 +08:00
parent 5f1edf6103
commit bbf285bdd8
13 changed files with 40 additions and 49 deletions

View File

@ -1107,24 +1107,22 @@ nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj)
}
nsresult
nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
nsAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent)
{
nsresult rv = nsAccessible::FireAccessibleEvent(aEvent);
nsresult rv = nsAccessible::HandleAccEvent(aEvent);
NS_ENSURE_SUCCESS(rv, rv);
return FirePlatformEvent(aEvent);
}
nsresult
nsAccessibleWrap::FirePlatformEvent(nsIAccessibleEvent *aEvent)
nsAccessibleWrap::FirePlatformEvent(nsAccEvent *aEvent)
{
nsCOMPtr<nsIAccessible> accessible;
aEvent->GetAccessible(getter_AddRefs(accessible));
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
PRUint32 type = 0;
nsresult rv = aEvent->GetEventType(&type);
NS_ENSURE_SUCCESS(rv, rv);
PRUint32 type = aEvent->GetEventType();
AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(accessible);

View File

@ -100,7 +100,7 @@ public:
// return the atk object for this nsAccessibleWrap
NS_IMETHOD GetNativeInterface(void **aOutAccessible);
NS_IMETHOD FireAccessibleEvent(nsIAccessibleEvent *aEvent);
virtual nsresult HandleAccEvent(nsAccEvent *aEvent);
AtkObject * GetAtkObject(void);
static AtkObject * GetAtkObject(nsIAccessible * acc);
@ -118,7 +118,7 @@ public:
}
protected:
virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent);
virtual nsresult FirePlatformEvent(nsAccEvent *aEvent);
nsresult FireAtkStateChangeEvent(nsIAccessibleEvent *aEvent,
AtkObject *aObject);

View File

@ -1356,7 +1356,7 @@ nsAccessible::GetXULName(nsAString& aLabel)
}
nsresult
nsAccessible::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
nsAccessible::HandleAccEvent(nsAccEvent *aEvent)
{
NS_ENSURE_ARG_POINTER(aEvent);
nsCOMPtr<nsIDOMNode> eventNode;

View File

@ -104,11 +104,11 @@ private:
#define NS_ACCESSIBLE_IMPL_CID \
{ /* c734df37-7e12-49ec-8983-eea88a186bb8 */ \
0xc734df37, \
0x7e12, \
0x49ec, \
{ 0x89, 0x83, 0xee, 0xa8, 0x8a, 0x18, 0x6b, 0xb8 } \
{ /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */ \
0x133c8bf4, \
0x4913, \
0x4355, \
{ 0xbd, 0x50, 0x42, 0x6b, 0xd1, 0xd6, 0xe1, 0xad } \
}
class nsAccessible : public nsAccessNodeWrap,
@ -280,9 +280,10 @@ public:
// Miscellaneous methods
/**
* Fire accessible event.
* Handle accessible event, i.e. process it, notifies observers and fires
* platform specific event.
*/
virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aAccEvent);
virtual nsresult HandleAccEvent(nsAccEvent *aAccEvent);
/**
* Return true if there are accessible children in anonymous content
@ -446,13 +447,13 @@ protected:
/**
* Fires platform accessible event. It's notification method only. It does
* change nothing on Gecko side. Mostly you should use
* nsIAccessible::FireAccessibleEvent excepting special cases like we have
* in xul:tree accessible to lie to AT. Must be overridden in wrap classes.
* change nothing on Gecko side. Don't use it until you're sure what you do
* (see example in XUL tree accessible), use nsEventShell::FireEvent()
* instead. MUST be overridden in wrap classes.
*
* @param aEvent the accessible event to fire.
*/
virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent) = 0;
virtual nsresult FirePlatformEvent(nsAccEvent *aEvent) = 0;
// Data Members
nsRefPtr<nsAccessible> mParent;

View File

@ -50,7 +50,7 @@ nsEventShell::FireEvent(nsAccEvent *aEvent)
nsAccUtils::QueryObject<nsAccessible>(aEvent->GetAccessible());
NS_ENSURE_TRUE(acc,);
acc->FireAccessibleEvent(aEvent);
acc->HandleAccEvent(aEvent);
}
void

View File

@ -77,7 +77,7 @@ class nsAccessibleWrap : public nsAccessible
virtual nsresult Shutdown ();
virtual void InvalidateChildren();
virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aEvent);
virtual nsresult HandleAccEvent(nsAccEvent *aEvent);
// ignored means that the accessible might still have children, but is not displayed
// to the user. it also has no native accessible object represented for it.
@ -97,7 +97,7 @@ class nsAccessibleWrap : public nsAccessible
protected:
virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent);
virtual nsresult FirePlatformEvent(nsAccEvent *aEvent);
PRBool AncestorIsFlat() {
// we don't create a native object if we're child of a "flat" accessible; for example, on OS X buttons

View File

@ -160,13 +160,11 @@ nsAccessibleWrap::Shutdown ()
}
nsresult
nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
nsAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
NS_ENSURE_ARG_POINTER(aEvent);
nsresult rv = nsAccessible::FireAccessibleEvent(aEvent);
nsresult rv = nsAccessible::HandleAccEvent(aEvent);
NS_ENSURE_SUCCESS(rv, rv);
return FirePlatformEvent(aEvent);
@ -175,13 +173,11 @@ nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
}
nsresult
nsAccessibleWrap::FirePlatformEvent(nsIAccessibleEvent *aEvent)
nsAccessibleWrap::FirePlatformEvent(nsAccEvent *aEvent)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
PRUint32 eventType;
nsresult rv = aEvent->GetEventType(&eventType);
NS_ENSURE_SUCCESS(rv, rv);
PRUint32 eventType = aEvent->GetEventType();
// ignore everything but focus-changed and value-changed events for now.
if (eventType != nsIAccessibleEvent::EVENT_FOCUS &&
@ -189,7 +185,7 @@ nsAccessibleWrap::FirePlatformEvent(nsIAccessibleEvent *aEvent)
return NS_OK;
nsCOMPtr<nsIAccessible> accessible;
rv = aEvent->GetAccessible(getter_AddRefs(accessible));
nsresult rv = aEvent->GetAccessible(getter_AddRefs(accessible));
NS_ENSURE_STATE(accessible);
mozAccessible *nativeAcc = nil;

View File

@ -1656,21 +1656,18 @@ NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
// nsAccessible
nsresult
nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
nsAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent)
{
NS_ENSURE_ARG(aEvent);
nsresult rv = nsAccessible::FireAccessibleEvent(aEvent);
nsresult rv = nsAccessible::HandleAccEvent(aEvent);
NS_ENSURE_SUCCESS(rv, rv);
return FirePlatformEvent(aEvent);
}
nsresult
nsAccessibleWrap::FirePlatformEvent(nsIAccessibleEvent *aEvent)
nsAccessibleWrap::FirePlatformEvent(nsAccEvent *aEvent)
{
PRUint32 eventType = 0;
aEvent->GetEventType(&eventType);
PRUint32 eventType = aEvent->GetEventType();
NS_ENSURE_TRUE(eventType > 0 &&
eventType < nsIAccessibleEvent::EVENT_LAST_ENTRY,

View File

@ -307,7 +307,7 @@ class nsAccessibleWrap : public nsAccessible,
UINT *puArgErr);
// nsAccessible
virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aEvent);
virtual nsresult HandleAccEvent(nsAccEvent *aEvent);
// Helper methods
static PRInt32 GetChildIDFor(nsIAccessible* aAccessible);
@ -342,7 +342,7 @@ class nsAccessibleWrap : public nsAccessible,
void UnattachIEnumVariant();
protected:
virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent);
virtual nsresult FirePlatformEvent(nsAccEvent *aEvent);
// mEnumVARIANTPosition not the current accessible's position, but a "cursor" of
// where we are in the current list of children, with respect to

View File

@ -49,10 +49,9 @@ IMPL_IUNKNOWN_INHERITED2(nsHyperTextAccessibleWrap,
CAccessibleEditableText);
nsresult
nsHyperTextAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
nsHyperTextAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent)
{
PRUint32 eventType;
aEvent->GetEventType(&eventType);
PRUint32 eventType = aEvent->GetEventType();
if (eventType == nsIAccessibleEvent::EVENT_TEXT_REMOVED ||
eventType == nsIAccessibleEvent::EVENT_TEXT_INSERTED) {
@ -74,7 +73,7 @@ nsHyperTextAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
}
}
return nsHyperTextAccessible::FireAccessibleEvent(aEvent);
return nsHyperTextAccessible::HandleAccEvent(aEvent);
}
nsresult

View File

@ -61,7 +61,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsAccessible
virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aEvent);
virtual nsresult HandleAccEvent(nsAccEvent *aEvent);
protected:
virtual nsresult GetModifiedText(PRBool aGetInsertedText, nsAString& aText,

View File

@ -53,7 +53,7 @@ class nsAccessibleWrap : public nsAccessible
virtual ~nsAccessibleWrap();
protected:
virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent) {
virtual nsresult FirePlatformEvent(nsAccEvent *aEvent) {
return NS_OK;
}
};

View File

@ -683,7 +683,7 @@ nsXULTreeAccessible::TreeViewChanged()
// Fire only notification destroy/create events on accessible tree to lie to
// AT because it should be expensive to fire destroy events for each tree item
// in cache.
nsCOMPtr<nsIAccessibleEvent> eventDestroy =
nsRefPtr<nsAccEvent> eventDestroy =
new nsAccEvent(nsIAccessibleEvent::EVENT_HIDE, this, PR_FALSE);
if (!eventDestroy)
return;
@ -694,7 +694,7 @@ nsXULTreeAccessible::TreeViewChanged()
mTree->GetView(getter_AddRefs(mTreeView));
nsCOMPtr<nsIAccessibleEvent> eventCreate =
nsRefPtr<nsAccEvent> eventCreate =
new nsAccEvent(nsIAccessibleEvent::EVENT_SHOW, this, PR_FALSE);
if (!eventCreate)
return;