Bug 1890277: part 2) Add `require-trusted-types-for` directive to CSP parser, guarded...
[gecko.git] / accessible / xpcom / xpcAccessibleTextLeafRange.h
blob8d61d2edc156bd0da055d2fdc25cb5b3b9be9b06
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_xpcAccessibleTextLeafRange_h_
8 #define mozilla_a11y_xpcAccessibleTextLeafRange_h_
10 #include "nsIAccessibleTextLeafRange.h"
12 namespace mozilla {
13 namespace a11y {
15 class TextLeafPoint;
17 class xpcAccessibleTextLeafPoint final : public nsIAccessibleTextLeafPoint {
18 public:
19 xpcAccessibleTextLeafPoint(nsIAccessible* aAccessible, int32_t aOffset);
21 NS_DECL_ISUPPORTS
22 NS_DECL_NSIACCESSIBLETEXTLEAFPOINT
24 private:
25 xpcAccessibleTextLeafPoint() = delete;
27 ~xpcAccessibleTextLeafPoint() {}
29 xpcAccessibleTextLeafPoint& operator=(const xpcAccessibleTextLeafPoint&) =
30 delete;
32 TextLeafPoint ToPoint();
34 // We can't hold a strong reference to an Accessible, but XPCOM needs strong
35 // references. Thus, instead of holding a TextLeafPoint here, we hold
36 // an nsIAccessible references and create the TextLeafPoint for each call
37 // using ToPoint().
38 RefPtr<nsIAccessible> mAccessible;
39 int32_t mOffset;
42 } // namespace a11y
43 } // namespace mozilla
45 #endif