/* *ThisSourceCodeFormissubjecttothetermsoftheMozillaPublic *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
[scriptable, builtinclass, uuid(a4cc7576-45bb-44c5-b347-d9cb3ca4de9f)]
interface nsIAccessibleText : nsISupports
{ // In parameters for character offsets: // -1 will be treated as the equal to the end of the text // -2 will be treated as the caret position const int32_t TEXT_OFFSET_END_OF_TEXT = -1; const int32_t TEXT_OFFSET_CARET = -2;
// A single Unicode character. For a user-perceived character, see // BOUNDARY_CLUSTER. const AccessibleTextBoundary BOUNDARY_CHAR = 0; const AccessibleTextBoundary BOUNDARY_WORD_START = 1; const AccessibleTextBoundary BOUNDARY_WORD_END = 2; const AccessibleTextBoundary BOUNDARY_SENTENCE_START = 3; // don't use, deprecated const AccessibleTextBoundary BOUNDARY_SENTENCE_END = 4; // don't use, deprecated const AccessibleTextBoundary BOUNDARY_LINE_START = 5; const AccessibleTextBoundary BOUNDARY_LINE_END = 6; const AccessibleTextBoundary BOUNDARY_PARAGRAPH = 7; // A grapheme cluster, AKA user-perceived character. This might consist of // multiple Unicode characters, but a user will perceive this as a single // character and it is treated as such by the caret, selection, etc. const AccessibleTextBoundary BOUNDARY_CLUSTER = 8;
/** *Thecurrentcurrentcaretoffset. *Ifset<0thencaretwillbeplacedattheendofthetext
*/
attribute long caretOffset;
void getCaretRect(out long x, out long y, out long width, out long height);
readonly attribute long characterCount;
readonly attribute long selectionCount;
/** *Stringmethodsmayneedtoreturnmultibyte-encodedstrings, *sincesomelocalescan'tbeencodedusing16-bitchars. *SothemethodsbelowmightreturnUTF-16strings,ortheycould *return"string"valueswhichareUTF-8.
*/
AString getText (in long startOffset, in long endOffset);
AString getTextAfterOffset (in long offset,
in AccessibleTextBoundary boundaryType,
out long startOffset,
out long endOffset);
AString getTextAtOffset (in long offset,
in AccessibleTextBoundary boundaryType,
out long startOffset,
out long endOffset);
AString getTextBeforeOffset (in long offset,
in AccessibleTextBoundary boundaryType,
out long startOffset,
out long endOffset);
/** *Itwouldbebettertoreturnanunsignedlonghere, *toallowunicodechars>16bits
*/
wchar getCharacterAtOffset (in long offset);
/** *Gettheaccessiblestart/endoffsetsaroundthegivenoffset, *returnthetextattributesforthisrangeoftext. * *@paramincludeDefAttrs[in]pointswhethertextattributesappliedto *theentireaccessibleshouldbeincludedornot. *@paramoffset[in]textoffset *@paramrangeStartOffset[out]startoffsetoftherangeoftext *@paramrangeEndOffset[out]endoffsetoftherangeoftext
*/
nsIPersistentProperties getTextAttributes(in boolean includeDefAttrs,
in long offset,
out long rangeStartOffset,
out long rangeEndOffset);
/** *Returnstheboundingboxofthespecifiedposition. * *Thevirtualcharacterafterthelastcharacteroftherepresentedtext, *i.e.theoneatpositionlengthisaspecialcase.Itrepresentsthe *currentinputpositionandwillthereforetypicallybequeriedbyATmore *oftenthanotherpositions.Becauseitdoesnotrepresentanexisting *characteritsboundingboxisdefinedinrelationtoprecedingcharacters. *Itshouldberoughlyequivalenttotheboundingboxofsomecharacterwhen *insertedattheendofthetext.Itsheighttypicallybeingthemaximal *heightofallthecharactersinthetextortheheightofthepreceding *character,itswidthbeingatleastonepixelsothattheboundingboxis *notdegenerate. * *@paramoffset-Indexofthecharacterforwhichtoreturnitsbounding *box.Thevalidrangeis0..length. *@paramx-Xcoordinateoftheboundingboxofthereferencedcharacter. *@paramy-Ycoordinateoftheboundingboxofthereferencedcharacter. *@paramwidth-Widthoftheboundingboxofthereferencedcharacter. *@paramheight-Heightoftheboundingboxofthereferencedcharacter. *@paramcoordType-Specifiesifthecoordinatesarerelativetothescreen *ortotheparentwindow(seeconstantsdeclaredin *nsIAccessibleCoordinateType).
*/ void getCharacterExtents (in long offset,
out long x,
out long y,
out long width,
out long height,
in unsignedlong coordType);
void getRangeExtents (in long startOffset,
in long endOffset,
out long x,
out long y,
out long width,
out long height,
in unsignedlong coordType);
/** *Getthetextoffsetatthegivenpoint,orreturn-1 *ifnocharacterexistsatthatpoint * *@paramx-Theposition'sxvalueforwhichtolookuptheindexofthe *characterthatisrenderedontothedisplayatthatpoint. *@paramy-Theposition'syvalueforwhichtolookuptheindexofthe *characterthatisrenderedontothedisplayatthatpoint. *@paramcoordType-Screencoordinatesorwindowcoordinates(seeconstants *declaredinnsIAccessibleCoordinateType). *@returnoffset-Indexofthecharacterunderthegivenpointor-1if *thepointisinvalidorthereisnocharacterunder *thepoint.
*/ long getOffsetAtPoint (in long x, in long y,
in unsignedlong coordType);
void getSelectionBounds (in long selectionNum,
out long startOffset,
out long endOffset);
/** *Settheboundsforthegivenselectionrange. *Areverserangewherethestartoffsetislargerthantheendoffsetis *acceptable.ThecaretOffsetwillbesettotheendOffsetargument.
*/ void setSelectionBounds (in long selectionNum,
in long startOffset,
in long endOffset);
void addSelection (in long startOffset, in long endOffset);
void removeSelection (in long selectionNum);
/** *Makesaspecificpartofstringvisibleonscreen. * *@paramstartIndex0-basedcharacteroffset *@paramendIndex0-basedcharacteroffset-theoffsetofthe *characterjustpastthelastcharacterofthe *string *@paramscrollTypedefineshowtoscroll(seensIAccessibleScrollTypefor *availableconstants)
*/ void scrollSubstringTo(in long startIndex, in long endIndex,
in unsignedlong scrollType);
/** *Movesthetopleftofasubstringtoaspecifiedlocation. * *@paramstartIndex0-basedcharacteroffset *@paramendIndex0-basedcharacteroffset-theoffsetofthe *characterjustpastthelastcharacterof *thestring *@paramcoordinateTypespecifiesthecoordinatesorigin(foravailable *constantsrefertonsIAccessibleCoordinateType) *@paramxdefinesthexcoordinate *@paramydefinestheycoordinate
*/ void scrollSubstringToPoint(in long startIndex, in long endIndex,
in unsignedlong coordinateType,
in long x, in long y);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.