diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /accessible/mac/HyperTextAccessibleWrap.h | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/mac/HyperTextAccessibleWrap.h')
-rw-r--r-- | accessible/mac/HyperTextAccessibleWrap.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/accessible/mac/HyperTextAccessibleWrap.h b/accessible/mac/HyperTextAccessibleWrap.h new file mode 100644 index 0000000000..bb418ed179 --- /dev/null +++ b/accessible/mac/HyperTextAccessibleWrap.h @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_a11y_HyperTextAccessibleWrap_h__ +#define mozilla_a11y_HyperTextAccessibleWrap_h__ + +#include "HyperTextAccessible.h" +#include "PlatformExtTypes.h" + +namespace mozilla { +namespace a11y { + +struct TextPoint; + +class HyperTextAccessibleWrap : public HyperTextAccessible { + public: + HyperTextAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) + : HyperTextAccessible(aContent, aDoc) {} + + void TextForRange(nsAString& aText, int32_t aStartOffset, + HyperTextAccessible* aEndContainer, int32_t aEndOffset); + + void AttributedTextForRange(nsTArray<nsString>& aStrings, + nsTArray<RefPtr<AccAttributes>>& aProperties, + nsTArray<LocalAccessible*>& aContainers, + int32_t aStartOffset, + HyperTextAccessible* aEndContainer, + int32_t aEndOffset); + + LayoutDeviceIntRect BoundsForRange(int32_t aStartOffset, + HyperTextAccessible* aEndContainer, + int32_t aEndOffset); + + int32_t LengthForRange(int32_t aStartOffset, + HyperTextAccessible* aEndContainer, + int32_t aEndOffset); + + void OffsetAtIndex(int32_t aIndex, HyperTextAccessible** aContainer, + int32_t* aOffset); + + void RangeAt(int32_t aOffset, EWhichRange aRangeType, + HyperTextAccessible** aStartContainer, int32_t* aStartOffset, + HyperTextAccessible** aEndContainer, int32_t* aEndOffset); + + void NextClusterAt(int32_t aOffset, HyperTextAccessible** aNextContainer, + int32_t* aNextOffset); + + void PreviousClusterAt(int32_t aOffset, HyperTextAccessible** aPrevContainer, + int32_t* aPrevOffset); + + void RangeOfChild(LocalAccessible* aChild, int32_t* aStartOffset, + int32_t* aEndOffset); + + LocalAccessible* LeafAtOffset(int32_t aOffset); + + MOZ_CAN_RUN_SCRIPT void SelectRange(int32_t aStartOffset, + HyperTextAccessible* aEndContainer, + int32_t aEndOffset); + + protected: + ~HyperTextAccessibleWrap() {} + + private: + TextPoint FindTextPoint(int32_t aOffset, nsDirection aDirection, + nsSelectionAmount aAmount, + EWordMovementType aWordMovementType); + + HyperTextAccessibleWrap* EditableRoot(); + + void LeftWordAt(int32_t aOffset, HyperTextAccessible** aStartContainer, + int32_t* aStartOffset, HyperTextAccessible** aEndContainer, + int32_t* aEndOffset); + + void RightWordAt(int32_t aOffset, HyperTextAccessible** aStartContainer, + int32_t* aStartOffset, HyperTextAccessible** aEndContainer, + int32_t* aEndOffset); + + void LineAt(int32_t aOffset, bool aNextLine, + HyperTextAccessible** aStartContainer, int32_t* aStartOffset, + HyperTextAccessible** aEndContainer, int32_t* aEndOffset); + + void ParagraphAt(int32_t aOffset, HyperTextAccessible** aStartContainer, + int32_t* aStartOffset, HyperTextAccessible** aEndContainer, + int32_t* aEndOffset); + + void StyleAt(int32_t aOffset, HyperTextAccessible** aStartContainer, + int32_t* aStartOffset, HyperTextAccessible** aEndContainer, + int32_t* aEndOffset); +}; + +} // namespace a11y +} // namespace mozilla + +#endif |