Bug 762389 - de-ns-ify nsXULTreeAccessible and nsXULTreeGridAccessible, r=surkov

--HG--
rename : accessible/src/atk/nsXULTreeGridAccessibleWrap.h => accessible/src/atk/XULTreeGridAccessibleWrap.h
rename : accessible/src/mac/nsXULTreeGridAccessibleWrap.h => accessible/src/mac/XULTreeGridAccessibleWrap.h
rename : accessible/src/msaa/nsXULTreeGridAccessibleWrap.cpp => accessible/src/msaa/XULTreeGridAccessibleWrap.cpp
rename : accessible/src/msaa/nsXULTreeGridAccessibleWrap.h => accessible/src/msaa/XULTreeGridAccessibleWrap.h
rename : accessible/src/other/nsXULTreeGridAccessibleWrap.h => accessible/src/other/XULTreeGridAccessibleWrap.h
rename : accessible/src/xul/nsXULTreeAccessible.cpp => accessible/src/xul/XULTreeAccessible.cpp
rename : accessible/src/xul/nsXULTreeAccessible.h => accessible/src/xul/XULTreeAccessible.h
rename : accessible/src/xul/nsXULTreeGridAccessible.cpp => accessible/src/xul/XULTreeGridAccessible.cpp
rename : accessible/src/xul/nsXULTreeGridAccessible.h => accessible/src/xul/XULTreeGridAccessible.h
This commit is contained in:
Mark Capella 2012-06-08 06:28:27 -04:00
parent 204d397ea8
commit 766822cea5
22 changed files with 551 additions and 517 deletions

View File

@ -0,0 +1,22 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
#include "XULTreeGridAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,16 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __nsXULTreeGridAccessibleWrap_h__
#define __nsXULTreeGridAccessibleWrap_h__
#include "nsXULTreeGridAccessible.h"
typedef class nsXULTreeGridAccessible nsXULTreeGridAccessibleWrap;
typedef class nsXULTreeGridCellAccessible nsXULTreeGridCellAccessibleWrap;
#endif

View File

