author Kyle Huey <>
Thu, 05 May 2016 01:45:00 -0700
changeset 296220 114ca1fc9c51036e4d2cd151125bb7c77d4b3d17
parent 280815 c34410da6b0130bc5430d18a20ad0357114ab0ed
child 404327 d864fe04c3eae42674b4265d8e3aa6eaef4c3172
permissions -rw-r--r--
Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at */

#ifndef mozilla_a11y_xpcAccessibleTextRange_h_
#define mozilla_a11y_xpcAccessibleTextRange_h_

#include "nsIAccessibleTextRange.h"
#include "TextRange.h"

#include "mozilla/Move.h"
#include "nsCycleCollectionParticipant.h"

namespace mozilla {
namespace a11y {

class TextRange;

#define NS_ACCESSIBLETEXTRANGE_IMPL_IID                 \
{  /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */           \
  0xb17652d9,                                           \
  0x4f54,                                               \
  0x4c56,                                               \
  { 0xbb, 0x62, 0x6d, 0x5b, 0xf1, 0xef, 0x91, 0x0c }    \

class xpcAccessibleTextRange final : public nsIAccessibleTextRange

  NS_IMETHOD GetStartContainer(nsIAccessibleText** aAnchor) final override;
  NS_IMETHOD GetStartOffset(int32_t* aOffset) final override;
  NS_IMETHOD GetEndContainer(nsIAccessibleText** aAnchor) final override;
  NS_IMETHOD GetEndOffset(int32_t* aOffset) final override;
  NS_IMETHOD GetContainer(nsIAccessible** aContainer) final override;
  NS_IMETHOD GetEmbeddedChildren(nsIArray** aList) final override;
  NS_IMETHOD Compare(nsIAccessibleTextRange* aOtherRange, bool* aResult) final override;
  NS_IMETHOD CompareEndPoints(uint32_t aEndPoint,
                              nsIAccessibleTextRange* aOtherRange,
                              uint32_t aOtherRangeEndPoint,
                              int32_t* aResult) final override;
  NS_IMETHOD GetText(nsAString& aText) final override;
  NS_IMETHOD GetBounds(nsIArray** aRectList) final override;
  NS_IMETHOD Move(uint32_t aUnit, int32_t aCount) final override;
  NS_IMETHOD MoveStart(uint32_t aUnit, int32_t aCount) final override;
  NS_IMETHOD MoveEnd(uint32_t aUnit, int32_t aCount) final override;
  NS_IMETHOD Normalize(uint32_t aUnit) final override;
  NS_IMETHOD Crop(nsIAccessible* aContainer, bool* aSuccess) final override;
  NS_IMETHOD FindText(const nsAString& aText, bool aIsBackward, bool aIsIgnoreCase,
                      nsIAccessibleTextRange** aRange) final override;
  NS_IMETHOD FindAttr(uint32_t aAttr, nsIVariant* aVal, bool aIsBackward,
                      nsIAccessibleTextRange** aRange) final override;
  NS_IMETHOD AddToSelection() final override;
  NS_IMETHOD RemoveFromSelection() final override;
  NS_IMETHOD Select() final override;
  NS_IMETHOD ScrollIntoView(uint32_t aHow) final override;


  explicit xpcAccessibleTextRange(TextRange&& aRange) :
    mRange(Forward<TextRange>(aRange)) {}
  xpcAccessibleTextRange() {}

  ~xpcAccessibleTextRange() {}

  friend class xpcAccessibleHyperText;

  xpcAccessibleTextRange(const xpcAccessibleTextRange&) = delete;
  xpcAccessibleTextRange& operator =(const xpcAccessibleTextRange&) = delete;

  TextRange mRange;


} // namespace a11y
} // namespace mozilla