/src/mozilla-central/accessible/xpcom/xpcAccessibleHyperText.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #ifndef mozilla_a11y_xpcAccessibleHyperText_h_ |
8 | | #define mozilla_a11y_xpcAccessibleHyperText_h_ |
9 | | |
10 | | #include "nsIAccessibleText.h" |
11 | | #include "nsIAccessibleHyperText.h" |
12 | | #include "nsIAccessibleEditableText.h" |
13 | | |
14 | | #include "HyperTextAccessible.h" |
15 | | #include "xpcAccessibleGeneric.h" |
16 | | |
17 | | namespace mozilla { |
18 | | namespace a11y { |
19 | | |
20 | | class xpcAccessibleHyperText : public xpcAccessibleGeneric, |
21 | | public nsIAccessibleText, |
22 | | public nsIAccessibleEditableText, |
23 | | public nsIAccessibleHyperText |
24 | | { |
25 | | public: |
26 | | explicit xpcAccessibleHyperText(Accessible* aIntl) : |
27 | | xpcAccessibleGeneric(aIntl) |
28 | 0 | { |
29 | 0 | if (aIntl->IsHyperText() && aIntl->AsHyperText()->IsTextRole()) |
30 | 0 | mSupportedIfaces |= eText; |
31 | 0 | } |
32 | | |
33 | | xpcAccessibleHyperText(ProxyAccessible* aProxy, uint32_t aInterfaces) : |
34 | 0 | xpcAccessibleGeneric(aProxy, aInterfaces) { mSupportedIfaces |= eText; } |
35 | | |
36 | | NS_DECL_ISUPPORTS_INHERITED |
37 | | |
38 | | NS_DECL_NSIACCESSIBLETEXT |
39 | | NS_DECL_NSIACCESSIBLEHYPERTEXT |
40 | | NS_DECL_NSIACCESSIBLEEDITABLETEXT |
41 | | |
42 | | protected: |
43 | 0 | virtual ~xpcAccessibleHyperText() {} |
44 | | |
45 | | private: |
46 | | HyperTextAccessible* Intl() |
47 | 0 | { |
48 | 0 | if (Accessible* acc = mIntl.AsAccessible()) { |
49 | 0 | return acc->AsHyperText(); |
50 | 0 | } |
51 | 0 | |
52 | 0 | return nullptr; |
53 | 0 | } |
54 | | |
55 | | xpcAccessibleHyperText(const xpcAccessibleHyperText&) = delete; |
56 | | xpcAccessibleHyperText& operator =(const xpcAccessibleHyperText&) = delete; |
57 | | }; |
58 | | |
59 | | } // namespace a11y |
60 | | } // namespace mozilla |
61 | | |
62 | | #endif // mozilla_a11y_xpcAccessibleHyperText_h_ |