1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
8 interface nsIAccessible
;
9 interface nsIAccessibleText
;
14 * A range representing a piece of text in the document.
16 [scriptable
, builtinclass
, uuid(c4515623
-55f9
-4543-a3d5
-c1e9afa588f4
)]
17 interface nsIAccessibleTextRange
: nsISupports
19 readonly attribute nsIAccessibleText startContainer
;
20 readonly attribute
long startOffset
;
21 readonly attribute nsIAccessibleText endContainer
;
22 readonly attribute
long endOffset
;
25 * Return an accessible containing the whole range
27 readonly attribute nsIAccessible container
;
30 * Return true if this range has the same end points of the given range.
32 boolean compare
(in nsIAccessibleTextRange aOtherRange
);
35 * The two endpoints of the range (starting and ending).
37 const unsigned long EndPoint_Start
= 1;
38 const unsigned long EndPoint_End
= 2;
41 * Compare this and given ranges end points.
43 * @return -1/0/1 if this range end point is before/equal/after the given
46 long compareEndPoints
(in unsigned long aEndPoint
,
47 in nsIAccessibleTextRange aOtherRange
,
48 in unsigned long aOtherRangeEndPoint
);
51 * Crops the range by the given accessible element.
53 boolean crop
(in nsIAccessible aContainer
);
55 const unsigned long AlignToTop
= 0;
56 const unsigned long AlignToBottom
= 1;