summaryrefslogtreecommitdiffstats
path: root/accessible/windows/msaa/MsaaDocAccessible.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /accessible/windows/msaa/MsaaDocAccessible.h
parentInitial commit. (diff)
downloadfirefox-esr-37a0381f8351b370577b65028ba1f6563ae23fdf.tar.xz
firefox-esr-37a0381f8351b370577b65028ba1f6563ae23fdf.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/windows/msaa/MsaaDocAccessible.h')
-rw-r--r--accessible/windows/msaa/MsaaDocAccessible.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/accessible/windows/msaa/MsaaDocAccessible.h b/accessible/windows/msaa/MsaaDocAccessible.h
new file mode 100644
index 0000000000..4bb36670a4
--- /dev/null
+++ b/accessible/windows/msaa/MsaaDocAccessible.h
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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_MsaaDocAccessible_h__
+#define mozilla_a11y_MsaaDocAccessible_h__
+
+#include "ia2AccessibleHypertext.h"
+#include "nsTHashMap.h"
+
+namespace mozilla {
+
+namespace a11y {
+class Accessible;
+class DocAccessible;
+class DocAccessibleParent;
+
+class MsaaDocAccessible : public ia2AccessibleHypertext {
+ public:
+ DocAccessible* DocAcc();
+
+ // IUnknown
+ DECL_IUNKNOWN_INHERITED
+ IMPL_IUNKNOWN_REFCOUNTING_INHERITED(ia2AccessibleHypertext)
+
+ // IAccessible
+
+ // Override get_accParent for e10s
+ virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accParent(
+ /* [retval][out] */ IDispatch __RPC_FAR* __RPC_FAR* ppdispParent)
+ override;
+
+ // Override get_accValue to provide URL when no other value is available
+ virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accValue(
+ /* [optional][in] */ VARIANT varChild,
+ /* [retval][out] */ BSTR __RPC_FAR* pszValue) override;
+
+ /**
+ * Manage the mapping from id to Accessible.
+ */
+ void AddID(uint32_t aID, Accessible* aAcc) {
+ mIDToAccessibleMap.InsertOrUpdate(aID, aAcc);
+ }
+ void RemoveID(uint32_t aID) { mIDToAccessibleMap.Remove(aID); }
+ Accessible* GetAccessibleByID(uint32_t aID) const {
+ return mIDToAccessibleMap.Get(aID);
+ }
+
+ static MsaaDocAccessible* GetFrom(DocAccessible* aDoc);
+ static MsaaDocAccessible* GetFrom(DocAccessibleParent* aDoc);
+
+ /**
+ * Get the MsaaDocAccessible for the document which owns the given Accessible.
+ */
+ static MsaaDocAccessible* GetFromOwned(Accessible* aAcc);
+
+ protected:
+ using ia2AccessibleHypertext::ia2AccessibleHypertext;
+
+ /*
+ * This provides a mapping from 32 bit id to accessible objects.
+ */
+ nsTHashMap<nsUint32HashKey, Accessible*> mIDToAccessibleMap;
+};
+
+} // namespace a11y
+} // namespace mozilla
+
+#endif