|
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_xpcAccessibleTextRange_h_ |
|
8 #define mozilla_a11y_xpcAccessibleTextRange_h_ |
|
9 |
|
10 #include "nsIAccessibleTextRange.h" |
|
11 #include "TextRange.h" |
|
12 |
|
13 #include "mozilla/Move.h" |
|
14 #include "nsCycleCollectionParticipant.h" |
|
15 |
|
16 namespace mozilla { |
|
17 namespace a11y { |
|
18 |
|
19 class TextRange; |
|
20 |
|
21 class xpcAccessibleTextRange MOZ_FINAL : public nsIAccessibleTextRange |
|
22 { |
|
23 public: |
|
24 NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
|
25 NS_DECL_CYCLE_COLLECTION_CLASS(xpcAccessibleTextRange) |
|
26 |
|
27 NS_IMETHOD GetStartContainer(nsIAccessible** aAnchor) MOZ_FINAL MOZ_OVERRIDE; |
|
28 NS_IMETHOD GetStartOffset(int32_t* aOffset) MOZ_FINAL MOZ_OVERRIDE; |
|
29 NS_IMETHOD GetEndContainer(nsIAccessible** aAnchor) MOZ_FINAL MOZ_OVERRIDE; |
|
30 NS_IMETHOD GetEndOffset(int32_t* aOffset) MOZ_FINAL MOZ_OVERRIDE; |
|
31 NS_IMETHOD GetText(nsAString& aText) MOZ_FINAL MOZ_OVERRIDE; |
|
32 |
|
33 private: |
|
34 xpcAccessibleTextRange(TextRange&& aRange) : |
|
35 mRange(Forward<TextRange>(aRange)) {} |
|
36 xpcAccessibleTextRange() {} |
|
37 friend class xpcAccessibleHyperText; |
|
38 |
|
39 xpcAccessibleTextRange(const xpcAccessibleTextRange&) MOZ_DELETE; |
|
40 xpcAccessibleTextRange& operator =(const xpcAccessibleTextRange&) MOZ_DELETE; |
|
41 |
|
42 TextRange mRange; |
|
43 }; |
|
44 |
|
45 } // namespace a11y |
|
46 } // namespace mozilla |
|
47 |
|
48 #endif |