Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties
nsDocAccessible Class Reference

#include <nsDocAccessible.h>

Inheritance diagram for nsDocAccessible:
Inheritance graph
[legend]
Collaboration diagram for nsDocAccessible:
Collaboration graph
[legend]

List of all members.

Public Types

enum  {
  eAction_Switch = 0, eAction_Jump = 0, eAction_Click = 0, eAction_Select = 0,
  eAction_Expand = 1
}
enum  { eNo_Action = 0, eSingle_Action = 1, eDouble_Action = 2 }
enum  { ROLE_TITLEBAR = 1U }
enum  { ROLE_MENUBAR = 2U }
enum  { ROLE_SCROLLBAR = 3U }
enum  { ROLE_GRIP = 4U }
enum  { ROLE_SOUND = 5U }
enum  { ROLE_CURSOR = 6U }
enum  { ROLE_CARET = 7U }
enum  { ROLE_ALERT = 8U }
enum  { ROLE_WINDOW = 9U }
enum  { ROLE_CLIENT = 10U }
enum  { ROLE_MENUPOPUP = 11U }
enum  { ROLE_MENUITEM = 12U }
enum  { ROLE_RADIO_MENU_ITEM = 12U }
enum  { ROLE_CHECK_MENU_ITEM = 12U }
enum  { ROLE_TOOLTIP = 13U }
enum  { ROLE_APPLICATION = 14U }
enum  { ROLE_DOCUMENT = 15U }
enum  { ROLE_PANE = 16U }
enum  { ROLE_CHART = 17U }
enum  { ROLE_DIALOG = 18U }
enum  { ROLE_BORDER = 19U }
enum  { ROLE_GROUPING = 20U }
enum  { ROLE_SEPARATOR = 21U }
enum  { ROLE_TOOLBAR = 22U }
enum  { ROLE_STATUSBAR = 23U }
enum  { ROLE_TABLE = 24U }
enum  { ROLE_COLUMNHEADER = 25U }
enum  { ROLE_ROWHEADER = 26U }
enum  { ROLE_COLUMN = 27U }
enum  { ROLE_ROW = 28U }
enum  { ROLE_CELL = 29U }
enum  { ROLE_LINK = 30U }
enum  { ROLE_HELPBALLOON = 31U }
enum  { ROLE_CHARACTER = 32U }
enum  { ROLE_LIST = 33U }
enum  { ROLE_LISTITEM = 34U }
enum  { ROLE_OUTLINE = 35U }
enum  { ROLE_TREE_TABLE = 35U }
enum  { ROLE_OUTLINEITEM = 36U }
enum  { ROLE_PAGETAB = 37U }
enum  { ROLE_PROPERTYPAGE = 38U }
enum  { ROLE_INDICATOR = 39U }
enum  { ROLE_GRAPHIC = 40U }
enum  { ROLE_STATICTEXT = 41U }
enum  { ROLE_TEXT = 42U }
enum  { ROLE_PUSHBUTTON = 43U }
enum  { ROLE_CHECKBUTTON = 44U }
enum  { ROLE_RADIOBUTTON = 45U }
enum  { ROLE_COMBOBOX = 46U }
enum  { ROLE_DROPLIST = 47U }
enum  { ROLE_PROGRESSBAR = 48U }
enum  { ROLE_DIAL = 49U }
enum  { ROLE_HOTKEYFIELD = 50U }
enum  { ROLE_SLIDER = 51U }
enum  { ROLE_SPINBUTTON = 52U }
enum  { ROLE_DIAGRAM = 53U }
enum  { ROLE_ANIMATION = 54U }
enum  { ROLE_EQUATION = 55U }
enum  { ROLE_BUTTONDROPDOWN = 56U }
enum  { ROLE_BUTTONMENU = 57U }
enum  { ROLE_BUTTONDROPDOWNGRID = 58U }
enum  { ROLE_WHITESPACE = 59U }
enum  { ROLE_PAGETABLIST = 60U }
enum  { ROLE_CLOCK = 61U }
enum  { ROLE_SPLITBUTTON = 62U }
enum  { ROLE_IPADDRESS = 63U }
enum  { ROLE_NOTHING = 4294967295U }
enum  { ROLE_ICON = ROLE_NOTHING }
enum  { ROLE_PASSWORD_TEXT = ROLE_TEXT }
enum  { ROLE_AUTOCOMPLETE = ROLE_COMBOBOX }
enum  { ROLE_EDITBAR = ROLE_NOTHING }
enum  { ROLE_EMBEDDED = ROLE_NOTHING }
enum  { ROLE_ENTRY = ROLE_NOTHING }
enum  { ROLE_CAPTION = ROLE_NOTHING }
enum  { ROLE_DOCUMENT_FRAME = ROLE_NOTHING }
enum  { ROLE_HEADING = ROLE_NOTHING }
enum  { ROLE_PAGE = ROLE_NOTHING }
enum  { ROLE_SECTION = ROLE_NOTHING }
enum  { ROLE_REDUNDANT_OBJECT = ROLE_NOTHING }
enum  { NAVRELATION_CONTROLLED_BY = 0x1000 }
enum  { NAVRELATION_CONTROLLER_FOR = 0x1001 }
enum  { NAVRELATION_LABEL_FOR = 0x1002 }
enum  { NAVRELATION_LABELLED_BY = 0x1003 }
enum  { NAVRELATION_MEMBER_OF = 0x1004 }
enum  { NAVRELATION_NODE_CHILD_OF = 0x1005 }
enum  { NAVRELATION_FLOWS_TO = 0x1006 }
enum  { NAVRELATION_FLOWS_FROM = 0x1007 }
enum  { NAVRELATION_SUBWINDOW_OF = 0x1008 }
enum  { NAVRELATION_EMBEDS = 0x1009 }
enum  { NAVRELATION_EMBEDDED_BY = 0x100a }
enum  { NAVRELATION_POPUP_FOR = 0x100b }
enum  { NAVRELATION_PARENT_WINDOW_OF = 0x100c }
enum  { NAVRELATION_DEFAULT_BUTTON = 0x100d }
enum  { NAVRELATION_DESCRIBED_BY = 0x100e }
enum  { NAVRELATION_DESCRIPTION_FOR = 0x100f }
enum  { eSelection_Add = 0U, eSelection_Remove = 1U, eSelection_GetState = 2U }

Public Member Functions

 nsDocAccessible (nsIDOMNode *aNode, nsIWeakReference *aShell)
virtual ~nsDocAccessible ()
NS_IMETHOD GetRole (PRUint32 *aRole)
NS_IMETHOD GetName (nsAString &aName)
NS_IMETHOD GetValue (nsAString &aValue)
NS_IMETHOD GetState (PRUint32 *aState)
NS_IMETHOD GetFocusedChild (nsIAccessible **aFocusedChild)
NS_IMETHOD GetParent (nsIAccessible **aParent)
NS_IMETHOD ScrollPositionWillChange (nsIScrollableView *aView, nscoord aX, nscoord aY)
NS_IMETHOD ScrollPositionDidChange (nsIScrollableView *aView, nscoord aX, nscoord aY)
NS_DECL_NSIDOCUMENTOBSERVER
NS_IMETHOD 
FireToolkitEvent (PRUint32 aEvent, nsIAccessible *aAccessible, void *aData)
NS_IMETHOD Shutdown ()
NS_IMETHOD Init ()
 NS_IMETHOD_ (nsIFrame *) GetFrame(void)
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
GetChildAtPoint (PRInt32 x, PRInt32 y, nsIAccessible **_retval)
NS_IMETHOD GetNativeInterface (void **aOutAccessible)
NS_IMETHOD GetNativeInterface (void **aOutAccessible)
NS_IMETHOD GetExtState (PRUint32 *aState)
AtkObject * GetAtkObject (void)
MaiInterfaceGetMaiInterface (PRInt16 aIfaceType)
PRBool IsValidObject ()
 STDMETHODIMP_ (ULONG) AddRef()
 STDMETHODIMP_ (ULONG) Release()
STDMETHODIMP QueryInterface (REFIID, void **)
NS_IMETHOD QueryInterface (REFNSIID aIID, void **aInstancePtr)
virtual long QueryInterface ()=0
STDMETHODIMP QueryService (REFGUID guidService, REFIID riid, void **ppv)
CLSID GetClassID () const
virtual HRESULT STDMETHODCALLTYPE get_accParent (IDispatch __RPC_FAR *__RPC_FAR *ppdispParent)
virtual HRESULT STDMETHODCALLTYPE get_accChildCount (long __RPC_FAR *pcountChildren)
virtual HRESULT STDMETHODCALLTYPE get_accChild (VARIANT varChild, IDispatch __RPC_FAR *__RPC_FAR *ppdispChild)
virtual HRESULT STDMETHODCALLTYPE get_accName (VARIANT varChild, BSTR __RPC_FAR *pszName)
virtual HRESULT STDMETHODCALLTYPE get_accValue (VARIANT varChild, BSTR __RPC_FAR *pszValue)
virtual HRESULT STDMETHODCALLTYPE get_accDescription (VARIANT varChild, BSTR __RPC_FAR *pszDescription)
virtual HRESULT STDMETHODCALLTYPE get_accRole (VARIANT varChild, VARIANT __RPC_FAR *pvarRole)
virtual HRESULT STDMETHODCALLTYPE get_accState (VARIANT varChild, VARIANT __RPC_FAR *pvarState)
virtual HRESULT STDMETHODCALLTYPE get_accHelp (VARIANT varChild, BSTR __RPC_FAR *pszHelp)
virtual HRESULT STDMETHODCALLTYPE get_accHelpTopic (BSTR __RPC_FAR *pszHelpFile, VARIANT varChild, long __RPC_FAR *pidTopic)
virtual HRESULT STDMETHODCALLTYPE get_accKeyboardShortcut (VARIANT varChild, BSTR __RPC_FAR *pszKeyboardShortcut)
virtual HRESULT STDMETHODCALLTYPE get_accFocus (VARIANT __RPC_FAR *pvarChild)
virtual HRESULT STDMETHODCALLTYPE get_accSelection (VARIANT __RPC_FAR *pvarChildren)
 This method is called when a client wants to know which children of a node are selected.
