michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:expandtab:shiftwidth=2:tabstop=2: michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_a11y_ApplicationAccessible_h__ michael@0: #define mozilla_a11y_ApplicationAccessible_h__ michael@0: michael@0: #include "AccessibleWrap.h" michael@0: #include "nsIAccessibleApplication.h" michael@0: michael@0: #include "nsIMutableArray.h" michael@0: #include "nsIXULAppInfo.h" michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: /** michael@0: * ApplicationAccessible is for the whole application of Mozilla. michael@0: * Only one instance of ApplicationAccessible exists for one Mozilla instance. michael@0: * And this one should be created when Mozilla Startup (if accessibility michael@0: * feature has been enabled) and destroyed when Mozilla Shutdown. michael@0: * michael@0: * All the accessibility objects for toplevel windows are direct children of michael@0: * the ApplicationAccessible instance. michael@0: */ michael@0: michael@0: class ApplicationAccessible : public AccessibleWrap, michael@0: public nsIAccessibleApplication michael@0: { michael@0: public: michael@0: michael@0: ApplicationAccessible(); michael@0: michael@0: // nsISupports michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: michael@0: // nsIAccessible michael@0: NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument); michael@0: NS_IMETHOD ScrollTo(uint32_t aScrollType); michael@0: NS_IMETHOD ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY); michael@0: NS_IMETHOD GetLanguage(nsAString& aLanguage); michael@0: NS_IMETHOD GetParent(nsIAccessible **aParent); michael@0: NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling); michael@0: NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling); michael@0: NS_IMETHOD GetBounds(int32_t *aX, int32_t *aY, michael@0: int32_t *aWidth, int32_t *aHeight); michael@0: NS_IMETHOD SetSelected(bool aIsSelected); michael@0: NS_IMETHOD TakeSelection(); michael@0: NS_IMETHOD TakeFocus(); michael@0: NS_IMETHOD GetActionName(uint8_t aIndex, nsAString &aName); michael@0: NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString &aDescription); michael@0: NS_IMETHOD DoAction(uint8_t aIndex); michael@0: michael@0: // nsIAccessibleApplication michael@0: NS_DECL_NSIACCESSIBLEAPPLICATION michael@0: michael@0: // Accessible michael@0: virtual void Shutdown(); michael@0: virtual already_AddRefed NativeAttributes() MOZ_OVERRIDE; michael@0: virtual GroupPos GroupPosition(); michael@0: virtual ENameValueFlag Name(nsString& aName); michael@0: virtual void ApplyARIAState(uint64_t* aState) const; michael@0: virtual void Description(nsString& aDescription); michael@0: virtual void Value(nsString& aValue); michael@0: virtual mozilla::a11y::role NativeRole(); michael@0: virtual uint64_t State(); michael@0: virtual uint64_t NativeState(); michael@0: virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE; michael@0: michael@0: virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY, michael@0: EWhichChildAtPoint aWhichChild); michael@0: virtual Accessible* FocusedChild(); michael@0: michael@0: virtual void InvalidateChildren(); michael@0: michael@0: // ActionAccessible michael@0: virtual uint8_t ActionCount(); michael@0: virtual KeyBinding AccessKey() const; michael@0: michael@0: protected: michael@0: michael@0: // Accessible michael@0: virtual void CacheChildren(); michael@0: virtual Accessible* GetSiblingAtOffset(int32_t aOffset, michael@0: nsresult *aError = nullptr) const; michael@0: michael@0: private: michael@0: nsCOMPtr mAppInfo; michael@0: }; michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif michael@0: