Bug 1760380 [wpt PR 33241] - Update wpt metadata, a=testonly
[gecko.git] / accessible / xpcom / xpcAccessibleHyperText.h
blob06cdba2d7a0055475bd91f1ceeb8164f61ac268f
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_a11y_xpcAccessibleHyperText_h_
8 #define mozilla_a11y_xpcAccessibleHyperText_h_
10 #include "nsIAccessibleText.h"
11 #include "nsIAccessibleHyperText.h"
12 #include "nsIAccessibleEditableText.h"
14 #include "HyperTextAccessible.h"
15 #include "xpcAccessibleGeneric.h"
17 namespace mozilla {
18 namespace a11y {
20 class xpcAccessibleHyperText : public xpcAccessibleGeneric,
21 public nsIAccessibleText,
22 public nsIAccessibleEditableText,
23 public nsIAccessibleHyperText {
24 public:
25 explicit xpcAccessibleHyperText(Accessible* aIntl)
26 : xpcAccessibleGeneric(aIntl) {
27 if (aIntl->IsHyperText() && aIntl->IsTextRole()) mSupportedIfaces |= eText;
30 NS_DECL_ISUPPORTS_INHERITED
32 NS_DECL_NSIACCESSIBLETEXT
33 NS_DECL_NSIACCESSIBLEHYPERTEXT
34 NS_DECL_NSIACCESSIBLEEDITABLETEXT
36 protected:
37 virtual ~xpcAccessibleHyperText() {}
39 private:
40 HyperTextAccessibleBase* Intl() { return mIntl->AsHyperTextBase(); }
42 HyperTextAccessible* IntlLocal() {
43 if (LocalAccessible* acc = mIntl->AsLocal()) {
44 return acc->AsHyperText();
47 return nullptr;
50 xpcAccessibleHyperText(const xpcAccessibleHyperText&) = delete;
51 xpcAccessibleHyperText& operator=(const xpcAccessibleHyperText&) = delete;
54 } // namespace a11y
55 } // namespace mozilla
57 #endif // mozilla_a11y_xpcAccessibleHyperText_h_