accessible/src/xpcom/xpcAccessibleTextRange.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/src/xpcom/xpcAccessibleTextRange.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_a11y_xpcAccessibleTextRange_h_
    1.11 +#define mozilla_a11y_xpcAccessibleTextRange_h_
    1.12 +
    1.13 +#include "nsIAccessibleTextRange.h"
    1.14 +#include "TextRange.h"
    1.15 +
    1.16 +#include "mozilla/Move.h"
    1.17 +#include "nsCycleCollectionParticipant.h"
    1.18 +
    1.19 +namespace mozilla {
    1.20 +namespace a11y {
    1.21 +
    1.22 +class TextRange;
    1.23 +
    1.24 +class xpcAccessibleTextRange MOZ_FINAL : public nsIAccessibleTextRange
    1.25 +{
    1.26 +public:
    1.27 +  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    1.28 +  NS_DECL_CYCLE_COLLECTION_CLASS(xpcAccessibleTextRange)
    1.29 +
    1.30 +  NS_IMETHOD GetStartContainer(nsIAccessible** aAnchor) MOZ_FINAL MOZ_OVERRIDE;
    1.31 +  NS_IMETHOD GetStartOffset(int32_t* aOffset) MOZ_FINAL MOZ_OVERRIDE;
    1.32 +  NS_IMETHOD GetEndContainer(nsIAccessible** aAnchor) MOZ_FINAL MOZ_OVERRIDE;
    1.33 +  NS_IMETHOD GetEndOffset(int32_t* aOffset) MOZ_FINAL MOZ_OVERRIDE;
    1.34 +  NS_IMETHOD GetText(nsAString& aText) MOZ_FINAL MOZ_OVERRIDE;
    1.35 +
    1.36 +private:
    1.37 +  xpcAccessibleTextRange(TextRange&& aRange) :
    1.38 +    mRange(Forward<TextRange>(aRange)) {}
    1.39 +  xpcAccessibleTextRange() {}
    1.40 +  friend class xpcAccessibleHyperText;
    1.41 +
    1.42 +  xpcAccessibleTextRange(const xpcAccessibleTextRange&) MOZ_DELETE;
    1.43 +  xpcAccessibleTextRange& operator =(const xpcAccessibleTextRange&) MOZ_DELETE;
    1.44 +
    1.45 +  TextRange mRange;
    1.46 +};
    1.47 +
    1.48 +} // namespace a11y
    1.49 +} // namespace mozilla
    1.50 +
    1.51 +#endif

mercurial