Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim:expandtab:shiftwidth=2:tabstop=2: |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef mozilla_a11y_ApplicationAccessible_h__ |
michael@0 | 9 | #define mozilla_a11y_ApplicationAccessible_h__ |
michael@0 | 10 | |
michael@0 | 11 | #include "AccessibleWrap.h" |
michael@0 | 12 | #include "nsIAccessibleApplication.h" |
michael@0 | 13 | |
michael@0 | 14 | #include "nsIMutableArray.h" |
michael@0 | 15 | #include "nsIXULAppInfo.h" |
michael@0 | 16 | |
michael@0 | 17 | namespace mozilla { |
michael@0 | 18 | namespace a11y { |
michael@0 | 19 | |
michael@0 | 20 | /** |
michael@0 | 21 | * ApplicationAccessible is for the whole application of Mozilla. |
michael@0 | 22 | * Only one instance of ApplicationAccessible exists for one Mozilla instance. |
michael@0 | 23 | * And this one should be created when Mozilla Startup (if accessibility |
michael@0 | 24 | * feature has been enabled) and destroyed when Mozilla Shutdown. |
michael@0 | 25 | * |
michael@0 | 26 | * All the accessibility objects for toplevel windows are direct children of |
michael@0 | 27 | * the ApplicationAccessible instance. |
michael@0 | 28 | */ |
michael@0 | 29 | |
michael@0 | 30 | class ApplicationAccessible : public AccessibleWrap, |
michael@0 | 31 | public nsIAccessibleApplication |
michael@0 | 32 | { |
michael@0 | 33 | public: |
michael@0 | 34 | |
michael@0 | 35 | ApplicationAccessible(); |
michael@0 | 36 | |
michael@0 | 37 | // nsISupports |
michael@0 | 38 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 39 | |
michael@0 | 40 | // nsIAccessible |
michael@0 | 41 | NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument); |
michael@0 | 42 | NS_IMETHOD ScrollTo(uint32_t aScrollType); |
michael@0 | 43 | NS_IMETHOD ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY); |
michael@0 | 44 | NS_IMETHOD GetLanguage(nsAString& aLanguage); |
michael@0 | 45 | NS_IMETHOD GetParent(nsIAccessible **aParent); |
michael@0 | 46 | NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling); |
michael@0 | 47 | NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling); |
michael@0 | 48 | NS_IMETHOD GetBounds(int32_t *aX, int32_t *aY, |
michael@0 | 49 | int32_t *aWidth, int32_t *aHeight); |
michael@0 | 50 | NS_IMETHOD SetSelected(bool aIsSelected); |
michael@0 | 51 | NS_IMETHOD TakeSelection(); |
michael@0 | 52 | NS_IMETHOD TakeFocus(); |
michael@0 | 53 | NS_IMETHOD GetActionName(uint8_t aIndex, nsAString &aName); |
michael@0 | 54 | NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString &aDescription); |
michael@0 | 55 | NS_IMETHOD DoAction(uint8_t aIndex); |
michael@0 | 56 | |
michael@0 | 57 | // nsIAccessibleApplication |
michael@0 | 58 | NS_DECL_NSIACCESSIBLEAPPLICATION |
michael@0 | 59 | |
michael@0 | 60 | // Accessible |
michael@0 | 61 | virtual void Shutdown(); |
michael@0 | 62 | virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE; |
michael@0 | 63 | virtual GroupPos GroupPosition(); |
michael@0 | 64 | virtual ENameValueFlag Name(nsString& aName); |
michael@0 | 65 | virtual void ApplyARIAState(uint64_t* aState) const; |
michael@0 | 66 | virtual void Description(nsString& aDescription); |
michael@0 | 67 | virtual void Value(nsString& aValue); |
michael@0 | 68 | virtual mozilla::a11y::role NativeRole(); |
michael@0 | 69 | virtual uint64_t State(); |
michael@0 | 70 | virtual uint64_t NativeState(); |
michael@0 | 71 | virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE; |
michael@0 | 72 | |
michael@0 | 73 | virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY, |
michael@0 | 74 | EWhichChildAtPoint aWhichChild); |
michael@0 | 75 | virtual Accessible* FocusedChild(); |
michael@0 | 76 | |
michael@0 | 77 | virtual void InvalidateChildren(); |
michael@0 | 78 | |
michael@0 | 79 | // ActionAccessible |
michael@0 | 80 | virtual uint8_t ActionCount(); |
michael@0 | 81 | virtual KeyBinding AccessKey() const; |
michael@0 | 82 | |
michael@0 | 83 | protected: |
michael@0 | 84 | |
michael@0 | 85 | // Accessible |
michael@0 | 86 | virtual void CacheChildren(); |
michael@0 | 87 | virtual Accessible* GetSiblingAtOffset(int32_t aOffset, |
michael@0 | 88 | nsresult *aError = nullptr) const; |
michael@0 | 89 | |
michael@0 | 90 | private: |
michael@0 | 91 | nsCOMPtr<nsIXULAppInfo> mAppInfo; |
michael@0 | 92 | }; |
michael@0 | 93 | |
michael@0 | 94 | } // namespace a11y |
michael@0 | 95 | } // namespace mozilla |
michael@0 | 96 | |
michael@0 | 97 | #endif |
michael@0 | 98 |