Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_a11y_XULMenuAccessible_h__ |
michael@0 | 7 | #define mozilla_a11y_XULMenuAccessible_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "AccessibleWrap.h" |
michael@0 | 10 | #include "nsIDOMXULSelectCntrlEl.h" |
michael@0 | 11 | #include "XULSelectControlAccessible.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace a11y { |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * Used for XUL menu, menuitem elements. |
michael@0 | 18 | */ |
michael@0 | 19 | class XULMenuitemAccessible : public AccessibleWrap |
michael@0 | 20 | { |
michael@0 | 21 | public: |
michael@0 | 22 | enum { eAction_Click = 0 }; |
michael@0 | 23 | |
michael@0 | 24 | XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc); |
michael@0 | 25 | |
michael@0 | 26 | // nsIAccessible |
michael@0 | 27 | NS_IMETHOD DoAction(uint8_t index); |
michael@0 | 28 | NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName); |
michael@0 | 29 | |
michael@0 | 30 | // Accessible |
michael@0 | 31 | virtual void Description(nsString& aDescription); |
michael@0 | 32 | virtual a11y::role NativeRole(); |
michael@0 | 33 | virtual uint64_t NativeState(); |
michael@0 | 34 | virtual uint64_t NativeInteractiveState() const; |
michael@0 | 35 | virtual int32_t GetLevelInternal(); |
michael@0 | 36 | |
michael@0 | 37 | virtual bool CanHaveAnonChildren(); |
michael@0 | 38 | |
michael@0 | 39 | // ActionAccessible |
michael@0 | 40 | virtual uint8_t ActionCount(); |
michael@0 | 41 | virtual KeyBinding AccessKey() const; |
michael@0 | 42 | virtual KeyBinding KeyboardShortcut() const; |
michael@0 | 43 | |
michael@0 | 44 | // Widgets |
michael@0 | 45 | virtual bool IsActiveWidget() const; |
michael@0 | 46 | virtual bool AreItemsOperable() const; |
michael@0 | 47 | virtual Accessible* ContainerWidget() const; |
michael@0 | 48 | |
michael@0 | 49 | protected: |
michael@0 | 50 | // Accessible |
michael@0 | 51 | virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE; |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * Used for XUL menuseparator element. |
michael@0 | 56 | */ |
michael@0 | 57 | class XULMenuSeparatorAccessible : public XULMenuitemAccessible |
michael@0 | 58 | { |
michael@0 | 59 | public: |
michael@0 | 60 | XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc); |
michael@0 | 61 | |
michael@0 | 62 | // nsIAccessible |
michael@0 | 63 | NS_IMETHOD DoAction(uint8_t index); |
michael@0 | 64 | NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName); |
michael@0 | 65 | |
michael@0 | 66 | // Accessible |
michael@0 | 67 | virtual a11y::role NativeRole(); |
michael@0 | 68 | virtual uint64_t NativeState(); |
michael@0 | 69 | |
michael@0 | 70 | // ActionAccessible |
michael@0 | 71 | virtual uint8_t ActionCount(); |
michael@0 | 72 | |
michael@0 | 73 | protected: |
michael@0 | 74 | // Accessible |
michael@0 | 75 | virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE; |
michael@0 | 76 | }; |
michael@0 | 77 | |
michael@0 | 78 | |
michael@0 | 79 | /** |
michael@0 | 80 | * Used for XUL menupopup and panel. |
michael@0 | 81 | */ |
michael@0 | 82 | class XULMenupopupAccessible : public XULSelectControlAccessible |
michael@0 | 83 | { |
michael@0 | 84 | public: |
michael@0 | 85 | XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc); |
michael@0 | 86 | |
michael@0 | 87 | // Accessible |
michael@0 | 88 | virtual a11y::role NativeRole(); |
michael@0 | 89 | virtual uint64_t NativeState(); |
michael@0 | 90 | |
michael@0 | 91 | // Widgets |
michael@0 | 92 | virtual bool IsWidget() const; |
michael@0 | 93 | virtual bool IsActiveWidget() const; |
michael@0 | 94 | virtual bool AreItemsOperable() const; |
michael@0 | 95 | |
michael@0 | 96 | virtual Accessible* ContainerWidget() const; |
michael@0 | 97 | |
michael@0 | 98 | protected: |
michael@0 | 99 | // Accessible |
michael@0 | 100 | virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE; |
michael@0 | 101 | }; |
michael@0 | 102 | |
michael@0 | 103 | /** |
michael@0 | 104 | * Used for XUL menubar element. |
michael@0 | 105 | */ |
michael@0 | 106 | class XULMenubarAccessible : public AccessibleWrap |
michael@0 | 107 | { |
michael@0 | 108 | public: |
michael@0 | 109 | XULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc); |
michael@0 | 110 | |
michael@0 | 111 | // Accessible |
michael@0 | 112 | virtual a11y::role NativeRole(); |
michael@0 | 113 | |
michael@0 | 114 | // Widget |
michael@0 | 115 | virtual bool IsActiveWidget() const; |
michael@0 | 116 | virtual bool AreItemsOperable() const; |
michael@0 | 117 | virtual Accessible* CurrentItem(); |
michael@0 | 118 | virtual void SetCurrentItem(Accessible* aItem); |
michael@0 | 119 | |
michael@0 | 120 | protected: |
michael@0 | 121 | // Accessible |
michael@0 | 122 | virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE; |
michael@0 | 123 | }; |
michael@0 | 124 | |
michael@0 | 125 | } // namespace a11y |
michael@0 | 126 | } // namespace mozilla |
michael@0 | 127 | |
michael@0 | 128 | #endif |