tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

xpcAccessibleTextLeafRange.h (1315B)


      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_xpcAccessibleTextLeafRange_h_
      8 #define mozilla_a11y_xpcAccessibleTextLeafRange_h_
      9 
     10 #include "nsIAccessibleTextLeafRange.h"
     11 
     12 namespace mozilla {
     13 namespace a11y {
     14 
     15 class TextLeafPoint;
     16 
     17 class xpcAccessibleTextLeafPoint final : public nsIAccessibleTextLeafPoint {
     18 public:
     19  xpcAccessibleTextLeafPoint(nsIAccessible* aAccessible, int32_t aOffset);
     20 
     21  NS_DECL_ISUPPORTS
     22  NS_DECL_NSIACCESSIBLETEXTLEAFPOINT
     23 
     24 private:
     25  xpcAccessibleTextLeafPoint() = delete;
     26 
     27  ~xpcAccessibleTextLeafPoint() {}
     28 
     29  xpcAccessibleTextLeafPoint& operator=(const xpcAccessibleTextLeafPoint&) =
     30      delete;
     31 
     32  TextLeafPoint ToPoint();
     33 
     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;
     40 };
     41 
     42 }  // namespace a11y
     43 }  // namespace mozilla
     44 
     45 #endif