tor-browser

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

xpcAccessibleHyperText.h (1718B)


      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 public:
     25  explicit xpcAccessibleHyperText(Accessible* aIntl)
     26      : xpcAccessibleGeneric(aIntl) {
     27    if (aIntl->IsHyperText() && aIntl->IsTextRole()) mSupportedIfaces |= eText;
     28  }
     29 
     30  NS_DECL_ISUPPORTS_INHERITED
     31 
     32  NS_DECL_NSIACCESSIBLETEXT
     33  NS_DECL_NSIACCESSIBLEHYPERTEXT
     34  NS_DECL_NSIACCESSIBLEEDITABLETEXT
     35 
     36 protected:
     37  virtual ~xpcAccessibleHyperText() {}
     38 
     39 private:
     40  HyperTextAccessibleBase* Intl() { return mIntl->AsHyperTextBase(); }
     41 
     42  HyperTextAccessible* IntlLocal() {
     43    if (LocalAccessible* acc = mIntl->AsLocal()) {
     44      return acc->AsHyperText();
     45    }
     46 
     47    return nullptr;
     48  }
     49 
     50  xpcAccessibleHyperText(const xpcAccessibleHyperText&) = delete;
     51  xpcAccessibleHyperText& operator=(const xpcAccessibleHyperText&) = delete;
     52 };
     53 
     54 }  // namespace a11y
     55 }  // namespace mozilla
     56 
     57 #endif  // mozilla_a11y_xpcAccessibleHyperText_h_