1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_a11y_AccessibleWrap_h_
7 #define mozilla_a11y_AccessibleWrap_h_
9 #include "LocalAccessible.h"
10 #include "mozilla/a11y/RemoteAccessible.h"
11 #include "mozilla/java/GeckoBundleWrappers.h"
17 class AccessibleWrap
: public LocalAccessible
{
19 AccessibleWrap(nsIContent
* aContent
, DocAccessible
* aDoc
);
20 virtual ~AccessibleWrap();
22 MOZ_CAN_RUN_SCRIPT_BOUNDARY
// TODO: Mark this as MOZ_CAN_RUN_SCRIPT
24 HandleAccEvent(AccEvent
* aEvent
) override
;
26 virtual void Shutdown() override
;
28 virtual bool DoAction(uint8_t aIndex
) const override
;
30 MOZ_CAN_RUN_SCRIPT_BOUNDARY
31 virtual bool PivotTo(int32_t aGranularity
, bool aForward
, bool aInclusive
);
33 void ExploreByTouch(float aX
, float aY
);
35 static uint32_t GetFlags(role aRole
, uint64_t aState
, uint8_t aActionCount
);
37 static int32_t GetInputType(const nsString
& aInputTypeAttr
);
39 static int32_t GetAndroidClass(role aRole
);
41 static void GetRoleDescription(role aRole
, AccAttributes
* aAttributes
,
42 nsAString
& aGeckoRole
,
43 nsAString
& aRoleDescription
);
45 static int32_t AndroidClass(Accessible
* aAccessible
);
47 static int32_t GetVirtualViewID(Accessible
* aAccessible
);
49 static void SetVirtualViewID(Accessible
* aAccessible
, int32_t aVirtualViewID
);
51 static Accessible
* DoPivot(Accessible
* aAccessible
, int32_t aGranularity
,
52 bool aForward
, bool aInclusive
);
54 static Maybe
<std::pair
<int32_t, int32_t>> NavigateText(
55 Accessible
* aAccessible
, int32_t aGranularity
, int32_t aStartOffset
,
56 int32_t aEndOffset
, bool aForward
, bool aSelect
);
62 void GetTextEquiv(nsString
& aText
);
64 bool HandleLiveRegionEvent(AccEvent
* aEvent
);
68 } // namespace mozilla