Bug 812466 - namespacify Accessible classes, r=tbsaunde

This commit is contained in:
Alexander Surkov 2012-11-18 11:01:44 +09:00
parent e4f96fc0f6
commit 37336125af
96 changed files with 419 additions and 149 deletions

View File

@ -12,7 +12,14 @@
#include "nsAutoPtr.h"
namespace mozilla {
namespace a11y {
class Accessible;
} // namespace a11y
} // namespace mozilla
class nsINode;
class nsIContent;
class nsIFrame;
@ -37,15 +44,17 @@ public:
* @param aCanCreate [in] points whether the root document accessible
* should be returned from the cache or can be created
*/
virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
bool aCanCreate) = 0;
virtual mozilla::a11y::Accessible*
GetRootDocumentAccessible(nsIPresShell* aPresShell, bool aCanCreate) = 0;
/**
* Adds/remove ATK root accessible for gtk+ native window to/from children
* of the application accessible.
*/
virtual Accessible* AddNativeRootAccessible(void* aAtkAccessible) = 0;
virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible) = 0;
virtual mozilla::a11y::Accessible*
AddNativeRootAccessible(void* aAtkAccessible) = 0;
virtual void
RemoveNativeRootAccessible(mozilla::a11y::Accessible* aRootAccessible) = 0;
/**
* Fire accessible event of the given type for the given target.
@ -53,7 +62,8 @@ public:
* @param aEvent [in] accessible event type
* @param aTarget [in] target of accessible event
*/
virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget) = 0;
virtual void FireAccessibleEvent(uint32_t aEvent,
mozilla::a11y::Accessible* aTarget) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService,

View File

