other-licenses/ia2/AccessibleText.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /*************************************************************************
michael@0 2 *
michael@0 3 * File Name (AccessibleText.idl)
michael@0 4 *
michael@0 5 * IAccessible2 IDL Specification
michael@0 6 *
michael@0 7 * Copyright (c) 2007, 2013 Linux Foundation
michael@0 8 * Copyright (c) 2006 IBM Corporation
michael@0 9 * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
michael@0 10 * All rights reserved.
michael@0 11 *
michael@0 12 *
michael@0 13 * Redistribution and use in source and binary forms, with or without
michael@0 14 * modification, are permitted provided that the following conditions
michael@0 15 * are met:
michael@0 16 *
michael@0 17 * 1. Redistributions of source code must retain the above copyright
michael@0 18 * notice, this list of conditions and the following disclaimer.
michael@0 19 *
michael@0 20 * 2. Redistributions in binary form must reproduce the above
michael@0 21 * copyright notice, this list of conditions and the following
michael@0 22 * disclaimer in the documentation and/or other materials
michael@0 23 * provided with the distribution.
michael@0 24 *
michael@0 25 * 3. Neither the name of the Linux Foundation nor the names of its
michael@0 26 * contributors may be used to endorse or promote products
michael@0 27 * derived from this software without specific prior written
michael@0 28 * permission.
michael@0 29 *
michael@0 30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
michael@0 31 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
michael@0 32 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@0 33 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
michael@0 34 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
michael@0 35 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@0 36 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
michael@0 37 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
michael@0 38 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
michael@0 39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
michael@0 40 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
michael@0 41 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
michael@0 42 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
michael@0 43 *
michael@0 44 * This BSD License conforms to the Open Source Initiative "Simplified
michael@0 45 * BSD License" as published at:
michael@0 46 * http://www.opensource.org/licenses/bsd-license.php
michael@0 47 *
michael@0 48 * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
michael@0 49 * mark may be used in accordance with the Linux Foundation Trademark
michael@0 50 * Policy to indicate compliance with the IAccessible2 specification.
michael@0 51 *
michael@0 52 ************************************************************************/
michael@0 53
michael@0 54 import "objidl.idl";
michael@0 55 import "oaidl.idl";
michael@0 56 import "oleacc.idl";
michael@0 57 import "IA2CommonTypes.idl";
michael@0 58
michael@0 59 /** A structure containing a substring and the start and end offsets in the enclosing string.
michael@0 60
michael@0 61 IAccessibleText::newText and IAccessibleText::oldText return this struct.
michael@0 62 */
michael@0 63 typedef struct IA2TextSegment {
michael@0 64 BSTR text; ///< A copy of a segment of text taken from an enclosing paragraph.
michael@0 65 long start; ///< Index of the first character of the segment in the enclosing text.
michael@0 66 long end; ///< Index of the character following the last character of the segment in the enclosing text.
michael@0 67 } IA2TextSegment;
michael@0 68
michael@0 69 /** This enum defines values which specify a text boundary type.
michael@0 70
michael@0 71 IA2_TEXT_BOUNDARY_SENTENCE is optional. When a method doesn't implement this
michael@0 72 method it must return S_FALSE. Typically this feature would not be implemented
michael@0 73 by an application. However, if the application developer was not satisfied with
michael@0 74 how screen readers have handled the reading of sentences this boundary type
michael@0 75 could be implemented and screen readers could use the application's version of a
michael@0 76 sentence rather than the screen reader's.
michael@0 77
michael@0 78 The rest of the boundary types must be supported.
michael@0 79
michael@0 80 This enum is used in IAccessibleText::textBeforeOffset, IAccessibleText::textAtOffset,
michael@0 81 and IAccessibleText::textAfterOffset.
michael@0 82 */
michael@0 83
michael@0 84 enum IA2TextBoundaryType {
michael@0 85 IA2_TEXT_BOUNDARY_CHAR, /**< Typically, a single character is returned. In some cases more than
michael@0 86 one character is returned, for example, when a document contains field
michael@0 87 data such as a field containing a date, time, or footnote reference.
michael@0 88 In this case the caret can move over several characters in one movement
michael@0 89 of the caret. Note that after the caret moves, the caret offset changes
michael@0 90 by the number of characters in the field, e.g. by 8 characters in the
michael@0 91 following date: 03/26/07. */
michael@0 92 IA2_TEXT_BOUNDARY_WORD, /**< The range provided matches the range observed when the application
michael@0 93 processes the Ctrl + left arrow and Ctrl + right arrow key sequences.
michael@0 94 Typically this is from the start of one word to the start of the next, but
michael@0 95 various applications are inconsistent in the handling of the end of a line. */
michael@0 96 IA2_TEXT_BOUNDARY_SENTENCE, ///< Range is from start of one sentence to the start of another sentence.
michael@0 97 IA2_TEXT_BOUNDARY_PARAGRAPH, ///< Range is from start of one paragraph to the start of another paragraph.
michael@0 98 IA2_TEXT_BOUNDARY_LINE, /**< Range is from start of one line to the start of another line. This
michael@0 99 often means that an end-of-line character will appear at the end of the
michael@0 100 range. However in the case of some applications an end-of-line character
michael@0 101 indicates the end of a paragraph and the lines composing the paragraph,
michael@0 102 other than the last line, do not contain an end of line character. */
michael@0 103 IA2_TEXT_BOUNDARY_ALL ///< Using this value will cause all text to be returned.
michael@0 104 };
michael@0 105
michael@0 106 /** @brief This interface gives read-only access to text.
michael@0 107
michael@0 108 The %IAccessibleText interface should be implemented by all components
michael@0 109 that present textual information on the display like buttons,
michael@0 110 text entry fields, or text portions of the document window. The interface
michael@0 111 provides access to the text's content, attributes, and spatial location.
michael@0 112 However, text can not be modified with this interface. That is the task
michael@0 113 of the IAccessibleEditableText interface.
michael@0 114
michael@0 115 The text length, i.e. the number of characters in the text, is
michael@0 116 returned by IAccessibleText::nCharacters. All methods that operate
michael@0 117 on particular characters (e.g. IAccessibleText::textAtOffset) use character
michael@0 118 indices from 0 to length-1. All methods that operate on character positions
michael@0 119 (e.g. IAccessibleText::text) use indices from 0 to length.
michael@0 120
michael@0 121 Please note that accessible text does not necessarily support selection.
michael@0 122 In this case it should behave as if there where no selection. An empty
michael@0 123 selection is used for example to express the current cursor position.
michael@0 124
michael@0 125 Refer to @ref _specialOffsets
michael@0 126 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 127 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 128
michael@0 129 E_FAIL is returned in the following cases
michael@0 130 @li endOffset < startOffset
michael@0 131 @li endoffset > length
michael@0 132 */
michael@0 133 [object, uuid(24FD2FFB-3AAD-4a08-8335-A3AD89C0FB4B)]
michael@0 134 interface IAccessibleText : IUnknown
michael@0 135 {
michael@0 136
michael@0 137 /** @brief Adds a text selection
michael@0 138 @param [in] startOffset
michael@0 139 Starting offset ( 0 based).
michael@0 140 @param [in] endOffset
michael@0 141 Offset of first character after new selection (0 based).
michael@0 142 @retval S_OK
michael@0 143 @retval E_INVALIDARG if bad [in] passed
michael@0 144 @note Refer to @ref _specialOffsets
michael@0 145 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 146 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 147 */
michael@0 148 HRESULT addSelection
michael@0 149 (
michael@0 150 [in] long startOffset,
michael@0 151 [in] long endOffset
michael@0 152 );
michael@0 153
michael@0 154 /** @brief Returns text attributes.
michael@0 155 @param [in] offset
michael@0 156 Text offset (0 based). Refer to @ref _specialOffsets
michael@0 157 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 158 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 159 @param [out] startOffset
michael@0 160 The starting offset of the character range over which all text attributes match
michael@0 161 those of offset. (0 based)
michael@0 162 @param [out] endOffset
michael@0 163 The offset of the first character past the character range over which all text
michael@0 164 attributes match those of offset. (0 based)
michael@0 165 @param [out] textAttributes
michael@0 166 A string of attributes describing the text. The attributes are described in the
michael@0 167 <a href="http://www.linuxfoundation.org/en/Accessibility/IAccessible2/TextAttributes">
michael@0 168 text attributes specification</a> on the %IAccessible2 web site.
michael@0 169 @retval S_OK
michael@0 170 @retval S_FALSE if there is nothing to return, [out] values are 0s and NULL respectively
michael@0 171 @retval E_INVALIDARG if bad [in] passed
michael@0 172 */
michael@0 173 [propget] HRESULT attributes
michael@0 174 (
michael@0 175 [in] long offset,
michael@0 176 [out] long *startOffset,
michael@0 177 [out] long *endOffset,
michael@0 178 [out, retval] BSTR *textAttributes
michael@0 179 );
michael@0 180
michael@0 181 /** @brief Returns the position of the caret.
michael@0 182
michael@0 183 Returns the 0-based offset of the caret within the text. If the text is
michael@0 184 implemented as a tree of text objects with embed characters in higher levels
michael@0 185 representing substrings of child text objects and the caret is in one of the
michael@0 186 child text objects, then the offset in the higher level text object would be
michael@0 187 at the embed character representing child text object that contains the caret.
michael@0 188
michael@0 189 For example, if the string "one two three" is implemented as a two text objects,
michael@0 190 with a top level text object containing an embed character "one ? three" and a
michael@0 191 child text object containing "two" and if the caret is in the descendant object
michael@0 192 just before the 'o' in "two", then:
michael@0 193 <ul>
michael@0 194 <li>the caretOffset for the "one ? three" object would be 4, matching the embed character</li>
michael@0 195 <li>the caretOffset for "two" would be 2, matching the "o"</li>
michael@0 196 </ul>
michael@0 197 The caret position/offset is that of the character logically following it, e.g.
michael@0 198 to the right of it in a left to right language, or to the left of it in a right
michael@0 199 to left language.
michael@0 200 @param [out] offset
michael@0 201 The returned offset is relative to the text represented by this object.
michael@0 202 @retval S_OK
michael@0 203 @retval S_FALSE if the caret is not currently active on this object, i.e. the
michael@0 204 caret is located on some other object. The returned offset value will be -1.
michael@0 205 @note S_FALSE (and an offset of -1) will not be returned if the caret is somewhere
michael@0 206 in the text object or one of its descendants.
michael@0 207 */
michael@0 208 [propget] HRESULT caretOffset
michael@0 209 (
michael@0 210 [out, retval] long *offset
michael@0 211 );
michael@0 212
michael@0 213
michael@0 214 /** @brief Returns the bounding box of the specified position.
michael@0 215
michael@0 216 The virtual character after the last character of the represented
michael@0 217 text, i.e. the one at position length is a special case. It represents the
michael@0 218 current input position and will therefore typically be queried by AT more
michael@0 219 often than other positions. Because it does not represent an existing character
michael@0 220 its bounding box is defined in relation to preceding characters. It should be
michael@0 221 roughly equivalent to the bounding box of some character when inserted at the
michael@0 222 end of the text. Its height typically being the maximal height of all the
michael@0 223 characters in the text or the height of the preceding character, its width being
michael@0 224 at least one pixel so that the bounding box is not degenerate.
michael@0 225
michael@0 226 Note that the index 'length' is not always valid. Whether it is or not is
michael@0 227 implementation dependent. It typically is when text is editable or otherwise
michael@0 228 when on the screen the caret can be placed behind the text. You can be sure
michael@0 229 that the index is valid after you have received a ::IA2_EVENT_TEXT_CARET_MOVED
michael@0 230 event for this index.
michael@0 231 @param [in] offset
michael@0 232 Index of the character for which to return its bounding box. The valid range
michael@0 233 is 0..length. Refer to @ref _specialOffsets
michael@0 234 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 235 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 236 @param [in] coordType
michael@0 237 Specifies if the coordinates are relative to the screen or to the parent window.
michael@0 238 @param [out] x
michael@0 239 X coordinate of the top left corner of the bounding box of the referenced character.
michael@0 240 @param [out] y
michael@0 241 Y coordinate of the top left corner of the bounding box of the referenced character.
michael@0 242 @param [out] width
michael@0 243 Width of the bounding box of the referenced character.
michael@0 244 @param [out] height
michael@0 245 Height of the bounding box of the referenced character.
michael@0 246 @retval S_OK
michael@0 247 @retval E_INVALIDARG if bad [in] passed
michael@0 248 */
michael@0 249 [propget] HRESULT characterExtents
michael@0 250 (
michael@0 251 [in] long offset,
michael@0 252 [in] enum IA2CoordinateType coordType,
michael@0 253 [out] long *x,
michael@0 254 [out] long *y,
michael@0 255 [out] long *width,
michael@0 256 [out, retval] long *height
michael@0 257 );
michael@0 258
michael@0 259
michael@0 260 /** @brief Returns the number of active non-contiguous selections
michael@0 261 @param [out] nSelections
michael@0 262 @retval S_OK
michael@0 263 */
michael@0 264 [propget] HRESULT nSelections
michael@0 265 (
michael@0 266 [out, retval] long *nSelections
michael@0 267 );
michael@0 268
michael@0 269 /** @brief Returns the text position for the specified screen position.
michael@0 270
michael@0 271 Given a point return the zero-based index of the character under that
michael@0 272 point. The same functionality could be achieved by using the bounding
michael@0 273 boxes for each character as returned by IAccessibleText::characterExtents.
michael@0 274 The method IAccessibleText::offsetAtPoint, however, can be implemented
michael@0 275 more efficiently.
michael@0 276
michael@0 277 @param [in] x
michael@0 278 The position's x value for which to look up the index of the character that
michael@0 279 is rendered on to the display at that point.
michael@0 280 @param [in] y
michael@0 281 The position's y value for which to look up the index of the character that
michael@0 282 is rendered on to the display at that point.
michael@0 283 @param [in] coordType
michael@0 284 Screen coordinates or window coordinates.
michael@0 285 @param [out] offset
michael@0 286 Index of the character under the given point or -1 if the point
michael@0 287 is invalid or there is no character under the point.
michael@0 288 @retval S_OK
michael@0 289 @retval S_FALSE if nothing to return, [out] value is -1
michael@0 290
michael@0 291 @retval E_INVALIDARG if bad [in] passed
michael@0 292 */
michael@0 293 [propget] HRESULT offsetAtPoint
michael@0 294 (
michael@0 295 [in] long x,
michael@0 296 [in] long y,
michael@0 297 [in] enum IA2CoordinateType coordType,
michael@0 298 [out, retval] long *offset
michael@0 299 );
michael@0 300
michael@0 301 /** @brief Returns the character offsets of Nth active text selection
michael@0 302
michael@0 303 Returns the 0-based starting and ending offsets of the Nth selection. If the
michael@0 304 text is implemented as a tree of text objects with embed characters in higher
michael@0 305 levels representing substrings of child text objects, consider the following.
michael@0 306 If the starting selection offset is in one of the child text objects, then the
michael@0 307 starting offset in the higher level text object would be at the embed character
michael@0 308 representing the child text object that contains the starting selection offset.
michael@0 309 If the ending selection offset is in one of the child text objects, then the
michael@0 310 ending offset in the higher level text object would be just after the embed
michael@0 311 character representing the child text object that contains the ending selection
michael@0 312 offset.
michael@0 313
michael@0 314 For example, if the string "one two three" is implemented as a two text objects,
michael@0 315 with a top level text object containing an embed character "one ? three" and a
michael@0 316 child text object containing "two" and if the selection is the string "two" then:
michael@0 317 <ul>
michael@0 318 <li>the startOffset for the "one ? three" object would be 4, matching the embed character and the endOffset would be 5.</li>
michael@0 319 <li>the startOffset for the "two" object would be 0, and the endOffset would be 3</li>
michael@0 320 </ul>
michael@0 321 Selection offsets are that of the character logically following it, e.g.
michael@0 322 to the right of it in a left to right language or to the left of it in a right to left language.
michael@0 323 @param [in] selectionIndex
michael@0 324 Index of selection (0 based).
michael@0 325 @param [out] startOffset
michael@0 326 0 based offset of first selected character
michael@0 327 @param [out] endOffset
michael@0 328 0 based offset of one past the last selected character.
michael@0 329 @retval S_OK
michael@0 330 @retval E_INVALIDARG if bad [in] passed
michael@0 331 */
michael@0 332 [propget] HRESULT selection
michael@0 333 (
michael@0 334 [in] long selectionIndex,
michael@0 335 [out] long *startOffset,
michael@0 336 [out, retval] long *endOffset
michael@0 337 );
michael@0 338
michael@0 339 /** @brief Returns the substring between the two given indices.
michael@0 340
michael@0 341 The substring starts with the character at startOffset (inclusive) and up to
michael@0 342 the character at endOffset (exclusive), if startOffset is less or equal
michael@0 343 endOffset. If endOffset is lower than startOffset, the result is the same
michael@0 344 as a call with the two arguments being exchanged.
michael@0 345
michael@0 346 The whole text can be requested by passing the indices zero and
michael@0 347 IAccessibleText::nCharacters. If both indices have the same value, an empty
michael@0 348 string is returned.
michael@0 349 @param [in] startOffset
michael@0 350 Index of the first character to include in the returned string. The valid range
michael@0 351 is 0..length.
michael@0 352 @param [in] endOffset
michael@0 353 Index of the last character to exclude in the returned string. The valid range
michael@0 354 is 0..length.
michael@0 355 @param [out] text
michael@0 356 Returns the substring starting with the character at startOffset (inclusive)
michael@0 357 and up to the character at endOffset (exclusive), if startOffset is less than
michael@0 358 or equal to endOffset.
michael@0 359 @retval S_OK
michael@0 360 @retval E_INVALIDARG if bad [in] passed
michael@0 361 @note
michael@0 362 @li The returned string may be longer than endOffset-startOffset bytes if text
michael@0 363 contains multi-byte characters.
michael@0 364 @li Refer to @ref _specialOffsets
michael@0 365 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 366 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 367 */
michael@0 368 [propget] HRESULT text
michael@0 369 (
michael@0 370 [in] long startOffset,
michael@0 371 [in] long endOffset,
michael@0 372 [out, retval] BSTR *text
michael@0 373 );
michael@0 374
michael@0 375 /** @brief Returns a text portion before the given position.
michael@0 376
michael@0 377 Returns the substring of the specified text type that is located before the
michael@0 378 given character and does not include it. The result of this method should be
michael@0 379 same as a result for IAccessibleText::textAtOffset with a suitably decreased
michael@0 380 index value.
michael@0 381
michael@0 382 For example, if text type is ::IA2_TEXT_BOUNDARY_WORD, then the complete
michael@0 383 word that is closest to and located before offset is returned.
michael@0 384
michael@0 385 If the index is valid, but no text is found, S_FALSE is returned along with out
michael@0 386 values of 0, 0, and a NULL pointer. This would happen for boundary types other
michael@0 387 than character when the text consists entirely of whitespace.
michael@0 388
michael@0 389 @param [in] offset
michael@0 390 Index of the character for which to return the text part before it. The index
michael@0 391 character will not be part of the returned string. The valid range is 0..length.
michael@0 392 Refer to @ref _specialOffsets
michael@0 393 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 394 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 395 @param [in] boundaryType
michael@0 396 The type of the text portion to return. See ::IA2TextBoundaryType for the
michael@0 397 complete list.
michael@0 398 @param [out] startOffset
michael@0 399 0 based offset of first character.
michael@0 400 @param [out] endOffset
michael@0 401 0 based offset of one past the last character.
michael@0 402 @param [out] text
michael@0 403 Returns the requested text portion. This portion may be empty or invalid when
michael@0 404 no appropriate text portion is found or text type is invalid.
michael@0 405 @retval S_OK
michael@0 406 @retval S_FALSE if the requested boundary type is not implemented, such as
michael@0 407 ::IA2_TEXT_BOUNDARY_SENTENCE, or if there is nothing to return;
michael@0 408 [out] values are 0s and NULL respectively
michael@0 409 @retval E_INVALIDARG if bad [in] passed
michael@0 410 */
michael@0 411 [propget] HRESULT textBeforeOffset
michael@0 412 (
michael@0 413 [in] long offset,
michael@0 414 [in] enum IA2TextBoundaryType boundaryType,
michael@0 415 [out] long *startOffset,
michael@0 416 [out] long *endOffset,
michael@0 417 [out, retval] BSTR *text
michael@0 418 );
michael@0 419
michael@0 420 /** @brief Returns a text portion after the given position.
michael@0 421
michael@0 422 Returns the substring of the specified text type that is located after the
michael@0 423 given character and does not include it. The result of this method should be
michael@0 424 same as a result for IAccessibleText::textAtOffset with a suitably increased
michael@0 425 index value.
michael@0 426
michael@0 427 For example, if text type is ::IA2_TEXT_BOUNDARY_WORD, then the complete
michael@0 428 word that is closest to and located after offset is returned.
michael@0 429
michael@0 430 If the index is valid, but no text is found, S_FALSE is returned along with out
michael@0 431 values of 0, 0, and a NULL pointer. This would happen for boundary types other
michael@0 432 than character when the text consists entirely of whitespace.
michael@0 433
michael@0 434 @param [in] offset
michael@0 435 Index of the character for which to return the text part after it. The index
michael@0 436 character will not be part of the returned string. The valid range is 0..length.
michael@0 437 Refer to @ref _specialOffsets
michael@0 438 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 439 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 440 @param [in] boundaryType
michael@0 441 The type of the text portion to return. See ::IA2TextBoundaryType for the complete
michael@0 442 list.
michael@0 443 @param [out] startOffset
michael@0 444 0 based offset of first character.
michael@0 445 @param [out] endOffset
michael@0 446 0 based offset of one past the last character.
michael@0 447 @param [out] text
michael@0 448 Returns the requested text portion. This portion may be empty or invalid when
michael@0 449 no appropriate text portion is found or text type is invalid.
michael@0 450 @retval S_OK
michael@0 451 @retval S_FALSE if the requested boundary type is not implemented, such as
michael@0 452 ::IA2_TEXT_BOUNDARY_SENTENCE, or if there is nothing to return;
michael@0 453 [out] values are 0s and NULL respectively
michael@0 454 @retval E_INVALIDARG if bad [in] passed
michael@0 455 */
michael@0 456 [propget] HRESULT textAfterOffset
michael@0 457 (
michael@0 458 [in] long offset,
michael@0 459 [in] enum IA2TextBoundaryType boundaryType,
michael@0 460 [out] long *startOffset,
michael@0 461 [out] long *endOffset,
michael@0 462 [out, retval] BSTR *text
michael@0 463 );
michael@0 464
michael@0 465 /** @brief Returns a text portion that spans the given position.
michael@0 466
michael@0 467 Returns the substring defined by the specified boundary type at the specified
michael@0 468 offset. Refer to IA2TextBoundaryType for more details.
michael@0 469
michael@0 470 For the word boundary type the returned string will contain the word at the
michael@0 471 offset if the offset is inside a word and will contain the word before the
michael@0 472 offset if the offset is not inside a word. All offsets from the first to the
michael@0 473 last characters of a word are considered inside the word. Boundary types of
michael@0 474 sentence and paragraph should exhibit similar behavior.
michael@0 475
michael@0 476 If the index is valid, but no text is found, S_FALSE is returned along with out
michael@0 477 values of 0, 0, and a NULL pointer. This would happen for boundary types other
michael@0 478 than character when the text consists entirely of whitespace.
michael@0 479
michael@0 480 @param [in] offset
michael@0 481 Index of the character for which to return the text part it belongs to. The valid
michael@0 482 range is 0..length.
michael@0 483 Refer to @ref _specialOffsets
michael@0 484 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 485 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 486 @param [in] boundaryType
michael@0 487 The type of the text portion to return. See ::IA2TextBoundaryType for the complete
michael@0 488 list.
michael@0 489 @param [out] startOffset
michael@0 490 0 based offset of first character.
michael@0 491 @param [out] endOffset
michael@0 492 0 based offset of one past the last character.
michael@0 493 @param [out] text
michael@0 494 Returns the requested text portion. This portion may be empty or invalid when
michael@0 495 no appropriate text portion is found or text type is invalid.
michael@0 496 @retval S_OK
michael@0 497 @retval S_FALSE if the requested boundary type is not implemented, such as
michael@0 498 ::IA2_TEXT_BOUNDARY_SENTENCE, or if there is nothing to return;
michael@0 499 [out] values are 0s and NULL respectively
michael@0 500 @retval E_INVALIDARG if bad [in] passed
michael@0 501 */
michael@0 502 [propget] HRESULT textAtOffset
michael@0 503 (
michael@0 504 [in] long offset,
michael@0 505 [in] enum IA2TextBoundaryType boundaryType,
michael@0 506 [out] long *startOffset,
michael@0 507 [out] long *endOffset,
michael@0 508 [out, retval] BSTR *text
michael@0 509 );
michael@0 510
michael@0 511 /** @brief Unselects a range of text.
michael@0 512 @param [in] selectionIndex
michael@0 513 Index of selection to remove (0 based).
michael@0 514 @retval S_OK
michael@0 515 @retval E_INVALIDARG if bad [in] passed
michael@0 516 */
michael@0 517 HRESULT removeSelection
michael@0 518 (
michael@0 519 [in] long selectionIndex
michael@0 520 );
michael@0 521
michael@0 522 /** @brief Sets the position of the caret.
michael@0 523
michael@0 524 The caret position/offset is that of the character logically following it,
michael@0 525 e.g. to the right of it in a left to right language.
michael@0 526
michael@0 527 Setting the caret position may or may not alter the current selection. A
michael@0 528 change of the selection is notified to the accessibility event listeners with
michael@0 529 an ::IA2_EVENT_TEXT_SELECTION_CHANGED event.
michael@0 530
michael@0 531 When the new caret position differs from the old one (which, of course, is the
michael@0 532 standard case) this is notified to the accessibility event listeners with an
michael@0 533 ::IA2_EVENT_TEXT_CARET_MOVED event.
michael@0 534 @param [in] offset
michael@0 535 The new index of the caret. This caret is actually placed to the left side of
michael@0 536 the character with that index. An index of 0 places the caret so that the next
michael@0 537 insertion goes before the first character. An index of IAccessibleText::nCharacters
michael@0 538 leads to insertion after the last character. Refer to @ref _specialOffsets
michael@0 539 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 540 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 541 @retval S_OK
michael@0 542 @retval E_FAIL if the caret cannot be set
michael@0 543 @retval E_INVALIDARG if bad [in] passed
michael@0 544 */
michael@0 545 HRESULT setCaretOffset
michael@0 546 (
michael@0 547 [in] long offset
michael@0 548 );
michael@0 549
michael@0 550 /** @brief Changes the bounds of an existing selection.
michael@0 551 @param [in] selectionIndex
michael@0 552 Index of selection to change (0 based)
michael@0 553 @param [in] startOffset
michael@0 554 New starting offset (0 based)
michael@0 555 @param [in] endOffset
michael@0 556 New ending offset (0 based) - the offset of the character just past the last character of the selection.
michael@0 557 @retval S_OK
michael@0 558 @retval E_INVALIDARG if bad [in] passed
michael@0 559 @note Refer to @ref _specialOffsets
michael@0 560 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 561 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 562 */
michael@0 563 HRESULT setSelection
michael@0 564 (
michael@0 565 [in] long selectionIndex,
michael@0 566 [in] long startOffset,
michael@0 567 [in] long endOffset
michael@0 568 );
michael@0 569
michael@0 570 /** @brief Returns total number of characters.
michael@0 571
michael@0 572 Note that this may be different than the total number of bytes required to store the
michael@0 573 text, if the text contains multi-byte characters.
michael@0 574 @param [out] nCharacters
michael@0 575 @retval S_OK
michael@0 576 */
michael@0 577 [propget] HRESULT nCharacters
michael@0 578 (
michael@0 579 [out, retval] long *nCharacters
michael@0 580 );
michael@0 581
michael@0 582 /** @brief Makes a specific part of string visible on screen.
michael@0 583 @param [in] startIndex
michael@0 584 0 based character offset.
michael@0 585 @param [in] endIndex
michael@0 586 0 based character offset - the offset of the character just past the last character of the string.
michael@0 587 @param [in] scrollType
michael@0 588 Defines where the object should be placed on the screen.
michael@0 589 @retval S_OK
michael@0 590 @retval E_INVALIDARG if bad [in] passed
michael@0 591 @note Refer to @ref _specialOffsets
michael@0 592 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 593 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 594 */
michael@0 595 HRESULT scrollSubstringTo
michael@0 596 (
michael@0 597 [in] long startIndex,
michael@0 598 [in] long endIndex,
michael@0 599 [in] enum IA2ScrollType scrollType
michael@0 600 );
michael@0 601
michael@0 602 /** @brief Moves the top left of a substring to a specified location.
michael@0 603
michael@0 604 @param [in] startIndex
michael@0 605 0 based character offset.
michael@0 606 @param [in] endIndex
michael@0 607 0 based character offset - the offset of the character just past the last character of the string.
michael@0 608 @param [in] coordinateType
michael@0 609 Specifies whether the coordinates are relative to the screen or the parent object.
michael@0 610 @param [in] x
michael@0 611 Defines the x coordinate.
michael@0 612 @param [in] y
michael@0 613 Defines the y coordinate.
michael@0 614 @retval S_OK
michael@0 615 @retval S_FALSE if the object is already at the specified location.
michael@0 616 @retval E_INVALIDARG if bad [in] passed
michael@0 617 @note Refer to @ref _specialOffsets
michael@0 618 "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
michael@0 619 for information about special offsets that can be used in %IAccessibleText methods.
michael@0 620 */
michael@0 621 HRESULT scrollSubstringToPoint
michael@0 622 (
michael@0 623 [in] long startIndex,
michael@0 624 [in] long endIndex,
michael@0 625 [in] enum IA2CoordinateType coordinateType,
michael@0 626 [in] long x,
michael@0 627 [in] long y
michael@0 628 );
michael@0 629
michael@0 630 /** @brief Returns any inserted text.
michael@0 631
michael@0 632 Provided for use by the ::IA2_EVENT_TEXT_INSERTED and ::IA2_EVENT_TEXT_UPDATED
michael@0 633 event handlers.
michael@0 634
michael@0 635 This data is only guaranteed to be valid while the thread notifying the event
michael@0 636 continues. Once the handler has returned, the validity of the data depends on
michael@0 637 how the server manages the life cycle of its objects. Also, note that the server
michael@0 638 may have different life cycle management strategies for controls depending on
michael@0 639 whether or not a control manages its children. Lists, trees, and tables can have
michael@0 640 a large number of children and thus it's possible that the child objects for those
michael@0 641 controls would only be created as needed. Servers should document their life cycle
michael@0 642 strategy as this will be of interest to assistive technology or script engines
michael@0 643 accessing data out of process or from other threads. Servers only need to save the
michael@0 644 last inserted block of text and a scope of the entire application is adequate.
michael@0 645
michael@0 646 @param [out] newText
michael@0 647 The text that was just inserted.
michael@0 648 @retval S_OK
michael@0 649 @retval S_FALSE If there is nothing to return, the values of IA2TextSegment
michael@0 650 struct are set as follows: text = NULL, start = 0, end = 0.
michael@0 651
michael@0 652 */
michael@0 653 [propget] HRESULT newText
michael@0 654 (
michael@0 655 [out, retval] IA2TextSegment *newText
michael@0 656 );
michael@0 657
michael@0 658 /** @brief Returns any removed text.
michael@0 659
michael@0 660 Provided for use by the IA2_EVENT_TEXT_REMOVED/UPDATED event handlers.
michael@0 661
michael@0 662 This data is only guaranteed to be valid while the thread notifying the event
michael@0 663 continues. Once the handler has returned, the validity of the data depends on
michael@0 664 how the server manages the life cycle of its objects. Also, note that the server
michael@0 665 may have different life cycle management strategies for controls depending on
michael@0 666 whether or not a control manages its children. Lists, trees, and tables can have
michael@0 667 a large number of children and thus it's possible that the child objects for those
michael@0 668 controls would only be created as needed. Servers should document their life cycle
michael@0 669 strategy as this will be of interest to assistive technology or script engines
michael@0 670 accessing data out of process or from other threads. Servers only need to save the
michael@0 671 last removed block of text and a scope of the entire application is adequate.
michael@0 672
michael@0 673 @param [out] oldText
michael@0 674 The text that was just removed.
michael@0 675 @retval S_OK
michael@0 676 @retval S_FALSE If there is nothing to return, the values of IA2TextSegment
michael@0 677 struct are set as follows: text = NULL, start = 0, end = 0.
michael@0 678 */
michael@0 679 [propget] HRESULT oldText
michael@0 680 (
michael@0 681 [out, retval] IA2TextSegment *oldText
michael@0 682 );
michael@0 683
michael@0 684 }

mercurial