virtual HRESULT STDMETHODCALLTYPE get_accDefaultAction (VARIANT varChild, BSTR __RPC_FAR *pszDefaultAction)
virtual HRESULT STDMETHODCALLTYPE accSelect (long flagsSelect, VARIANT varChild)
virtual HRESULT STDMETHODCALLTYPE accLocation (long __RPC_FAR *pxLeft, long __RPC_FAR *pyTop, long __RPC_FAR *pcxWidth, long __RPC_FAR *pcyHeight, VARIANT varChild)
virtual HRESULT STDMETHODCALLTYPE accNavigate (long navDir, VARIANT varStart, VARIANT __RPC_FAR *pvarEndUpAt)
virtual HRESULT STDMETHODCALLTYPE accHitTest (long xLeft, long yTop, VARIANT __RPC_FAR *pvarChild)
virtual HRESULT STDMETHODCALLTYPE accDoDefaultAction (VARIANT varChild)
virtual HRESULT STDMETHODCALLTYPE put_accName (VARIANT varChild, BSTR szName)
virtual HRESULT STDMETHODCALLTYPE put_accValue (VARIANT varChild, BSTR szValue)
virtual HRESULT STDMETHODCALLTYPE Next (ULONG celt, VARIANT __RPC_FAR *rgVar, ULONG __RPC_FAR *pCeltFetched)
virtual HRESULT STDMETHODCALLTYPE Skip (ULONG celt)
virtual HRESULT STDMETHODCALLTYPE Reset (void)
virtual HRESULT STDMETHODCALLTYPE Clone (IEnumVARIANT __RPC_FAR *__RPC_FAR *ppEnum)
STDMETHODIMP GetTypeInfoCount (UINT *p)
STDMETHODIMP GetTypeInfo (UINT i, LCID lcid, ITypeInfo **ppti)
STDMETHODIMP GetIDsOfNames (REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
STDMETHODIMP Invoke (DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
virtual void GetXPAccessibleFor (const VARIANT &aVarChild, nsIAccessible **aXPAccessible)
NS_IMETHOD GetDescription (nsAString &aDescription)
virtual HRESULT STDMETHODCALLTYPE get_nodeInfo (BSTR __RPC_FAR *tagName, short __RPC_FAR *nameSpaceID, BSTR __RPC_FAR *nodeValue, unsigned int __RPC_FAR *numChildren, unsigned int __RPC_FAR *aUniqueID, unsigned short __RPC_FAR *nodeType)
virtual HRESULT STDMETHODCALLTYPE get_attributes (unsigned short maxAttribs, BSTR __RPC_FAR *attribNames, short __RPC_FAR *nameSpaceID, BSTR __RPC_FAR *attribValues, unsigned short __RPC_FAR *numAttribs)
virtual HRESULT STDMETHODCALLTYPE get_attributesForNames (unsigned short maxAttribs, BSTR __RPC_FAR *attribNames, short __RPC_FAR *nameSpaceID, BSTR __RPC_FAR *attribValues)
virtual HRESULT STDMETHODCALLTYPE get_computedStyle (unsigned short maxStyleProperties, boolean useAlternateView, BSTR __RPC_FAR *styleProperties, BSTR __RPC_FAR *styleValues, unsigned short __RPC_FAR *numStyleProperties)
virtual HRESULT STDMETHODCALLTYPE get_computedStyleForProperties (unsigned short numStyleProperties, boolean useAlternateView, BSTR __RPC_FAR *styleProperties, BSTR __RPC_FAR *styleValues)
virtual HRESULT STDMETHODCALLTYPE scrollTo (boolean scrollTopLeft)
virtual HRESULT STDMETHODCALLTYPE get_parentNode (ISimpleDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE get_firstChild (ISimpleDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE get_lastChild (ISimpleDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE get_previousSibling (ISimpleDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE get_nextSibling (ISimpleDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE get_childAt (unsigned childIndex, ISimpleDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE get_innerHTML (BSTR __RPC_FAR *innerHTML)
virtual HRESULT STDMETHODCALLTYPE get_localInterface (void __RPC_FAR *__RPC_FAR *localInterface)
virtual HRESULT STDMETHODCALLTYPE get_language (BSTR __RPC_FAR *language)
 NS_IMETHOD_ (nsrefcnt) AddRef(void)
nsIAccessNode getChildNodeAt (in long childNum)
 Get the nth child of this node.
DOMString getComputedStyleValue (in DOMString pseudoElt, in DOMString propertyName)
 Retrieve the computed style value for this DOM node, if it is a DOM element.
void init ()
void shutdown ()
nsIFrame GetFrame ()
virtual long AddRef ()=0
virtual long Release ()=0
nsIAccessible getChildAtPoint (in long x, in long y)
 Accessible child which contains the coordinate at x,y.
nsIAccessible getChildAt (in long aChildIndex)
 Nth accessible child using zero-based index or last child if index less than zero.
nsIAccessible getAccessibleToRight ()
 Accessible node geometrically to the right of this one.
nsIAccessible getAccessibleToLeft ()
 Accessible node geometrically to the left of this one.
nsIAccessible getAccessibleAbove ()
 Accessible node geometrically above this one.
nsIAccessible getAccessibleBelow ()
 Accessible node geometrically below this one.
nsIAccessible getAccessibleRelated (in unsigned long aRelationType)
 Accessible node related to this one.
void getBounds (out long x, out long y, out long width, out long height)
void addSelection ()
 Add this accessible to the current selection.
void removeSelection ()
 Remove this accessible from the current selection.
void extendSelection ()
 Extend the current selection from its current accessible anchor node to this accessible.
void takeSelection ()
 Select this accessible node only.
void takeFocus ()
 Focus this accessible node, The state STATE_FOCUSABLE indicates whether this node is normally focusable.
AString getActionName (in PRUint8 index)
 The name of the accessible action at the given zero-based index.
void doAction (in PRUint8 index)
 Perform the accessible action at the given zero-based index Action number 0 is the default action.
void getNativeInterface (out voidPtr aOutAccessible)
 Get a pointer to accessibility interface for this node, which is specific to the OS/accessibility toolkit we're running on.
void setParent (in nsIAccessible aAccParent)
void setFirstChild (in nsIAccessible aAccFirstChild)
void setNextSibling (in nsIAccessible aAccNextSibling)
void invalidateChildren ()
 Set the child count to -1 (unknown) and null out cached child pointers.
void fireToolkitEvent (in unsigned long aEvent, in nsIAccessible aTarget, in voidPtr aData)
nsIArray GetSelectedChildren ()
 Return an nsIArray of selected nsIAccessible children.
void addChildToSelection (in long index)
 Adds the specified accessible child of the object to the object's selection.
void removeChildFromSelection (in long index)
 Removes the specified child of the object from the object's selection.
void clearSelection ()
 Clears the selection in the object so that no children in the object are selected.
nsIAccessible refSelection (in long index)
 Returns a reference to the accessible object representing the specified selected child of the object.
boolean isChildSelected (in long index)
 Determines if the current child of this object is selected.
boolean selectAllSelection ()
 Select all children.
AString getNameSpaceURIForID (in short nameSpaceID)
 The namespace for each ID that is handed back.
nsIAccessNode getCachedAccessNode (in voidPtr aUniqueID)
 Returns the access node cached by this document.
nsIAccessible getAccessibleInParentChain (in nsIDOMNode aDOMNode)
 Returns the first accessible parent of a DOM node.
void invalidateCacheSubtree (in nsIContent aChangeContent, in PRUint32 aChangeEvent)
 Find the accessible object in the accessibility cache that corresponds to aStartNode or the first ancestor of aStartNode that has an accessible object associated with it.
void cacheAccessNode (in voidPtr aUniqueID, in nsIAccessNode aAccessNode)
void destroy ()
void flushPendingEvents ()
void fireDocLoadingEvent (in boolean isFinished)
void fireAnchorJumpEvent ()
virtual void BeginUpdate (nsIDocument *aDocument, nsUpdateType aUpdateType)=0
 Notify that a content model update is beginning.
virtual void EndUpdate (nsIDocument *aDocument, nsUpdateType aUpdateType)=0
 Notify that a content model update is finished.
virtual void BeginLoad (nsIDocument *aDocument)=0
 Notify the observer that a document load is beginning.
virtual void EndLoad (nsIDocument *aDocument)=0
 Notify the observer that a document load has finished.
virtual void BeginReflow (nsIDocument *aDocument, nsIPresShell *aShell)=0
 Notify the observer that the document is being reflowed in the given presentation shell.
virtual void EndReflow (nsIDocument *aDocument, nsIPresShell *aShell)=0
 Notify the observer that the document is done being reflowed in the given presentation shell.
virtual void CharacterDataChanged (nsIDocument *aDocument, nsIContent *aContent, PRBool aAppend)=0
 Notification that the content model has changed.
virtual void ContentStatesChanged (nsIDocument *aDocument, nsIContent *aContent1, nsIContent *aContent2, PRInt32 aStateMask)=0
 Notification that the state of a content node has changed.
virtual void AttributeChanged (nsIDocument *aDocument, nsIContent *aContent, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType)=0
 Notification that the content model has changed.
virtual void ContentAppended (nsIDocument *aDocument, nsIContent *aContainer, PRInt32 aNewIndexInContainer)=0
 Notifcation that the content model has had data appended to the given content object.
virtual void ContentInserted (nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)=0
 Notification that content has been inserted.
virtual void ContentRemoved (nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)=0
 Content has just been removed.
virtual void StyleSheetAdded (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)=0
 A StyleSheet has just been added to the document.
virtual void StyleSheetRemoved (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)=0
 A StyleSheet has just been removed from the document.
virtual void StyleSheetApplicableStateChanged (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aApplicable)=0
 A StyleSheet has just changed its applicable state.
virtual void StyleRuleChanged (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleRule *aNewStyleRule)=0
 A StyleRule has just been modified within a style sheet.
virtual void StyleRuleAdded (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)=0
 A StyleRule has just been added to a style sheet.
virtual void StyleRuleRemoved (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)=0
 A StyleRule has just been removed from a style sheet.
virtual void DocumentWillBeDestroyed (nsIDocument *aDocument)=0
 The document is in the process of being destroyed.
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.

Static Public Member Functions

static void FlushEventsCallback (nsITimer *aTimer, void *aClosure)
static void TranslateStates (PRUint32 aState, PRUint32 aExtState, void *aAtkStateSet)
static STDMETHODIMP AccessibleObjectFromWindow (HWND hwnd, DWORD dwObjectID, REFIID riid, void **ppvObject)
static STDMETHODIMP NotifyWinEvent (DWORD event, HWND hwnd, LONG idObjectType, LONG idObject)
static PRBool IsCorrectFrameType (nsIFrame *aFrame, nsIAtom *aAtom)
 Static Helper method to help sub classes make sure they have the proper frame when walking the frame tree to get at children and such.
static void InitAccessibility ()
static void InitAccessibility ()
static void InitAccessibility ()
static void InitAccessibility ()
static void ShutdownAccessibility ()
static void ShutdownAccessibility ()
static void ShutdownAccessibility ()
static void ShutdownAccessibility ()
NS_DECL_NSIACCESSNODE static
NS_DECL_NSPIACCESSNODE void 
InitXPAccessibility ()
static void ShutdownXPAccessibility ()
static void PutCacheEntry (nsInterfaceHashtable< nsVoidHashKey, nsIAccessNode > &aCache, void *aUniqueID, nsIAccessNode *aAccessNode)
static void GetCacheEntry (nsInterfaceHashtable< nsVoidHashKey, nsIAccessNode > &aCache, void *aUniqueID, nsIAccessNode **aAccessNode)
static void ClearCache (nsInterfaceHashtable< nsVoidHashKey, nsIAccessNode > &aCache)
static PLDHashOperator PR_CALLBACK ClearCacheEntry (const void *aKey, nsCOMPtr< nsIAccessNode > &aAccessNode, void *aUserArg)
static already_AddRefed
< nsIAccessibleDocument
GetDocAccessibleFor (nsIWeakReference *aPresShell)
static already_AddRefed
< nsIAccessibleDocument
GetDocAccessibleFor (nsISupports *aContainer)
static already_AddRefed
< nsIAccessibleDocument
GetDocAccessibleFor (nsIDOMNode *aNode)
static already_AddRefed
< nsIDocShellTreeItem
GetDocShellTreeItemFor (nsIDOMNode *aStartNode)
static already_AddRefed
< nsIPresShell
GetPresShellFor (nsIDOMNode *aStartNode)
static PRBool HasRoleAttribute (nsIContent *aContent)
static PRBool GetRoleAttribute (nsIContent *aContent, nsAString &aRole)

Public Attributes

readonly attribute nsIDOMNode DOMNode
 The DOM node this nsIAccessNode is associated with.
readonly attribute long numChildren
 The number of DOM children for the DOM node, which matches the number of nsIAccessNode children for this nsIAccessNode.
readonly attribute nsIAccessNode parentNode
 The parent nsIAccessNode.
readonly attribute nsIAccessNode firstChildNode
 The first nsIAccessNode child.
readonly attribute nsIAccessNode lastChildNode
 The last nsIAccessNode child.
readonly attribute nsIAccessNode previousSiblingNode
 The previous nsIAccessNode sibling.
readonly attribute nsIAccessNode nextSiblingNode
 The next nsIAccessNode sibling.
readonly attribute
nsIAccessibleDocument 
accessibleDocument
 The nsIAccessibleDocument that this nsIAccessNode resides in.
readonly attribute DOMString innerHTML
 The innerHTML for the DOM node This is a text string of all the markup inside the DOM node, not including the start and end tag for the node.
readonly attribute voidPtr ownerWindow
 The OS window handle for the window this node is being displayed in.
readonly attribute voidPtr uniqueID
 A unique ID calculated for this DOM node, for the purposes of caching and referencing this object.
const unsigned short NODETYPE_ELEMENT = 1
const unsigned short NODETYPE_ATTRIBUTE = 2
const unsigned short NODETYPE_TEXT = 3
const unsigned short NODETYPE_CDATA_SECTION = 4
const unsigned short NODETYPE_ENTITY_REFERENCE = 5
const unsigned short NODETYPE_ENTITY = 6
const unsigned short NODETYPE_PROCESSING_INSTRUCTION = 7
const unsigned short NODETYPE_COMMENT = 8
const unsigned short NODETYPE_DOCUMENT = 9
const unsigned short NODETYPE_DOCUMENT_TYPE = 10
const unsigned short NODETYPE_DOCUMENT_FRAGMENT = 11
const unsigned short NODETYPE_NOTATION = 12
readonly attribute nsIAccessible firstChild
 First child in accessible tree.
readonly attribute nsIAccessible lastChild
 Last child in accessible tree.
readonly attribute nsIAccessible previousSibling
 Previous sibling in accessible tree.
readonly attribute nsIAccessible nextSibling
 Next sibling in accessible tree.
readonly attribute nsIAccessible parent
 Parent node in accessible tree.
readonly attribute long childCount
 Number of accessible children.
readonly attribute long indexInParent
 The 0-based index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent.
attribute AString name
 Accessible name -- the main text equivalent for this node.
readonly attribute AString finalValue
 Accessible value -- a number or a secondary text equivalent for this node Widgets that use a role attribute can force a value using the valuenow attribute.
readonly attribute AString description
 Accessible description -- long text associated with this node.
readonly attribute AString keyboardShortcut
 Provides localized string of accesskey name, such as Alt+D.
readonly attribute AString keyBinding
 Provides localized string of global keyboard accelerator, such as Ctrl+O for Open file.
readonly attribute unsigned long role
 Natural enumerated accessible role for the associated element.
readonly attribute unsigned long finalRole
 Enumerated accessible role.
readonly attribute unsigned long finalState
 Accessible states -- bit field which describes boolean properties of node.
readonly attribute unsigned long extState
 Extended accessible states -- second bit field describing node.
readonly attribute AString help
 Help text associated with node.
readonly attribute nsIAccessible focusedChild
 Focused accessible child of node.
readonly attribute PRUint8 numActions
 The number of accessible actions associated with this accessible.
const unsigned long STATE_UNAVAILABLE = 0x00000001
 MSAA State flags - used for bitfield.
const unsigned long STATE_SELECTED = 0x00000002
const unsigned long STATE_FOCUSED = 0x00000004
const unsigned long STATE_PRESSED = 0x00000008
const unsigned long STATE_CHECKED = 0x00000010
const unsigned long STATE_MIXED = 0x00000020
const unsigned long STATE_READONLY = 0x00000040
const unsigned long STATE_HOTTRACKED = 0x00000080
const unsigned long STATE_DEFAULT = 0x00000100
const unsigned long STATE_EXPANDED = 0x00000200
const unsigned long STATE_COLLAPSED = 0x00000400
const unsigned long STATE_BUSY = 0x00000800
const unsigned long STATE_FLOATING = 0x00001000
const unsigned long STATE_MARQUEED = 0x00002000
const unsigned long STATE_ANIMATED = 0x00004000
const unsigned long STATE_INVISIBLE = 0x00008000
const unsigned long STATE_OFFSCREEN = 0x00010000
const unsigned long STATE_SIZEABLE = 0x00020000
const unsigned long STATE_MOVEABLE = 0x00040000
const unsigned long STATE_SELFVOICING = 0x00080000
const unsigned long STATE_FOCUSABLE = 0x00100000
const unsigned long STATE_SELECTABLE = 0x00200000
const unsigned long STATE_LINKED = 0x00400000
const unsigned long STATE_TRAVERSED = 0x00800000
const unsigned long STATE_MULTISELECTABLE = 0x01000000
const unsigned long STATE_EXTSELECTABLE = 0x02000000
const unsigned long STATE_ALERT_LOW = 0x04000000
const unsigned long STATE_ALERT_MEDIUM = 0x08000000
const unsigned long STATE_ALERT_HIGH = 0x10000000
const unsigned long STATE_PROTECTED = 0x20000000
const unsigned long STATE_HASPOPUP = 0x40000000
const unsigned long STATE_REQUIRED = STATE_ALERT_LOW
const unsigned long STATE_IMPORTANT = STATE_ALERT_MEDIUM
const unsigned long STATE_INVALID = STATE_ALERT_HIGH
const unsigned long STATE_CHECKABLE = STATE_MARQUEED
const unsigned long EXT_STATE_EDITABLE = 0x00200000
 Extended state flags (for now non-MSAA, for Java and Gnome/ATK support) "Extended state flags" has seperate value space from "MSAA State flags".
const unsigned long EXT_STATE_ACTIVE = 0x00400000
const unsigned long EXT_STATE_EXPANDABLE = 0x00800000
const unsigned long EXT_STATE_MODAL = 0x01000000
const unsigned long EXT_STATE_MULTI_LINE = 0x02000000
const unsigned long EXT_STATE_SENSITIVE = 0x04000000
const unsigned long EXT_STATE_SHOWING = 0x10000000
const unsigned long EXT_STATE_SINGLE_LINE = 0x20000000
const unsigned long EXT_STATE_TRANSIENT = 0x40000000
const unsigned long EXT_STATE_VERTICAL = 0x80000000
const unsigned long RELATION_NUL = 0x00
 Relation Types -- most of these come from ATK's atkrelationtype.h RELATION_NULL: RELATION_CONTROLLED_BY: Controlled by one or more target objects.
const unsigned long RELATION_CONTROLLED_BY = 0x01
const unsigned long RELATION_CONTROLLER_FOR = 0x02
const unsigned long RELATION_LABEL_FOR = 0x03
const unsigned long RELATION_LABELLED_BY = 0x04
const unsigned long RELATION_MEMBER_OF = 0x05
const unsigned long RELATION_NODE_CHILD_OF = 0x06
const unsigned long RELATION_FLOWS_TO = 0x07
const unsigned long RELATION_FLOWS_FROM = 0x08
const unsigned long RELATION_SUBWINDOW_OF = 0x09
const unsigned long RELATION_EMBEDS = 0x0a
const unsigned long RELATION_EMBEDDED_BY = 0x0b
const unsigned long RELATION_POPUP_FOR = 0x0c
const unsigned long RELATION_PARENT_WINDOW_OF = 0x0d
const unsigned long RELATION_DEFAULT_BUTTON = 0x4000
const unsigned long RELATION_DESCRIBED_BY = 0x4001
const unsigned long RELATION_DESCRIPTION_FOR = 0x4002
readonly attribute long selectionCount
 Returns the number of accessible children currently selected.
readonly attribute AString URL
 The URL of the document.
readonly attribute AString title
 The title of the document, as specified in the document.
readonly attribute AString mimeType
 The mime type of the document.
readonly attribute AString docType
 The doc type of the document, as specified in the document.
readonly attribute boolean isEditable
 True if the document is live in an editor.
readonly attribute nsIDOMDocument document
 The nsIDOMDocument interface associated with this document.
readonly attribute nsIDOMWindow window
 The nsIDOMWindow that the document resides in.
readonly attribute nsIAccessible caretAccessible
readonly attribute voidPtr windowHandle
 The window handle for the OS window the document is being displayed in.

Static Public Attributes

static HINSTANCE gmAccLib = nsnull
 the accessible library and cached methods
static HINSTANCE gmUserLib = nsnull
static
LPFNACCESSIBLEOBJECTFROMWINDOW 
gmAccessibleObjectFromWindow = nsnull
static LPFNNOTIFYWINEVENT gmNotifyWinEvent = nsnull
static LPFNGETGUITHREADINFO gmGetGUIThreadInfo = nsnull
static nsIDOMNodegLastFocusedNode = 0

Protected Member Functions

virtual void GetBoundsRect (nsRect &aRect, nsIFrame **aRelativeFrame)
virtual nsresult AddEventListeners ()
virtual nsresult RemoveEventListeners ()
void AddScrollListener ()
void RemoveScrollListener ()
void RefreshNodes (nsIDOMNode *aStartNode, PRUint32 aChangeEvent)
virtual void CheckForEditor ()
nsresult FireDelayedToolkitEvent (PRUint32 aEvent, nsIDOMNode *aDOMNode, void *aData, PRBool aAllowDupes=PR_FALSE)
IDispatchNativeAccessible (nsIAccessible *aXPAccessible)
PRBool MappedAttrState (nsIContent *aContent, PRUint32 *aStateInOut, nsStateMapEntry *aStateMapEntry)
virtual nsIFrameGetBoundsFrame ()
PRBool IsPartiallyVisible (PRBool *aIsOffscreen)
nsresult GetTextFromRelationID (nsIAtom *aIDAttrib, nsString &aName)
nsresult GetHTMLName (nsAString &_retval, PRBool aCanAggregateSubtree=PR_TRUE)
 Only called if the element is not a nsIDOMXULControlElement.
nsresult GetXULName (nsAString &aName, PRBool aCanAggregateSubtree=PR_TRUE)
 3 main cases for XUL Controls to be labeled 1 - control contains label="foo" 2 - control has, as a child, a label element
nsresult AppendFlatStringFromSubtree (nsIContent *aContent, nsAString *aFlatString)
nsresult AppendNameFromAccessibleFor (nsIContent *aContent, nsAString *aFlatString, PRBool aFromValue=PR_FALSE)
nsresult AppendFlatStringFromContentNode (nsIContent *aContent, nsAString *aFlatString)
nsresult AppendStringWithSpaces (nsAString *aFlatString, const nsAString &textEquivalent)
void GetScreenOrigin (nsPresContext *aPresContext, nsIFrame *aFrame, nsRect *aRect)
nsresult AppendFlatStringFromSubtreeRecurse (nsIContent *aContent, nsAString *aFlatString)
virtual void CacheChildren (PRBool aWalkAnonContent)
already_AddRefed< nsIAccessibleGetNextWithState (nsIAccessible *aStart, PRUint32 matchState)
nsresult SetNonTextSelection (PRBool aSelect)
nsresult DoCommand (nsIContent *aContent=nsnull)
already_AddRefed< nsIDOMNodeGetInverseRelatedNode (nsIAtom *aRelationAttr, PRUint32 aAncestorLevelsToSearch=0)
void GetAccessibleFor (nsIDOMNode *node, nsIAccessible **newAcc)
ISimpleDOMNodeMakeAccessNode (nsIDOMNode *node)
nsresult MakeAccessNode (nsIDOMNode *aNode, nsIAccessNode **aAccessNode)
NS_IMETHOD GetComputedStyleDeclaration (nsIDOMCSSStyleDeclaration **aCssDecl, PRUint32 *aLength)
already_AddRefed< nsIPresShellGetPresShell ()
nsPresContextGetPresContext ()
already_AddRefed
< nsIAccessibleDocument
GetDocAccessible ()

Static Protected Member Functions

static void ScrollTimerCallback (nsITimer *aTimer, void *aClosure)
static nsIContentGetContentPointingTo (const nsAString *aId, nsIContent *aLookContent, nsIAtom *forAttrib, PRUint32 aForAttribNamespace=kNameSpaceID_None, nsIAtom *aTagType=nsAccessibilityAtoms::label)
static nsIContentGetXULLabelContent (nsIContent *aForNode, nsIAtom *aLabelType=nsAccessibilityAtoms::label)
static nsIContentGetHTMLLabelContent (nsIContent *aForNode)
static nsIContentGetLabelContent (nsIContent *aForNode)
static nsIContentGetRoleContent (nsIDOMNode *aDOMNode)
static nsresult GetFullKeyName (const nsAString &aModifierName, const nsAString &aKeyName, nsAString &aStringOut)
static nsresult GetTranslatedString (const nsAString &aKey, nsAString &aStringOut)
static already_AddRefed
< nsIAccessible
GetMultiSelectFor (nsIDOMNode *aNode)
static void DoCommandCallback (nsITimer *aTimer, void *aClosure)

Protected Attributes

nsInterfaceHashtable
< nsVoidHashKey, nsIAccessNode
mAccessNodeCache
voidmWnd
nsCOMPtr< nsIDocumentmDocument
nsCOMPtr< nsITimermScrollWatchTimer
nsCOMPtr< nsITimermFireEventTimer
nsCOMPtr< nsIEditormEditor
PRUint16 mScrollPositionChangedTicks
PRPackedBool mIsContentLoaded
nsCOMArray< nsIAccessibleEventmEventsToFire
AtkObject * mMaiAtkObject
PRUint16 mEnumVARIANTPosition
nsCOMPtr< nsIAccessiblemParent
nsIAccessiblemFirstChild
nsIAccessiblemNextSibling
nsRoleMapEntrymRoleMapEntry
PRUint32 mAccChildCount
nsCOMPtr< nsIDOMNodemDOMNode
nsCOMPtr< nsIWeakReferencemWeakShell
PRInt32 mRefCnt

Static Protected Attributes

static nsRoleMapEntry gWAIRoleMap []
static nsStateMapEntry gUnivStateMap []
static PRBool gIsEnumVariantSupportDisabled = 0
static NS_DECL_OWNINGTHREAD
nsIStringBundle
gStringBundle = 0
static nsIStringBundlegKeyStringBundle = 0
static nsITimergDoCommandTimer = 0
static PRBool gIsAccessibilityActive = PR_FALSE
static PRBool gIsCacheDisabled = PR_FALSE
static nsInterfaceHashtable
< nsVoidHashKey, nsIAccessNode
gGlobalDocAccessibleCache

Properties

ISimpleDOMNode parentNode [get]
BSTR innerHTML [get]
short nodeInfo ([out] BSTR nodeName,[out] short nameSpaceID,[out] BSTR nodeValue,[out] int numChildren,[out] int uniqueID) [get]
short attributes ([in] short maxAttribs,[out, size_is(maxAttribs), length_is(*numAttribs)] BSTR attribNames,[out, size_is(maxAttribs), length_is(*numAttribs)] short nameSpaceID,[out, size_is(maxAttribs), length_is(*numAttribs)] BSTR attribValues) [get]
BSTR attributesForNames ([in] short numAttribs,[in, size_is(numAttribs), length_is(numAttribs)] BSTR attribNames,[in, size_is(numAttribs), length_is(numAttribs)] short nameSpaceID) [get]
short computedStyle ([in] short maxStyleProperties,[in] boolean useAlternateView,[out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR styleProperties,[out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR styleValues) [get]
BSTR computedStyleForProperties ([in] short numStyleProperties,[in] boolean useAlternateView,[in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR styleProperties) [get]
ISimpleDOMNode firstChild [get]
ISimpleDOMNode lastChild [get]
ISimpleDOMNode previousSibling [get]
ISimpleDOMNode nextSibling [get]
ISimpleDOMNode childAt ([in] unsigned childIndex) [get]
void localInterface [get]
BSTR language [get]

Detailed Description

Definition at line 59 of file nsDocAccessible.h.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
ROLE_TITLEBAR 

Definition at line 539 of file nsIAccessible.idl.

{ ROLE_TITLEBAR = 1U };
anonymous enum [inherited]
Enumerator:
ROLE_MENUBAR 

Definition at line 540 of file nsIAccessible.idl.

{ ROLE_MENUBAR = 2U };
anonymous enum [inherited]
Enumerator:
ROLE_MENUPOPUP 

Definition at line 549 of file nsIAccessible.idl.

{ ROLE_MENUPOPUP = 11U };
anonymous enum [inherited]
Enumerator:
ROLE_MENUITEM 

Definition at line 550 of file nsIAccessible.idl.

{ ROLE_MENUITEM = 12U };
anonymous enum [inherited]
Enumerator:
ROLE_RADIO_MENU_ITEM 

Definition at line 551 of file nsIAccessible.idl.

{ ROLE_RADIO_MENU_ITEM = 12U }; // Same as ROLE_MENUITEM
anonymous enum [inherited]
Enumerator:
ROLE_CHECK_MENU_ITEM 

Definition at line 552 of file nsIAccessible.idl.

{ ROLE_CHECK_MENU_ITEM = 12U }; // Same as ROLE_MENUITEM
anonymous enum [inherited]
Enumerator:
ROLE_TOOLTIP 

Definition at line 553 of file nsIAccessible.idl.

{ ROLE_TOOLTIP = 13U };
anonymous enum [inherited]
Enumerator:
ROLE_APPLICATION 

Definition at line 554 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_DOCUMENT 

Definition at line 555 of file nsIAccessible.idl.

{ ROLE_DOCUMENT = 15U };
anonymous enum [inherited]
Enumerator:
ROLE_PANE 

Definition at line 556 of file nsIAccessible.idl.

{ ROLE_PANE = 16U };
anonymous enum [inherited]
Enumerator:
ROLE_CHART 

Definition at line 557 of file nsIAccessible.idl.

{ ROLE_CHART = 17U };
anonymous enum [inherited]
Enumerator:
ROLE_DIALOG 

Definition at line 558 of file nsIAccessible.idl.

{ ROLE_DIALOG = 18U };
anonymous enum [inherited]
Enumerator:
ROLE_SCROLLBAR 

Definition at line 541 of file nsIAccessible.idl.

{ ROLE_SCROLLBAR = 3U };
anonymous enum [inherited]
Enumerator:
ROLE_BORDER 

Definition at line 559 of file nsIAccessible.idl.

{ ROLE_BORDER = 19U };
anonymous enum [inherited]
Enumerator:
ROLE_GROUPING 

Definition at line 560 of file nsIAccessible.idl.

{ ROLE_GROUPING = 20U };
anonymous enum [inherited]
Enumerator:
ROLE_SEPARATOR 

Definition at line 561 of file nsIAccessible.idl.

{ ROLE_SEPARATOR = 21U };
anonymous enum [inherited]
Enumerator:
ROLE_TOOLBAR 

Definition at line 562 of file nsIAccessible.idl.

{ ROLE_TOOLBAR = 22U };
anonymous enum [inherited]
Enumerator:
ROLE_STATUSBAR 

Definition at line 563 of file nsIAccessible.idl.

{ ROLE_STATUSBAR = 23U };
anonymous enum [inherited]
Enumerator:
ROLE_TABLE 

Definition at line 564 of file nsIAccessible.idl.

{ ROLE_TABLE = 24U };
anonymous enum [inherited]
Enumerator:
ROLE_COLUMNHEADER 

Definition at line 565 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_ROWHEADER 

Definition at line 566 of file nsIAccessible.idl.

{ ROLE_ROWHEADER = 26U };
anonymous enum [inherited]
Enumerator:
ROLE_COLUMN 

Definition at line 567 of file nsIAccessible.idl.

{ ROLE_COLUMN = 27U };
anonymous enum [inherited]
Enumerator:
ROLE_ROW 

Definition at line 568 of file nsIAccessible.idl.

{ ROLE_ROW = 28U };
anonymous enum [inherited]
Enumerator:
ROLE_GRIP 

Definition at line 542 of file nsIAccessible.idl.

{ ROLE_GRIP = 4U };
anonymous enum [inherited]
Enumerator:
ROLE_CELL 

Definition at line 569 of file nsIAccessible.idl.

{ ROLE_CELL = 29U };
anonymous enum [inherited]
Enumerator:
ROLE_LINK 

Definition at line 570 of file nsIAccessible.idl.

{ ROLE_LINK = 30U };
anonymous enum [inherited]
Enumerator:
ROLE_HELPBALLOON 

Definition at line 571 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_CHARACTER 

Definition at line 572 of file nsIAccessible.idl.

{ ROLE_CHARACTER = 32U };
anonymous enum [inherited]
Enumerator:
ROLE_LIST 

Definition at line 573 of file nsIAccessible.idl.

{ ROLE_LIST = 33U };
anonymous enum [inherited]
Enumerator:
ROLE_LISTITEM 

Definition at line 574 of file nsIAccessible.idl.

{ ROLE_LISTITEM = 34U };
anonymous enum [inherited]
Enumerator:
ROLE_OUTLINE 

Definition at line 575 of file nsIAccessible.idl.

{ ROLE_OUTLINE = 35U };
anonymous enum [inherited]
Enumerator:
ROLE_TREE_TABLE 

Definition at line 576 of file nsIAccessible.idl.

{ ROLE_TREE_TABLE = 35U }; // Same as ROLE_OUTLINE
anonymous enum [inherited]
Enumerator:
ROLE_OUTLINEITEM 

Definition at line 577 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_PAGETAB 

Definition at line 578 of file nsIAccessible.idl.

{ ROLE_PAGETAB = 37U };
anonymous enum [inherited]
Enumerator:
ROLE_SOUND 

Definition at line 543 of file nsIAccessible.idl.

{ ROLE_SOUND = 5U };
anonymous enum [inherited]
Enumerator:
ROLE_PROPERTYPAGE 

Definition at line 579 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_INDICATOR 

Definition at line 580 of file nsIAccessible.idl.

{ ROLE_INDICATOR = 39U };
anonymous enum [inherited]
Enumerator:
ROLE_GRAPHIC 

Definition at line 581 of file nsIAccessible.idl.

{ ROLE_GRAPHIC = 40U };
anonymous enum [inherited]
Enumerator:
ROLE_STATICTEXT 

Definition at line 582 of file nsIAccessible.idl.

{ ROLE_STATICTEXT = 41U };
anonymous enum [inherited]
Enumerator:
ROLE_TEXT 

Definition at line 583 of file nsIAccessible.idl.

{ ROLE_TEXT = 42U };
anonymous enum [inherited]
Enumerator:
ROLE_PUSHBUTTON 

Definition at line 584 of file nsIAccessible.idl.

{ ROLE_PUSHBUTTON = 43U };
anonymous enum [inherited]
Enumerator:
ROLE_CHECKBUTTON 

Definition at line 585 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_RADIOBUTTON 

Definition at line 586 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_COMBOBOX 

Definition at line 587 of file nsIAccessible.idl.

{ ROLE_COMBOBOX = 46U };
anonymous enum [inherited]
Enumerator:
ROLE_DROPLIST 

Definition at line 588 of file nsIAccessible.idl.

{ ROLE_DROPLIST = 47U };
anonymous enum [inherited]
Enumerator:
ROLE_CURSOR 

Definition at line 544 of file nsIAccessible.idl.

{ ROLE_CURSOR = 6U };
anonymous enum [inherited]
Enumerator:
ROLE_PROGRESSBAR 

Definition at line 589 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_DIAL 

Definition at line 590 of file nsIAccessible.idl.

{ ROLE_DIAL = 49U };
anonymous enum [inherited]
Enumerator:
ROLE_HOTKEYFIELD 

Definition at line 591 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_SLIDER 

Definition at line 592 of file nsIAccessible.idl.

{ ROLE_SLIDER = 51U };
anonymous enum [inherited]
Enumerator:
ROLE_SPINBUTTON 

Definition at line 593 of file nsIAccessible.idl.

{ ROLE_SPINBUTTON = 52U };
anonymous enum [inherited]
Enumerator:
ROLE_DIAGRAM 

Definition at line 594 of file nsIAccessible.idl.

{ ROLE_DIAGRAM = 53U };
anonymous enum [inherited]
Enumerator:
ROLE_ANIMATION 

Definition at line 595 of file nsIAccessible.idl.

{ ROLE_ANIMATION = 54U };
anonymous enum [inherited]
Enumerator:
ROLE_EQUATION 

Definition at line 596 of file nsIAccessible.idl.

{ ROLE_EQUATION = 55U };
anonymous enum [inherited]
Enumerator:
ROLE_BUTTONDROPDOWN 

Definition at line 597 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_BUTTONMENU 

Definition at line 598 of file nsIAccessible.idl.

{ ROLE_BUTTONMENU = 57U };
anonymous enum [inherited]
Enumerator:
ROLE_CARET 

Definition at line 545 of file nsIAccessible.idl.

{ ROLE_CARET = 7U };
anonymous enum [inherited]
Enumerator:
ROLE_BUTTONDROPDOWNGRID 

Definition at line 599 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_WHITESPACE 

Definition at line 600 of file nsIAccessible.idl.

{ ROLE_WHITESPACE = 59U };
anonymous enum [inherited]
Enumerator:
ROLE_PAGETABLIST 

Definition at line 601 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_CLOCK 

Definition at line 602 of file nsIAccessible.idl.

{ ROLE_CLOCK = 61U };
anonymous enum [inherited]
Enumerator:
ROLE_SPLITBUTTON 

Definition at line 603 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_IPADDRESS 

Definition at line 604 of file nsIAccessible.idl.

{ ROLE_IPADDRESS = 63U };
anonymous enum [inherited]
Enumerator:
ROLE_NOTHING 

Definition at line 605 of file nsIAccessible.idl.

{ ROLE_NOTHING = 4294967295U };
anonymous enum [inherited]
Enumerator:
ROLE_ICON 

Definition at line 609 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_PASSWORD_TEXT 

Definition at line 610 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_AUTOCOMPLETE 

Definition at line 611 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_ALERT 

Definition at line 546 of file nsIAccessible.idl.

{ ROLE_ALERT = 8U };
anonymous enum [inherited]
Enumerator:
ROLE_EDITBAR 

Definition at line 612 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_EMBEDDED 

Definition at line 613 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_ENTRY 

Definition at line 614 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_CAPTION 

Definition at line 615 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_DOCUMENT_FRAME 

Definition at line 616 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_HEADING 

Definition at line 617 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_PAGE 

Definition at line 618 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_SECTION 

Definition at line 619 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_REDUNDANT_OBJECT 

Definition at line 620 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
NAVRELATION_CONTROLLED_BY 

Definition at line 623 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_WINDOW 

Definition at line 547 of file nsIAccessible.idl.

{ ROLE_WINDOW = 9U };
anonymous enum [inherited]
Enumerator:
NAVRELATION_CONTROLLER_FOR 

Definition at line 624 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
NAVRELATION_LABEL_FOR 

Definition at line 625 of file nsIAccessible.idl.

{ NAVRELATION_LABEL_FOR = 0x1002 };
anonymous enum [inherited]
Enumerator:
NAVRELATION_LABELLED_BY 

Definition at line 626 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
NAVRELATION_MEMBER_OF 

Definition at line 627 of file nsIAccessible.idl.

{ NAVRELATION_MEMBER_OF = 0x1004 };
anonymous enum [inherited]
Enumerator:
NAVRELATION_NODE_CHILD_OF 

Definition at line 628 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
NAVRELATION_FLOWS_TO 

Definition at line 629 of file nsIAccessible.idl.

{ NAVRELATION_FLOWS_TO = 0x1006 };
anonymous enum [inherited]
Enumerator:
NAVRELATION_FLOWS_FROM 

Definition at line 630 of file nsIAccessible.idl.

{ NAVRELATION_FLOWS_FROM = 0x1007 };
anonymous enum [inherited]
Enumerator:
NAVRELATION_SUBWINDOW_OF 

Definition at line 631 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
NAVRELATION_EMBEDS 

Definition at line 632 of file nsIAccessible.idl.

{ NAVRELATION_EMBEDS = 0x1009 };
anonymous enum [inherited]
Enumerator:
NAVRELATION_EMBEDDED_BY 

Definition at line 633 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
ROLE_CLIENT 

Definition at line 548 of file nsIAccessible.idl.

{ ROLE_CLIENT = 10U };
anonymous enum [inherited]
Enumerator:
NAVRELATION_POPUP_FOR 

Definition at line 634 of file nsIAccessible.idl.

{ NAVRELATION_POPUP_FOR = 0x100b };
anonymous enum [inherited]
Enumerator:
NAVRELATION_PARENT_WINDOW_OF 

Definition at line 635 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
NAVRELATION_DEFAULT_BUTTON 

Definition at line 636 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
NAVRELATION_DESCRIBED_BY 

Definition at line 637 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
NAVRELATION_DESCRIPTION_FOR 

Definition at line 638 of file nsIAccessible.idl.

anonymous enum [inherited]
Enumerator:
eSelection_Add 
eSelection_Remove 
eSelection_GetState 

Definition at line 56 of file nsIAccessibleSelectable.idl.

anonymous enum [inherited]
Enumerator:
eAction_Switch 
eAction_Jump 
eAction_Click 
eAction_Select 
eAction_Expand 

Definition at line 121 of file nsAccessible.h.

anonymous enum [inherited]
Enumerator:
eNo_Action 
eSingle_Action 
eDouble_Action 

Definition at line 123 of file nsAccessible.h.


Constructor & Destructor Documentation

Definition at line 86 of file nsDocAccessible.cpp.

                                                                              :
  nsBlockAccessible(aDOMNode, aShell), mWnd(nsnull),
  mEditor(nsnull), mScrollPositionChangedTicks(0), mIsContentLoaded(PR_FALSE)
{
  // Because of the way document loading happens, the new nsIWidget is created before
  // the old one is removed. Since it creates the nsDocAccessible, for a brief moment 
  // there can be 2 nsDocAccessible's for the content area, although for 2 different
  // pres shells.

  nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
  if (shell) {
    mDocument = shell->GetDocument();
    nsIViewManager* vm = shell->GetViewManager();
    if (vm) {
      nsCOMPtr<nsIWidget> widget;
      vm->GetWidget(getter_AddRefs(widget));
      if (widget) {
        mWnd = widget->GetNativeData(NS_NATIVE_WINDOW);
      }
    }
  }
  
  // XXX aaronl should we use an algorithm for the initial cache size?
  mAccessNodeCache.Init(kDefaultCacheSize);

  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
    GetDocShellTreeItemFor(mDOMNode);
  if (docShellTreeItem) {
    PRInt32 itemType;
    docShellTreeItem->GetItemType(&itemType);
    if (itemType == nsIDocShellTreeItem::typeChrome) {
      mIsContentLoaded = PR_TRUE;
    }
  }
}

Here is the call graph for this function:

Definition at line 125 of file nsDocAccessible.cpp.

{
}

Member Function Documentation

STDMETHODIMP nsAccessibleWrap::accDoDefaultAction ( VARIANT  varChild) [virtual, inherited]

Definition at line 837 of file nsAccessibleWrap.cpp.

{
  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));

  if (!xpAccessible || FAILED(xpAccessible->DoAction(0))) {
    return E_FAIL;
  }
  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::AccessibleObjectFromWindow ( HWND  hwnd,
DWORD  dwObjectID,
REFIID  riid,
void **  ppvObject 
) [static, inherited]

Definition at line 138 of file nsAccessibleWrap.cpp.

{
  // open the dll dynamically
  if (!gmAccLib) 
    gmAccLib =::LoadLibrary("OLEACC.DLL");  

  if (gmAccLib) {
    if (!gmAccessibleObjectFromWindow)
      gmAccessibleObjectFromWindow = (LPFNACCESSIBLEOBJECTFROMWINDOW)GetProcAddress(gmAccLib,"AccessibleObjectFromWindow");

    if (gmAccessibleObjectFromWindow)
      return gmAccessibleObjectFromWindow(hwnd, dwObjectID, riid, ppvObject);
  }

  return E_FAIL;
}

Here is the caller graph for this function:

STDMETHODIMP nsAccessibleWrap::accHitTest ( long  xLeft,
long  yTop,
VARIANT __RPC_FAR *  pvarChild 
) [virtual, inherited]

Definition at line 794 of file nsAccessibleWrap.cpp.

{
  VariantInit(pvarChild);

  // convert to window coords
  nsCOMPtr<nsIAccessible> xpAccessible;

  xLeft = xLeft;
  yTop = yTop;

  GetChildAtPoint(xLeft, yTop, getter_AddRefs(xpAccessible));

  // if we got a child
  if (xpAccessible) {
    // if the child is us
    if (xpAccessible == NS_STATIC_CAST(nsIAccessible*, this)) {
      pvarChild->vt = VT_I4;
      pvarChild->lVal = CHILDID_SELF;
    } else { // its not create an Accessible for it.
      pvarChild->vt = VT_DISPATCH;
      pvarChild->pdispVal = NativeAccessible(xpAccessible);
      nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(xpAccessible));
      NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
      nsCOMPtr<nsIDOMNode> domNode;
      accessNode->GetDOMNode(getter_AddRefs(domNode));
      if (!domNode) {
        // Has already been shut down
        pvarChild->vt = VT_EMPTY;
        return E_FAIL;
      }
    }
  } else {
    // no child at that point
    pvarChild->vt = VT_EMPTY;
    return E_FAIL;
  }

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::accLocation ( long __RPC_FAR *  pxLeft,
long __RPC_FAR *  pyTop,
long __RPC_FAR *  pcxWidth,
long __RPC_FAR *  pcyHeight,
VARIANT  varChild 
) [virtual, inherited]

Definition at line 694 of file nsAccessibleWrap.cpp.

{
  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));

  if (xpAccessible) {
    PRInt32 x, y, width, height;
    if (NS_FAILED(xpAccessible->GetBounds(&x, &y, &width, &height)))
      return E_FAIL;

    *pxLeft = x;
    *pyTop = y;
    *pcxWidth = width;
    *pcyHeight = height;
    return S_OK;
  }

  return E_FAIL;  
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::accNavigate ( long  navDir,
VARIANT  varStart,
VARIANT __RPC_FAR *  pvarEndUpAt 
) [virtual, inherited]

Definition at line 719 of file nsAccessibleWrap.cpp.

{
  nsCOMPtr<nsIAccessible> xpAccessibleStart, xpAccessibleResult;
  GetXPAccessibleFor(varStart, getter_AddRefs(xpAccessibleStart));
  if (!xpAccessibleStart)
    return E_FAIL;

  VariantInit(pvarEndUpAt);
  PRUint32 xpRelation = 0;

  switch(navDir) {
    case NAVDIR_DOWN: 
      xpAccessibleStart->GetAccessibleBelow(getter_AddRefs(xpAccessibleResult));
      break;
    case NAVDIR_FIRSTCHILD:
      xpAccessibleStart->GetFirstChild(getter_AddRefs(xpAccessibleResult));
      break;
    case NAVDIR_LASTCHILD:
      xpAccessibleStart->GetLastChild(getter_AddRefs(xpAccessibleResult));
      break;
    case NAVDIR_LEFT:
      xpAccessibleStart->GetAccessibleToLeft(getter_AddRefs(xpAccessibleResult));
      break;
    case NAVDIR_NEXT:
      xpAccessibleStart->GetNextSibling(getter_AddRefs(xpAccessibleResult));
      break;
    case NAVDIR_PREVIOUS:
      xpAccessibleStart->GetPreviousSibling(getter_AddRefs(xpAccessibleResult));
      break;
    case NAVDIR_RIGHT:
      xpAccessibleStart->GetAccessibleToRight(getter_AddRefs(xpAccessibleResult));
      break;
    case NAVDIR_UP:
      xpAccessibleStart->GetAccessibleAbove(getter_AddRefs(xpAccessibleResult));
      break;
    // MSAA relationship extensions to accNavigate
    case NAVRELATION_CONTROLLED_BY:    xpRelation = RELATION_CONTROLLED_BY;    break;
    case NAVRELATION_CONTROLLER_FOR:   xpRelation = RELATION_CONTROLLER_FOR;   break;
    case NAVRELATION_LABEL_FOR:        xpRelation = RELATION_LABEL_FOR;        break;
    case NAVRELATION_LABELLED_BY:      xpRelation = RELATION_LABELLED_BY;      break;
    case NAVRELATION_MEMBER_OF:        xpRelation = RELATION_MEMBER_OF;        break;
    case NAVRELATION_NODE_CHILD_OF:    xpRelation = RELATION_NODE_CHILD_OF;    break;
    case NAVRELATION_FLOWS_TO:         xpRelation = RELATION_FLOWS_TO;         break;
    case NAVRELATION_FLOWS_FROM:       xpRelation = RELATION_FLOWS_FROM;       break;
    case NAVRELATION_SUBWINDOW_OF:     xpRelation = RELATION_SUBWINDOW_OF;     break;
    case NAVRELATION_EMBEDS:           xpRelation = RELATION_EMBEDS;           break;
    case NAVRELATION_EMBEDDED_BY:      xpRelation = RELATION_EMBEDDED_BY;      break;
    case NAVRELATION_POPUP_FOR:        xpRelation = RELATION_POPUP_FOR;        break;
    case NAVRELATION_PARENT_WINDOW_OF: xpRelation = RELATION_PARENT_WINDOW_OF; break;
    case NAVRELATION_DEFAULT_BUTTON:   xpRelation = RELATION_DEFAULT_BUTTON;   break;
    case NAVRELATION_DESCRIBED_BY:     xpRelation = RELATION_DESCRIBED_BY;     break;
    case NAVRELATION_DESCRIPTION_FOR:  xpRelation = RELATION_DESCRIPTION_FOR;  break;
  }

  pvarEndUpAt->vt = VT_EMPTY;

  if (xpRelation) {
    nsresult rv = GetAccessibleRelated(xpRelation,
                                       getter_AddRefs(xpAccessibleResult));
    if (rv == NS_ERROR_NOT_IMPLEMENTED) {
      return E_NOTIMPL;
    }
  }

  if (xpAccessibleResult) {
    pvarEndUpAt->pdispVal = NativeAccessible(xpAccessibleResult);
    pvarEndUpAt->vt = VT_DISPATCH;
    return NS_OK;
  } 
  return E_FAIL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

STDMETHODIMP nsAccessibleWrap::accSelect ( long  flagsSelect,
VARIANT  varChild 
) [virtual, inherited]

Definition at line 669 of file nsAccessibleWrap.cpp.

{
  // currently only handle focus and selection
  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));

  if (flagsSelect & (SELFLAG_TAKEFOCUS|SELFLAG_TAKESELECTION|SELFLAG_REMOVESELECTION))
  {
    if (flagsSelect & SELFLAG_TAKEFOCUS)
      xpAccessible->TakeFocus();

    if (flagsSelect & SELFLAG_TAKESELECTION)
      xpAccessible->TakeSelection();

    if (flagsSelect & SELFLAG_REMOVESELECTION)
      xpAccessible->RemoveSelection();

    return S_OK;
  }

  return E_FAIL;
}

Here is the call graph for this function:

Adds the specified accessible child of the object to the object's selection.

If the specified object is already selected, then it does nothing.

Exceptions:
NS_ERROR_FAILUREif the specified object is not selectable.
nsresult nsDocAccessible::AddEventListeners ( ) [protected, virtual]

Reimplemented in nsRootAccessible.

Definition at line 545 of file nsDocAccessible.cpp.

{
  // 1) Set up scroll position listener
  // 2) Check for editor and listen for changes to editor

  nsCOMPtr<nsIPresShell> presShell(GetPresShell());
  NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);

  nsCOMPtr<nsISupports> container = mDocument->GetContainer();
  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
  NS_ENSURE_TRUE(docShellTreeItem, NS_ERROR_FAILURE);

  // Make sure we're a content docshell
  // We don't want to listen to chrome progress
  PRInt32 itemType;
  docShellTreeItem->GetItemType(&itemType);

  PRBool isContent = (itemType == nsIDocShellTreeItem::typeContent);

  if (isContent) {
    CheckForEditor();
  
    if (!mEditor) {
      // We're not an editor yet, but we might become one
      nsCOMPtr<nsICommandManager> commandManager = do_GetInterface(docShellTreeItem);
      if (commandManager) {
        commandManager->AddCommandObserver(this, "obs_documentCreated");
      }
    }
  }

  // add document observer
  mDocument->AddObserver(this);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual long IUnknown::AddRef ( ) [pure virtual, inherited]

Here is the caller graph for this function:

Definition at line 661 of file nsDocAccessible.cpp.

{
  nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));

  nsIViewManager* vm = nsnull;
  if (presShell)
    vm = presShell->GetViewManager();

  nsIScrollableView* scrollableView = nsnull;
  if (vm)
    vm->GetRootScrollableView(&scrollableView);

  if (scrollableView)
    scrollableView->AddScrollPositionListener(this);
}

Here is the call graph for this function:

Add this accessible to the current selection.

nsresult nsAccessible::AppendFlatStringFromContentNode ( nsIContent aContent,
nsAString *  aFlatString 
) [protected, inherited]

Definition at line 1299 of file nsAccessible.cpp.

{
  if (aContent->IsContentOfType(nsIContent::eTEXT)) {
    nsCOMPtr<nsITextContent> textContent(do_QueryInterface(aContent));
    NS_ASSERTION(textContent, "No text content for text content type");
    // If it's a text node, append the text
    PRBool isHTMLBlock = PR_FALSE;
    nsCOMPtr<nsIPresShell> shell = GetPresShell();
    if (!shell) {
      return NS_ERROR_FAILURE;  
    }

    nsIContent *parentContent = aContent->GetParent();
    nsCOMPtr<nsIContent> appendedSubtreeStart(do_QueryInterface(mDOMNode));
    if (parentContent && parentContent != appendedSubtreeStart) {
      nsIFrame *frame;
      shell->GetPrimaryFrameFor(parentContent, &frame);
      if (frame) {
        // If this text is inside a block level frame (as opposed to span level), we need to add spaces around that 
        // block's text, so we don't get words jammed together in final name
        // Extra spaces will be trimmed out later
        const nsStyleDisplay* display = frame->GetStyleDisplay();
        if (display->IsBlockLevel() ||
          display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
          isHTMLBlock = PR_TRUE;
          if (!aFlatString->IsEmpty()) {
            aFlatString->Append(PRUnichar(' '));
          }
        }
      }
    }
    if (textContent->TextLength() > 0) {
      nsAutoString text;
      textContent->AppendTextTo(text);
      if (!text.IsEmpty())
        aFlatString->Append(text);
      if (isHTMLBlock && !aFlatString->IsEmpty())
        aFlatString->Append(PRUnichar(' '));
    }
    return NS_OK;
  }

  nsAutoString textEquivalent;
  if (!aContent->IsContentOfType(nsIContent::eHTML)) {
    if (aContent->IsContentOfType(nsIContent::eXUL)) {
      nsCOMPtr<nsIPresShell> shell = GetPresShell();
      if (!shell) {
        return NS_ERROR_FAILURE;  
      }
      nsIFrame *frame;
      shell->GetPrimaryFrameFor(aContent, &frame);
      if (!frame || !frame->GetStyleVisibility()->IsVisible()) {
        return NS_OK;
      }
 
      nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl(do_QueryInterface(aContent));
      if (labeledEl) {
        labeledEl->GetLabel(textEquivalent);
      }
      else {
        aContent->GetAttr(kNameSpaceID_None,
                          nsAccessibilityAtoms::tooltiptext, textEquivalent);
      }
      AppendNameFromAccessibleFor(aContent, &textEquivalent, PR_TRUE /* use value */);

      return AppendStringWithSpaces(aFlatString, textEquivalent);
    }
    return NS_OK; // Not HTML and not XUL -- we don't handle it yet
  }

  nsCOMPtr<nsIAtom> tag = aContent->Tag();
  if (tag == nsAccessibilityAtoms::img) {
    return AppendNameFromAccessibleFor(aContent, aFlatString);
  }

  if (tag == nsAccessibilityAtoms::input) {
    nsAutoString inputType;
    aContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::type, inputType);
    if (inputType.LowerCaseEqualsLiteral("button") ||
        inputType.LowerCaseEqualsLiteral("submit") ||
        inputType.LowerCaseEqualsLiteral("reset") ||
        inputType.LowerCaseEqualsLiteral("image")) {
      return AppendNameFromAccessibleFor(aContent, aFlatString);
    }
  }

  if (tag == nsAccessibilityAtoms::object && !aContent->GetChildCount()) {
    // If object has no alternative content children, try title
    aContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::title, textEquivalent);
  }
  else if (tag == nsAccessibilityAtoms::br) {
    // If it's a line break, insert a space so that words aren't jammed together
    aFlatString->AppendLiteral("\r\n");
    return NS_OK;
  }
  else if (tag != nsAccessibilityAtoms::a && tag != nsAccessibilityAtoms::area) { 
    AppendNameFromAccessibleFor(aContent, aFlatString, PR_TRUE /* use value */);
  }

  textEquivalent.CompressWhitespace();
  return AppendStringWithSpaces(aFlatString, textEquivalent);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAccessible::AppendFlatStringFromSubtree ( nsIContent aContent,
nsAString *  aFlatString 
) [protected, inherited]

Reimplemented in nsXULSelectableAccessible.

Definition at line 1403 of file nsAccessible.cpp.

{
  nsresult rv = AppendFlatStringFromSubtreeRecurse(aContent, aFlatString);
  if (NS_SUCCEEDED(rv) && !aFlatString->IsEmpty()) {
    nsAString::const_iterator start, end;
    aFlatString->BeginReading(start);
    aFlatString->EndReading(end);

    PRInt32 spacesToTruncate = 0;
    while (-- end != start && *end == ' ')
      ++ spacesToTruncate;

    if (spacesToTruncate > 0)
      aFlatString->Truncate(aFlatString->Length() - spacesToTruncate);
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAccessible::AppendFlatStringFromSubtreeRecurse ( nsIContent aContent,
nsAString *  aFlatString 
) [protected, inherited]

Definition at line 1422 of file nsAccessible.cpp.

{
  // Depth first search for all text nodes that are decendants of content node.
  // Append all the text into one flat string
  PRUint32 numChildren = 0;
  nsCOMPtr<nsIDOMXULSelectControlElement> selectControlEl(do_QueryInterface(aContent));
  if (!selectControlEl) {  // Don't walk children of elements with options, just get label directly
    numChildren = aContent->GetChildCount();
  }

  if (numChildren == 0) {
    // There are no children or they are irrelvant: get the text from the current node
    AppendFlatStringFromContentNode(aContent, aFlatString);
    return NS_OK;
  }

  // There are relevant children: use them to get the text.
  PRUint32 index;
  for (index = 0; index < numChildren; index++) {
    AppendFlatStringFromSubtreeRecurse(aContent->GetChildAt(index), aFlatString);
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAccessible::AppendNameFromAccessibleFor ( nsIContent aContent,
nsAString *  aFlatString,
PRBool  aFromValue = PR_FALSE 
) [protected, inherited]

Definition at line 1260 of file nsAccessible.cpp.

{
  nsAutoString textEquivalent, value;

  nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(aContent));
  nsCOMPtr<nsIAccessible> accessible;
  if (domNode == mDOMNode) {
    accessible = this;
  }
  else {
    nsCOMPtr<nsIAccessibilityService> accService =
      do_GetService("@mozilla.org/accessibilityService;1");
    NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
    accService->GetAccessibleInWeakShell(domNode, mWeakShell, getter_AddRefs(accessible));
  }
  if (accessible) {
    if (aFromValue) {
      accessible->GetFinalValue(textEquivalent);
    }
    else {
      accessible->GetName(textEquivalent);
    }
  }

  textEquivalent.CompressWhitespace();
  return AppendStringWithSpaces(aFlatString, textEquivalent);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAccessible::AppendStringWithSpaces ( nsAString *  aFlatString,
const nsAString &  textEquivalent 
) [protected, inherited]

Definition at line 1248 of file nsAccessible.cpp.

{
  // Insert spaces to insure that words from controls aren't jammed together
  if (!textEquivalent.IsEmpty()) {
    if (!aFlatString->IsEmpty())
      aFlatString->Append(PRUnichar(' '));
    aFlatString->Append(textEquivalent);
    aFlatString->Append(PRUnichar(' '));
  }
  return NS_OK;
}

Here is the caller graph for this function:

virtual void nsIDocumentObserver::AttributeChanged ( nsIDocument aDocument,
nsIContent aContent,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [pure virtual, inherited]

Notification that the content model has changed.

This method is called automatically by content objects when an attribute's value has changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers document observers.

Parameters:
aDocumentThe document being observed
aContentthe piece of content whose attribute changed
aAttributethe atom name of the attribute
aModTypeWhether or not the attribute was added, changed, or removed. The constants are defined in nsIDOMMutationEvent.h.

Implemented in PresShell, nsContentList, nsXULContentBuilder, nsXULTemplateBuilder, nsImageMap, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::BeginLoad ( nsIDocument aDocument) [pure virtual, inherited]

Notify the observer that a document load is beginning.

Implemented in PresShell.

virtual void nsIDocumentObserver::BeginReflow ( nsIDocument aDocument,
nsIPresShell aShell 
) [pure virtual, inherited]

Notify the observer that the document is being reflowed in the given presentation shell.

virtual void nsIDocumentObserver::BeginUpdate ( nsIDocument aDocument,
nsUpdateType  aUpdateType 
) [pure virtual, inherited]

Notify that a content model update is beginning.

This call can be nested.

Implemented in nsFragmentObserver, PresShell, HTMLContentSink, and nsXMLPrettyPrinter.

void nsPIAccessibleDocument::cacheAccessNode ( in voidPtr  aUniqueID,
in nsIAccessNode  aAccessNode 
) [inherited]
void nsAccessible::CacheChildren ( PRBool  aWalkAnonContent) [protected, virtual, inherited]

Reimplemented in nsHTMLSelectListAccessible, nsHTMLLIAccessible, nsHTMLGroupboxAccessible, nsHTMLImageAccessible, nsOuterDocAccessible, and nsXULButtonAccessible.

Definition at line 619 of file nsAccessible.cpp.

{
  if (!mWeakShell) {
    // This node has been shut down
    mAccChildCount = -1;
    return;
  }

  if (mAccChildCount == eChildCountUninitialized) {
    nsAccessibleTreeWalker walker(mWeakShell, mDOMNode, aWalkAnonContent);
    // Seed the frame hint early while we're still on a container node.
    // This is better than doing the GetPrimaryFrameFor() later on
    // a text node, because text nodes aren't in the frame map.
    walker.mState.frame = GetFrame();

    nsCOMPtr<nsPIAccessible> privatePrevAccessible;
    mAccChildCount = 0;
    walker.GetFirstChild();
    SetFirstChild(walker.mState.accessible);

    while (walker.mState.accessible) {
      ++mAccChildCount;
      privatePrevAccessible = do_QueryInterface(walker.mState.accessible);
      privatePrevAccessible->SetParent(this);
      walker.GetNextSibling();
      privatePrevAccessible->SetNextSibling(walker.mState.accessible);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocumentObserver::CharacterDataChanged ( nsIDocument aDocument,
nsIContent aContent,
PRBool  aAppend 
) [pure virtual, inherited]

Notification that the content model has changed.

This method is called automatically by content objects when their state is changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers. The notification is passed on to all of the document observers.

This notification is not sent when a piece of content is added/removed from the document (the other notifications are used for that).

Parameters:
aDocumentThe document being observed
aContentthe piece of content that changed
aAppendWhether the change was an append

Implemented in PresShell.

void nsDocAccessible::CheckForEditor ( ) [protected, virtual]

Reimplemented in nsDocAccessibleWrap.

Definition at line 359 of file nsDocAccessible.cpp.

{
  if (mEditor) {
    return;  // Already have editor, don't need to check
  }
  if (!mDocument) {
    return;  // No document -- we've been shut down
  }
  nsCOMPtr<nsIDOMWindow> domWindow(do_QueryInterface(mDocument->GetScriptGlobalObject()));
  if (!domWindow)
    return;  // No DOM Window

  nsCOMPtr<nsISupports> container = mDocument->GetContainer();
  nsCOMPtr<nsIEditingSession> editingSession(do_GetInterface(container));
  if (!editingSession)
    return; // No editing session interface

  editingSession->GetEditorForWindow(domWindow, getter_AddRefs(mEditor));
  if (mEditor) {
    // State readonly is now clear
#ifdef MOZ_ACCESSIBILITY_ATK
    AtkStateChange stateData;
    stateData.enable = PR_TRUE;
    stateData.state = STATE_READONLY; // Will be translated to ATK_STATE_EDITABLE
    FireToolkitEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, this, &stateData);
#else
    FireToolkitEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, this, nsnull);
#endif
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 535 of file nsAccessNode.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

PLDHashOperator nsAccessNode::ClearCacheEntry ( const void aKey,
nsCOMPtr< nsIAccessNode > &  aAccessNode,
void aUserArg 
) [static, inherited]

Definition at line 527 of file nsAccessNode.cpp.

{
  nsCOMPtr<nsPIAccessNode> privateAccessNode(do_QueryInterface(aAccessNode));
  privateAccessNode->Shutdown();

  return PL_DHASH_REMOVE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Clears the selection in the object so that no children in the object are selected.

STDMETHODIMP nsAccessibleWrap::Clone ( IEnumVARIANT __RPC_FAR *__RPC_FAR *  ppEnum) [virtual, inherited]

Definition at line 955 of file nsAccessibleWrap.cpp.

{
  // Clone could be bad, the cloned items aren't tracked for shutdown
  // Then again, as long as the client releases the items in time, we're okay
  *ppenum = nsnull;

  nsAccessibleWrap *accessibleWrap = new nsAccessibleWrap(mDOMNode, mWeakShell);
  if (!accessibleWrap)
    return E_FAIL;

  IAccessible *msaaAccessible = NS_STATIC_CAST(IAccessible*, accessibleWrap);
  msaaAccessible->AddRef();
  QueryInterface(IID_IEnumVARIANT, (void**)ppenum);
  if (*ppenum)
    (*ppenum)->Skip(mEnumVARIANTPosition); // QI addrefed
  msaaAccessible->Release();

  return NOERROR;
}

Here is the call graph for this function:

virtual void nsIDocumentObserver::ContentAppended ( nsIDocument aDocument,
nsIContent aContainer,
PRInt32  aNewIndexInContainer 
) [pure virtual, inherited]

Notifcation that the content model has had data appended to the given content object.

This method is called automatically by the content container objects when a new content object is appended to the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that had a new child appended
aNewIndexInContainerthe index in the container of the first new child

Implemented in PresShell, nsContentList, nsBindingManager, nsImageMap, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::ContentInserted ( nsIDocument aDocument,
nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [pure virtual, inherited]

Notification that content has been inserted.

This method is called automatically by the content container objects when a new content object is inserted in the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that now contains aChild
aChildthe child that was inserted
aIndexInContainerthe index of the child in the container

Implemented in PresShell, nsContentList, nsBindingManager, nsImageMap, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::ContentRemoved ( nsIDocument aDocument,
nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [pure virtual, inherited]

Content has just been removed.

This method is called automatically by content container objects when a content object has just been removed from the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that had a child removed
aChildthe child that was just removed
aIndexInContainerthe index of the child in the container before it was removed

Implemented in PresShell, nsContentList, nsBindingManager, nsImageMap, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::ContentStatesChanged ( nsIDocument aDocument,
nsIContent aContent1,
nsIContent aContent2,
PRInt32  aStateMask 
) [pure virtual, inherited]

Notification that the state of a content node has changed.

(ie: gained or lost focus, became active or hovered over) This method is called automatically by content objects when their state is changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers. The notification is passed on to all of the document observers.

This notification is not sent when a piece of content is added/removed from the document or the content itself changed (the other notifications are used for that).

The optional second content node is to allow optimization of the case where state moves from one node to another (as is likely for :focus and :hover)

Either content node may be nsnull, but not both

Parameters:
aDocumentThe document being observed
aContent1the piece of content that changed
aContent2optional second piece of content that changed

Implemented in PresShell, and nsTreeContentView.

void nsIAccessible::doAction ( in PRUint8  index) [inherited]

Perform the accessible action at the given zero-based index Action number 0 is the default action.

nsresult nsAccessible::DoCommand ( nsIContent aContent = nsnull) [protected, inherited]

Definition at line 2359 of file nsAccessible.cpp.

{
  nsCOMPtr<nsIContent> content = aContent;
  if (!content) {
    content = do_QueryInterface(mDOMNode);
  }
  if (gDoCommandTimer) {
    // Already have timer going for another command
    NS_WARNING("Doubling up on do command timers doesn't work. This wasn't expected.");
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1");
  if (!timer) {
    return NS_ERROR_OUT_OF_MEMORY;
  } 

  NS_ADDREF(gDoCommandTimer = timer);
  return gDoCommandTimer->InitWithFuncCallback(DoCommandCallback,
                                               (void*)content, 0,
                                               nsITimer::TYPE_ONE_SHOT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsAccessible::DoCommandCallback ( nsITimer aTimer,
void aClosure 
) [static, protected, inherited]

Definition at line 2316 of file nsAccessible.cpp.

{
  NS_ASSERTION(gDoCommandTimer, "How did we get here if there was no gDoCommandTimer?");
  NS_RELEASE(gDoCommandTimer);

  nsIContent *content = NS_REINTERPRET_CAST(nsIContent*, aClosure);
  nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(content));
  if (xulElement) {
    xulElement->Click();
  }
  else {
    nsIDocument *doc = content->GetDocument();
    if (!doc) {
      return;
    }
    nsCOMPtr<nsIPresShell> presShell = doc->GetShellAt(0);
    nsPIDOMWindow *outerWindow = doc->GetWindow();
    if (presShell && outerWindow) {
      nsAutoPopupStatePusher popupStatePusher(outerWindow, openAllowed);

      nsMouseEvent downEvent(PR_TRUE, NS_MOUSE_LEFT_BUTTON_DOWN, nsnull,
                              nsMouseEvent::eSynthesized);
      nsMouseEvent upEvent(PR_TRUE, NS_MOUSE_LEFT_BUTTON_UP, nsnull,
                              nsMouseEvent::eSynthesized);
      nsMouseEvent clickEvent(PR_TRUE, NS_MOUSE_LEFT_CLICK, nsnull,
                              nsMouseEvent::eSynthesized);

      nsEventStatus eventStatus = nsEventStatus_eIgnore;
      presShell->HandleDOMEventWithTarget(content, &downEvent, &eventStatus);
      presShell->HandleDOMEventWithTarget(content, &upEvent, &eventStatus);
      presShell->HandleDOMEventWithTarget(content, &clickEvent, &eventStatus);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocumentObserver::DocumentWillBeDestroyed ( nsIDocument aDocument) [pure virtual, inherited]

The document is in the process of being destroyed.

This method is called automatically during document destruction.

Parameters:
aDocumentThe document being observed

Implemented in nsFragmentObserver, nsDOMStyleSheetList, nsContentList, nsBindingManager, nsXULContentBuilder, nsXULTreeBuilder, nsXULTemplateBuilder, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::EndLoad ( nsIDocument aDocument) [pure virtual, inherited]

Notify the observer that a document load has finished.

Note that the associated reflow of the document will be done before EndLoad is invoked, not after.

Implemented in PresShell.

virtual void nsIDocumentObserver::EndReflow ( nsIDocument aDocument,
nsIPresShell aShell 
) [pure virtual, inherited]

Notify the observer that the document is done being reflowed in the given presentation shell.

virtual void nsIDocumentObserver::EndUpdate ( nsIDocument aDocument,
nsUpdateType  aUpdateType 
) [pure virtual, inherited]

Notify that a content model update is finished.

This call can be nested.

Implemented in PresShell, HTMLContentSink, and nsXMLPrettyPrinter.

Extend the current selection from its current accessible anchor node to this accessible.

nsresult nsDocAccessible::FireDelayedToolkitEvent ( PRUint32  aEvent,
nsIDOMNode aDOMNode,
void aData,
PRBool  aAllowDupes = PR_FALSE 
) [protected]

Definition at line 908 of file nsDocAccessible.cpp.

{
  PRBool isTimerStarted = PR_TRUE;
  PRInt32 numQueuedEvents = mEventsToFire.Count();
    if (!mFireEventTimer) {
      // Do not yet have a timer going for firing another event.
      mFireEventTimer = do_CreateInstance("@mozilla.org/timer;1");
      NS_ENSURE_TRUE(mFireEventTimer, NS_ERROR_OUT_OF_MEMORY);
    }
  if (numQueuedEvents == 0) {
    isTimerStarted = PR_FALSE;
  }
  else if (!aAllowDupes) {
    // Check for repeat events. If a redundant event exists remove
    // original and put the new event at the end of the queue
    // so it is fired after the others
    for (PRInt32 index = 0; index < numQueuedEvents; index ++) {
      nsIAccessibleEvent *accessibleEvent = mEventsToFire[index];
      NS_ASSERTION(accessibleEvent, "Array item is not an accessible event");
      if (!accessibleEvent) {
        continue;
      }
      PRUint32 eventType;
      accessibleEvent->GetEventType(&eventType);
      if (eventType == aEvent) {
        nsCOMPtr<nsIDOMNode> domNode;
        accessibleEvent->GetDOMNode(getter_AddRefs(domNode));
        if (domNode == aDOMNode) {
          mEventsToFire.RemoveObjectAt(index);
          -- index;
          -- numQueuedEvents;
        }
      }
    }
  }

  // XXX Add related data for ATK support.
  // For example, state change event should provide what state has changed,
  // as well as the old and new value.
  nsCOMPtr<nsIAccessibleEvent> event =
    new nsAccessibleEventData(aEvent, aDOMNode, this, aData);
  NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
  mEventsToFire.AppendObject(event);
  if (!isTimerStarted) {
    // This is be the first delayed event in queue, start timer
    // so that event gets fired via FlushEventsCallback
    mFireEventTimer->InitWithFuncCallback(FlushEventsCallback,
                                          NS_STATIC_CAST(nsPIAccessibleDocument*, this),
                                          0, nsITimer::TYPE_ONE_SHOT);
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsPIAccessible::fireToolkitEvent ( in unsigned long  aEvent,
in nsIAccessible  aTarget,
in voidPtr  aData 
) [inherited]
NS_IMETHODIMP nsDocAccessible::FireToolkitEvent ( PRUint32  aEvent,
nsIAccessible aAccessible,
void aData 
)

Reimplemented in nsDocAccessibleWrap, nsDocAccessibleWrap, nsDocAccessibleWrap, and nsDocAccessibleWrap.

Definition at line 1215 of file nsDocAccessible.cpp.

{
  nsCOMPtr<nsIObserverService> obsService =
    do_GetService("@mozilla.org/observer-service;1");
  if (!obsService) {
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsIAccessibleEvent> accEvent = new nsAccessibleEventData(aEvent, aAccessible, this, aData);
  NS_ENSURE_TRUE(accEvent, NS_ERROR_OUT_OF_MEMORY);

  return obsService->NotifyObservers(accEvent, NS_ACCESSIBLE_EVENT_TOPIC, nsnull);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsDocAccessible::FlushEventsCallback ( nsITimer aTimer,
void aClosure 
) [static]

Definition at line 984 of file nsDocAccessible.cpp.

{
  nsPIAccessibleDocument *accessibleDoc = NS_STATIC_CAST(nsPIAccessibleDocument*, aClosure);
  NS_ASSERTION(accessibleDoc, "How did we get here without an accessible document?");
  accessibleDoc->FlushPendingEvents();
}

Here is the caller graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accChild ( VARIANT  varChild,
IDispatch __RPC_FAR *__RPC_FAR *  ppdispChild 
) [virtual, inherited]

Reimplemented in nsDocAccessibleWrap.

Definition at line 237 of file nsAccessibleWrap.cpp.

{
  *ppdispChild = NULL;

  if (!mWeakShell || varChild.vt != VT_I4)
    return E_FAIL;

  if (varChild.lVal == CHILDID_SELF) {
    *ppdispChild = NS_STATIC_CAST(IDispatch*, this);
    AddRef();
    return S_OK;
  }

  nsCOMPtr<nsIAccessible> childAccessible;
  GetChildAt(varChild.lVal - 1, getter_AddRefs(childAccessible));
  if (childAccessible) {
    *ppdispChild = NativeAccessible(childAccessible);
  }

  return (*ppdispChild)? S_OK: E_FAIL;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accChildCount ( long __RPC_FAR *  pcountChildren) [virtual, inherited]

Definition at line 228 of file nsAccessibleWrap.cpp.

{
  PRInt32 numChildren;
  GetChildCount(&numChildren);
  *pcountChildren = numChildren;

  return S_OK;
}
STDMETHODIMP nsAccessibleWrap::get_accDefaultAction ( VARIANT  varChild,
BSTR __RPC_FAR *  pszDefaultAction 
) [virtual, inherited]

Definition at line 651 of file nsAccessibleWrap.cpp.

{
  *pszDefaultAction = NULL;
  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));
  if (xpAccessible) {
    nsAutoString defaultAction;
    if (NS_FAILED(xpAccessible->GetActionName(0, defaultAction)))
      return S_FALSE;

    *pszDefaultAction = ::SysAllocString(defaultAction.get());
  }

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accDescription ( VARIANT  varChild,
BSTR __RPC_FAR *  pszDescription 
) [virtual, inherited]

Definition at line 402 of file nsAccessibleWrap.cpp.

{
  *pszDescription = NULL;
  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));
  if (xpAccessible) {
     nsAutoString description;
     if (NS_FAILED(xpAccessible->GetDescription(description)))
       return S_FALSE;

     *pszDescription = ::SysAllocString(description.get());
  }

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accFocus ( VARIANT __RPC_FAR *  pvarChild) [virtual, inherited]

Definition at line 538 of file nsAccessibleWrap.cpp.

{
  // VT_EMPTY:    None. This object does not have the keyboard focus itself
  //              and does not contain a child that has the keyboard focus.
  // VT_I4:       lVal is CHILDID_SELF. The object itself has the keyboard focus.
  // VT_I4:       lVal contains the child ID of the child element with the keyboard focus.
  // VT_DISPATCH: pdispVal member is the address of the IDispatch interface
  //              for the child object with the keyboard focus.

  if (!mDOMNode) {
    return E_FAIL; // This node is shut down
  }

  VariantInit(pvarChild);

  // Return the current IAccessible child that has focus
  nsCOMPtr<nsIAccessible> focusedAccessible;
  GetFocusedChild(getter_AddRefs(focusedAccessible));
  if (focusedAccessible == this) {
    pvarChild->vt = VT_I4;
    pvarChild->lVal = CHILDID_SELF;
  }
  else if (focusedAccessible) {
    pvarChild->vt = VT_DISPATCH;
    pvarChild->pdispVal = NativeAccessible(focusedAccessible);
  }
  else {
    pvarChild->vt = VT_EMPTY;   // No focus or focus is not a child
  }

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accHelp ( VARIANT  varChild,
BSTR __RPC_FAR *  pszHelp 
) [virtual, inherited]

Definition at line 501 of file nsAccessibleWrap.cpp.

{
  *pszHelp = NULL;
  return S_FALSE;
}
STDMETHODIMP nsAccessibleWrap::get_accHelpTopic ( BSTR __RPC_FAR *  pszHelpFile,
VARIANT  varChild,
long __RPC_FAR *  pidTopic 
) [virtual, inherited]

Definition at line 509 of file nsAccessibleWrap.cpp.

{
  *pszHelpFile = NULL;
  *pidTopic = 0;
  return E_NOTIMPL;
}
STDMETHODIMP nsAccessibleWrap::get_accKeyboardShortcut ( VARIANT  varChild,
BSTR __RPC_FAR *  pszKeyboardShortcut 
) [virtual, inherited]

Definition at line 519 of file nsAccessibleWrap.cpp.

{
  *pszKeyboardShortcut = NULL;
  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));
  if (xpAccessible) {
    nsAutoString shortcut;
    nsresult rv = xpAccessible->GetKeyboardShortcut(shortcut);
    if (NS_FAILED(rv))
      return S_FALSE;

    *pszKeyboardShortcut = ::SysAllocString(shortcut.get());
    return S_OK;
  }
  return S_FALSE;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accName ( VARIANT  varChild,
BSTR __RPC_FAR *  pszName 
) [virtual, inherited]

Definition at line 261 of file nsAccessibleWrap.cpp.

{
  *pszName = NULL;
  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));
  if (xpAccessible) {
    nsAutoString name;
    if (NS_FAILED(xpAccessible->GetName(name)))
      return S_FALSE;
    if (!name.IsVoid()) {
      *pszName = ::SysAllocString(name.get());
    }
    NS_ASSERTION(mIsInitialized, "Access node was not initialized");
  }

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accParent ( IDispatch __RPC_FAR *__RPC_FAR *  ppdispParent) [virtual, inherited]

Definition at line 169 of file nsAccessibleWrap.cpp.

{
  *ppdispParent = NULL;
  if (!mWeakShell)
    return E_FAIL;  // We've been shut down

  nsIFrame *frame = GetFrame();
  HWND hwnd = 0;
  if (frame) {
    nsIView *view = frame->GetViewExternal();
    if (view) {
      // This code is essentially our implementation of WindowFromAccessibleObject,
      // because MSAA iterates get_accParent() until it sees an object of ROLE_WINDOW
      // to know where the window for a given accessible is. We must expose the native 
      // window accessible that MSAA creates for us. This must be done for the document
      // object as well as any layout that creates its own window (e.g. via overflow: scroll)
      nsIWidget *widget = view->GetWidget();
      if (widget) {
        hwnd = (HWND)widget->GetNativeData(NS_NATIVE_WINDOW);
        NS_ASSERTION(hwnd, "No window handle for window");
        nsIView *rootView;
        view->GetViewManager()->GetRootView(rootView);
        if (rootView == view) {
          // If the current object has a widget but was created by an
          // outer object with its own outer window, then
          // we want the native accessible for that outer window
          hwnd = ::GetParent(hwnd);
          NS_ASSERTION(hwnd, "No window handle for window");
        }
      }
      else {
        // If a frame is a scrollable frame, then it has one window for the client area,
        // not an extra parent window for just the scrollbars
        nsIScrollableFrame *scrollFrame = nsnull;
        CallQueryInterface(frame, &scrollFrame);
        if (scrollFrame) {
          hwnd = (HWND)scrollFrame->GetScrolledFrame()->GetWindow()->GetNativeData(NS_NATIVE_WINDOW);
          NS_ASSERTION(hwnd, "No window handle for window");
        }
      }
    }

    if (hwnd && SUCCEEDED(AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, IID_IAccessible,
                                              (void**)ppdispParent))) {
      return S_OK;
    }
  }

  nsCOMPtr<nsIAccessible> xpParentAccessible;
  GetParent(getter_AddRefs(xpParentAccessible));
  NS_ASSERTION(xpParentAccessible, "No parent accessible where we're not direct child of window");
  if (!xpParentAccessible) {
    return E_UNEXPECTED;
  }
  *ppdispParent = NativeAccessible(xpParentAccessible);

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accRole ( VARIANT  varChild,
VARIANT __RPC_FAR *  pvarRole 
) [virtual, inherited]

Definition at line 420 of file nsAccessibleWrap.cpp.

{
  VariantInit(pvarRole);

  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));

  if (!xpAccessible)
    return E_FAIL;

  PRUint32 role = 0;
  if (NS_FAILED(xpAccessible->GetFinalRole(&role)))
    return E_FAIL;

  // -- Try enumerated role
  if (role != ROLE_NOTHING && role != ROLE_CLIENT) {
    pvarRole->vt = VT_I4;
    pvarRole->lVal = role;  // Normal enumerated role
    return S_OK;
  }

  // -- Try BSTR role
  // Could not map to known enumerated MSAA role like ROLE_BUTTON
  // Use BSTR role to expose role attribute or tag name + namespace
  nsCOMPtr<nsIDOMNode> domNode;
  nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(xpAccessible));
  NS_ASSERTION(accessNode, "No accessnode for accessible");
  accessNode->GetDOMNode(getter_AddRefs(domNode));  
  nsIContent *content = GetRoleContent(domNode);
  NS_ASSERTION(content, "No content for accessible");
  if (content) {
    nsAutoString roleString;
    if (role != ROLE_CLIENT && GetRoleAttribute(content, roleString)) {
      content->GetAttr(kNameSpaceID_XHTML2_Unofficial, nsAccessibilityAtoms::role, roleString);
    }
    if (roleString.IsEmpty()) {
      nsINodeInfo *nodeInfo = content->GetNodeInfo();
      if (nodeInfo) {
        nodeInfo->GetName(roleString);
        nsAutoString nameSpaceURI;
        nodeInfo->GetNamespaceURI(nameSpaceURI);
        if (!nameSpaceURI.IsEmpty()) {
          // Only append name space if different from that of current document
          roleString += NS_LITERAL_STRING(", ") + nameSpaceURI;
        }
        if (!roleString.IsEmpty()) {
          pvarRole->vt = VT_BSTR;
          pvarRole->bstrVal = ::SysAllocString(roleString.get());
          return S_OK;
        }
      }
    }
  }
  return E_FAIL;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accSelection ( VARIANT __RPC_FAR *  pvarChildren) [virtual, inherited]

This method is called when a client wants to know which children of a node are selected.

Currently we only handle this for HTML selects, which are the only nsIAccessible objects to implement nsIAccessibleSelectable.

The VARIANT return value arguement is expected to either contain a single IAccessible or an IEnumVARIANT of IAccessibles. We return the IEnumVARIANT regardless of the number of options selected, unless there are none selected in which case we return an empty VARIANT.

The typedefs at the beginning set up the structure that will contain an array of the IAccessibles. It implements the IEnumVARIANT interface, allowing us to use it to return the IAccessibles in the VARIANT.

We get the selected options from the select's accessible object and then put create IAccessible objects for them and put those in the CComObject<EnumeratorType> object. Then we put the CComObject<EnumeratorType> object in the VARIANT and return.

returns a VT_EMPTY VARIANT if:

  • there are no options in the select
  • none of the options are selected
  • there is an error QIing to IEnumVARIANT
  • The object is not the type that can have children selected

Definition at line 596 of file nsAccessibleWrap.cpp.

{
  typedef VARIANT                      ItemType;              /* type of the object to be stored in container */
  typedef ItemType                     EnumeratorExposedType; /* the type of the item exposed by the enumerator interface */
  typedef IEnumVARIANT                 EnumeratorInterface;   /* a COM enumerator ( IEnumXXXXX ) interface */
  typedef _Copy<EnumeratorExposedType> EnumeratorCopyPolicy;  /* Copy policy class */
  typedef CComEnum<EnumeratorInterface,
                   &__uuidof(EnumeratorInterface),
                   EnumeratorExposedType,
                   EnumeratorCopyPolicy > EnumeratorType;

  IEnumVARIANT* pUnk = NULL;
  CComObject<EnumeratorType>* pEnum = NULL;
  VariantInit(pvarChildren);
  pvarChildren->vt = VT_EMPTY;

  nsCOMPtr<nsIAccessibleSelectable> select;
  nsAccessNode::QueryInterface(NS_GET_IID(nsIAccessibleSelectable), getter_AddRefs(select));

  if (select) {  // do we have an nsIAccessibleSelectable?
    // we have an accessible that can have children selected
    nsCOMPtr<nsIArray> selectedOptions;
    // gets the selected options as nsIAccessibles.
    select->GetSelectedChildren(getter_AddRefs(selectedOptions));
    if (selectedOptions) { // false if the select has no children or none are selected
      PRUint32 length;
      selectedOptions->GetLength(&length);
      CComVariant* optionArray = new CComVariant[length]; // needs to be a CComVariant to go into the EnumeratorType object

      // 1) Populate an array to store in the enumeration
      for (PRUint32 i = 0 ; i < length ; i++) {
        nsCOMPtr<nsIAccessible> tempAccess;
        selectedOptions->QueryElementAt(i, NS_GET_IID(nsIAccessible), 
                                        getter_AddRefs(tempAccess));
        if (tempAccess) {
          optionArray[i] = NativeAccessible(tempAccess);
        }
      }

      // 2) Create and initialize the enumeration
      HRESULT hr = CComObject<EnumeratorType>::CreateInstance(&pEnum);
      pEnum->Init(&optionArray[0], &optionArray[length], NULL, AtlFlagCopy);
      pEnum->QueryInterface(IID_IEnumVARIANT, reinterpret_cast<void**>(&pUnk));
      delete [] optionArray; // clean up, the Init call copies the data (AtlFlagCopy)

      // 3) Put the enumerator in the VARIANT
      if (!pUnk)
        return NS_ERROR_FAILURE;
      pvarChildren->vt = VT_UNKNOWN;    // this must be VT_UNKNOWN for an IEnumVARIANT
      pvarChildren->punkVal = pUnk;
    }
  }
  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accState ( VARIANT  varChild,
VARIANT __RPC_FAR *  pvarState 
) [virtual, inherited]

Definition at line 478 of file nsAccessibleWrap.cpp.

{
  VariantInit(pvarState);
  pvarState->vt = VT_I4;
  pvarState->lVal = 0;

  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));
  if (!xpAccessible)
    return E_FAIL;

  PRUint32 state;
  if (NS_FAILED(xpAccessible->GetFinalState(&state)))
    return E_FAIL;

  pvarState->lVal = state;

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessibleWrap::get_accValue ( VARIANT  varChild,
BSTR __RPC_FAR *  pszValue 
) [virtual, inherited]

Definition at line 282 of file nsAccessibleWrap.cpp.

{
  *pszValue = NULL;
  nsCOMPtr<nsIAccessible> xpAccessible;
  GetXPAccessibleFor(varChild, getter_AddRefs(xpAccessible));
  if (xpAccessible) {
    nsAutoString value;
    if (NS_FAILED(xpAccessible->GetFinalValue(value)))
      return S_FALSE;

    *pszValue = ::SysAllocString(value.get());
  }

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_attributes ( unsigned short  maxAttribs,
BSTR __RPC_FAR *  attribNames,
short __RPC_FAR *  nameSpaceID,
BSTR __RPC_FAR *  attribValues,
unsigned short __RPC_FAR *  numAttribs 
) [virtual, inherited]

Definition at line 175 of file nsAccessNodeWrap.cpp.

{
  *aNumAttribs = 0;

  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
  if (!content) 
    return E_FAIL;

  PRUint32 numAttribs = content->GetAttrCount();

  if (numAttribs > aMaxAttribs)
    numAttribs = aMaxAttribs;
  *aNumAttribs = NS_STATIC_CAST(unsigned short, numAttribs);

  PRInt32 nameSpaceID;
  nsCOMPtr<nsIAtom> nameAtom, prefixAtom;

  for (PRUint32 index = 0; index < numAttribs; index++) {
    aNameSpaceIDs[index] = 0; aAttribValues[index] = aAttribNames[index] = nsnull;
    nsAutoString attributeValue;
    const char *pszAttributeName; 

    if (NS_SUCCEEDED(content->GetAttrNameAt(index, &nameSpaceID, getter_AddRefs(nameAtom), getter_AddRefs(prefixAtom)))) {
      aNameSpaceIDs[index] = NS_STATIC_CAST(short, nameSpaceID);
      nameAtom->GetUTF8String(&pszAttributeName);
      aAttribNames[index] = ::SysAllocString(NS_ConvertUTF8toUCS2(pszAttributeName).get());
      if (NS_SUCCEEDED(content->GetAttr(nameSpaceID, nameAtom, attributeValue))) 
        aAttribValues[index] = ::SysAllocString(attributeValue.get());
    }
  }

  return S_OK; 
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_attributesForNames ( unsigned short  maxAttribs,
BSTR __RPC_FAR *  attribNames,
short __RPC_FAR *  nameSpaceID,
BSTR __RPC_FAR *  attribValues 
) [virtual, inherited]

Definition at line 215 of file nsAccessNodeWrap.cpp.

{
  nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(mDOMNode));
  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));

  if (!domElement || !content) 
    return E_FAIL;

  if (!content->GetDocument())
    return E_FAIL;

  nsCOMPtr<nsINameSpaceManager> nameSpaceManager =
    do_GetService(NS_NAMESPACEMANAGER_CONTRACTID);

  PRInt32 index;

  for (index = 0; index < aNumAttribs; index++) {
    aAttribValues[index] = nsnull;
    if (aAttribNames[index]) {
      nsAutoString attributeValue, nameSpaceURI;
      nsAutoString attributeName(nsDependentString(NS_STATIC_CAST(PRUnichar*,aAttribNames[index])));
      nsresult rv;

      if (aNameSpaceID[index]>0 && 
        NS_SUCCEEDED(nameSpaceManager->GetNameSpaceURI(aNameSpaceID[index], nameSpaceURI)))
          rv = domElement->GetAttributeNS(nameSpaceURI, attributeName, attributeValue);
      else 
        rv = domElement->GetAttribute(attributeName, attributeValue);

      if (NS_SUCCEEDED(rv))
        aAttribValues[index] = ::SysAllocString(attributeValue.get());
    }
  }

  return S_OK; 
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_childAt ( unsigned  childIndex,
ISimpleDOMNode __RPC_FAR *__RPC_FAR *  node 
) [virtual, inherited]

Definition at line 483 of file nsAccessNodeWrap.cpp.

{
  *aNode = nsnull;

  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
  if (!content)
    return E_FAIL;  // Node already shut down

  nsCOMPtr<nsIDOMNode> node =
    do_QueryInterface(content->GetChildAt(aChildIndex));

  if (!node)
    return E_FAIL; // No such child

  *aNode = MakeAccessNode(node);

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_computedStyle ( unsigned short  maxStyleProperties,
boolean  useAlternateView,
BSTR __RPC_FAR *  styleProperties,
BSTR __RPC_FAR *  styleValues,
unsigned short __RPC_FAR *  numStyleProperties 
) [virtual, inherited]

Definition at line 293 of file nsAccessNodeWrap.cpp.

{
  if (!mDOMNode)
    return E_FAIL;
 
  *aNumStyleProperties = 0;
  PRUint32 length;
  nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
  if (NS_FAILED(GetComputedStyleDeclaration(getter_AddRefs(cssDecl), &length)))
    return E_FAIL;

  PRUint32 index, realIndex;
  for (index = realIndex = 0; index < length && realIndex < aMaxStyleProperties; index ++) {
    nsAutoString property, value;
    if (NS_SUCCEEDED(cssDecl->Item(index, property)) && property.CharAt(0) != '-')  // Ignore -moz-* properties
      cssDecl->GetPropertyValue(property, value);  // Get property value
    if (!value.IsEmpty()) {
      aStyleProperties[realIndex] =   ::SysAllocString(property.get());
      aStyleValues[realIndex]     =   ::SysAllocString(value.get());
      ++realIndex;
    }
  }
  *aNumStyleProperties = NS_STATIC_CAST(unsigned short, realIndex);

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_computedStyleForProperties ( unsigned short  numStyleProperties,
boolean  useAlternateView,
BSTR __RPC_FAR *  styleProperties,
BSTR __RPC_FAR *  styleValues 
) [virtual, inherited]

Definition at line 326 of file nsAccessNodeWrap.cpp.

{
  if (!mDOMNode)
    return E_FAIL;
 
  PRUint32 length = 0;
  nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
  nsresult rv = GetComputedStyleDeclaration(getter_AddRefs(cssDecl), &length);
  if (NS_FAILED(rv))
    return E_FAIL;

  PRUint32 index;
  for (index = 0; index < aNumStyleProperties; index ++) {
    nsAutoString value;
    if (aStyleProperties[index])
      cssDecl->GetPropertyValue(nsDependentString(NS_STATIC_CAST(PRUnichar*,aStyleProperties[index])), value);  // Get property value
    aStyleValues[index] = ::SysAllocString(value.get());
  }

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_firstChild ( ISimpleDOMNode __RPC_FAR *__RPC_FAR *  node) [virtual, inherited]

Definition at line 434 of file nsAccessNodeWrap.cpp.

{
  if (!mDOMNode)
    return E_FAIL;
 
  nsCOMPtr<nsIDOMNode> node;
  mDOMNode->GetFirstChild(getter_AddRefs(node));
  *aNode = MakeAccessNode(node);

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_innerHTML ( BSTR __RPC_FAR *  innerHTML) [virtual, inherited]

Definition at line 504 of file nsAccessNodeWrap.cpp.

{
  *aInnerHTML = nsnull;

  nsCOMPtr<nsIDOMNSHTMLElement> domNSElement(do_QueryInterface(mDOMNode));
  if (!domNSElement)
    return E_FAIL; // Node already shut down

  nsAutoString innerHTML;
  domNSElement->GetInnerHTML(innerHTML);
  *aInnerHTML = ::SysAllocString(innerHTML.get());

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_language ( BSTR __RPC_FAR *  language) [virtual, inherited]

Definition at line 520 of file nsAccessNodeWrap.cpp.

{
  *aLanguage = nsnull;
  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
  if (!content) {
    return E_FAIL;
  }

  nsAutoString language;
  for (nsIContent *walkUp = content; walkUp = walkUp->GetParent(); walkUp) {
    if (NS_CONTENT_ATTR_HAS_VALUE ==
        walkUp->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::lang, language)) {
      break;
    }
  }

  if (language.IsEmpty()) { // Nothing found, so use document's language
    nsIDocument *doc = content->GetOwnerDoc();
    if (doc) {
      doc->GetHeaderData(nsAccessibilityAtoms::headerContentLanguage, language);
    }
  }
 
  *aLanguage = ::SysAllocString(language.get());
  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_lastChild ( ISimpleDOMNode __RPC_FAR *__RPC_FAR *  node) [virtual, inherited]

Definition at line 446 of file nsAccessNodeWrap.cpp.

{
  if (!mDOMNode)
    return E_FAIL;

  nsCOMPtr<nsIDOMNode> node;
  mDOMNode->GetLastChild(getter_AddRefs(node));
  *aNode = MakeAccessNode(node);

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_localInterface ( void __RPC_FAR *__RPC_FAR *  localInterface) [virtual, inherited]

Definition at line 548 of file nsAccessNodeWrap.cpp.

STDMETHODIMP nsAccessNodeWrap::get_nextSibling ( ISimpleDOMNode __RPC_FAR *__RPC_FAR *  node) [virtual, inherited]

Definition at line 470 of file nsAccessNodeWrap.cpp.

{
  if (!mDOMNode)
    return E_FAIL;

  nsCOMPtr<nsIDOMNode> node;
  mDOMNode->GetNextSibling(getter_AddRefs(node));
  *aNode = MakeAccessNode(node);

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_nodeInfo ( BSTR __RPC_FAR *  tagName,
short __RPC_FAR *  nameSpaceID,
BSTR __RPC_FAR *  nodeValue,
unsigned int __RPC_FAR *  numChildren,
unsigned int __RPC_FAR *  aUniqueID,
unsigned short __RPC_FAR *  nodeType 
) [virtual, inherited]

Definition at line 125 of file nsAccessNodeWrap.cpp.

{
  if (!mDOMNode)
    return E_FAIL;
 
  *aNodeName = nsnull;
  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));

  PRUint16 nodeType = 0;
  mDOMNode->GetNodeType(&nodeType);
  *aNodeType=NS_STATIC_CAST(unsigned short, nodeType);

  if (*aNodeType !=  NODETYPE_TEXT) {
    nsAutoString nodeName;
    mDOMNode->GetNodeName(nodeName);
    *aNodeName =   ::SysAllocString(nodeName.get());
  }

  nsAutoString nodeValue;

  mDOMNode->GetNodeValue(nodeValue);
  *aNodeValue = ::SysAllocString(nodeValue.get());
  *aNameSpaceID = content ? NS_STATIC_CAST(short, content->GetNameSpaceID()) : 0;

  // This is a unique ID for every content node.  The 3rd party
  // accessibility application can compare this to the childID we
  // return for events such as focus events, to correlate back to
  // data nodes in their internal object model.
  void *uniqueID;
  GetUniqueID(&uniqueID);
  *aUniqueID = - NS_PTR_TO_INT32(uniqueID);

  *aNumChildren = 0;
  PRUint32 numChildren = 0;
  nsCOMPtr<nsIDOMNodeList> nodeList;
  mDOMNode->GetChildNodes(getter_AddRefs(nodeList));
  if (nodeList && NS_OK == nodeList->GetLength(&numChildren))
    *aNumChildren = NS_STATIC_CAST(unsigned int, numChildren);

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_parentNode ( ISimpleDOMNode __RPC_FAR *__RPC_FAR *  node) [virtual, inherited]

Definition at line 422 of file nsAccessNodeWrap.cpp.

{
  if (!mDOMNode)
    return E_FAIL;
 
  nsCOMPtr<nsIDOMNode> node;
  mDOMNode->GetParentNode(getter_AddRefs(node));
  *aNode = MakeAccessNode(node);

  return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsAccessNodeWrap::get_previousSibling ( ISimpleDOMNode __RPC_FAR *__RPC_FAR *  node) [virtual, inherited]

Definition at line 458 of file nsAccessNodeWrap.cpp.

{
  if (!mDOMNode)
    return E_FAIL;

  nsCOMPtr<nsIDOMNode> node;
  mDOMNode->GetPreviousSibling(getter_AddRefs(node));
  *aNode = MakeAccessNode(node);

  return S_OK;
}

Here is the call graph for this function:

Accessible node geometrically above this one.

Accessible node geometrically below this one.

void nsAccessNodeWrap::GetAccessibleFor ( nsIDOMNode node,
nsIAccessible **  newAcc 
) [protected, inherited]

Returns the first accessible parent of a DOM node.

Guaranteed not to return nsnull if the DOM node is in a document.

Parameters:
aDOMNodeThe DOM node we need an accessible for.
Returns:
An first nsIAccessible found by crawling up the DOM node to the document root.
nsIAccessible nsIAccessible::getAccessibleRelated ( in unsigned long  aRelationType) [inherited]

Accessible node related to this one.

Accessible node geometrically to the left of this one.

Accessible node geometrically to the right of this one.

AString nsIAccessible::getActionName ( in PRUint8  index) [inherited]

The name of the accessible action at the given zero-based index.

AtkObject * nsAccessibleWrap::GetAtkObject ( void  ) [inherited]

Definition at line 251 of file nsAccessibleWrap.cpp.

{
    void *atkObj = nsnull;
    GetNativeInterface(&atkObj);
    return NS_STATIC_CAST(AtkObject *, atkObj);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIAccessible::getBounds ( out long  x,
out long  y,
out long  width,
out long  height 
) [inherited]
nsIFrame * nsAccessible::GetBoundsFrame ( ) [protected, virtual, inherited]

Reimplemented in nsHTMLSelectOptionAccessible, and nsXULSelectOptionAccessible.

Definition at line 1087 of file nsAccessible.cpp.

{
  return GetFrame();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsDocAccessible::GetBoundsRect ( nsRect aRect,
nsIFrame **  aRelativeFrame 
) [protected, virtual]

Reimplemented from nsAccessible.

Definition at line 501 of file nsDocAccessible.cpp.

{
  *aRelativeFrame = GetFrame();

  nsIDocument *document = mDocument;
  nsIDocument *parentDoc = nsnull;

  while (document) {
    nsIPresShell *presShell = document->GetShellAt(0);
    if (!presShell) {
      return;
    }
    nsIViewManager* vm = presShell->GetViewManager();
    if (!vm) {
      return;
    }

    nsIScrollableView* scrollableView = nsnull;
    vm->GetRootScrollableView(&scrollableView);

    nsRect viewBounds(0, 0, 0, 0);
    if (scrollableView) {
      viewBounds = scrollableView->View()->GetBounds();
    }
    else {
      nsIView *view;
      vm->GetRootView(view);
      if (view) {
        viewBounds = view->GetBounds();
      }
    }

    if (parentDoc) {  // After first time thru loop
      aBounds.IntersectRect(viewBounds, aBounds);
    }
    else {  // First time through loop
      aBounds = viewBounds;
    }

    document = parentDoc = document->GetParentDocument();
  }
}

Here is the call graph for this function:

nsIAccessNode nsIAccessibleDocument::getCachedAccessNode ( in voidPtr  aUniqueID) [inherited]

Returns the access node cached by this document.

Parameters:
aUniqueIDThe unique ID used to cache the node. This matches up with the uniqueID attribute on nsIAccessNode.
Returns:
The nsIAccessNode cached for this particular unique ID.
void nsAccessNode::GetCacheEntry ( nsInterfaceHashtable< nsVoidHashKey, nsIAccessNode > &  aCache,
void aUniqueID,
nsIAccessNode **  aAccessNode 
) [static, inherited]

Definition at line 520 of file nsAccessNode.cpp.

{
  aCache.Get(aUniqueID, aAccessNode);  // AddRefs for us
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIAccessible nsIAccessible::getChildAt ( in long  aChildIndex) [inherited]

Nth accessible child using zero-based index or last child if index less than zero.

Definition at line 64 of file nsBaseWidgetAccessible.cpp.

{
  *aChildAtPoint = nsnull;
  nsCOMPtr<nsIAccessible> childAtPoint;

  // We're going to find the child that contains coordinates (tx,ty)
  PRInt32 x,y,w,h;
  GetBounds(&x,&y,&w,&h);  // Get bounds for this accessible
  if (tx >= x && tx < x + w && ty >= y && ty < y + h)
  {
    // It's within this nsIAccessible, let's drill down
    nsCOMPtr<nsIAccessible> child;
    nsCOMPtr<nsIAccessible> next;
    GetFirstChild(getter_AddRefs(child));
    PRInt32 cx,cy,cw,ch;  // Child bounds

    while(child) {
      child->GetBounds(&cx,&cy,&cw,&ch);
      
      // if there are multiple accessibles the contain the point 
      // and they overlap then pick the one with a frame that contans the point
      
      // For example, A point that's in block #2 is also in block #1, but we want to return #2:
      // [[block #1 is long wrapped text that continues to
      // another line]]  [[here is a shorter block #2]]

      if (tx >= cx && tx < cx + cw && ty >= cy && ty < cy + ch) 
      {
        // See whether one of the frames for this accessible
        // contains this screen point
        if (!childAtPoint) {
          // Default in case accessible doesn't have a frame such as
          // tree items or combo box dropdown markers
          childAtPoint = child;
        }
        nsCOMPtr<nsPIAccessNode> accessNode(do_QueryInterface(child));
        if (accessNode) {
          nsIFrame *frame = accessNode->GetFrame();
          while (frame) {
            if (frame->GetScreenRectExternal().Contains(tx, ty)) {
              childAtPoint = child;
              break; // Definitely in this accessible, since one of its frame matches the point
            }
            frame = frame->GetNextInFlow();
          }
        }
      }
      child->GetNextSibling(getter_AddRefs(next));
      child = next;
    }

    *aChildAtPoint = childAtPoint ? childAtPoint : this;
    NS_ADDREF(*aChildAtPoint);
  }

  return NS_OK;
}

Here is the call graph for this function:

Accessible child which contains the coordinate at x,y.

Get the nth child of this node.

Parameters:
childNumZero-based child index
Returns:
The nth nsIAccessNode child
CLSID nsAccessibleWrap::GetClassID ( ) const [inherited]
NS_IMETHODIMP nsAccessNodeWrap::GetComputedStyleDeclaration ( nsIDOMCSSStyleDeclaration **  aCssDecl,
PRUint32 aLength 
) [protected, inherited]

Definition at line 257 of file nsAccessNodeWrap.cpp.

{
  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
  if (!content) 
    return NS_ERROR_FAILURE;   

  if (content->IsContentOfType(nsIContent::eTEXT)) {
    content = content->GetParent();
    NS_ASSERTION(content, "No parent for text node");
  }

  nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(content));
  nsCOMPtr<nsIDocument> doc = content->GetDocument();

  if (!domElement || !doc) {
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsIDOMViewCSS> viewCSS(do_QueryInterface(doc->GetScriptGlobalObject()));

  if (!viewCSS)
    return NS_ERROR_FAILURE;   

  nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
  nsAutoString empty;
  viewCSS->GetComputedStyle(domElement, empty, getter_AddRefs(cssDecl));
  if (cssDecl) {
    *aCssDecl = cssDecl;
    NS_ADDREF(*aCssDecl);
    cssDecl->GetLength(aLength);
    return NS_OK;
  }
  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

DOMString nsIAccessNode::getComputedStyleValue ( in DOMString  pseudoElt,
in DOMString  propertyName 
) [inherited]

Retrieve the computed style value for this DOM node, if it is a DOM element.

Note: the meanings of width, height and other size measurements depend on the version of CSS being used. Therefore, for bounds information, it is better to use nsIAccessible::accGetBounds.

Parameters:
pseudoEltThe pseudo element to retrieve style for, or NULL for general computed style information for this node.
propertyNameRetrieve the computed style value for this property name, for example "border-bottom".
nsIContent * nsAccessible::GetContentPointingTo ( const nsAString *  aId,
nsIContent aLookContent,
nsIAtom forAttrib,
PRUint32  aForAttribNamespace = kNameSpaceID_None,
nsIAtom aTagType = nsAccessibilityAtoms::label 
) [static, protected, inherited]

Definition at line 1577 of file nsAccessible.cpp.

{
  if (!aTagType || aLookContent->Tag() == aTagType) {
    if (aForAttrib) {
      nsAutoString labelIsFor;
      aLookContent->GetAttr(aForAttribNameSpace, aForAttrib, labelIsFor);
      if (labelIsFor.Equals(*aId)) {
        return aLookContent;
      }
    }
    if (aTagType) {
      return nsnull;
    }
  }

  // Recursively search descendents for labels
  PRUint32 count  = 0;
  nsIContent *child;

  while ((child = aLookContent->GetChildAt(count++)) != nsnull) {
    nsIContent *labelContent = GetContentPointingTo(aId, child, aForAttrib,
                                                    aForAttribNameSpace, aTagType);
    if (labelContent) {
      return labelContent;
    }
  }
  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsAccessibleWrap::GetDescription ( nsAString &  aDescription) [inherited]

Reimplemented in nsHTMLComboboxAccessible, nsXULComboboxAccessible, nsAppRootAccessible, nsXULTreeitemAccessibleWrap, nsHTMLAreaAccessible, and nsHTMLRadioButtonAccessibleWrap.

Definition at line 300 of file nsAccessibleWrap.cpp.

{
  // For items that are a choice in a list of choices, 
  // use MSAA description field to shoehorn positional info, it's becoming
  // a defacto standard use for the field.
  // Tree items override this, because they provide the current level as well

  aDescription.Truncate();
  PRUint32 currentRole;
  nsresult rv = GetFinalRole(&currentRole);
  if (NS_FAILED(rv) ||
      (currentRole != ROLE_LISTITEM && currentRole != ROLE_MENUITEM &&
       currentRole != ROLE_RADIOBUTTON && currentRole != ROLE_PAGETAB &&
       currentRole != ROLE_OUTLINEITEM)) {
    nsAutoString description;
    nsAccessible::GetDescription(description);
    if (!description.IsEmpty()) {
      // Signal to screen readers that this description is speakable
      // and is not a formatted positional information description
      // Don't localize the "Description: " part of this string, it will be 
      // parsed out by assistive technologies.
      aDescription = NS_LITERAL_STRING("Description: ") + description;
    }
    return NS_OK;
  }
  
  nsCOMPtr<nsIAccessible> parent;
  GetParent(getter_AddRefs(parent));
  if (!parent) {
    return NS_ERROR_FAILURE;
  }
  
  PRInt32 indexInParent = 0, numSiblings = 0;
  
  nsCOMPtr<nsIAccessible> sibling, nextSibling;
  parent->GetFirstChild(getter_AddRefs(sibling));
  NS_ENSURE_TRUE(sibling, NS_ERROR_FAILURE);
  
  PRBool foundCurrent = PR_FALSE;
  PRUint32 siblingRole;
  while (sibling) {
    sibling->GetFinalRole(&siblingRole);
    if (siblingRole == currentRole) {
      ++ numSiblings;
      if (!foundCurrent) {
        ++ indexInParent;
        if (sibling == this) {
          foundCurrent = PR_TRUE;        
        }
      }
    }
    sibling->GetNextSibling(getter_AddRefs(nextSibling));
    sibling = nextSibling;
  }
  
  // Don't localize the string "of" -- that's just the format of this string.
  // The AT will parse the relevant numbers out and add its own localization.
  if (currentRole == ROLE_OUTLINEITEM) {
    PRUint32 level = 1;
    nsCOMPtr<nsIAccessible> nextParent;
    while (parent) {
      parent->GetFinalRole(&currentRole);
      if (currentRole != ROLE_GROUPING) {
        break;
      }
      ++level;
      parent->GetParent(getter_AddRefs(nextParent));
      parent.swap(nextParent);
    }

    // Count the number of tree item children
    PRInt32 numChildren = 0;
    nsCOMPtr<nsIAccessible> groupSibling;
    GetNextSibling(getter_AddRefs(groupSibling));
    if (groupSibling) {
      groupSibling->GetFinalRole(&currentRole);
      if (currentRole == ROLE_GROUPING) {
        // Accessible that groups child tree items
        nsCOMPtr<nsIAccessible> child;
        groupSibling->GetFirstChild(getter_AddRefs(child));
        while (child) {
          child->GetFinalRole(&currentRole);
          numChildren += (currentRole == ROLE_OUTLINEITEM);
          nsCOMPtr<nsIAccessible> nextChild;
          child->GetNextSibling(getter_AddRefs(nextChild));
          child.swap(nextChild);
        }
      }
    }

    // This must be a DHTML tree item -- XUL tree items impl GetDescription()
    nsTextFormatter::ssprintf(aDescription,
                              NS_LITERAL_STRING("L%d, %d of %d with %d").get(),
                              level, indexInParent, numSiblings, numChildren);
  }
  else {
    nsTextFormatter::ssprintf(aDescription, NS_LITERAL_STRING("%d of %d").get(),
                              indexInParent, numSiblings);
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 245 of file nsAccessNode.cpp.

{
  return GetDocAccessibleFor(mWeakShell); // Addref'd
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 440 of file nsAccessNode.cpp.

{
  nsIAccessibleDocument *docAccessible = nsnull;
  nsCOMPtr<nsIAccessNode> accessNode;
  gGlobalDocAccessibleCache.Get(NS_STATIC_CAST(void*, aPresShell), getter_AddRefs(accessNode));
  if (accessNode) {
    CallQueryInterface(accessNode, &docAccessible);
  }
  return docAccessible;
}

Here is the call graph for this function:

Here is the caller graph for this function:

already_AddRefed< nsIAccessibleDocument > nsAccessNode::GetDocAccessibleFor ( nsISupports *  aContainer) [static, inherited]

Definition at line 452 of file nsAccessNode.cpp.

{
  nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aContainer));
  NS_ASSERTION(docShell, "This method currently only supports docshells");
  nsCOMPtr<nsIPresShell> presShell;
  docShell->GetPresShell(getter_AddRefs(presShell));
  nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(presShell));
  return weakShell ? GetDocAccessibleFor(weakShell) : nsnull;
}

Here is the call graph for this function:

Definition at line 463 of file nsAccessNode.cpp.

{
  nsCOMPtr<nsIPresShell> eventShell = GetPresShellFor(aNode);
  nsCOMPtr<nsIWeakReference> weakEventShell(do_GetWeakReference(eventShell));
  return weakEventShell? GetDocAccessibleFor(weakEventShell) : nsnull;
}

Here is the call graph for this function:

Definition at line 489 of file nsAccessNode.cpp.

{
  nsCOMPtr<nsIDOMDocument> domDoc;
  aStartNode->GetOwnerDocument(getter_AddRefs(domDoc));
  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
  if (!doc) {
    doc = do_QueryInterface(aStartNode);
  }
  NS_ASSERTION(doc, "No document for node passed in");
  NS_ENSURE_TRUE(doc, nsnull);
  nsCOMPtr<nsISupports> container = doc->GetContainer();
  nsIDocShellTreeItem *docShellTreeItem = nsnull;
  if (container) {
    CallQueryInterface(container, &docShellTreeItem);
  }

  return docShellTreeItem;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in nsXULTextFieldAccessible, nsHTMLTextFieldAccessible, nsXULTextFieldAccessibleWrap, nsRootAccessibleWrap, and nsHTMLTextFieldAccessibleWrap.

Definition at line 219 of file nsAccessibleWrap.cpp.

{
    PRUint32 state;
    nsAccessible::GetState(&state);
    if (!(state & STATE_INVISIBLE))
      *aState |= EXT_STATE_SHOWING;
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 234 of file nsDocAccessible.cpp.

{
  if (!gLastFocusedNode) {
    *aFocusedChild = nsnull;
    return NS_OK;
  }

  // Return an accessible for the current global focus, which does not have to
  // be contained within the current document.
  nsCOMPtr<nsIAccessibilityService> accService =
    do_GetService("@mozilla.org/accessibilityService;1");
  return accService->GetAccessibleFor(gLastFocusedNode, aFocusedChild);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAccessible::GetFullKeyName ( const nsAString &  aModifierName,
const nsAString &  aKeyName,
nsAString &  aStringOut 
) [static, protected, inherited]

Definition at line 705 of file nsAccessible.cpp.

{
  nsXPIDLString modifierName, separator;

  if (!gKeyStringBundle ||
      NS_FAILED(gKeyStringBundle->GetStringFromName(PromiseFlatString(aModifierName).get(), 
                                                    getter_Copies(modifierName))) ||
      NS_FAILED(gKeyStringBundle->GetStringFromName(PromiseFlatString(NS_LITERAL_STRING("MODIFIER_SEPARATOR")).get(), 
                                                    getter_Copies(separator)))) {
    return NS_ERROR_FAILURE;
  }

  aStringOut = modifierName + separator + aKeyName; 
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIContent * nsAccessible::GetHTMLLabelContent ( nsIContent aForNode) [static, protected, inherited]

Definition at line 1489 of file nsAccessible.cpp.

{
  nsIContent *walkUpContent = aForNode;

  // go up tree get name of ancestor label if there is one. Don't go up farther than form element
  while ((walkUpContent = walkUpContent->GetParent()) != nsnull) {
    nsIAtom *tag = walkUpContent->Tag();
    if (tag == nsAccessibilityAtoms::label) {
      return walkUpContent;
    }
    if (tag == nsAccessibilityAtoms::form ||
        tag == nsAccessibilityAtoms::body) {
      // Reached top ancestor in form
      // There can be a label targeted at this control using the 
      // for="control_id" attribute. To save computing time, only 
      // look for those inside of a form element
      nsAutoString forId;
      aForNode->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::id, forId);
      // Actually we'll be walking down the content this time, with a depth first search
      if (forId.IsEmpty()) {
        break;
      }
      return GetContentPointingTo(&forId, walkUpContent, nsAccessibilityAtoms::_for); 
    }
  }

  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAccessible::GetHTMLName ( nsAString &  aLabel,
PRBool  aCanAggregateSubtree = PR_TRUE 
) [protected, inherited]

Only called if the element is not a nsIDOMXULControlElement.

Initially walks up the DOM tree to the form, concatonating label elements as it goes. Then checks for labels with the for="controlID" property.

Definition at line 1615 of file nsAccessible.cpp.

{
  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
  if (!content) {
    return NS_ERROR_FAILURE;   // Node shut down
  }

  // Check for DHTML accessibility labelledby relationship property
  nsAutoString label;
  nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::labelledby, label);
  if (NS_SUCCEEDED(rv)) {
    aLabel = label;
    return rv;
  }

  nsIContent *labelContent = GetHTMLLabelContent(content);
  if (labelContent) {
    AppendFlatStringFromSubtree(labelContent, &label);
    label.CompressWhitespace();
    if (!label.IsEmpty()) {
      aLabel = label;
      return NS_OK;
    }
  }

  if (aCanAggregateSubtree) {
    // Don't use AppendFlatStringFromSubtree for container widgets like menulist
    nsresult rv = AppendFlatStringFromSubtree(content, &aLabel);
    if (NS_SUCCEEDED(rv)) {
      return NS_OK;
    }
  }

  // Still try the title as as fallback method in that case.
  if (NS_CONTENT_ATTR_NOT_THERE ==
      content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::title, aLabel)) {
    aLabel.SetIsVoid(PR_TRUE);
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

STDMETHODIMP nsAccessibleWrap::GetIDsOfNames ( REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
) [inherited]

Definition at line 993 of file nsAccessibleWrap.cpp.

{
  return E_NOTIMPL;
}
already_AddRefed< nsIDOMNode > nsAccessible::GetInverseRelatedNode ( nsIAtom aRelationAttr,
PRUint32  aAncestorLevelsToSearch = 0 
) [protected, inherited]

Definition at line 2067 of file nsAccessible.cpp.

{
  // aAncestorLevelsToSearch is an optimization used for label and description searches.
  // We expect the control to be relatively near the label/description in the DOM tree,
  // so to optimize we don't search the entire DOM tree.
  nsIContent *content = GetRoleContent(mDOMNode);
  if (!content) {
    return nsnull; // Node shut down
  }
  nsAutoString controlID;
  content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::id, controlID);
  if (controlID.IsEmpty()) {
    return nsnull;
  }
  nsIDOMNode *relatedNode = nsnull;
  // Something might be pointing to us
  PRUint32 count = 0;
  nsIContent *start = content;
  while ((!aAncestorLevelsToSearch || ++count <= aAncestorLevelsToSearch) && 
        (start = start->GetParent()) != nsnull) {
    nsIContent *description = GetContentPointingTo(&controlID, start,
                                                   aRelationAttr,
                                                   kNameSpaceID_WAIProperties,
                                                   nsnull);
    if (description) {
      nsIDOMNode *relatedNode;
      CallQueryInterface(description, &relatedNode);
      return relatedNode;
    }
  }
  return nsnull;
}

Here is the call graph for this function:

nsIContent * nsAccessible::GetLabelContent ( nsIContent aForNode) [static, protected, inherited]

Definition at line 1446 of file nsAccessible.cpp.

{
  return aForNode->IsContentOfType(nsIContent::eXUL) ? GetXULLabelContent(aForNode) :
                                                       GetHTMLLabelContent(aForNode);
}

Here is the call graph for this function:

Definition at line 397 of file nsAccessibleWrap.cpp.

{
    NS_ENSURE_TRUE(aIfaceType > MAI_INTERFACE_INVALID, nsnull);
    NS_ENSURE_TRUE(aIfaceType < MAI_INTERFACE_NUM, nsnull);
    return mInterfaces[aIfaceType];
}

Here is the caller graph for this function:

already_AddRefed< nsIAccessible > nsAccessible::GetMultiSelectFor ( nsIDOMNode aNode) [static, protected, inherited]

Definition at line 1093 of file nsAccessible.cpp.

{
  NS_ENSURE_TRUE(aNode, nsnull);
  nsCOMPtr<nsIAccessibilityService> accService =
    do_GetService("@mozilla.org/accessibilityService;1");
  NS_ENSURE_TRUE(accService, nsnull);
  nsCOMPtr<nsIAccessible> accessible;
  accService->GetAccessibleFor(aNode, getter_AddRefs(accessible));
  if (!accessible) {
    return nsnull;
  }

  PRUint32 state;
  accessible->GetFinalState(&state);
  if (0 == (state & STATE_SELECTABLE)) {
    return nsnull;
  }

  PRUint32 containerRole;
  while (0 == (state & STATE_MULTISELECTABLE)) {
    nsIAccessible *current = accessible;
    current->GetParent(getter_AddRefs(accessible));
    if (!accessible || (NS_SUCCEEDED(accessible->GetFinalRole(&containerRole)) &&
                        containerRole == ROLE_PANE)) {
      return nsnull;
    }
    accessible->GetFinalState(&state);
  }
  nsIAccessible *returnAccessible = nsnull;
  accessible.swap(returnAccessible);
  return returnAccessible;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsDocAccessible::GetName ( nsAString &  aName)

Reimplemented in nsRootAccessible.

Definition at line 142 of file nsDocAccessible.cpp.

{ 
  nsresult rv = NS_OK;
  aName.Truncate();
  if (mRoleMapEntry) {
    rv = nsAccessible::GetName(aName);
  }
  if (aName.IsEmpty()) {
    rv = GetTitle(aName);
  }
  if (aName.IsEmpty() && mParent) {
    rv = mParent->GetName(aName);
  }

  return rv;
}

Here is the caller graph for this function:

AString nsIAccessibleDocument::getNameSpaceURIForID ( in short  nameSpaceID) [inherited]

The namespace for each ID that is handed back.

NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface ( void **  aOutAccessible) [inherited]

Reimplemented in nsAppRootAccessible.

Definition at line 228 of file nsAccessibleWrap.cpp.

{
    *aOutAccessible = nsnull;

    if (!mMaiAtkObject) {
        CreateMaiInterfaces();
        GType type = GetMaiAtkType(mInterfaceCount, mInterfaces);
        NS_ENSURE_TRUE(type, NS_ERROR_FAILURE);
        mMaiAtkObject =
            NS_REINTERPRET_CAST(AtkObject *,
                                g_object_new(type, NULL));
        NS_ENSURE_TRUE(mMaiAtkObject, NS_ERROR_OUT_OF_MEMORY);

        atk_object_initialize(mMaiAtkObject, this);
        mMaiAtkObject->role = ATK_ROLE_INVALID;
        mMaiAtkObject->layer = ATK_LAYER_INVALID;
    }

    *aOutAccessible = mMaiAtkObject;
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD nsAccessibleWrap::GetNativeInterface ( void **  aOutAccessible) [inherited]

Reimplemented in nsAppRootAccessible.

void nsIAccessible::getNativeInterface ( out voidPtr  aOutAccessible) [inherited]

Get a pointer to accessibility interface for this node, which is specific to the OS/accessibility toolkit we're running on.

already_AddRefed< nsIAccessible > nsAccessible::GetNextWithState ( nsIAccessible aStart,
PRUint32  matchState 
) [protected, inherited]

Definition at line 2383 of file nsAccessible.cpp.

{
  // Return the next descendant that matches one of the states in matchState
  // Uses depth first search
  NS_ASSERTION(matchState, "GetNextWithState() not called with a state to match");
  NS_ASSERTION(aStart, "GetNextWithState() not called with an accessible to start with");
  nsCOMPtr<nsIAccessible> look, current = aStart;
  PRUint32 state = 0;
  while (0 == (state & matchState)) {
    current->GetFirstChild(getter_AddRefs(look));
    while (!look) {
      if (current == this) {
        return nsnull; // At top of subtree
      }
      current->GetNextSibling(getter_AddRefs(look));
      if (!look) {
        current->GetParent(getter_AddRefs(look));
        current.swap(look);
        continue;
      }
    }
    current.swap(look);
    current->GetFinalState(&state);
  }

  nsIAccessible *returnAccessible = nsnull;
  current.swap(returnAccessible);

  return returnAccessible;
}

Here is the call graph for this function:

Reimplemented in nsRootAccessible, and nsRootAccessibleWrap.

Definition at line 413 of file nsDocAccessible.cpp.

{
  // Hook up our new accessible with our parent
  if (!mParent) {
    nsIDocument *parentDoc = mDocument->GetParentDocument();
    if (parentDoc) {
      nsIContent *ownerContent = parentDoc->FindContentForSubDocument(mDocument);
      nsCOMPtr<nsIDOMNode> ownerNode(do_QueryInterface(ownerContent));
      if (ownerNode) {
        nsCOMPtr<nsIAccessibilityService> accService = 
          do_GetService("@mozilla.org/accessibilityService;1");
        if (accService) {
          // XXX aaronl: ideally we would traverse the presshell chain
          // Since there's no easy way to do that, we cheat and use
          // the document hierarchy. GetAccessibleFor() is bad because
          // it doesn't support our concept of multiple presshells per doc.
          // It should be changed to use GetAccessibleInWeakShell()
          accService->GetAccessibleFor(ownerNode, getter_AddRefs(mParent));
        }
      }
    }
  }
  return mParent ? nsAccessible::GetParent(aParent) : NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsPresContext * nsAccessNode::GetPresContext ( ) [protected, inherited]

Definition at line 236 of file nsAccessNode.cpp.

{
  nsCOMPtr<nsIPresShell> presShell(GetPresShell());
  if (!presShell) {
    return nsnull;
  }
  return presShell->GetPresContext();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 219 of file nsAccessNode.cpp.

{
  nsIPresShell *presShell = nsnull;
  if (mWeakShell)
    CallQueryReferent(mWeakShell.get(), &presShell);
  if (!presShell) {
    if (mWeakShell) {
      // If our pres shell has died, but we're still holding onto
      // a weak reference, our accessibles are no longer relevant
      // and should be shut down
      Shutdown();
    }
    return nsnull;
  }
  return presShell;
}

Here is the call graph for this function:

Here is the caller graph for this function:

already_AddRefed< nsIPresShell > nsAccessNode::GetPresShellFor ( nsIDOMNode aStartNode) [static, inherited]

Definition at line 471 of file nsAccessNode.cpp.

{
  nsCOMPtr<nsIDOMDocument> domDocument;
  aNode->GetOwnerDocument(getter_AddRefs(domDocument));
  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDocument));
  if (!doc) {   // This is necessary when the node is the document node
    doc = do_QueryInterface(aNode);
  }
  nsIPresShell *presShell = nsnull;
  if (doc) {
    presShell = doc->GetShellAt(0);
    NS_IF_ADDREF(presShell);
  }
  return presShell;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in nsRootAccessible, nsDocAccessibleWrap, and nsRootAccessibleWrap.

Definition at line 159 of file nsDocAccessible.cpp.

{
  *aRole = ROLE_PANE; // Fall back

  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
    GetDocShellTreeItemFor(mDOMNode);
  if (docShellTreeItem) {
    nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
    docShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
    if (sameTypeRoot == docShellTreeItem) {
      // Root of content or chrome tree
      PRInt32 itemType;
      docShellTreeItem->GetItemType(&itemType);
      if (itemType == nsIDocShellTreeItem::typeChrome) {
        *aRole = ROLE_APPLICATION;
      }
      else if (itemType == nsIDocShellTreeItem::typeContent) {
#ifdef MOZ_XUL
        nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
        *aRole = xulDoc ? ROLE_APPLICATION : ROLE_DOCUMENT;
#else
        *aRole = ROLE_DOCUMENT;
#endif
      }
    }
  }
  
  return NS_OK;
}

Here is the call graph for this function:

static PRBool nsAccessNode::GetRoleAttribute ( nsIContent aContent,
nsAString &  aRole 
) [inline, static, inherited]

Definition at line 135 of file nsAccessNode.h.

    {
      aRole.Truncate();
      return (aContent->IsContentOfType(nsIContent::eHTML) && aContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::role, aRole) != NS_CONTENT_ATTR_NOT_THERE) ||
              aContent->GetAttr(kNameSpaceID_XHTML, nsAccessibilityAtoms::role, aRole) != NS_CONTENT_ATTR_NOT_THERE ||
              aContent->GetAttr(kNameSpaceID_XHTML2_Unofficial, nsAccessibilityAtoms::role, aRole) != NS_CONTENT_ATTR_NOT_THERE;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

nsIContent * nsAccessible::GetRoleContent ( nsIDOMNode aDOMNode) [static, protected, inherited]

Definition at line 422 of file nsAccessible.cpp.

{
  // Given the DOM node for an acessible, return content node that
  // we should look at role string from
  // For non-document accessibles, this is the associated content node.
  // For doc accessibles, first try the <body> if it's HTML and there is
  // a role attribute used there.
  // For any other doc accessible , this is the document element.
  nsCOMPtr<nsIContent> content(do_QueryInterface(aDOMNode));
  if (!content) {
    nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(aDOMNode));
    if (domDoc) {
      nsCOMPtr<nsIDOMHTMLDocument> htmlDoc(do_QueryInterface(aDOMNode));
      if (htmlDoc) {
        nsCOMPtr<nsIDOMHTMLElement> bodyElement;
        htmlDoc->GetBody(getter_AddRefs(bodyElement));
        content = do_QueryInterface(bodyElement);
      }
      if (!content || !HasRoleAttribute(content)) {
        nsCOMPtr<nsIDOMElement> docElement;
        domDoc->GetDocumentElement(getter_AddRefs(docElement));
        content = do_QueryInterface(docElement);
      }
    }
  }
  return content;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsAccessible::GetScreenOrigin ( nsPresContext aPresContext,
nsIFrame aFrame,
nsRect aRect 
) [protected, inherited]

Definition at line 913 of file nsAccessible.cpp.

{
  aRect->x = aRect->y = 0;

  if (!aPresContext) {
    return;
  }

  nsPoint origin(0,0);
  nsIView *view = aFrame->GetViewExternal();
  if (!view) {
    aFrame->GetOffsetFromView(origin, &view);
    NS_ASSERTION(view, "Frame has no view");
  }

  nsPoint viewOrigin(0,0);
  nsIWidget *widget = view->GetNearestWidget(&viewOrigin);
  origin += viewOrigin;

  // Get the scale from that Presentation Context
  float t2p = aPresContext->TwipsToPixels();

  // Convert to pixels using that scale
  origin.x = NSTwipsToIntPixels(origin.x, t2p);
  origin.y = NSTwipsToIntPixels(origin.y, t2p);
  
  // Add the widget's screen coordinates to the offset we've counted
  NS_ASSERTION(widget, "No widget for top view");
  widget->WidgetToScreen(nsRect(origin.x, origin.y, 1, 1), *aRect);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Return an nsIArray of selected nsIAccessible children.

Reimplemented from nsAccessible.

Reimplemented in nsRootAccessible.

Definition at line 194 of file nsDocAccessible.cpp.

{
  if (!mDOMNode) {
    return NS_ERROR_FAILURE;
  }
  nsAccessible::GetState(aState);
  *aState |= STATE_FOCUSABLE;
  
  if (!mIsContentLoaded) {
    *aState |= STATE_BUSY;
  }

  // Is it visible?
  nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
  nsCOMPtr<nsIWidget> widget;
  if (shell) {
    nsIViewManager* vm = shell->GetViewManager();
    if (vm) {
      vm->GetWidget(getter_AddRefs(widget));
    }
  }
  PRBool isVisible = (widget != nsnull);
  while (widget && isVisible) {
    widget->IsVisible(isVisible);
    widget = widget->GetParent();
  }
  if (!isVisible) {
    *aState |= STATE_INVISIBLE;
  }

  PRBool isEditable;
  GetIsEditable(&isEditable);

  if (!isEditable) {
    // Use STATE_READONLY when we're not in an editor pane
    *aState |= STATE_READONLY; 
  }
  return NS_OK;
}

Here is the call graph for this function:

nsresult nsAccessible::GetTextFromRelationID ( nsIAtom aIDAttrib,
nsString aName 
) [protected, inherited]

Definition at line 1518 of file nsAccessible.cpp.

{
  // Get DHTML name from content subtree pointed to by ID attribute
  aName.Truncate();
  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
  NS_ASSERTION(content, "Called from shutdown accessible");

  nsAutoString ids;
  if (NS_CONTENT_ATTR_NOT_THERE ==
      content->GetAttr(kNameSpaceID_WAIProperties, aIDAttrib, ids)) {
    return NS_ERROR_FAILURE;
  }
  ids.CompressWhitespace(PR_TRUE, PR_TRUE);

  nsCOMPtr<nsIDOMDocument> domDoc;
  mDOMNode->GetOwnerDocument(getter_AddRefs(domDoc));
  NS_ENSURE_TRUE(domDoc, NS_ERROR_FAILURE);
  
  nsresult rv = NS_ERROR_FAILURE;

  // Support idlist as in aaa::labelledby="id1 id2 id3"
  while (PR_TRUE) {
    nsAutoString id;
    PRInt32 idLength = ids.FindChar(' ');  // -1 means end of string, not space found
    NS_ASSERTION(idLength != 0, "Should not be 0 because of CompressWhitespace() call above");
    id = Substring(ids, 0, idLength);
    if (idLength == -1) {
      ids.Truncate();
    }
    else {
      ids.Cut(0, idLength + 1);
    }
    if (!id.IsEmpty() && id.Last() == ' ') {
      id.Truncate(idLength - 1);  // Eliminate trailing space if it's there
    }

    if (id.IsEmpty()) {
      break;
    }
    if (!aName.IsEmpty()) {
      aName += ' '; // Need whitespace between multiple labels or descriptions
    }
    nsCOMPtr<nsIDOMElement> labelElement;
    domDoc->GetElementById(id, getter_AddRefs(labelElement));
    content = do_QueryInterface(labelElement);
    if (!content) {
      return NS_OK;
    }
    // We have a label content
    rv = AppendFlatStringFromSubtree(content, &aName);
    if (NS_SUCCEEDED(rv)) {
      aName.CompressWhitespace();
    }
  }
  
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAccessible::GetTranslatedString ( const nsAString &  aKey,
nsAString &  aStringOut 
) [static, protected, inherited]

Definition at line 693 of file nsAccessible.cpp.

{
  nsXPIDLString xsValue;

  if (!gStringBundle || 
    NS_FAILED(gStringBundle->GetStringFromName(PromiseFlatString(aKey).get(), getter_Copies(xsValue)))) 
    return NS_ERROR_FAILURE;

  aStringOut.Assign(xsValue);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

STDMETHODIMP nsAccessibleWrap::GetTypeInfo ( UINT  i,
LCID  lcid,
ITypeInfo **  ppti 
) [inherited]

Definition at line 985 of file nsAccessibleWrap.cpp.

{
  *ppti = 0;
  return E_NOTIMPL;
}
STDMETHODIMP nsAccessibleWrap::GetTypeInfoCount ( UINT p) [inherited]

Definition at line 978 of file nsAccessibleWrap.cpp.

{
  *p = 0;
  return E_NOTIMPL;
}
NS_IMETHODIMP nsDocAccessible::GetValue ( nsAString &  aValue)

Reimplemented from nsAccessible.

Definition at line 189 of file nsDocAccessible.cpp.

{
  return GetURL(aValue);
}
void nsAccessibleWrap::GetXPAccessibleFor ( const VARIANT &  aVarChild,
nsIAccessible **  aXPAccessible 
) [virtual, inherited]

Reimplemented in nsDocAccessibleWrap.

Definition at line 1043 of file nsAccessibleWrap.cpp.

{
  *aXPAccessible = nsnull;
  if (!mWeakShell)
    return; // Fail, we don't want to do anything after we've shut down

  // if its us real easy - this seems to always be the case
  if (aVarChild.lVal == CHILDID_SELF) {
    *aXPAccessible = NS_STATIC_CAST(nsIAccessible*, this);
  } 
  else {
    // XXX It is rare to use a VARIANT with a child num
    // so optimizing this is not a priority
    // We can come back it do it later, if there are perf problems
    // with a specific assistive technology
    nsCOMPtr<nsIAccessible> xpAccessible, nextAccessible;
    GetFirstChild(getter_AddRefs(xpAccessible));
    for (PRInt32 index = 0; xpAccessible; index ++) {
      if (!xpAccessible)
        break; // Failed
      if (aVarChild.lVal == index) {
        *aXPAccessible = xpAccessible;
        break;
      }
      nextAccessible = xpAccessible;
      nextAccessible->GetNextSibling(getter_AddRefs(xpAccessible));
    }
  }
  NS_IF_ADDREF(*aXPAccessible);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIContent * nsAccessible::GetXULLabelContent ( nsIContent aForNode,
nsIAtom aLabelType = nsAccessibilityAtoms::label 
) [static, protected, inherited]

Definition at line 1452 of file nsAccessible.cpp.

{
  nsAutoString controlID;
  nsIContent *labelContent = GetContentPointingTo(&controlID, aForNode, nsnull,
                                                  kNameSpaceID_None, aLabelType);
  if (labelContent) {
    return labelContent;
  }

  // If we're in anonymous content, determine whether we should use
  // the binding parent based on where the id for this control is
  aForNode->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::id, controlID);
  if (controlID.IsEmpty()) {
    // If no control ID and we're anonymous content
    // get ID from parent that inserted us.
    aForNode = aForNode->GetBindingParent();
    if (aForNode) {
      aForNode->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::id, controlID);
    }
    if (controlID.IsEmpty()) {
      return nsnull;
    }
  }
  
  // Look for label in subtrees of nearby ancestors
  static const PRUint32 kAncestorLevelsToSearch = 5;
  PRUint32 count = 0;
  while (!labelContent && ++count <= kAncestorLevelsToSearch && 
         (aForNode = aForNode->GetParent()) != nsnull) {
    labelContent = GetContentPointingTo(&controlID, aForNode,
                                        nsAccessibilityAtoms::control,
                                        kNameSpaceID_None, aLabelType);
  }

  return labelContent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAccessible::GetXULName ( nsAString &  aLabel,
PRBool  aCanAggregateSubtree = PR_TRUE 
) [protected, inherited]

3 main cases for XUL Controls to be labeled 1 - control contains label="foo" 2 - control has, as a child, a label element

   - label has either value="foo" or children

3 - non-child label contains control="controlID"

  • label has either value="foo" or children Once a label is found, the search is discontinued, so a control that has a label child as well as having a label external to the control that uses the control="controlID" syntax will use the child label for its Name.

Definition at line 1668 of file nsAccessible.cpp.

{
  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
  NS_ASSERTION(content, "No nsIContent for DOM node");

  // First check for label override via accessibility labelledby relationship
  nsAutoString label;
  nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::labelledby, label);
  if (NS_SUCCEEDED(rv)) {
    aLabel = label;
    return rv;
  }

  // CASE #1 (via label attribute) -- great majority of the cases
  nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl(do_QueryInterface(mDOMNode));
  if (labeledEl) {
    rv = labeledEl->GetLabel(label);
  }
  else {
    nsCOMPtr<nsIDOMXULSelectControlItemElement> itemEl(do_QueryInterface(mDOMNode));
    if (itemEl) {
      rv = itemEl->GetLabel(label);
    }
    else {
      nsCOMPtr<nsIDOMXULSelectControlElement> select(do_QueryInterface(mDOMNode));
      // Use label if this is not a select control element which 
      // uses label attribute to indicate which option is selected
      if (!select) {
        nsCOMPtr<nsIDOMXULElement> xulEl(do_QueryInterface(mDOMNode));
        if (xulEl) {
          rv = xulEl->GetAttribute(NS_LITERAL_STRING("label"), label);
        }
      }
    }
  }

  // CASES #2 and #3 ------ label as a child or <label control="id" ... > </label>
  if (NS_FAILED(rv) || label.IsEmpty()) {
    label.Truncate();
    nsIContent *labelContent = GetXULLabelContent(content);
    nsCOMPtr<nsIDOMXULLabelElement> xulLabel(do_QueryInterface(labelContent));
    // Check if label's value attribute is used
    if (xulLabel && NS_SUCCEEDED(xulLabel->GetValue(label)) && label.IsEmpty()) {
      // If no value attribute, a non-empty label must contain
      // children that define it's text -- possibly using HTML
      AppendFlatStringFromSubtree(labelContent, &label);
    }
  }

  // XXX If CompressWhiteSpace worked on nsAString we could avoid a copy
  label.CompressWhitespace();
  if (!label.IsEmpty()) {
    aLabel = label;
    return NS_OK;
  }

  content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::tooltiptext, label);
  label.CompressWhitespace();
  if (!label.IsEmpty()) {
    aLabel = label;
    return NS_OK;
  }

  // Can get text from title of <toolbaritem> if we're a child of a <toolbaritem>
  nsIContent *bindingParent = content->GetBindingParent();
  nsIContent *parent = bindingParent? bindingParent->GetParent() :
                                      content->GetParent();
  while (parent) {
    if (parent->Tag() == nsAccessibilityAtoms::toolbaritem &&
        parent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::title)) {
      parent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::title, label);
      label.CompressWhitespace();
      aLabel = label;
      return NS_OK;
    }
    parent = parent->GetParent();
  }

  // Don't use AppendFlatStringFromSubtree for container widgets like menulist
  return aCanAggregateSubtree? AppendFlatStringFromSubtree(content, &aLabel) : NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool nsAccessNode::HasRoleAttribute ( nsIContent aContent) [inline, static, inherited]

Definition at line 127 of file nsAccessNode.h.

    {
      return (aContent->IsContentOfType(nsIContent::eHTML) && aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) ||
              aContent->HasAttr(kNameSpaceID_XHTML, nsAccessibilityAtoms::role) ||
              aContent->HasAttr(kNameSpaceID_XHTML2_Unofficial, nsAccessibilityAtoms::role);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void nsPIAccessNode::init ( ) [inherited]

Reimplemented from nsAccessible.

Reimplemented in nsRootAccessibleWrap.

Definition at line 438 of file nsDocAccessible.cpp.

{
  PutCacheEntry(gGlobalDocAccessibleCache, mWeakShell, this);

  AddEventListeners();

  nsresult rv = nsBlockAccessible::Init();

  if (mRoleMapEntry && mRoleMapEntry->role != ROLE_DIALOG &&
      mRoleMapEntry->role != ROLE_APPLICATION &&
      mRoleMapEntry->role != ROLE_ALERT &&
      mRoleMapEntry->role != ROLE_DOCUMENT) {
    // Document accessible can only have certain roles
    // This was set in nsAccessible::Init() based on dynamic role attribute
    mRoleMapEntry = nsnull; // role attribute is not valid for a document
  }

  return rv;
}  

Here is the call graph for this function:

void nsAccessNodeWrap::InitAccessibility ( ) [static, inherited]

Definition at line 67 of file nsAccessNodeWrap.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static void nsAccessNodeWrap::InitAccessibility ( ) [static, inherited]
static void nsAccessNodeWrap::InitAccessibility ( ) [static, inherited]
static void nsAccessNodeWrap::InitAccessibility ( ) [static, inherited]
void nsAccessNode::InitXPAccessibility ( ) [static, inherited]

Definition at line 172 of file nsAccessNode.cpp.

{
  if (gIsAccessibilityActive) {
    return;
  }

  nsCOMPtr<nsIStringBundleService> stringBundleService =
    do_GetService(NS_STRINGBUNDLE_CONTRACTID);
  if (stringBundleService) {
    // Static variables are released in ShutdownAllXPAccessibility();
    stringBundleService->CreateBundle(ACCESSIBLE_BUNDLE_URL, 
                                      &gStringBundle);
    stringBundleService->CreateBundle(PLATFORM_KEYS_BUNDLE_URL, 
                                      &gKeyStringBundle);
  }

  nsAccessibilityAtoms::AddRefAtoms();

  gGlobalDocAccessibleCache.Init(4);

  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
  if (prefBranch) {
    prefBranch->GetBoolPref("accessibility.disablecache", &gIsCacheDisabled);
  }

  gIsAccessibilityActive = PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsPIAccessibleDocument::invalidateCacheSubtree ( in nsIContent  aChangeContent,
in PRUint32  aChangeEvent 
) [inherited]

Find the accessible object in the accessibility cache that corresponds to aStartNode or the first ancestor of aStartNode that has an accessible object associated with it.

Clear that accessible object's parent's cache of accessible children and and remove the accessible object and any decendents from the accessible cache. New accessible objects will be created and cached again on demand.

Parameters:
aChangeContentThe child that is changing
aEventThe event from nsIAccessibleEvent that caused the change: Must be one of: EVENT_REORDER (change), EVENT_SHOW (make visible or create) or EVENT_HIDE (destroy or hide)

Set the child count to -1 (unknown) and null out cached child pointers.

STDMETHODIMP nsAccessibleWrap::Invoke ( DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
) [inherited]

Definition at line 1000 of file nsAccessibleWrap.cpp.

{
  return E_NOTIMPL;
}

Determines if the current child of this object is selected.

Parameters:
Thezero-based accessible child index
Returns:
Returns true if the child is selected, false if not.
PRBool nsAccessible::IsCorrectFrameType ( nsIFrame aFrame,
nsIAtom aAtom 
) [static, inherited]

Static Helper method to help sub classes make sure they have the proper frame when walking the frame tree to get at children and such.

Definition at line 1078 of file nsAccessible.cpp.

{
  NS_ASSERTION(aFrame != nsnull, "aFrame is null in call to IsCorrectFrameType!");
  NS_ASSERTION(aAtom != nsnull, "aAtom is null in call to IsCorrectFrameType!");

  return aFrame->GetType() == aAtom;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsAccessible::IsPartiallyVisible ( PRBool aIsOffscreen) [protected, inherited]

Definition at line 721 of file nsAccessible.cpp.

{
  // We need to know if at least a kMinPixels around the object is visible
  // Otherwise it will be marked STATE_OFFSCREEN and STATE_INVISIBLE
  
  *aIsOffscreen = PR_FALSE;

  const PRUint16 kMinPixels  = 12;
   // Set up the variables we need, return false if we can't get at them all
  nsCOMPtr<nsIPresShell> shell(GetPresShell());
  if (!shell) 
    return PR_FALSE;

  nsIViewManager* viewManager = shell->GetViewManager();
  if (!viewManager)
    return PR_FALSE;

  nsIFrame *frame = GetFrame();
  if (!frame) {
    return PR_FALSE;
  }

  // If visibility:hidden or visibility:collapsed then mark with STATE_INVISIBLE
  if (!frame->GetStyleVisibility()->IsVisible())
  {
      return PR_FALSE;
  }

  nsPresContext *presContext = shell->GetPresContext();
  if (!presContext)
    return PR_FALSE;

  // Get the bounds of the current frame, relative to the current view.
  // We don't use the more accurate GetBoundsRect, because that is more expensive 
  // and the STATE_OFFSCREEN flag that this is used for only needs to be a rough indicator

  nsRect relFrameRect = frame->GetRect();
  nsPoint frameOffset;
  nsIView *containingView = frame->GetViewExternal();
  if (!containingView) {
    frame->GetOffsetFromView(frameOffset, &containingView);
    if (!containingView)
      return PR_FALSE;  // no view -- not visible
    relFrameRect.x = frameOffset.x;
    relFrameRect.y = frameOffset.y;
  }

  float p2t;
  p2t = presContext->PixelsToTwips();
  nsRectVisibility rectVisibility;
  viewManager->GetRectVisibility(containingView, relFrameRect, 
                                 NS_STATIC_CAST(PRUint16, (kMinPixels * p2t)), 
                                 &rectVisibility);

  if (rectVisibility == nsRectVisibility_kVisible ||
      (rectVisibility == nsRectVisibility_kZeroAreaRect && frame->GetNextInFlow())) {
    // This view says it is visible, but we need to check the parent view chain :(
    // Note: zero area rects can occur in the first frame of a multi-frame text flow,
    //       in which case the next frame exists because the text flow is visible
    while ((containingView = containingView->GetParent()) != nsnull) {
      if (containingView->GetVisibility() == nsViewVisibility_kHide) {
        return PR_FALSE;
      }
    }
    return PR_TRUE;
  }

  *aIsOffscreen = rectVisibility != nsRectVisibility_kZeroAreaRect;
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 609 of file nsAccessibleWrap.cpp.

{
    // to ensure we are not shut down
    return (mDOMNode != nsnull);
}

Here is the caller graph for this function:

ISimpleDOMNode * nsAccessNodeWrap::MakeAccessNode ( nsIDOMNode node) [protected, inherited]

Definition at line 372 of file nsAccessNodeWrap.cpp.

{
  if (!node) 
    return NULL;

  nsAccessNodeWrap *newNode = NULL;
  
  nsCOMPtr<nsIContent> content(do_QueryInterface(node));
  nsCOMPtr<nsIDocument> doc;

  if (content) 
    doc = content->GetDocument();
  else {
    // Get the document via QueryInterface, since there is no content node
    doc = do_QueryInterface(node);
    content = do_QueryInterface(node);
  }

  if (!doc)
    return NULL;

  nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
  if (!accService)
    return NULL;

  ISimpleDOMNode *iNode = NULL;
  nsCOMPtr<nsIAccessible> nsAcc;
  accService->GetAccessibleInWeakShell(node, mWeakShell, getter_AddRefs(nsAcc));
  if (nsAcc) {
    nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(nsAcc));
    NS_ASSERTION(accessNode, "nsIAccessible impl does not inherit from nsIAccessNode");
    IAccessible *msaaAccessible;
    nsAcc->GetNativeInterface((void**)&msaaAccessible); // addrefs
    msaaAccessible->QueryInterface(IID_ISimpleDOMNode, (void**)&iNode); // addrefs
    msaaAccessible->Release(); // Release IAccessible
  }
  else {
    newNode = new