Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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_xpcAccessibleTextRange_h_
8 #define mozilla_a11y_xpcAccessibleTextRange_h_
10 #include "nsIAccessibleTextRange.h"
11 #include "TextRange.h"
13 #include "mozilla/Move.h"
14 #include "nsCycleCollectionParticipant.h"
16 namespace mozilla {
17 namespace a11y {
19 class TextRange;
21 class xpcAccessibleTextRange MOZ_FINAL : public nsIAccessibleTextRange
22 {
23 public:
24 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
25 NS_DECL_CYCLE_COLLECTION_CLASS(xpcAccessibleTextRange)
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;
33 private:
34 xpcAccessibleTextRange(TextRange&& aRange) :
35 mRange(Forward<TextRange>(aRange)) {}
36 xpcAccessibleTextRange() {}
37 friend class xpcAccessibleHyperText;
39 xpcAccessibleTextRange(const xpcAccessibleTextRange&) MOZ_DELETE;
40 xpcAccessibleTextRange& operator =(const xpcAccessibleTextRange&) MOZ_DELETE;
42 TextRange mRange;
43 };
45 } // namespace a11y
46 } // namespace mozilla
48 #endif