@ -26,9 +26,6 @@ class Accessible;
class HyperTextAccessible;
class DocAccessible;
struct nsRoleMapEntry;
#ifdef MOZ_XUL
class nsXULTreeAccessible;
#endif
class nsAccUtils
{

View File

@ -76,7 +76,7 @@
#include "nsXULSliderAccessible.h"
#include "nsXULTabAccessible.h"
#include "nsXULTextAccessible.h"
#include "nsXULTreeGridAccessibleWrap.h"
#include "XULTreeGridAccessibleWrap.h"
#endif
using namespace mozilla;
@ -530,7 +530,7 @@ nsAccessibilityService::TreeViewChanged(nsIPresShell* aPresShell,
if (document) {
Accessible* accessible = document->GetAccessible(aContent);
if (accessible) {
nsXULTreeAccessible* treeAcc = accessible->AsXULTree();
XULTreeAccessible* treeAcc = accessible->AsXULTree();
if (treeAcc)
treeAcc->TreeViewChanged(aView);
}
@ -1460,7 +1460,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
return CreateAccessibleForXULTree(aContent, aDoc);
case nsIAccessibleProvider::XULTreeColumns:
accessible = new nsXULTreeColumAccessible(aContent, aDoc);
accessible = new XULTreeColumAccessible(aContent, aDoc);
break;
case nsIAccessibleProvider::XULTreeColumnItem:
@ -1803,13 +1803,13 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
// Outline of list accessible.
if (count == 1) {
Accessible* accessible = new nsXULTreeAccessible(aContent, aDoc);
Accessible* accessible = new XULTreeAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}
// Table or tree table accessible.
Accessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aDoc);
Accessible* accessible = new XULTreeGridAccessibleWrap(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;
}

View File

@ -38,6 +38,7 @@ class HTMLLIAccessible;
class ImageAccessible;
class TableAccessible;
class TextLeafAccessible;
class XULTreeAccessible;
/**
* Name type flags.
@ -68,8 +69,6 @@ struct GroupPos
} // namespace a11y
} // namespace mozilla
class nsXULTreeAccessible;
struct nsRect;
class nsIContent;
class nsIFrame;
@ -507,7 +506,7 @@ public:
mozilla::a11y::HTMLImageMapAccessible* AsImageMap();
inline bool IsXULTree() const { return mFlags & eXULTreeAccessible; }
nsXULTreeAccessible* AsXULTree();
mozilla::a11y::XULTreeAccessible* AsXULTree();
inline bool IsListControl() const { return mFlags & eListControlAccessible; }

View File

@ -18,6 +18,9 @@
#include "Relation.h"
#include "Role.h"
#include "States.h"
#ifdef MOZ_XUL
#include "XULTreeAccessible.h"
#endif
#include "mozilla/dom/Element.h"
@ -51,7 +54,6 @@
#include "nsFocusManager.h"
#ifdef MOZ_XUL
#include "nsXULTreeAccessible.h"
#include "nsIXULDocument.h"
#include "nsIXULWindow.h"
#endif
@ -324,7 +326,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
nsINode* targetNode = accessible->GetNode();
#ifdef MOZ_XUL
nsXULTreeAccessible* treeAcc = accessible->AsXULTree();
XULTreeAccessible* treeAcc = accessible->AsXULTree();
if (treeAcc) {
if (eventType.EqualsLiteral("TreeRowCountChanged")) {
HandleTreeRowCountChangedEvent(aDOMEvent, treeAcc);
@ -403,7 +405,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
// XXX: We need to fire EVENT_SELECTION_ADD and EVENT_SELECTION_REMOVE
// for each tree item. Perhaps each tree item will need to cache its
// selection state and fire an event after a DOM "select" event when
// that state changes. nsXULTreeAccessible::UpdateTreeSelection();
// that state changes. XULTreeAccessible::UpdateTreeSelection();
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
accessible);
return;
@ -672,7 +674,7 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
#ifdef MOZ_XUL
void
RootAccessible::HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
nsXULTreeAccessible* aAccessible)
XULTreeAccessible* aAccessible)
{
nsCOMPtr<nsIDOMDataContainerEvent> dataEvent(do_QueryInterface(aEvent));
if (!dataEvent)
@ -699,7 +701,7 @@ RootAccessible::HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
void
RootAccessible::HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
nsXULTreeAccessible* aAccessible)
XULTreeAccessible* aAccessible)
{
nsCOMPtr<nsIDOMDataContainerEvent> dataEvent(do_QueryInterface(aEvent));
if (!dataEvent)

View File

@ -15,7 +15,6 @@
#include "nsIDocument.h"
#include "nsIDOMEventListener.h"
class nsXULTreeAccessible;
class Relation;
namespace mozilla {
@ -76,9 +75,9 @@ protected:
#ifdef MOZ_XUL
void HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
nsXULTreeAccessible* aAccessible);
XULTreeAccessible* aAccessible);
void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
nsXULTreeAccessible* aAccessible);
XULTreeAccessible* aAccessible);
PRUint32 GetChromeFlags();
#endif

View File

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
#include "XULTreeGridAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,14 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __nsXULTreeGridAccessibleWrap_h__
#define __nsXULTreeGridAccessibleWrap_h__
#include "nsXULTreeGridAccessible.h"
typedef class nsXULTreeGridAccessible nsXULTreeGridAccessibleWrap;
typedef class nsXULTreeGridCellAccessible nsXULTreeGridCellAccessibleWrap;
#endif

View File

@ -27,7 +27,6 @@ CPPSRCS = \
nsHTMLWin32ObjectAccessible.cpp \
nsXULMenuAccessibleWrap.cpp \
nsXULListboxAccessibleWrap.cpp \
nsXULTreeGridAccessibleWrap.cpp \
nsWinUtils.cpp \
CAccessibleText.cpp \
CAccessibleEditableText.cpp \
@ -46,6 +45,12 @@ CPPSRCS = \
TextLeafAccessibleWrap.cpp \
$(NULL)
ifdef MOZ_XUL
CPPSRCS += \
XULTreeGridAccessibleWrap.cpp \
$(NULL)
endif
EXPORTS = \
nsAccessNodeWrap.h \
$(NULL)

View File

@ -0,0 +1,49 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "XULTreeGridAccessibleWrap.h"
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// XULTreeGridAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
XULTreeGridAccessibleWrap::
XULTreeGridAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
XULTreeGridAccessible(aContent, aDoc)
{
}
NS_IMPL_ISUPPORTS_INHERITED0(XULTreeGridAccessibleWrap,
XULTreeGridAccessible)
IMPL_IUNKNOWN_INHERITED1(XULTreeGridAccessibleWrap,
AccessibleWrap,
CAccessibleTable)
////////////////////////////////////////////////////////////////////////////////
// XULTreeGridCellAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
XULTreeGridCellAccessibleWrap::
XULTreeGridCellAccessibleWrap(nsIContent* aContent,
DocAccessible* aDoc,
XULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree,
nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn) :
XULTreeGridCellAccessible(aContent, aDoc, aRowAcc, aTree, aTreeView,
aRow, aColumn)
{
}
NS_IMPL_ISUPPORTS_INHERITED0(XULTreeGridCellAccessibleWrap,
XULTreeGridCellAccessible)
IMPL_IUNKNOWN_INHERITED1(XULTreeGridCellAccessibleWrap,
AccessibleWrap,
CAccessibleTableCell)

View File

@ -0,0 +1,59 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
#include "XULTreeGridAccessible.h"
#include "CAccessibleTable.h"
#include "CAccessibleTableCell.h"
namespace mozilla {
namespace a11y {
/**
* IA2 wrapper class for XULTreeGridAccessible class implementing
* IAccessibleTable and IAccessibleTable2 interfaces.
*/
class XULTreeGridAccessibleWrap : public XULTreeGridAccessible,
public CAccessibleTable
{
public:
XULTreeGridAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
/**
* IA2 wrapper class for XULTreeGridCellAccessible class, implements
* IAccessibleTableCell interface.
*/
class XULTreeGridCellAccessibleWrap : public XULTreeGridCellAccessible,
public CAccessibleTableCell
{
public:
XULTreeGridCellAccessibleWrap(nsIContent* aContent,
DocAccessible* aDoc,
XULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree,
nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn);
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,47 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsXULTreeGridAccessibleWrap.h"
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridAccessibleWrap::
nsXULTreeGridAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
nsXULTreeGridAccessible(aContent, aDoc)
{
}
NS_IMPL_ISUPPORTS_INHERITED0(nsXULTreeGridAccessibleWrap,
nsXULTreeGridAccessible)
IMPL_IUNKNOWN_INHERITED1(nsXULTreeGridAccessibleWrap,
AccessibleWrap,
CAccessibleTable)
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridCellAccessibleWrap::
nsXULTreeGridCellAccessibleWrap(nsIContent* aContent,
DocAccessible* aDoc,
nsXULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree,
nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn) :
nsXULTreeGridCellAccessible(aContent, aDoc, aRowAcc, aTree, aTreeView,
aRow, aColumn)
{
}
NS_IMPL_ISUPPORTS_INHERITED0(nsXULTreeGridCellAccessibleWrap,
nsXULTreeGridCellAccessible)
IMPL_IUNKNOWN_INHERITED1(nsXULTreeGridCellAccessibleWrap,
AccessibleWrap,
CAccessibleTableCell)

View File

@ -1,53 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __nsXULTreeGridAccessibleWrap_h__
#define __nsXULTreeGridAccessibleWrap_h__
#include "nsXULTreeGridAccessible.h"
#include "CAccessibleTable.h"
#include "CAccessibleTableCell.h"
/**
* IA2 wrapper class for nsXULTreeGridAccessible class implementing
* IAccessibleTable and IAccessibleTable2 interfaces.
*/
class nsXULTreeGridAccessibleWrap : public nsXULTreeGridAccessible,
public CAccessibleTable
{
public:
nsXULTreeGridAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
/**
* IA2 wrapper class for nsXULTreeGridCellAccessible class, implements
* IAccessibleTableCell interface.
*/
class nsXULTreeGridCellAccessibleWrap : public nsXULTreeGridCellAccessible,
public CAccessibleTableCell
{
public:
nsXULTreeGridCellAccessibleWrap(nsIContent* aContent,
DocAccessible* aDoc,
nsXULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree,
nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn);
// IUnknown
DECL_IUNKNOWN_INHERITED
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
};
#endif

View File

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
#include "XULTreeGridAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,14 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __nsXULTreeGridAccessibleWrap_h__
#define __nsXULTreeGridAccessibleWrap_h__
#include "nsXULTreeGridAccessible.h"
typedef class nsXULTreeGridAccessible nsXULTreeGridAccessibleWrap;
typedef class nsXULTreeGridCellAccessible nsXULTreeGridCellAccessibleWrap;
#endif

View File

@ -27,8 +27,8 @@ CPPSRCS = \
nsXULSliderAccessible.cpp \
nsXULTabAccessible.cpp \
nsXULTextAccessible.cpp \
nsXULTreeAccessible.cpp \
nsXULTreeGridAccessible.cpp \
XULTreeAccessible.cpp \
XULTreeGridAccessible.cpp \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.

View File

@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsXULTreeAccessible.h"
#include "XULTreeAccessible.h"
#include "nsAccCache.h"
#include "nsAccUtils.h"
@ -28,11 +28,11 @@
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible
// XULTreeAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULTreeAccessible::
nsXULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULTreeAccessible::
XULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
mFlags |= eXULTreeAccessible;
@ -58,33 +58,32 @@ nsXULTreeAccessible::
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: nsISupports and cycle collection implementation
// XULTreeAccessible: nsISupports and cycle collection implementation
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeAccessible)
NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeAccessible)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeAccessible,
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeAccessible,
Accessible)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTree)
CycleCollectorTraverseCache(tmp->mAccessibleCache, &cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeAccessible,
Accessible)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeAccessible, Accessible)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTree)
ClearCache(tmp->mAccessibleCache);
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeAccessible)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeAccessible)
NS_INTERFACE_MAP_END_INHERITING(Accessible)
NS_IMPL_ADDREF_INHERITED(nsXULTreeAccessible, Accessible)
NS_IMPL_RELEASE_INHERITED(nsXULTreeAccessible, Accessible)
NS_IMPL_ADDREF_INHERITED(XULTreeAccessible, Accessible)
NS_IMPL_RELEASE_INHERITED(XULTreeAccessible, Accessible)
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: Accessible implementation
// XULTreeAccessible: Accessible implementation
PRUint64
nsXULTreeAccessible::NativeState()
XULTreeAccessible::NativeState()
{
// Get focus status from base class.
PRUint64 state = Accessible::NativeState();
@ -111,7 +110,7 @@ nsXULTreeAccessible::NativeState()
}
void
nsXULTreeAccessible::Value(nsString& aValue)
XULTreeAccessible::Value(nsString& aValue)
{
aValue.Truncate();
if (!mTreeView)
@ -140,10 +139,10 @@ nsXULTreeAccessible::Value(nsString& aValue)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: nsAccessNode implementation
// XULTreeAccessible: nsAccessNode implementation
void
nsXULTreeAccessible::Shutdown()
XULTreeAccessible::Shutdown()
{
// XXX: we don't remove accessible from document cache if shutdown wasn't
// initiated by document destroying. Note, we can't remove accessible from
@ -158,10 +157,10 @@ nsXULTreeAccessible::Shutdown()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: Accessible implementation (put methods here)
// XULTreeAccessible: Accessible implementation (put methods here)
role
nsXULTreeAccessible::NativeRole()
XULTreeAccessible::NativeRole()
{
// No primary column means we're in a list. In fact, history and mail turn off
// the primary flag when switching to a flat view.
@ -176,11 +175,11 @@ nsXULTreeAccessible::NativeRole()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: Accessible implementation (DON'T put methods here)
// XULTreeAccessible: Accessible implementation (DON'T put methods here)
Accessible*
nsXULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
EWhichChildAtPoint aWhichChild)
XULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
EWhichChildAtPoint aWhichChild)
{
nsIFrame *frame = GetFrame();
if (!frame)
@ -211,7 +210,7 @@ nsXULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
Accessible* child = GetTreeItemAccessible(row);
if (aWhichChild == eDeepestChild && child) {
// Look for accessible cell for the found item accessible.
nsRefPtr<nsXULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
nsRefPtr<XULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
Accessible* cell = treeitem->GetCellAccessible(column);
if (cell)
@ -222,16 +221,16 @@ nsXULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: SelectAccessible
// XULTreeAccessible: SelectAccessible
bool
nsXULTreeAccessible::IsSelect()
XULTreeAccessible::IsSelect()
{
return true;
}
Accessible*
nsXULTreeAccessible::CurrentItem()
XULTreeAccessible::CurrentItem()
{
if (!mTreeView)
return nsnull;
@ -249,13 +248,13 @@ nsXULTreeAccessible::CurrentItem()
}
void
nsXULTreeAccessible::SetCurrentItem(Accessible* aItem)
XULTreeAccessible::SetCurrentItem(Accessible* aItem)
{
NS_ERROR("nsXULTreeAccessible::SetCurrentItem not implemented");
NS_ERROR("XULTreeAccessible::SetCurrentItem not implemented");
}
already_AddRefed<nsIArray>
nsXULTreeAccessible::SelectedItems()
XULTreeAccessible::SelectedItems()
{
if (!mTreeView)
return nsnull;
@ -288,7 +287,7 @@ nsXULTreeAccessible::SelectedItems()
}
PRUint32
nsXULTreeAccessible::SelectedItemCount()
XULTreeAccessible::SelectedItemCount()
{
if (!mTreeView)
return 0;
@ -305,7 +304,7 @@ nsXULTreeAccessible::SelectedItemCount()
}
bool
nsXULTreeAccessible::AddItemToSelection(PRUint32 aIndex)
XULTreeAccessible::AddItemToSelection(PRUint32 aIndex)
{
if (!mTreeView)
return false;
@ -324,7 +323,7 @@ nsXULTreeAccessible::AddItemToSelection(PRUint32 aIndex)
}
bool
nsXULTreeAccessible::RemoveItemFromSelection(PRUint32 aIndex)
XULTreeAccessible::RemoveItemFromSelection(PRUint32 aIndex)
{
if (!mTreeView)
return false;
@ -343,7 +342,7 @@ nsXULTreeAccessible::RemoveItemFromSelection(PRUint32 aIndex)
}
bool
nsXULTreeAccessible::IsItemSelected(PRUint32 aIndex)
XULTreeAccessible::IsItemSelected(PRUint32 aIndex)
{
if (!mTreeView)
return false;
@ -359,7 +358,7 @@ nsXULTreeAccessible::IsItemSelected(PRUint32 aIndex)
}
bool
nsXULTreeAccessible::UnselectAll()
XULTreeAccessible::UnselectAll()
{
if (!mTreeView)
return false;
@ -374,7 +373,7 @@ nsXULTreeAccessible::UnselectAll()
}
Accessible*
nsXULTreeAccessible::GetSelectedItem(PRUint32 aIndex)
XULTreeAccessible::GetSelectedItem(PRUint32 aIndex)
{
if (!mTreeView)
return nsnull;
@ -402,7 +401,7 @@ nsXULTreeAccessible::GetSelectedItem(PRUint32 aIndex)
}
bool
nsXULTreeAccessible::SelectAll()
XULTreeAccessible::SelectAll()
{
// see if we are multiple select if so set ourselves as such
if (!mTreeView)
@ -423,10 +422,10 @@ nsXULTreeAccessible::SelectAll()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: Accessible implementation
// XULTreeAccessible: Accessible implementation
Accessible*
nsXULTreeAccessible::GetChildAt(PRUint32 aIndex)
XULTreeAccessible::GetChildAt(PRUint32 aIndex)
{
PRUint32 childCount = Accessible::ChildCount();
if (aIndex < childCount)
@ -436,7 +435,7 @@ nsXULTreeAccessible::GetChildAt(PRUint32 aIndex)
}
PRUint32
nsXULTreeAccessible::ChildCount() const
XULTreeAccessible::ChildCount() const
{
// Tree's children count is row count + treecols count.
PRUint32 childCount = Accessible::ChildCount();
@ -451,16 +450,16 @@ nsXULTreeAccessible::ChildCount() const
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: Widgets
// XULTreeAccessible: Widgets
bool
nsXULTreeAccessible::IsWidget() const
XULTreeAccessible::IsWidget() const
{
return true;
}
bool
nsXULTreeAccessible::IsActiveWidget() const
XULTreeAccessible::IsActiveWidget() const
{
if (IsAutoCompletePopup()) {
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
@ -476,7 +475,7 @@ nsXULTreeAccessible::IsActiveWidget() const
}
bool
nsXULTreeAccessible::AreItemsOperable() const
XULTreeAccessible::AreItemsOperable() const
{
if (IsAutoCompletePopup()) {
nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
@ -492,7 +491,7 @@ nsXULTreeAccessible::AreItemsOperable() const
}
Accessible*
nsXULTreeAccessible::ContainerWidget() const
XULTreeAccessible::ContainerWidget() const
{
if (IsAutoCompletePopup()) {
// This works for XUL autocompletes. It doesn't work for HTML forms
@ -518,10 +517,10 @@ nsXULTreeAccessible::ContainerWidget() const
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: public implementation
// XULTreeAccessible: public implementation
Accessible*
nsXULTreeAccessible::GetTreeItemAccessible(PRInt32 aRow)
XULTreeAccessible::GetTreeItemAccessible(PRInt32 aRow)
{
if (aRow < 0 || IsDefunct() || !mTreeView)
return nsnull;
@ -549,7 +548,7 @@ nsXULTreeAccessible::GetTreeItemAccessible(PRInt32 aRow)
}
void
nsXULTreeAccessible::InvalidateCache(PRInt32 aRow, PRInt32 aCount)
XULTreeAccessible::InvalidateCache(PRInt32 aRow, PRInt32 aCount)
{
if (IsDefunct())
return;
@ -601,8 +600,8 @@ nsXULTreeAccessible::InvalidateCache(PRInt32 aRow, PRInt32 aCount)
}
void
nsXULTreeAccessible::TreeViewInvalidated(PRInt32 aStartRow, PRInt32 aEndRow,
PRInt32 aStartCol, PRInt32 aEndCol)
XULTreeAccessible::TreeViewInvalidated(PRInt32 aStartRow, PRInt32 aEndRow,
PRInt32 aStartCol, PRInt32 aEndCol)
{
if (IsDefunct())
return;
@ -641,7 +640,7 @@ nsXULTreeAccessible::TreeViewInvalidated(PRInt32 aStartRow, PRInt32 aEndRow,
Accessible* accessible = mAccessibleCache.GetWeak(key);
if (accessible) {
nsRefPtr<nsXULTreeItemAccessibleBase> treeitemAcc = do_QueryObject(accessible);
nsRefPtr<XULTreeItemAccessibleBase> treeitemAcc = do_QueryObject(accessible);
NS_ASSERTION(treeitemAcc, "Wrong accessible at the given key!");
treeitemAcc->RowInvalidated(aStartCol, endCol);
@ -650,7 +649,7 @@ nsXULTreeAccessible::TreeViewInvalidated(PRInt32 aStartRow, PRInt32 aEndRow,
}
void
nsXULTreeAccessible::TreeViewChanged(nsITreeView* aView)
XULTreeAccessible::TreeViewChanged(nsITreeView* aView)
{
if (IsDefunct())
return;
@ -670,26 +669,25 @@ nsXULTreeAccessible::TreeViewChanged(nsITreeView* aView)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: protected implementation
// XULTreeAccessible: protected implementation
already_AddRefed<Accessible>
nsXULTreeAccessible::CreateTreeItemAccessible(PRInt32 aRow)
XULTreeAccessible::CreateTreeItemAccessible(PRInt32 aRow)
{
nsRefPtr<Accessible> accessible =
new nsXULTreeItemAccessible(mContent, mDoc, this, mTree, mTreeView,
aRow);
new XULTreeItemAccessible(mContent, mDoc, this, mTree, mTreeView, aRow);
return accessible.forget();
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase
// XULTreeItemAccessibleBase
////////////////////////////////////////////////////////////////////////////////
nsXULTreeItemAccessibleBase::
nsXULTreeItemAccessibleBase(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow) :
XULTreeItemAccessibleBase::
XULTreeItemAccessibleBase(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow) :
AccessibleWrap(aContent, aDoc),
mTree(aTree), mTreeView(aTreeView), mRow(aRow)
{
@ -697,39 +695,39 @@ nsXULTreeItemAccessibleBase::
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase: nsISupports implementation
// XULTreeItemAccessibleBase: nsISupports implementation
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeItemAccessibleBase)
NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeItemAccessibleBase)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeItemAccessibleBase,
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeItemAccessibleBase,
Accessible)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTree)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeItemAccessibleBase,
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeItemAccessibleBase,
Accessible)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTree)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULTreeItemAccessibleBase)
NS_INTERFACE_TABLE_INHERITED1(nsXULTreeItemAccessibleBase,
nsXULTreeItemAccessibleBase)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessibleBase)
NS_INTERFACE_TABLE_INHERITED1(XULTreeItemAccessibleBase,
XULTreeItemAccessibleBase)
NS_INTERFACE_TABLE_TAIL_INHERITING(Accessible)
NS_IMPL_ADDREF_INHERITED(nsXULTreeItemAccessibleBase, Accessible)
NS_IMPL_RELEASE_INHERITED(nsXULTreeItemAccessibleBase, Accessible)
NS_IMPL_ADDREF_INHERITED(XULTreeItemAccessibleBase, Accessible)
NS_IMPL_RELEASE_INHERITED(XULTreeItemAccessibleBase, Accessible)
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase: nsIAccessible implementation
// XULTreeItemAccessibleBase: nsIAccessible implementation
Accessible*
nsXULTreeItemAccessibleBase::FocusedChild()
XULTreeItemAccessibleBase::FocusedChild()
{
return FocusMgr()->FocusedAccessible() == this ? this : nsnull;
}
NS_IMETHODIMP
nsXULTreeItemAccessibleBase::GetBounds(PRInt32 *aX, PRInt32 *aY,
PRInt32 *aWidth, PRInt32 *aHeight)
XULTreeItemAccessibleBase::GetBounds(PRInt32* aX, PRInt32* aY,
PRInt32* aWidth, PRInt32* aHeight)
{
NS_ENSURE_ARG_POINTER(aX);
*aX = 0;
@ -775,7 +773,7 @@ nsXULTreeItemAccessibleBase::GetBounds(PRInt32 *aX, PRInt32 *aY,
}
NS_IMETHODIMP
nsXULTreeItemAccessibleBase::SetSelected(bool aSelect)
XULTreeItemAccessibleBase::SetSelected(bool aSelect)
{
if (IsDefunct() || !mTreeView)
return NS_ERROR_FAILURE;
@ -793,7 +791,7 @@ nsXULTreeItemAccessibleBase::SetSelected(bool aSelect)
}
NS_IMETHODIMP
nsXULTreeItemAccessibleBase::TakeFocus()
XULTreeItemAccessibleBase::TakeFocus()
{
if (IsDefunct() || !mTreeView)
return NS_ERROR_FAILURE;
@ -808,7 +806,7 @@ nsXULTreeItemAccessibleBase::TakeFocus()
}
Relation
nsXULTreeItemAccessibleBase::RelationByType(PRUint32 aType)
XULTreeItemAccessibleBase::RelationByType(PRUint32 aType)
{
if (!mTreeView)
return Relation();
@ -823,12 +821,12 @@ nsXULTreeItemAccessibleBase::RelationByType(PRUint32 aType)
if (parentIndex == -1)
return Relation(mParent);
nsXULTreeAccessible* treeAcc = mParent->AsXULTree();
XULTreeAccessible* treeAcc = mParent->AsXULTree();
return Relation(treeAcc->GetTreeItemAccessible(parentIndex));
}
PRUint8
nsXULTreeItemAccessibleBase::ActionCount()
XULTreeItemAccessibleBase::ActionCount()
{
// "activate" action is available for all treeitems, "expand/collapse" action
// is avaible for treeitem which is container.
@ -836,7 +834,7 @@ nsXULTreeItemAccessibleBase::ActionCount()
}
NS_IMETHODIMP
nsXULTreeItemAccessibleBase::GetActionName(PRUint8 aIndex, nsAString& aName)
XULTreeItemAccessibleBase::GetActionName(PRUint8 aIndex, nsAString& aName)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -861,7 +859,7 @@ nsXULTreeItemAccessibleBase::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
nsXULTreeItemAccessibleBase::DoAction(PRUint8 aIndex)
XULTreeItemAccessibleBase::DoAction(PRUint8 aIndex)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -875,10 +873,10 @@ nsXULTreeItemAccessibleBase::DoAction(PRUint8 aIndex)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase: nsAccessNode implementation
// XULTreeItemAccessibleBase: nsAccessNode implementation
void
nsXULTreeItemAccessibleBase::Shutdown()
XULTreeItemAccessibleBase::Shutdown()
{
mTree = nsnull;
mTreeView = nsnull;
@ -888,17 +886,17 @@ nsXULTreeItemAccessibleBase::Shutdown()
}
bool
nsXULTreeItemAccessibleBase::IsPrimaryForNode() const
XULTreeItemAccessibleBase::IsPrimaryForNode() const
{
return false;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase: Accessible public methods
// XULTreeItemAccessibleBase: Accessible public methods
// nsIAccessible::groupPosition
GroupPos
nsXULTreeItemAccessibleBase::GroupPosition()
XULTreeItemAccessibleBase::GroupPosition()
{
GroupPos groupPos;
@ -942,7 +940,7 @@ nsXULTreeItemAccessibleBase::GroupPosition()
}
PRUint64
nsXULTreeItemAccessibleBase::NativeState()
XULTreeItemAccessibleBase::NativeState()
{
if (!mTreeView)
return states::DEFUNCT;
@ -982,32 +980,32 @@ nsXULTreeItemAccessibleBase::NativeState()
}
PRUint64
nsXULTreeItemAccessibleBase::NativeInteractiveState() const
XULTreeItemAccessibleBase::NativeInteractiveState() const
{
return states::FOCUSABLE | states::SELECTABLE;
}
PRInt32
nsXULTreeItemAccessibleBase::IndexInParent() const
XULTreeItemAccessibleBase::IndexInParent() const
{
return mParent ? mParent->ContentChildCount() + mRow : -1;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase: Widgets
// XULTreeItemAccessibleBase: Widgets
Accessible*
nsXULTreeItemAccessibleBase::ContainerWidget() const
XULTreeItemAccessibleBase::ContainerWidget() const
{
return mParent;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase: Accessible protected methods
// XULTreeItemAccessibleBase: Accessible protected methods
void
nsXULTreeItemAccessibleBase::DispatchClickEvent(nsIContent *aContent,
PRUint32 aActionIndex)
XULTreeItemAccessibleBase::DispatchClickEvent(nsIContent* aContent,
PRUint32 aActionIndex)
{
if (IsDefunct())
return;
@ -1035,8 +1033,8 @@ nsXULTreeItemAccessibleBase::DispatchClickEvent(nsIContent *aContent,
}
Accessible*
nsXULTreeItemAccessibleBase::GetSiblingAtOffset(PRInt32 aOffset,
nsresult* aError) const
XULTreeItemAccessibleBase::GetSiblingAtOffset(PRInt32 aOffset,
nsresult* aError) const
{
if (aError)
*aError = NS_OK; // fail peacefully
@ -1045,10 +1043,10 @@ nsXULTreeItemAccessibleBase::GetSiblingAtOffset(PRInt32 aOffset,
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessibleBase: protected implementation
// XULTreeItemAccessibleBase: protected implementation
bool
nsXULTreeItemAccessibleBase::IsExpandable()
XULTreeItemAccessibleBase::IsExpandable()
{
if (!mTreeView)
return false;
@ -1075,8 +1073,7 @@ nsXULTreeItemAccessibleBase::IsExpandable()
}
void
nsXULTreeItemAccessibleBase::GetCellName(nsITreeColumn* aColumn,
nsAString& aName)
XULTreeItemAccessibleBase::GetCellName(nsITreeColumn* aColumn, nsAString& aName)
{
if (!mTreeView)
return;
@ -1095,43 +1092,43 @@ nsXULTreeItemAccessibleBase::GetCellName(nsITreeColumn* aColumn,
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessible
// XULTreeItemAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULTreeItemAccessible::
nsXULTreeItemAccessible(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow) :
nsXULTreeItemAccessibleBase(aContent, aDoc, aParent, aTree, aTreeView, aRow)
XULTreeItemAccessible::
XULTreeItemAccessible(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow) :
XULTreeItemAccessibleBase(aContent, aDoc, aParent, aTree, aTreeView, aRow)
{
mColumn = nsCoreUtils::GetFirstSensibleColumn(mTree);
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessible: nsISupports implementation
// XULTreeItemAccessible: nsISupports implementation
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeItemAccessible)
NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeItemAccessible)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeItemAccessible,
nsXULTreeItemAccessibleBase)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeItemAccessible,
XULTreeItemAccessibleBase)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mColumn)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeItemAccessible,
nsXULTreeItemAccessibleBase)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeItemAccessible,
XULTreeItemAccessibleBase)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mColumn)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeItemAccessible)
NS_INTERFACE_MAP_END_INHERITING(nsXULTreeItemAccessibleBase)
NS_IMPL_ADDREF_INHERITED(nsXULTreeItemAccessible, nsXULTreeItemAccessibleBase)
NS_IMPL_RELEASE_INHERITED(nsXULTreeItemAccessible, nsXULTreeItemAccessibleBase)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessible)
NS_INTERFACE_MAP_END_INHERITING(XULTreeItemAccessibleBase)
NS_IMPL_ADDREF_INHERITED(XULTreeItemAccessible, XULTreeItemAccessibleBase)
NS_IMPL_RELEASE_INHERITED(XULTreeItemAccessible, XULTreeItemAccessibleBase)
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessible: nsIAccessible implementation
// XULTreeItemAccessible: nsIAccessible implementation
ENameValueFlag
nsXULTreeItemAccessible::Name(nsString& aName)
XULTreeItemAccessible::Name(nsString& aName)
{
aName.Truncate();
@ -1140,12 +1137,12 @@ nsXULTreeItemAccessible::Name(nsString& aName)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessible: nsAccessNode implementation
// XULTreeItemAccessible: nsAccessNode implementation
bool
nsXULTreeItemAccessible::Init()
XULTreeItemAccessible::Init()
{
if (!nsXULTreeItemAccessibleBase::Init())
if (!XULTreeItemAccessibleBase::Init())
return false;
Name(mCachedName);
@ -1153,17 +1150,17 @@ nsXULTreeItemAccessible::Init()
}
void
nsXULTreeItemAccessible::Shutdown()
XULTreeItemAccessible::Shutdown()
{
mColumn = nsnull;
nsXULTreeItemAccessibleBase::Shutdown();
XULTreeItemAccessibleBase::Shutdown();
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessible: Accessible implementation
// XULTreeItemAccessible: Accessible implementation
role
nsXULTreeItemAccessible::NativeRole()
XULTreeItemAccessible::NativeRole()
{
nsCOMPtr<nsITreeColumns> columns;
mTree->GetColumns(getter_AddRefs(columns));
@ -1179,11 +1176,10 @@ nsXULTreeItemAccessible::NativeRole()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessible: nsXULTreeItemAccessibleBase implementation
// XULTreeItemAccessible: XULTreeItemAccessibleBase implementation
void
nsXULTreeItemAccessible::RowInvalidated(PRInt32 aStartColIdx,
PRInt32 aEndColIdx)
XULTreeItemAccessible::RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx)
{
nsAutoString name;
Name(name);
@ -1195,27 +1191,27 @@ nsXULTreeItemAccessible::RowInvalidated(PRInt32 aStartColIdx,
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeItemAccessible: Accessible protected implementation
// XULTreeItemAccessible: Accessible protected implementation
void
nsXULTreeItemAccessible::CacheChildren()
XULTreeItemAccessible::CacheChildren()
{
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeColumAccessible
// XULTreeColumAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULTreeColumAccessible::
nsXULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULTreeColumAccessible::
XULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
nsXULColumAccessible(aContent, aDoc)
{
}
Accessible*
nsXULTreeColumAccessible::GetSiblingAtOffset(PRInt32 aOffset,
nsresult* aError) const
XULTreeColumAccessible::GetSiblingAtOffset(PRInt32 aOffset,
nsresult* aError) const
{
if (aOffset < 0)
return nsXULColumAccessible::GetSiblingAtOffset(aOffset, aError);
@ -1231,7 +1227,7 @@ nsXULTreeColumAccessible::GetSiblingAtOffset(PRInt32 aOffset,
PRInt32 rowCount = 0;
treeView->GetRowCount(&rowCount);
if (rowCount > 0 && aOffset <= rowCount) {
nsXULTreeAccessible* treeAcc = Parent()->AsXULTree();
XULTreeAccessible* treeAcc = Parent()->AsXULTree();
if (treeAcc)
return treeAcc->GetTreeItemAccessible(aOffset - 1);

View File

@ -2,14 +2,18 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __nsXULTreeAccessible_h__
#define __nsXULTreeAccessible_h__
#ifndef mozilla_a11y_XULTreeAccessible_h__
#define mozilla_a11y_XULTreeAccessible_h__
#include "nsITreeBoxObject.h"
#include "nsITreeView.h"
#include "nsITreeColumns.h"
#include "nsXULListboxAccessible.h"
namespace mozilla {
namespace a11y {
/*
* A class the represents the XUL Tree widget.
*/
@ -20,24 +24,23 @@ const PRUint32 kDefaultTreeCacheSize = 256;
* Accessible class for XUL tree element.
*/
class nsXULTreeAccessible : public AccessibleWrap
class XULTreeAccessible : public AccessibleWrap
{
public:
using Accessible::GetChildAt;
nsXULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsISupports and cycle collection
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeAccessible,
Accessible)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeAccessible, Accessible)
// nsAccessNode
virtual void Shutdown();
// Accessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
EWhichChildAtPoint aWhichChild);
@ -65,7 +68,7 @@ public:
virtual Accessible* ContainerWidget() const;
// nsXULTreeAccessible
// XULTreeAccessible
/**
* Return tree item accessible at the givem row. If accessible doesn't exist
@ -117,7 +120,7 @@ protected:
* Base class for tree item accessibles.
*/
#define NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID \
#define XULTREEITEMBASEACCESSIBLE_IMPL_CID \
{ /* 1ab79ae7-766a-443c-940b-b1e6b0831dfc */ \
0x1ab79ae7, \
0x766a, \
@ -125,18 +128,18 @@ protected:
{ 0x94, 0x0b, 0xb1, 0xe6, 0xb0, 0x83, 0x1d, 0xfc } \
}
class nsXULTreeItemAccessibleBase : public AccessibleWrap
class XULTreeItemAccessibleBase : public AccessibleWrap
{
public:
using Accessible::GetParent;
nsXULTreeItemAccessibleBase(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow);
XULTreeItemAccessibleBase(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow);
// nsISupports and cycle collection
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeItemAccessibleBase,
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessibleBase,
AccessibleWrap)
// nsIAccessible
@ -154,7 +157,7 @@ public:
virtual bool IsPrimaryForNode() const;
// Accessible
virtual mozilla::a11y::GroupPos GroupPosition();
virtual GroupPos GroupPosition();
virtual PRUint64 NativeState();
virtual PRUint64 NativeInteractiveState() const;
virtual PRInt32 IndexInParent() const;
@ -167,8 +170,8 @@ public:
// Widgets
virtual Accessible* ContainerWidget() const;
// nsXULTreeItemAccessibleBase
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
// XULTreeItemAccessibleBase
NS_DECLARE_STATIC_IID_ACCESSOR(XULTREEITEMBASEACCESSIBLE_IMPL_CID)
/**
* Return row index associated with the accessible.
@ -195,7 +198,7 @@ protected:
virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
nsresult *aError = nsnull) const;
// nsXULTreeItemAccessibleBase
// XULTreeItemAccessibleBase
/**
* Return true if the tree item accessible is expandable (contains subrows).
@ -212,34 +215,34 @@ protected:
PRInt32 mRow;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsXULTreeItemAccessibleBase,
NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
NS_DEFINE_STATIC_IID_ACCESSOR(XULTreeItemAccessibleBase,
XULTREEITEMBASEACCESSIBLE_IMPL_CID)
/**
* Accessible class for items for XUL tree.
*/
class nsXULTreeItemAccessible : public nsXULTreeItemAccessibleBase
class XULTreeItemAccessible : public XULTreeItemAccessibleBase
{
public:
nsXULTreeItemAccessible(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow);
XULTreeItemAccessible(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow);
// nsISupports and cycle collection
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeItemAccessible,
nsXULTreeItemAccessibleBase)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessible,
XULTreeItemAccessibleBase)
// nsAccessNode
virtual bool Init();
virtual void Shutdown();
// Accessible
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
virtual mozilla::a11y::role NativeRole();
virtual ENameValueFlag Name(nsString& aName);
virtual a11y::role NativeRole();
// nsXULTreeItemAccessibleBase
// XULTreeItemAccessibleBase
virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx);
protected:
@ -247,7 +250,7 @@ protected:
// Accessible
virtual void CacheChildren();
// nsXULTreeItemAccessible
// XULTreeItemAccessible
nsCOMPtr<nsITreeColumn> mColumn;
nsString mCachedName;
};
@ -256,10 +259,10 @@ protected:
/**
* Accessible class for columns element of XUL tree.
*/
class nsXULTreeColumAccessible : public nsXULColumAccessible
class XULTreeColumAccessible : public nsXULColumAccessible
{
public:
nsXULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
protected:
@ -268,14 +271,17 @@ protected:
nsresult *aError = nsnull) const;
};
} // namespace a11y
} // namespace mozilla
////////////////////////////////////////////////////////////////////////////////
// Accessible downcasting method
inline nsXULTreeAccessible*
inline mozilla::a11y::XULTreeAccessible*
Accessible::AsXULTree()
{
return IsXULTree() ?
static_cast<nsXULTreeAccessible*>(this) : nsnull;
static_cast<mozilla::a11y::XULTreeAccessible*>(this) : nsnull;
}
#endif

View File

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsXULTreeGridAccessibleWrap.h"
#include "XULTreeGridAccessibleWrap.h"
#include "nsAccCache.h"
#include "nsAccessibilityService.h"
@ -20,33 +20,33 @@
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessible
// XULTreeGridAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridAccessible::
nsXULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc) :
nsXULTreeAccessible(aContent, aDoc), xpcAccessibleTable(this)
XULTreeGridAccessible::
XULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULTreeAccessible(aContent, aDoc), xpcAccessibleTable(this)
{
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessible: nsISupports implementation
// XULTreeGridAccessible: nsISupports implementation
NS_IMPL_ISUPPORTS_INHERITED1(nsXULTreeGridAccessible,
nsXULTreeAccessible,
NS_IMPL_ISUPPORTS_INHERITED1(XULTreeGridAccessible,
XULTreeAccessible,
nsIAccessibleTable)
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessible: nsIAccessibleTable implementation
// XULTreeGridAccessible: nsIAccessibleTable implementation
PRUint32
nsXULTreeGridAccessible::ColCount()
XULTreeGridAccessible::ColCount()
{
return nsCoreUtils::GetSensibleColumnCount(mTree);
}
PRUint32
nsXULTreeGridAccessible::RowCount()
XULTreeGridAccessible::RowCount()
{
if (!mTreeView)
return 0;
@ -57,7 +57,7 @@ nsXULTreeGridAccessible::RowCount()
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetSelectedCellCount(PRUint32* aCount)
XULTreeGridAccessible::GetSelectedCellCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -75,7 +75,7 @@ nsXULTreeGridAccessible::GetSelectedCellCount(PRUint32* aCount)
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetSelectedColumnCount(PRUint32* aCount)
XULTreeGridAccessible::GetSelectedColumnCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -106,7 +106,7 @@ nsXULTreeGridAccessible::GetSelectedColumnCount(PRUint32* aCount)
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetSelectedRowCount(PRUint32* aCount)
XULTreeGridAccessible::GetSelectedRowCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -123,7 +123,7 @@ nsXULTreeGridAccessible::GetSelectedRowCount(PRUint32* aCount)
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetSelectedCells(nsIArray **aCells)
XULTreeGridAccessible::GetSelectedCells(nsIArray** aCells)
{
NS_ENSURE_ARG_POINTER(aCells);
*aCells = nsnull;
@ -167,8 +167,8 @@ nsXULTreeGridAccessible::GetSelectedCells(nsIArray **aCells)
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetSelectedCellIndices(PRUint32 *aCellsCount,
PRInt32 **aCells)
XULTreeGridAccessible::GetSelectedCellIndices(PRUint32* aCellsCount,
PRInt32** aCells)
{
NS_ENSURE_ARG_POINTER(aCellsCount);
*aCellsCount = 0;
@ -214,8 +214,8 @@ nsXULTreeGridAccessible::GetSelectedCellIndices(PRUint32 *aCellsCount,
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetSelectedColumnIndices(PRUint32 *acolumnCount,
PRInt32 **aColumns)
XULTreeGridAccessible::GetSelectedColumnIndices(PRUint32* acolumnCount,
PRInt32** aColumns)
{
NS_ENSURE_ARG_POINTER(acolumnCount);
*acolumnCount = 0;
@ -256,8 +256,8 @@ nsXULTreeGridAccessible::GetSelectedColumnIndices(PRUint32 *acolumnCount,
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetSelectedRowIndices(PRUint32 *arowCount,
PRInt32 **aRows)
XULTreeGridAccessible::GetSelectedRowIndices(PRUint32* arowCount,
PRInt32** aRows)
{
NS_ENSURE_ARG_POINTER(arowCount);
*arowCount = 0;
@ -299,7 +299,7 @@ nsXULTreeGridAccessible::GetSelectedRowIndices(PRUint32 *arowCount,
}
Accessible*
nsXULTreeGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
XULTreeGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
{
Accessible* row = GetTreeItemAccessible(aRowIndex);
if (!row)
@ -310,7 +310,7 @@ nsXULTreeGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
if (!column)
return nsnull;
nsRefPtr<nsXULTreeItemAccessibleBase> rowAcc = do_QueryObject(row);
nsRefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(row);
if (!rowAcc)
return nsnull;
@ -318,8 +318,8 @@ nsXULTreeGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex,
PRInt32 *aColumnIndex)
XULTreeGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex,
PRInt32* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
@ -333,7 +333,7 @@ nsXULTreeGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex,
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetRowIndexAt(PRInt32 aCellIndex, PRInt32 *aRowIndex)
XULTreeGridAccessible::GetRowIndexAt(PRInt32 aCellIndex, PRInt32* aRowIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -347,9 +347,9 @@ nsXULTreeGridAccessible::GetRowIndexAt(PRInt32 aCellIndex, PRInt32 *aRowIndex)
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
PRInt32* aRowIndex,
PRInt32* aColumnIndex)
XULTreeGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
PRInt32* aRowIndex,
PRInt32* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -369,8 +369,8 @@ nsXULTreeGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetColumnDescription(PRInt32 aColumnIndex,
nsAString& aDescription)
XULTreeGridAccessible::GetColumnDescription(PRInt32 aColumnIndex,
nsAString& aDescription)
{
aDescription.Truncate();
@ -390,16 +390,15 @@ nsXULTreeGridAccessible::GetColumnDescription(PRInt32 aColumnIndex,
}
NS_IMETHODIMP
nsXULTreeGridAccessible::GetRowDescription(PRInt32 aRowIndex,
nsAString& aDescription)
XULTreeGridAccessible::GetRowDescription(PRInt32 aRowIndex,
nsAString& aDescription)
{
aDescription.Truncate();
return NS_OK;
}
NS_IMETHODIMP
nsXULTreeGridAccessible::IsColumnSelected(PRInt32 aColumnIndex,
bool *aIsSelected)
XULTreeGridAccessible::IsColumnSelected(PRInt32 aColumnIndex, bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -423,7 +422,7 @@ nsXULTreeGridAccessible::IsColumnSelected(PRInt32 aColumnIndex,
}
NS_IMETHODIMP
nsXULTreeGridAccessible::IsRowSelected(PRInt32 aRowIndex, bool *aIsSelected)
XULTreeGridAccessible::IsRowSelected(PRInt32 aRowIndex, bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -442,14 +441,14 @@ nsXULTreeGridAccessible::IsRowSelected(PRInt32 aRowIndex, bool *aIsSelected)
}
NS_IMETHODIMP
nsXULTreeGridAccessible::IsCellSelected(PRInt32 aRowIndex, PRInt32 aColumnIndex,
bool *aIsSelected)
XULTreeGridAccessible::IsCellSelected(PRInt32 aRowIndex, PRInt32 aColumnIndex,
bool* aIsSelected)
{
return IsRowSelected(aRowIndex, aIsSelected);
}
NS_IMETHODIMP
nsXULTreeGridAccessible::SelectRow(PRInt32 aRowIndex)
XULTreeGridAccessible::SelectRow(PRInt32 aRowIndex)
{
if (!mTreeView)
return NS_ERROR_INVALID_ARG;
@ -462,13 +461,13 @@ nsXULTreeGridAccessible::SelectRow(PRInt32 aRowIndex)
}
NS_IMETHODIMP
nsXULTreeGridAccessible::SelectColumn(PRInt32 aColumnIndex)
XULTreeGridAccessible::SelectColumn(PRInt32 aColumnIndex)
{
return NS_OK;
}
void
nsXULTreeGridAccessible::UnselectRow(PRUint32 aRowIdx)
XULTreeGridAccessible::UnselectRow(PRUint32 aRowIdx)
{
if (!mTreeView)
return;
@ -481,20 +480,20 @@ nsXULTreeGridAccessible::UnselectRow(PRUint32 aRowIdx)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessible: nsAccessNode implementation
// XULTreeGridAccessible: nsAccessNode implementation
void
nsXULTreeGridAccessible::Shutdown()
XULTreeGridAccessible::Shutdown()
{
mTable = nsnull;
nsXULTreeAccessible::Shutdown();
XULTreeAccessible::Shutdown();
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessible: Accessible implementation
// XULTreeGridAccessible: Accessible implementation
role
nsXULTreeGridAccessible::NativeRole()
XULTreeGridAccessible::NativeRole()
{
nsCOMPtr<nsITreeColumns> treeColumns;
mTree->GetColumns(getter_AddRefs(treeColumns));
@ -510,77 +509,76 @@ nsXULTreeGridAccessible::NativeRole()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessible: nsXULTreeAccessible implementation
// XULTreeGridAccessible: XULTreeAccessible implementation
already_AddRefed<Accessible>
nsXULTreeGridAccessible::CreateTreeItemAccessible(PRInt32 aRow)
XULTreeGridAccessible::CreateTreeItemAccessible(PRInt32 aRow)
{
nsRefPtr<Accessible> accessible =
new nsXULTreeGridRowAccessible(mContent, mDoc, this, mTree,
mTreeView, aRow);
new XULTreeGridRowAccessible(mContent, mDoc, this, mTree, mTreeView, aRow);
return accessible.forget();
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridRowAccessible
// XULTreeGridRowAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridRowAccessible::
nsXULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aTreeAcc, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow) :
nsXULTreeItemAccessibleBase(aContent, aDoc, aTreeAcc, aTree, aTreeView, aRow)
XULTreeGridRowAccessible::
XULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aTreeAcc, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow) :
XULTreeItemAccessibleBase(aContent, aDoc, aTreeAcc, aTree, aTreeView, aRow)
{
mAccessibleCache.Init(kDefaultTreeCacheSize);
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridRowAccessible: nsISupports and cycle collection implementation
// XULTreeGridRowAccessible: nsISupports and cycle collection implementation
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeGridRowAccessible)
NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeGridRowAccessible)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeGridRowAccessible,
nsXULTreeItemAccessibleBase)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeGridRowAccessible,
XULTreeItemAccessibleBase)
CycleCollectorTraverseCache(tmp->mAccessibleCache, &cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeGridRowAccessible,
nsXULTreeItemAccessibleBase)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeGridRowAccessible,
XULTreeItemAccessibleBase)
ClearCache(tmp->mAccessibleCache);
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeGridRowAccessible)
NS_INTERFACE_MAP_STATIC_AMBIGUOUS(nsXULTreeGridRowAccessible)
NS_INTERFACE_MAP_END_INHERITING(nsXULTreeItemAccessibleBase)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeGridRowAccessible)
NS_INTERFACE_MAP_STATIC_AMBIGUOUS(XULTreeGridRowAccessible)
NS_INTERFACE_MAP_END_INHERITING(XULTreeItemAccessibleBase)
NS_IMPL_ADDREF_INHERITED(nsXULTreeGridRowAccessible,
nsXULTreeItemAccessibleBase)
NS_IMPL_RELEASE_INHERITED(nsXULTreeGridRowAccessible,
nsXULTreeItemAccessibleBase)
NS_IMPL_ADDREF_INHERITED(XULTreeGridRowAccessible,
XULTreeItemAccessibleBase)
NS_IMPL_RELEASE_INHERITED(XULTreeGridRowAccessible,
XULTreeItemAccessibleBase)
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridRowAccessible: nsAccessNode implementation
// XULTreeGridRowAccessible: nsAccessNode implementation
void
nsXULTreeGridRowAccessible::Shutdown()
XULTreeGridRowAccessible::Shutdown()
{
ClearCache(mAccessibleCache);
nsXULTreeItemAccessibleBase::Shutdown();
XULTreeItemAccessibleBase::Shutdown();
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridRowAccessible: Accessible implementation
// XULTreeGridRowAccessible: Accessible implementation
role
nsXULTreeGridRowAccessible::NativeRole()
XULTreeGridRowAccessible::NativeRole()
{
return roles::ROW;
}
ENameValueFlag
nsXULTreeGridRowAccessible::Name(nsString& aName)
XULTreeGridRowAccessible::Name(nsString& aName)
{
aName.Truncate();
@ -601,8 +599,8 @@ nsXULTreeGridRowAccessible::Name(nsString& aName)
}
Accessible*
nsXULTreeGridRowAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
EWhichChildAtPoint aWhichChild)
XULTreeGridRowAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
EWhichChildAtPoint aWhichChild)
{
nsIFrame *frame = GetFrame();
if (!frame)
@ -633,7 +631,7 @@ nsXULTreeGridRowAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
}
Accessible*
nsXULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
XULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
{
if (IsDefunct())
return nsnull;
@ -647,16 +645,16 @@ nsXULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
}
PRUint32
nsXULTreeGridRowAccessible::ChildCount() const
XULTreeGridRowAccessible::ChildCount() const
{
return nsCoreUtils::GetSensibleColumnCount(mTree);
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridRowAccessible: nsXULTreeItemAccessibleBase implementation
// XULTreeGridRowAccessible: XULTreeItemAccessibleBase implementation
Accessible*
nsXULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn)
XULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn)
{
NS_PRECONDITION(aColumn, "No tree column!");
@ -666,8 +664,8 @@ nsXULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn)
return cachedCell;
nsRefPtr<Accessible> cell =
new nsXULTreeGridCellAccessibleWrap(mContent, mDoc, this, mTree,
mTreeView, mRow, aColumn);
new XULTreeGridCellAccessibleWrap(mContent, mDoc, this, mTree,
mTreeView, mRow, aColumn);
if (cell) {
mAccessibleCache.Put(key, cell);
if (Document()->BindToDocument(cell, nsnull))
@ -680,8 +678,8 @@ nsXULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn)
}
void
nsXULTreeGridRowAccessible::RowInvalidated(PRInt32 aStartColIdx,
PRInt32 aEndColIdx)
XULTreeGridRowAccessible::RowInvalidated(PRInt32 aStartColIdx,
PRInt32 aEndColIdx)
{
nsCOMPtr<nsITreeColumns> treeColumns;
mTree->GetColumns(getter_AddRefs(treeColumns));
@ -694,7 +692,7 @@ nsXULTreeGridRowAccessible::RowInvalidated(PRInt32 aStartColIdx,
if (column && !nsCoreUtils::IsColumnHidden(column)) {
Accessible* cellAccessible = GetCellAccessible(column);
if (cellAccessible) {
nsRefPtr<nsXULTreeGridCellAccessible> cellAcc = do_QueryObject(cellAccessible);
nsRefPtr<XULTreeGridCellAccessible> cellAcc = do_QueryObject(cellAccessible);
cellAcc->CellInvalidated();
}
@ -703,22 +701,22 @@ nsXULTreeGridRowAccessible::RowInvalidated(PRInt32 aStartColIdx,
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridRowAccessible: Accessible protected implementation
// XULTreeGridRowAccessible: Accessible protected implementation
void
nsXULTreeGridRowAccessible::CacheChildren()
XULTreeGridRowAccessible::CacheChildren()
{
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible
// XULTreeGridCellAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridCellAccessible::
nsXULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
nsXULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree, nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn) :
XULTreeGridCellAccessible::
XULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
XULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree, nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn) :
LeafAccessible(aContent, aDoc), mTree(aTree),
mTreeView(aTreeView), mRow(aRow), mColumn(aColumn)
{
@ -726,41 +724,41 @@ nsXULTreeGridCellAccessible::
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: nsISupports implementation
// XULTreeGridCellAccessible: nsISupports implementation
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeGridCellAccessible)
NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeGridCellAccessible)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeGridCellAccessible,
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeGridCellAccessible,
LeafAccessible)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTree)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mColumn)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeGridCellAccessible,
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeGridCellAccessible,
LeafAccessible)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTree)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mColumn)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULTreeGridCellAccessible)
NS_INTERFACE_TABLE_INHERITED2(nsXULTreeGridCellAccessible,
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(XULTreeGridCellAccessible)
NS_INTERFACE_TABLE_INHERITED2(XULTreeGridCellAccessible,
nsIAccessibleTableCell,
nsXULTreeGridCellAccessible)
XULTreeGridCellAccessible)
NS_INTERFACE_TABLE_TAIL_INHERITING(LeafAccessible)
NS_IMPL_ADDREF_INHERITED(nsXULTreeGridCellAccessible, LeafAccessible)
NS_IMPL_RELEASE_INHERITED(nsXULTreeGridCellAccessible, LeafAccessible)
NS_IMPL_ADDREF_INHERITED(XULTreeGridCellAccessible, LeafAccessible)
NS_IMPL_RELEASE_INHERITED(XULTreeGridCellAccessible, LeafAccessible)
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: nsIAccessible implementation
// XULTreeGridCellAccessible: nsIAccessible implementation
Accessible*
nsXULTreeGridCellAccessible::FocusedChild()
XULTreeGridCellAccessible::FocusedChild()
{
return nsnull;
}
ENameValueFlag
nsXULTreeGridCellAccessible::Name(nsString& aName)
XULTreeGridCellAccessible::Name(nsString& aName)
{
aName.Truncate();
@ -781,8 +779,8 @@ nsXULTreeGridCellAccessible::Name(nsString& aName)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetBounds(PRInt32 *aX, PRInt32 *aY,
PRInt32 *aWidth, PRInt32 *aHeight)
XULTreeGridCellAccessible::GetBounds(PRInt32* aX, PRInt32* aY,
PRInt32* aWidth, PRInt32* aHeight)
{
NS_ENSURE_ARG_POINTER(aX);
*aX = 0;
@ -823,7 +821,7 @@ nsXULTreeGridCellAccessible::GetBounds(PRInt32 *aX, PRInt32 *aY,
}
PRUint8
nsXULTreeGridCellAccessible::ActionCount()
XULTreeGridCellAccessible::ActionCount()
{
bool isCycler = false;
mColumn->GetCycler(&isCycler);
@ -839,7 +837,7 @@ nsXULTreeGridCellAccessible::ActionCount()
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
XULTreeGridCellAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
aName.Truncate();
@ -873,7 +871,7 @@ nsXULTreeGridCellAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::DoAction(PRUint8 aIndex)
XULTreeGridCellAccessible::DoAction(PRUint8 aIndex)
{
if (aIndex != eAction_Click)
return NS_ERROR_INVALID_ARG;
@ -899,10 +897,10 @@ nsXULTreeGridCellAccessible::DoAction(PRUint8 aIndex)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: nsIAccessibleTableCell implementation
// XULTreeGridCellAccessible: nsIAccessibleTableCell implementation
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetTable(nsIAccessibleTable **aTable)
XULTreeGridCellAccessible::GetTable(nsIAccessibleTable** aTable)
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nsnull;
@ -918,7 +916,7 @@ nsXULTreeGridCellAccessible::GetTable(nsIAccessibleTable **aTable)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
XULTreeGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
@ -931,7 +929,7 @@ nsXULTreeGridCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
XULTreeGridCellAccessible::GetRowIndex(PRInt32* aRowIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -944,7 +942,7 @@ nsXULTreeGridCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetColumnExtent(PRInt32 *aExtentCount)
XULTreeGridCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 1;
@ -953,7 +951,7 @@ nsXULTreeGridCellAccessible::GetColumnExtent(PRInt32 *aExtentCount)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetRowExtent(PRInt32 *aExtentCount)
XULTreeGridCellAccessible::GetRowExtent(PRInt32* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 1;
@ -962,7 +960,7 @@ nsXULTreeGridCellAccessible::GetRowExtent(PRInt32 *aExtentCount)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
XULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
@ -990,7 +988,7 @@ nsXULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
XULTreeGridCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
@ -1008,7 +1006,7 @@ nsXULTreeGridCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
}
NS_IMETHODIMP
nsXULTreeGridCellAccessible::IsSelected(bool *aIsSelected)
XULTreeGridCellAccessible::IsSelected(bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -1024,10 +1022,10 @@ nsXULTreeGridCellAccessible::IsSelected(bool *aIsSelected)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: nsAccessNode implementation
// XULTreeGridCellAccessible: nsAccessNode implementation
bool
nsXULTreeGridCellAccessible::Init()
XULTreeGridCellAccessible::Init()
{
if (!LeafAccessible::Init() || !mTreeView)
return false;
@ -1043,16 +1041,16 @@ nsXULTreeGridCellAccessible::Init()
}
bool
nsXULTreeGridCellAccessible::IsPrimaryForNode() const
XULTreeGridCellAccessible::IsPrimaryForNode() const
{
return false;
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: Accessible public implementation
// XULTreeGridCellAccessible: Accessible public implementation
nsresult
nsXULTreeGridCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
XULTreeGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);
@ -1091,13 +1089,13 @@ nsXULTreeGridCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAtt
}
role
nsXULTreeGridCellAccessible::NativeRole()
XULTreeGridCellAccessible::NativeRole()
{
return roles::GRID_CELL;
}
PRUint64
nsXULTreeGridCellAccessible::NativeState()
XULTreeGridCellAccessible::NativeState()
{
if (!mTreeView)
return states::DEFUNCT;
@ -1129,28 +1127,28 @@ nsXULTreeGridCellAccessible::NativeState()
}
PRUint64
nsXULTreeGridCellAccessible::NativeInteractiveState() const
XULTreeGridCellAccessible::NativeInteractiveState() const
{
return states::SELECTABLE;
}
PRInt32
nsXULTreeGridCellAccessible::IndexInParent() const
XULTreeGridCellAccessible::IndexInParent() const
{
return GetColumnIndex();
}
Relation
nsXULTreeGridCellAccessible::RelationByType(PRUint32 aType)
XULTreeGridCellAccessible::RelationByType(PRUint32 aType)
{
return Relation();
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: public implementation
// XULTreeGridCellAccessible: public implementation
PRInt32
nsXULTreeGridCellAccessible::GetColumnIndex() const
XULTreeGridCellAccessible::GetColumnIndex() const
{
PRInt32 index = 0;
nsCOMPtr<nsITreeColumn> column = mColumn;
@ -1165,7 +1163,7 @@ nsXULTreeGridCellAccessible::GetColumnIndex() const
}
void
nsXULTreeGridCellAccessible::CellInvalidated()
XULTreeGridCellAccessible::CellInvalidated()
{
if (!mTreeView)
return;
@ -1196,11 +1194,11 @@ nsXULTreeGridCellAccessible::CellInvalidated()
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: Accessible protected implementation
// XULTreeGridCellAccessible: Accessible protected implementation
Accessible*
nsXULTreeGridCellAccessible::GetSiblingAtOffset(PRInt32 aOffset,
nsresult* aError) const
XULTreeGridCellAccessible::GetSiblingAtOffset(PRInt32 aOffset,
nsresult* aError) const
{
if (aError)
*aError = NS_OK; // fail peacefully
@ -1221,13 +1219,13 @@ nsXULTreeGridCellAccessible::GetSiblingAtOffset(PRInt32 aOffset,
if (!columnAtOffset)
return nsnull;
nsRefPtr<nsXULTreeItemAccessibleBase> rowAcc = do_QueryObject(Parent());
nsRefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(Parent());
return rowAcc->GetCellAccessible(columnAtOffset);
}
void
nsXULTreeGridCellAccessible::DispatchClickEvent(nsIContent *aContent,
PRUint32 aActionIndex)
XULTreeGridCellAccessible::DispatchClickEvent(nsIContent* aContent,
PRUint32 aActionIndex)
{
if (IsDefunct())
return;
@ -1236,10 +1234,10 @@ nsXULTreeGridCellAccessible::DispatchClickEvent(nsIContent *aContent,
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: protected implementation
// XULTreeGridCellAccessible: protected implementation
bool
nsXULTreeGridCellAccessible::IsEditable() const
XULTreeGridCellAccessible::IsEditable() const
{
if (!mTreeView)
return false;

View File

@ -3,23 +3,26 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __nsXULTreeGridAccessible_h__
#define __nsXULTreeGridAccessible_h__
#ifndef mozilla_a11y_XULTreeGridAccessible_h__
#define mozilla_a11y_XULTreeGridAccessible_h__
#include "nsXULTreeAccessible.h"
#include "XULTreeAccessible.h"
#include "TableAccessible.h"
#include "xpcAccessibleTable.h"
namespace mozilla {
namespace a11y {
/**
* Represents accessible for XUL tree in the case when it has multiple columns.
*/
class nsXULTreeGridAccessible : public nsXULTreeAccessible,
public xpcAccessibleTable,
public nsIAccessibleTable,
public mozilla::a11y::TableAccessible
class XULTreeGridAccessible : public XULTreeAccessible,
public xpcAccessibleTable,
public nsIAccessibleTable,
public TableAccessible
{
public:
nsXULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
XULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -37,12 +40,12 @@ public:
virtual void Shutdown();
// Accessible
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
virtual mozilla::a11y::role NativeRole();
virtual TableAccessible* AsTable() { return this; }
virtual a11y::role NativeRole();
protected:
// nsXULTreeAccessible
// XULTreeAccessible
virtual already_AddRefed<Accessible> CreateTreeItemAccessible(PRInt32 aRow);
};
@ -51,33 +54,33 @@ protected:
* Represents accessible for XUL tree item in the case when XUL tree has
* multiple columns.
*/
class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
class XULTreeGridRowAccessible : public XULTreeItemAccessibleBase
{
public:
using Accessible::GetChildAt;
nsXULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow);
XULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
Accessible* aParent, nsITreeBoxObject* aTree,
nsITreeView* aTreeView, PRInt32 aRow);
// nsISupports and cycle collection
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeGridRowAccessible,
nsXULTreeItemAccessibleBase)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridRowAccessible,
XULTreeItemAccessibleBase)
// nsAccessNode
virtual void Shutdown();
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
virtual a11y::role NativeRole();
virtual ENameValueFlag Name(nsString& aName);
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
EWhichChildAtPoint aWhichChild);
virtual Accessible* GetChildAt(PRUint32 aIndex);
virtual PRUint32 ChildCount() const;
// nsXULTreeItemAccessibleBase
// XULTreeItemAccessibleBase
virtual Accessible* GetCellAccessible(nsITreeColumn* aColumn);
virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx);
@ -86,7 +89,7 @@ protected:
// Accessible
virtual void CacheChildren();
// nsXULTreeItemAccessibleBase
// XULTreeItemAccessibleBase
AccessibleHashtable mAccessibleCache;
};
@ -96,7 +99,7 @@ protected:
* multiple columns.
*/
#define NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID \
#define XULTREEGRIDCELLACCESSIBLE_IMPL_CID \
{ /* 84588ad4-549c-4196-a932-4c5ca5de5dff */ \
0x84588ad4, \
0x549c, \
@ -104,19 +107,19 @@ protected:
{ 0xa9, 0x32, 0x4c, 0x5c, 0xa5, 0xde, 0x5d, 0xff } \
}
class nsXULTreeGridCellAccessible : public mozilla::a11y::LeafAccessible,
public nsIAccessibleTableCell
class XULTreeGridCellAccessible : public LeafAccessible,
public nsIAccessibleTableCell
{
public:
nsXULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
nsXULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree, nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn);
XULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
XULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree, nsITreeView* aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeGridCellAccessible,
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridCellAccessible,
LeafAccessible)
// nsIAccessible
@ -135,20 +138,20 @@ public:
virtual bool IsPrimaryForNode() const;
// Accessible
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
virtual ENameValueFlag Name(nsString& aName);
virtual Accessible* FocusedChild();
virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
virtual PRInt32 IndexInParent() const;
virtual Relation RelationByType(PRUint32 aType);
virtual mozilla::a11y::role NativeRole();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual PRUint64 NativeInteractiveState() const;
// ActionAccessible
virtual PRUint8 ActionCount();
// nsXULTreeGridCellAccessible
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
// XULTreeGridCellAccessible
NS_DECLARE_STATIC_IID_ACCESSOR(XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
/**
* Return index of the column.
@ -167,7 +170,7 @@ protected:
nsresult* aError = nsnull) const;
virtual void DispatchClickEvent(nsIContent* aContent, PRUint32 aActionIndex);
// nsXULTreeGridCellAccessible
// XULTreeGridCellAccessible
/**
* Return true if value of cell can be modified.
@ -185,7 +188,10 @@ protected:
nsString mCachedTextEquiv;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsXULTreeGridCellAccessible,
NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
NS_DEFINE_STATIC_IID_ACCESSOR(XULTreeGridCellAccessible,
XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
} // namespace a11y
} // namespace mozilla
#endif