@ -41,6 +41,9 @@ struct AtkPropertyChange {
void *newvalue;
};
namespace mozilla {
namespace a11y {
class MaiHyperlink;
/**
@ -110,4 +113,7 @@ private:
uint16_t CreateMaiInterfaces(void);
};
} // namespace a11y
} // namespace mozilla
#endif /* __NS_ACCESSIBLE_WRAP_H__ */

View File

@ -11,6 +11,8 @@
#include "nsMai.h"
#include "mozilla/Likely.h"
using namespace mozilla::a11y;
AtkSocketEmbedType AtkSocketAccessible::g_atk_socket_embed = NULL;
GType AtkSocketAccessible::g_atk_socket_type = G_TYPE_INVALID;
const char* AtkSocketAccessible::sATKSocketEmbedSymbol = "atk_socket_embed";

View File

@ -17,6 +17,9 @@ extern "C" typedef void (*AtkSocketEmbedType) (AtkSocket*, gchar*);
extern "C" typedef void (*AtkSocketEmbedType) (void*, void*);
#endif
namespace mozilla {
namespace a11y {
/**
* Provides a AccessibleWrap wrapper around AtkSocket for out-of-process
* accessibles.
@ -49,4 +52,7 @@ public:
NS_IMETHODIMP GetNativeInterface(void** aOutAccessible);
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -7,6 +7,8 @@
#include "nsMai.h"
#include "DocAccessibleWrap.h"
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// DocAccessibleWrap
////////////////////////////////////////////////////////////////////////////////

View File

@ -13,6 +13,9 @@
#include "DocAccessible.h"
namespace mozilla {
namespace a11y {
class DocAccessibleWrap : public DocAccessible
{
public:
@ -23,4 +26,7 @@ public:
bool mActivated;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -9,7 +9,13 @@
#include "HyperTextAccessible.h"
namespace mozilla {
namespace a11y {
typedef class HyperTextAccessible HyperTextAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -9,8 +9,14 @@
#include <atk/atk.h>
namespace mozilla {
namespace a11y {
class AccessibleWrap;
} // namespace a11y
} // namespace mozilla
extern "C" {
void actionInterfaceInitCB(AtkActionIface* aIface);
void componentInterfaceInitCB(AtkComponentIface* aIface);
@ -28,9 +34,9 @@ void valueInterfaceInitCB(AtkValueIface *aIface);
/**
* XXX these should live in a file of utils for atk.
*/
AtkObject* refAccessibleAtPointHelper(AccessibleWrap* aAccWrap,
AtkObject* refAccessibleAtPointHelper(mozilla::a11y::AccessibleWrap* aAccWrap,
gint aX, gint aY, AtkCoordType aCoordType);
void getExtentsHelper(AccessibleWrap* aAccWrap,
void getExtentsHelper(mozilla::a11y::AccessibleWrap* aAccWrap,
gint* aX, gint* aY, gint* aWidth, gint* aHeight,
AtkCoordType aCoordType);

View File

@ -10,6 +10,7 @@
* see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
*/
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsAccessNodeWrap

View File

@ -13,7 +13,10 @@
#include "nsAccessNode.h"
class nsAccessNodeWrap : public nsAccessNode
namespace mozilla {
namespace a11y {
class nsAccessNodeWrap : public nsAccessNode
{
public: // construction, destruction
nsAccessNodeWrap(nsIContent* aContent, DocAccessible* aDoc);
@ -23,4 +26,7 @@ public: // construction, destruction
static void ShutdownAccessibility();
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -46,6 +46,6 @@ PR_END_MACRO
MAI_TYPE_ATK_OBJECT, \
MaiAtkObjectClass))
GType mai_atk_object_get_type(void);
AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
#endif /* __NS_MAI_H__ */

View File

@ -7,6 +7,8 @@
#include "nsIURI.h"
#include "nsMaiHyperlink.h"
using namespace mozilla::a11y;
/* MaiAtkHyperlink */
#define MAI_TYPE_ATK_HYPERLINK (mai_atk_hyperlink_get_type ())

View File

@ -13,6 +13,9 @@
struct _AtkHyperlink;
typedef struct _AtkHyperlink AtkHyperlink;
namespace mozilla {
namespace a11y {
/*
* MaiHyperlink is a auxiliary class for MaiInterfaceHyperText.
*/
@ -34,4 +37,8 @@ protected:
public:
static nsresult Initialize(AtkHyperlink *aObj, MaiHyperlink *aClass);
};
} // namespace a11y
} // namespace mozilla
#endif /* __MAI_HYPERLINK_H__ */

View File

@ -12,6 +12,8 @@
#include "nsMai.h"
#include "mozilla/Likely.h"
using namespace mozilla::a11y;
extern "C" {
static AtkObject*

View File

@ -11,6 +11,8 @@
#include "nsMai.h"
#include "mozilla/Likely.h"
using namespace mozilla::a11y;
static const char* const kDocTypeName = "W3C-doctype";
static const char* const kDocUrlName = "DocURL";
static const char* const kMimeTypeName = "MimeType";

View File

@ -12,6 +12,8 @@
#include "nsString.h"
#include "mozilla/Likely.h"
using namespace mozilla::a11y;
extern "C" {
static void
setTextContentsCB(AtkEditableText *aText, const gchar *aString)

View File

@ -9,6 +9,8 @@
#include "nsMaiHyperlink.h"
#include "mozilla/Likely.h"
using namespace mozilla::a11y;
extern "C" {
static AtkHyperlink*
getHyperlinkCB(AtkHyperlinkImpl* aImpl)

View File

@ -11,6 +11,8 @@
#include "nsMaiHyperlink.h"
#include "mozilla/Likely.h"
using namespace mozilla::a11y;
extern "C" {
static AtkHyperlink*

View File

@ -12,6 +12,8 @@
#include <atk/atk.h>
using namespace mozilla::a11y;
extern "C" {
static gboolean

View File

@ -10,6 +10,8 @@
#include "AccessibleWrap.h"
#include "nsMai.h"
using namespace mozilla::a11y;
extern "C" {
static void

View File

@ -9,11 +9,11 @@
#include "nsTArray.h"
class Accessible;
namespace mozilla {
namespace a11y {
class Accessible;
/**
* Collect accessible children complying with filter function. Provides quick
* access to accessible by index.
@ -86,7 +86,7 @@ protected:
virtual void AppendObject(Accessible* aAccessible);
friend class ::Accessible;
friend class Accessible;
};
} // namespace a11y

View File

@ -10,9 +10,13 @@
#include "mozilla/a11y/Accessible.h"
class nsAccEvent;
namespace mozilla {
namespace a11y {
class DocAccessible;
class nsAccEvent;
// Constants used to point whether the event is from user input.
enum EIsFromUserInput
{
@ -486,5 +490,8 @@ private:
AccEvent* mRawPtr;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -8,6 +8,9 @@
#include "Accessible-inl.h"
#include "nsAccUtils.h"
namespace mozilla {
namespace a11y {
/**
* Calculate and store group information.
*/
@ -76,4 +79,7 @@ private:
Accessible* mParent;
};
} // namespace mozilla
} // namespace a11y
#endif

View File

@ -24,7 +24,7 @@ public:
virtual Accessible* Next() = 0;
private:
friend class mozilla::a11y::Relation;
friend class Relation;
nsAutoPtr<AccIterable> mNextIter;
};

View File

@ -7,13 +7,14 @@
#include "mozilla/StandardInteger.h"
class Accessible;
/**
* Predefined filters used for nsAccIterator and nsAccCollector.
*/
namespace mozilla {
namespace a11y {
class Accessible;
namespace filters {
enum EResult {

View File

@ -8,13 +8,13 @@
#include "nsAutoPtr.h"
#include "mozilla/dom/Element.h"
namespace mozilla {
namespace a11y {
class AccEvent;
class Accessible;
class DocAccessible;
namespace mozilla {
namespace a11y {
/**
* Manage the accessible focus. Used to fire and process accessible events.
*/

View File

@ -10,10 +10,6 @@
#include "nscore.h"
#include "nsAString.h"
class AccEvent;
class Accessible;
class DocAccessible;
class nsIDocument;
class nsINode;
class nsIRequest;
@ -23,6 +19,9 @@ class nsIWebProgress;
namespace mozilla {
namespace a11y {
class AccEvent;
class Accessible;
class DocAccessible;
class OuterDocAccessible;
namespace logging {

View File

@ -14,9 +14,13 @@
#include "Logging.h"
#endif
class nsIContent;
namespace mozilla {
namespace a11y {
class Accessible;
class DocAccessible;
class nsIContent;
/**
* Notification interface.
@ -347,4 +351,7 @@ private:
nsTArray<nsRefPtr<AccEvent> > mEvents;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -10,16 +10,17 @@
#include "nsColor.h"
#include "nsStyleConsts.h"
class HyperTextAccessible;
class nsIFrame;
class nsIPersistentProperties;
class nsIContent;
class Accessible;
class nsDeviceContext;
namespace mozilla {
namespace a11y {
class Accessible;
class HyperTextAccessible;
/**
* Used to expose text attributes for the hyper text accessible (see
* HyperTextAccessible class).

View File

@ -33,9 +33,9 @@ ClearCacheEntry(const void* aKey, nsRefPtr<T>& aAccessible, void* aUserArg)
*/
static void
ClearCache(AccessibleHashtable& aCache)
ClearCache(mozilla::a11y::AccessibleHashtable& aCache)
{
aCache.Enumerate(ClearCacheEntry<Accessible>, nullptr);
aCache.Enumerate(ClearCacheEntry<mozilla::a11y::Accessible>, nullptr);
}
/**
@ -61,10 +61,11 @@ CycleCollectorTraverseCacheEntry(const void *aKey, T *aAccessible,
*/
static void
CycleCollectorTraverseCache(AccessibleHashtable& aCache,
CycleCollectorTraverseCache(mozilla::a11y::AccessibleHashtable& aCache,
nsCycleCollectionTraversalCallback *aCallback)
{
aCache.EnumerateRead(CycleCollectorTraverseCacheEntry<Accessible>, aCallback);
aCache.EnumerateRead(CycleCollectorTraverseCacheEntry<mozilla::a11y::Accessible>,
aCallback);
}
#endif

View File

@ -13,9 +13,15 @@
#include "nsWeakReference.h"
#include "nsIPresShell.h"
namespace mozilla {
namespace a11y {
class Accessible;
class DocAccessible;
} // namespace a11y
} // namespace mozilla
/**
* Manage the document accessible life cycle.
*/
@ -24,6 +30,9 @@ class nsAccDocManager : public nsIWebProgressListener,
public nsSupportsWeakReference
{
public:
typedef mozilla::a11y::Accessible Accessible;
typedef mozilla::a11y::DocAccessible DocAccessible;
virtual ~nsAccDocManager() { }
NS_DECL_ISUPPORTS

View File

@ -11,6 +11,8 @@
#include "nsINodeList.h"
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// WalkState
////////////////////////////////////////////////////////////////////////////////

View File

@ -9,8 +9,15 @@
#include "nsAutoPtr.h"
#include "nsIContent.h"
namespace mozilla {
namespace a11y {
class Accessible;
class DocAccessible;
} // namespace a11y
} // namespace mozilla
struct WalkState;
/**
@ -19,6 +26,9 @@ struct WalkState;
class nsAccTreeWalker
{
public:
typedef mozilla::a11y::Accessible Accessible;
typedef mozilla::a11y::DocAccessible DocAccessible;
nsAccTreeWalker(DocAccessible* aDoc, Accessible* aContext, nsIContent* aNode,
bool aWalkCache = false);
virtual ~nsAccTreeWalker();

View File

@ -20,11 +20,15 @@
#include "nsIPresShell.h"
#include "nsPoint.h"
struct nsRoleMapEntry;
namespace mozilla {
namespace a11y {
class nsAccessNode;
class Accessible;
class HyperTextAccessible;
class DocAccessible;
struct nsRoleMapEntry;
class nsAccUtils
{
@ -293,4 +297,7 @@ public:
static bool MustPrune(Accessible* aAccessible);
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -13,23 +13,19 @@
#include "nsIAccessibleTypes.h"
#include "nsINode.h"
class nsAccessNode;
class DocAccessible;
class nsIAccessibleDocument;
class nsIContent;
class nsIDocShellTreeItem;
class nsIFrame;
class nsIPresShell;
class nsPresContext;
namespace mozilla {
namespace a11y {
class DocAccessible;
class RootAccessible;
}
}
class nsIPresShell;
class nsPresContext;
class nsIFrame;
class nsIDocShellTreeItem;
class nsAccessNode: public nsISupports
class nsAccessNode : public nsISupports
{
public:
@ -47,7 +43,7 @@ public:
/**
* Return the root document accessible for this accessnode.
*/
mozilla::a11y::RootAccessible* RootAccessible() const;
a11y::RootAccessible* RootAccessible() const;
/**
* Shutdown the access node object.
@ -58,6 +54,7 @@ public:
* Return frame for the given access node object.
*/
virtual nsIFrame* GetFrame() const;
/**
* Return DOM node associated with the accessible.
*/
@ -103,5 +100,8 @@ private:
nsAccessNode& operator =(const nsAccessNode&) MOZ_DELETE;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -14,7 +14,14 @@
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
namespace mozilla {
namespace a11y {
class Accessible;
} // namespace a11y
} // namespace mozilla
class nsIAccessibleTraversalRule;
/**
@ -23,6 +30,8 @@ class nsIAccessibleTraversalRule;
class nsAccessiblePivot MOZ_FINAL : public nsIAccessiblePivot
{
public:
typedef mozilla::a11y::Accessible Accessible;
nsAccessiblePivot(Accessible* aRoot);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS

View File

@ -117,7 +117,7 @@ private:
// If it was on a control, then its control's selection. Otherwise, it's for
// a document where the selection changed.
nsCOMPtr<nsIWeakReference> mLastUsedSelection; // Weak ref to nsISelection
nsRefPtr<HyperTextAccessible> mLastTextAccessible;
nsRefPtr<mozilla::a11y::HyperTextAccessible> mLastTextAccessible;
int32_t mLastCaretOffset;
mozilla::a11y::RootAccessible* mRootAccessible;

View File

@ -7,6 +7,8 @@
#include "nsAccUtils.h"
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsEventShell
////////////////////////////////////////////////////////////////////////////////

View File

@ -20,7 +20,7 @@ public:
/**
* Fire the accessible event.
*/
static void FireEvent(AccEvent* aEvent);
static void FireEvent(mozilla::a11y::AccEvent* aEvent);
/**
* Fire accessible event of the given type for the given accessible.
@ -28,8 +28,9 @@ public:
* @param aEventType [in] the event type
* @param aAccessible [in] the event target
*/
static void FireEvent(uint32_t aEventType, Accessible* aAccessible,
EIsFromUserInput aIsFromUserInput = eAutoDetect);
static void FireEvent(uint32_t aEventType,
mozilla::a11y::Accessible* aAccessible,
mozilla::a11y::EIsFromUserInput aIsFromUserInput = mozilla::a11y::eAutoDetect);
/**
* Append 'event-from-input' object attribute if the accessible event has

View File

@ -42,6 +42,7 @@ enum ETextEquivRule
class nsTextEquivUtils
{
public:
typedef mozilla::a11y::Accessible Accessible;
/**
* Calculates the name from accessible subtree if allowed.

View File

@ -11,8 +11,11 @@
#include "AccIterator.h"
namespace mozilla {
namespace a11y {
inline Accessible*
mozilla::a11y::ARIAGridCellAccessible::TableFor(Accessible* aRow) const
ARIAGridCellAccessible::TableFor(Accessible* aRow) const
{
if (aRow) {
Accessible* table = aRow->Parent();
@ -33,7 +36,7 @@ mozilla::a11y::ARIAGridCellAccessible::TableFor(Accessible* aRow) const
}
inline int32_t
mozilla::a11y::ARIAGridCellAccessible::RowIndexFor(Accessible* aRow) const
ARIAGridCellAccessible::RowIndexFor(Accessible* aRow) const
{
Accessible* table = TableFor(aRow);
if (table) {
@ -50,4 +53,7 @@ mozilla::a11y::ARIAGridCellAccessible::RowIndexFor(Accessible* aRow) const
return -1;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -10,6 +10,9 @@
#include "Accessible.h"
#include "nsARIAMap.h"
namespace mozilla {
namespace a11y {
inline mozilla::a11y::role
Accessible::Role()
{
@ -45,4 +48,7 @@ Accessible::HasNumericValue() const
return mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -21,20 +21,26 @@
#include "nsTArray.h"
#include "nsRefPtrHashtable.h"
class AccEvent;
class AccGroupInfo;
class KeyBinding;
class Accessible;
class HyperTextAccessible;
struct nsRoleMapEntry;
struct nsRect;
class nsIContent;
class nsIFrame;
class nsIAtom;
class nsIView;
namespace mozilla {
namespace a11y {
class Accessible;
class AccEvent;
class AccGroupInfo;
class EmbeddedObjCollector;
class HTMLImageMapAccessible;
class HTMLLIAccessible;
class HyperTextAccessible;
class ImageAccessible;
class KeyBinding;
class Relation;
class TableAccessible;
class TableCellAccessible;
@ -81,15 +87,6 @@ struct GroupPos
int32_t setSize;
};
} // namespace a11y
} // namespace mozilla
struct nsRect;
class nsIContent;
class nsIFrame;
class nsIAtom;
class nsIView;
typedef nsRefPtrHashtable<nsPtrHashKey<const void>, Accessible>
AccessibleHashtable;
@ -150,7 +147,7 @@ public:
* Note: aName.IsVoid() when name was left empty by the author on purpose.
* aName.IsEmpty() when the author missed name, AT can try to repair a name.
*/
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
virtual ENameValueFlag Name(nsString& aName);
/**
* Return DOM node associated with this accessible.
@ -911,7 +908,7 @@ protected:
nsAutoPtr<mozilla::a11y::EmbeddedObjCollector> mEmbeddedObjCollector;
int32_t mIndexOfEmbeddedChild;
friend class mozilla::a11y::EmbeddedObjCollector;
friend class EmbeddedObjCollector;
nsAutoPtr<AccGroupInfo> mGroupInfo;
friend class AccGroupInfo;
@ -983,4 +980,7 @@ private:
uint32_t mModifierMask;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -12,6 +12,9 @@
#include "NotificationController.h"
#include "States.h"
namespace mozilla {
namespace a11y {
inline void
DocAccessible::BindChildDocument(DocAccessible* aDocument)
{
@ -50,7 +53,7 @@ DocAccessible::NotifyOfLoad(uint32_t aLoadEventType)
// caused by file loading. Fire busy state change event.
if (HasLoadState(eCompletelyLoaded) && IsLoadEventTarget()) {
nsRefPtr<AccEvent> stateEvent =
new AccStateChangeEvent(this, mozilla::a11y::states::BUSY, false);
new AccStateChangeEvent(this, states::BUSY, false);
FireDelayedAccessibleEvent(stateEvent);
}
}
@ -59,8 +62,7 @@ inline void
DocAccessible::MaybeNotifyOfValueChange(Accessible* aAccessible)
{
mozilla::a11y::role role = aAccessible->Role();
if (role == mozilla::a11y::roles::ENTRY ||
role == mozilla::a11y::roles::COMBOBOX) {
if (role == roles::ENTRY || role == roles::COMBOBOX) {
nsRefPtr<AccEvent> valueChangeEvent =
new AccEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, aAccessible,
eAutoDetect, AccEvent::eRemoveDupes);
@ -68,4 +70,7 @@ DocAccessible::MaybeNotifyOfValueChange(Accessible* aAccessible)
}
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -24,22 +24,20 @@
#include "nsIWeakReference.h"
#include "nsIDocShellTreeNode.h"
template<class Class, class Arg>
class TNotification;
class NotificationController;
class nsAccDocManager;
class nsAccessiblePivot;
class nsIScrollableView;
class nsAccessiblePivot;
const uint32_t kDefaultCacheSize = 256;
namespace mozilla {
namespace a11y {
class NotificationController;
class RelatedAccIterator;
} // namespace a11y
} // namespace mozilla
template<class Class, class Arg>
class TNotification;
class DocAccessible : public HyperTextAccessibleWrap,
public nsIAccessibleDocument,
@ -333,7 +331,7 @@ protected:
void NotifyOfLoad(uint32_t aLoadEventType);
void NotifyOfLoading(bool aIsReloading);
friend class nsAccDocManager;
friend class ::nsAccDocManager;
/**
* Perform initial update (create accessible tree).
@ -563,7 +561,7 @@ protected:
typedef nsTArray<nsAutoPtr<AttrRelProvider> > AttrRelProviderArray;
nsClassHashtable<nsStringHashKey, AttrRelProviderArray> mDependentIDsHash;
friend class mozilla::a11y::RelatedAccIterator;
friend class RelatedAccIterator;
/**
* Used for our caching algorithm. We store the list of nodes that should be
@ -591,4 +589,7 @@ Accessible::AsDoc()
static_cast<DocAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -17,12 +17,11 @@
namespace mozilla {
namespace a11y {
struct DOMPoint {
nsINode* node;
int32_t idx;
};
}
}
enum EGetTextType { eGetBefore=-1, eGetAt=0, eGetAfter=1 };
@ -243,7 +242,7 @@ public:
protected:
// Accessible
virtual mozilla::a11y::ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
// HyperTextAccessible
@ -405,5 +404,8 @@ Accessible::AsHyperText()
static_cast<HyperTextAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -77,18 +77,17 @@ private:
};
} // namespace a11y
} // namespace mozilla
////////////////////////////////////////////////////////////////////////////////
// Accessible downcasting method
inline mozilla::a11y::ImageAccessible*
inline ImageAccessible*
Accessible::AsImage()
{
return IsImage() ?
static_cast<mozilla::a11y::ImageAccessible*>(this) : nullptr;
return IsImage() ? static_cast<ImageAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -9,7 +9,6 @@
#include "nsCaretAccessible.h"
#include "DocAccessibleWrap.h"
#include "nsHashtable.h"
#include "nsCaretAccessible.h"
#include "nsIDocument.h"
@ -83,14 +82,14 @@ protected:
nsRefPtr<nsCaretAccessible> mCaretAccessible;
};
} // namespace a11y
} // namespace mozilla
inline mozilla::a11y::RootAccessible*
inline RootAccessible*
Accessible::AsRoot()
{
return mFlags & eRootAccessible ?
static_cast<mozilla::a11y::RootAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -11,11 +11,11 @@
#include "nsTArray.h"
#include "prtypes.h"
class Accessible;
namespace mozilla {
namespace a11y {
class Accessible;
/**
* Accessible table interface.
*/

View File

@ -10,11 +10,10 @@
#include "nsTArray.h"
#include "mozilla/StandardInteger.h"
class Accessible;
namespace mozilla {
namespace a11y {
class Accessible;
class TableAccessible;
/**

View File

@ -38,18 +38,19 @@ protected:
nsString mText;
};
} // namespace a11y
} // namespace mozilla
////////////////////////////////////////////////////////////////////////////////
// Accessible downcast method
inline mozilla::a11y::TextLeafAccessible*
inline TextLeafAccessible*
Accessible::AsTextLeaf()
{
return mFlags & eTextLeafAccessible ?
static_cast<mozilla::a11y::TextLeafAccessible*>(this) : nullptr;
static_cast<TextLeafAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -69,17 +69,18 @@ protected:
virtual void CacheChildren();
};
} // namespace a11y
} // namespace mozilla
////////////////////////////////////////////////////////////////////////////////
// Accessible downcasting method
inline mozilla::a11y::HTMLImageMapAccessible*
inline HTMLImageMapAccessible*
Accessible::AsImageMap()
{
return IsImageMapAccessible() ?
static_cast<mozilla::a11y::HTMLImageMapAccessible*>(this) : nullptr;
static_cast<HTMLImageMapAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -96,15 +96,15 @@ public:
bool IsInside() const;
};
} // namespace a11y
} // namespace mozilla
inline mozilla::a11y::HTMLLIAccessible*
inline HTMLLIAccessible*
Accessible::AsHTMLListItem()
{
return mFlags & eHTMLListItemAccessible ?
static_cast<mozilla::a11y::HTMLLIAccessible*>(this) : nullptr;
static_cast<HTMLLIAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -25,6 +25,9 @@
@class mozAccessible;
#endif
namespace mozilla {
namespace a11y {
class AccessibleWrap : public Accessible
{
public: // construction, destruction
@ -108,4 +111,7 @@ private:
bool mNativeInited;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -8,6 +8,9 @@
#include "DocAccessible.h"
namespace mozilla {
namespace a11y {
class DocAccessibleWrap : public DocAccessible
{
public:
@ -17,4 +20,7 @@ public:
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -7,6 +7,8 @@
#import "mozAccessible.h"
using namespace mozilla::a11y;
DocAccessibleWrap::
DocAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
nsIPresShell* aPresShell) :

View File

@ -8,7 +8,13 @@
#include "HyperTextAccessible.h"
namespace mozilla {
namespace a11y {
typedef class HyperTextAccessible HyperTextAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -36,7 +36,7 @@ GetNativeFromGeckoAccessible(nsIAccessible* aAccessible)
/**
* Weak reference; it owns us.
*/
AccessibleWrap* mGeckoAccessible;
mozilla::a11y::AccessibleWrap* mGeckoAccessible;
/**
* Strong ref to array of children
@ -55,7 +55,7 @@ GetNativeFromGeckoAccessible(nsIAccessible* aAccessible)
}
// inits with the gecko owner.
- (id)initWithAccessible:(AccessibleWrap*)geckoParent;
- (id)initWithAccessible:(mozilla::a11y::AccessibleWrap*)geckoParent;
// our accessible parent (AXParent)
- (id <mozAccessible>)parent;
@ -116,7 +116,7 @@ GetNativeFromGeckoAccessible(nsIAccessible* aAccessible)
/**
* Append a child if they are already cached.
*/
- (void)appendChild:(Accessible*)aAccessible;
- (void)appendChild:(mozilla::a11y::Accessible*)aAccessible;
// makes ourselves "expired". after this point, we might be around if someone
// has retained us (e.g., a third-party), but we really contain no information.

View File

@ -10,7 +10,7 @@
{
// both of these are the same old mGeckoAccessible, but already
// QI'd for us, to the right type, for convenience.
HyperTextAccessible *mGeckoTextAccessible; // strong
mozilla::a11y::HyperTextAccessible* mGeckoTextAccessible; // strong
nsIAccessibleEditableText *mGeckoEditableTextAccessible; // strong
}
@end

View File

@ -12,7 +12,10 @@
#include "nsAccessNode.h"
class nsAccessNodeWrap : public nsAccessNode
namespace mozilla {
namespace a11y {
class nsAccessNodeWrap : public nsAccessNode
{
public:
nsAccessNodeWrap(nsIContent* aContent, DocAccessible* aDoc);
@ -22,5 +25,8 @@ public:
static void ShutdownAccessibility();
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -9,6 +9,7 @@
* see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
*/
using namespace mozilla::a11y;
/*
* Class nsAccessNodeWrap

View File

@ -116,6 +116,10 @@ __try { \
IMPL_IUNKNOWN_QUERY_CLASS(Super0) \
IMPL_IUNKNOWN_QUERY_TAIL
namespace mozilla {
namespace a11y {
class AccessibleWrap : public Accessible,
public ia2AccessibleComponent,
public ia2AccessibleHyperlink,
@ -370,4 +374,7 @@ protected:
};
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -9,11 +9,11 @@
#include "mozilla/StandardInteger.h"
class nsAccessNodeWrap;
namespace mozilla {
namespace a11y {
class nsAccessNodeWrap;
/**
* Used to get compatibility modes. Note, modes are computed at accessibility
* start up time and aren't changed during lifetime.

View File

@ -15,6 +15,9 @@
#include "DocAccessible.h"
#include "nsIDocShellTreeItem.h"
namespace mozilla {
namespace a11y {
class DocAccessibleWrap : public DocAccessible,
public ISimpleDOMDocument
{
@ -69,4 +72,7 @@ protected:
void* mHWND;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -9,6 +9,9 @@
#include "nsEventShell.h"
using namespace mozilla;
using namespace mozilla::a11y;
NS_IMPL_ISUPPORTS_INHERITED0(HyperTextAccessibleWrap,
HyperTextAccessible)

View File

@ -12,6 +12,9 @@
#include "ia2AccessibleEditableText.h"
#include "ia2AccessibleHyperText.h"
namespace mozilla {
namespace a11y {
class HyperTextAccessibleWrap : public HyperTextAccessible,
public ia2AccessibleHypertext,
public ia2AccessibleEditableText
@ -35,5 +38,7 @@ protected:
uint32_t *aEndOffset);
};
#endif
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -43,12 +43,15 @@
{ } \
return E_FAIL;
namespace mozilla {
namespace a11y {
class AccTextChangeEvent;
class nsAccessNodeWrap : public nsAccessNode,
public nsIWinAccessNode,
public ISimpleDOMNode,
public IServiceProvider
class nsAccessNodeWrap : public nsAccessNode,
public nsIWinAccessNode,
public ISimpleDOMNode,
public IServiceProvider
{
public:
NS_DECL_ISUPPORTS_INHERITED
@ -148,6 +151,9 @@ protected:
static AccTextChangeEvent* gTextEvent;
};
} // namespace a11y
} // namespace mozilla
/**
* Converts nsresult to HRESULT.
*/

View File

@ -5,6 +5,8 @@
#include "AccessibleWrap.h"
using namespace mozilla::a11y;
//-----------------------------------------------------
// construction
//-----------------------------------------------------

View File

@ -7,12 +7,15 @@
* see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
*/
#ifndef _AccessibleWrap_H_
#define _AccessibleWrap_H_
#ifndef mozilla_a11y_AccessibleWrap_h_
#define mozilla_a11y_AccessibleWrap_h_
#include "nsCOMPtr.h"
#include "Accessible.h"
namespace mozilla {
namespace a11y {
class AccessibleWrap : public Accessible
{
public: // construction, destruction
@ -26,4 +29,7 @@ public: // construction, destruction
}
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -12,6 +12,12 @@
#include "DocAccessible.h"
namespace mozilla {
namespace a11y {
typedef DocAccessible DocAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -8,7 +8,13 @@
#include "HyperTextAccessible.h"
namespace mozilla {
namespace a11y {
typedef class HyperTextAccessible HyperTextAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -9,6 +9,7 @@
* see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
*/
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// Class nsAccessNodeWrap

View File

@ -12,6 +12,9 @@
#include "nsAccessNode.h"
namespace mozilla {
namespace a11y {
class nsAccessNodeWrap : public nsAccessNode
{
public: // construction, destruction
@ -22,5 +25,8 @@ public: // construction, destruction
static void ShutdownAccessibility();
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -11,6 +11,8 @@
#include "AccessibleWrap.h"
using namespace mozilla::a11y;
// IUnknown
STDMETHODIMP

View File

@ -13,6 +13,8 @@
#include "nsCOMPtr.h"
#include "nsString.h"
using namespace mozilla::a11y;
// IAccessibleEditableText
STDMETHODIMP

View File

@ -12,6 +12,8 @@
#include "AccessibleWrap.h"
#include "nsIWinAccessNode.h"
using namespace mozilla::a11y;
// IUnknown
STDMETHODIMP

View File

@ -11,6 +11,8 @@
#include "HyperTextAccessibleWrap.h"
using namespace mozilla::a11y;
// IAccessibleHypertext
STDMETHODIMP

View File

@ -20,6 +20,8 @@
#include "nsCOMPtr.h"
#include "nsString.h"
using namespace mozilla::a11y;
#define TABLECELL_INTERFACE_UNSUPPORTED_MSG \
"Subclass of ia2AccessibleTableCell doesn't implement nsIAccessibleTableCell"\

View File

@ -14,6 +14,8 @@
#include "nsIPersistentProperties2.h"
using namespace mozilla::a11y;
// IAccessibleText
STDMETHODIMP

View File

@ -11,6 +11,8 @@
#include "AccessibleWrap.h"
using namespace mozilla::a11y;
// IUnknown
STDMETHODIMP

View File

@ -11,11 +11,11 @@
#include "AccessibleWrap.h"
#include "UIAutomation.h"
class AccessibleWrap;
namespace mozilla {
namespace a11y {
class AccessibleWrap;
/**
* IRawElementProviderSimple implementation (maintains IAccessibleEx approach).
*/

View File

@ -7,6 +7,8 @@
#include "nsAccUtils.h"
#include "DocAccessible.h"
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsAccEvent
////////////////////////////////////////////////////////////////////////////////

View File

@ -10,6 +10,9 @@
#include "AccEvent.h"
namespace mozilla {
namespace a11y {
/**
* Generic accessible event.
*/
@ -151,5 +154,8 @@ private:
nsAccVirtualCursorChangeEvent& operator =(const nsAccVirtualCursorChangeEvent&) MOZ_DELETE;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -12,6 +12,8 @@
#include "nsIMutableArray.h"
#include "nsComponentManagerUtils.h"
using namespace mozilla::a11y;
static const uint32_t XPC_TABLE_DEFAULT_SIZE = 40;
nsresult

View File

@ -10,14 +10,13 @@
#include "nsAString.h"
#include "nscore.h"
class nsIAccessible;
class nsIArray;
namespace mozilla {
namespace a11y {
class TableAccessible;
}
}
class xpcAccessibleTable
{
@ -65,4 +64,7 @@ protected:
mozilla::a11y::TableAccessible* mTable;
};
} // namespace a11y
} // namespace mozilla
#endif // MOZILLA_A11Y_XPCOM_XPACCESSIBLETABLE_H_

View File

@ -40,6 +40,7 @@ public:
protected:
mozilla::a11y::TableCellAccessible* mTableCell;
};
} // namespace a11y
} // namespace mozilla

View File

@ -269,17 +269,17 @@ protected:
nsresult *aError = nullptr) const;
};
} // namespace a11y
} // namespace mozilla
////////////////////////////////////////////////////////////////////////////////
// Accessible downcasting method
inline mozilla::a11y::XULTreeAccessible*
inline XULTreeAccessible*
Accessible::AsXULTree()
{
return IsXULTree() ?
static_cast<mozilla::a11y::XULTreeAccessible*>(this) : nullptr;
return IsXULTree() ? static_cast<XULTreeAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -76,7 +76,11 @@ class nsRefreshDriver;
class nsARefreshObserver;
#ifdef ACCESSIBILITY
class nsAccessibilityService;
namespace mozilla {
namespace a11y {
class DocAccessible;
} // namespace a11y
} // namespace mozilla
#endif
class nsIWidget;
struct nsArenaMemoryStats;
@ -274,7 +278,7 @@ public:
/**
* Return the document accessible for this pres shell if there is one.
*/
DocAccessible* GetDocAccessible() const
mozilla::a11y::DocAccessible* GetDocAccessible() const
{
return mDocAccessible;
}
@ -282,7 +286,7 @@ public:
/**
* Set the document accessible for this pres shell.
*/
void SetDocAccessible(DocAccessible* aDocAccessible)
void SetDocAccessible(mozilla::a11y::DocAccessible* aDocAccessible)
{
mDocAccessible = aDocAccessible;
}
@ -1377,7 +1381,7 @@ protected:
nsWeakPtr mForwardingContainer;
nsRefreshDriver* mHiddenInvalidationObserverRefreshDriver;
#ifdef ACCESSIBILITY
DocAccessible* mDocAccessible;
mozilla::a11y::DocAccessible* mDocAccessible;
#endif
#ifdef DEBUG

View File

@ -473,7 +473,7 @@ public:
bool PaintWindow(nsIntRegion aRegion, bool aIsAlternate);
#ifdef ACCESSIBILITY
already_AddRefed<Accessible> GetDocumentAccessible();
already_AddRefed<mozilla::a11y::Accessible> GetDocumentAccessible();
#endif
virtual void CreateCompositor();

View File

@ -1854,13 +1854,13 @@ nsChildView::EndSecureKeyboardInput()
}
#ifdef ACCESSIBILITY
already_AddRefed<Accessible>
already_AddRefed<a11y::Accessible>
nsChildView::GetDocumentAccessible()
{
if (!mozilla::a11y::ShouldA11yBeEnabled())
return nullptr;
Accessible *docAccessible = nullptr;
a11y::Accessible* docAccessible = nullptr;
if (mAccessible) {
CallQueryReferent(mAccessible.get(), &docAccessible);
return docAccessible;
@ -1868,7 +1868,7 @@ nsChildView::GetDocumentAccessible()
// need to fetch the accessible anew, because it has gone away.
// cache the accessible in our weak ptr
Accessible* acc = GetAccessible();
a11y::Accessible* acc = GetAccessible();
mAccessible = do_GetWeakReference(static_cast<nsIAccessible *>(acc));
NS_IF_ADDREF(acc);
@ -4597,7 +4597,7 @@ static int32_t RoundUp(double aDouble)
nsAutoRetainCocoaObject kungFuDeathGrip(self);
nsCOMPtr<nsIWidget> kungFuDeathGrip2(mGeckoChild);
nsRefPtr<Accessible> accessible = mGeckoChild->GetDocumentAccessible();
nsRefPtr<a11y::Accessible> accessible = mGeckoChild->GetDocumentAccessible();
if (!accessible)
return nil;

View File

@ -5822,7 +5822,7 @@ nsWindow::DispatchEventToRootAccessible(uint32_t aEventType)
}
// Get the root document accessible and fire event to it.
Accessible *acc = GetAccessible();
a11y::Accessible* acc = GetAccessible();
if (acc) {
accService->FireAccessibleEvent(aEventType, acc);
}

View File

@ -366,7 +366,7 @@ private:
nsRefPtr<gfxASurface> mThebesSurface;
#ifdef ACCESSIBILITY
nsRefPtr<Accessible> mRootAccessible;
nsRefPtr<mozilla::a11y::Accessible> mRootAccessible;
/**
* Request to create the accessible for this window if it is top level.

View File

@ -5138,7 +5138,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam,
// for details).
DWORD objId = static_cast<DWORD>(lParam);
if (objId == OBJID_CLIENT) { // oleacc.dll will be loaded dynamically
Accessible* rootAccessible = GetRootAccessible(); // Held by a11y cache
a11y::Accessible* rootAccessible = GetRootAccessible(); // Held by a11y cache
if (rootAccessible) {
IAccessible *msaaAccessible = NULL;
rootAccessible->GetNativeInterface((void**)&msaaAccessible); // does an addref
@ -7467,7 +7467,7 @@ bool nsWindow::AssociateDefaultIMC(bool aAssociate)
#ifdef DEBUG_WMGETOBJECT
#define NS_LOG_WMGETOBJECT_WNDACC(aWnd) \
Accessible* acc = aWnd ? aWind->GetAccessible() : nullptr; \
a11y::Accessible* acc = aWnd ? aWind->GetAccessible() : nullptr; \
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (" acc: %p", acc)); \
if (acc) { \
nsAutoString name; \
@ -7505,7 +7505,7 @@ bool nsWindow::AssociateDefaultIMC(bool aAssociate)
#define NS_LOG_WMGETOBJECT_WND(aMsg, aHwnd)
#endif // DEBUG_WMGETOBJECT
Accessible*
a11y::Accessible*
nsWindow::GetRootAccessible()
{
// If the pref was ePlatformIsDisabled, return null here, disabling a11y.

View File

@ -207,7 +207,7 @@ public:
void SuppressBlurEvents(bool aSuppress); // Called from nsFilePicker
bool BlurEventsSuppressed();
#ifdef ACCESSIBILITY
Accessible* GetRootAccessible();
mozilla::a11y::Accessible* GetRootAccessible();
#endif // ACCESSIBILITY
/**

View File

@ -1396,7 +1396,7 @@ nsBaseWidget::NotifyUIStateChanged(UIStateChangeType aShowAccelerators,
#ifdef ACCESSIBILITY
Accessible*
a11y::Accessible*
nsBaseWidget::GetAccessible()
{
NS_ENSURE_TRUE(mWidgetListener, nullptr);

View File

@ -19,11 +19,13 @@ class nsIContent;
class nsAutoRollup;
class gfxContext;
namespace mozilla {
#ifdef ACCESSIBILITY
namespace a11y {
class Accessible;
}
#endif
namespace mozilla {
namespace layers {
class BasicLayerManager;
class CompositorChild;
@ -172,7 +174,7 @@ public:
#ifdef ACCESSIBILITY
// Get the accessible for the window.
Accessible* GetAccessible();
mozilla::a11y::Accessible* GetAccessible();
#endif
nsPopupLevel PopupLevel() { return mPopupLevel; }