1d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10d1766043SAndrew Rist * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12d1766043SAndrew Rist * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19d1766043SAndrew Rist * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir#ifndef __com_sun_star_accessibility_XAccessibleText_idl__ 25cdf0e10cSrcweir#define __com_sun_star_accessibility_XAccessibleText_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#ifndef __com_sun_star_accessibility_AccessibleTextType_idl__ 28cdf0e10cSrcweir#include <com/sun/star/accessibility/AccessibleTextType.idl> 29cdf0e10cSrcweir#endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 32cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 33cdf0e10cSrcweir#endif 34cdf0e10cSrcweir#ifndef __com_sun_star_awt_Point_idl__ 35cdf0e10cSrcweir#include <com/sun/star/awt/Point.idl> 36cdf0e10cSrcweir#endif 37cdf0e10cSrcweir#ifndef __com_sun_star_awt_Rectangle_idl__ 38cdf0e10cSrcweir#include <com/sun/star/awt/Rectangle.idl> 39cdf0e10cSrcweir#endif 40cdf0e10cSrcweir#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ 41cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl> 42cdf0e10cSrcweir#endif 43cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 44cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 45cdf0e10cSrcweir#endif 46cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__ 47cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl> 48cdf0e10cSrcweir#endif 49cdf0e10cSrcweir#ifndef __com_sun_star_accessibility_TextSegment_idl__ 50cdf0e10cSrcweir#include <com/sun/star/accessibility/TextSegment.idl> 51cdf0e10cSrcweir#endif 52cdf0e10cSrcweir 53cdf0e10cSrcweirmodule com { module sun { module star { module accessibility { 54cdf0e10cSrcweir 55cdf0e10cSrcweir/** Implement this interface to give read-only access to a text. 56cdf0e10cSrcweir 57cdf0e10cSrcweir <p>The <type>XAccessibleText</type> interface should be implemented by 58cdf0e10cSrcweir all UNO components that present textual information on the display like 59cdf0e10cSrcweir buttons, text entry fields, or text portions of the document window. 60cdf0e10cSrcweir The interface provides access to the text's content, attributes, and 61cdf0e10cSrcweir spatial location. However, text can not be modified with this 62cdf0e10cSrcweir interface. That is the task of the <type>XAccessibleEditableText</type> 63cdf0e10cSrcweir interface.</p> 64cdf0e10cSrcweir 65cdf0e10cSrcweir <p>The text length, i.e. the number of characters in the text, is 66cdf0e10cSrcweir returned by <member>XAccessibleText::getCharacterCount</member>. 67cdf0e10cSrcweir All methods that operate on particular characters (e.g. 68cdf0e10cSrcweir <member>XAccessibleText::getCharacterAt</member>) use character 69cdf0e10cSrcweir indices from 0 to length-1. All methods that operate on character 70cdf0e10cSrcweir positions (e.g. <member>XAccessibleText::getTextRange</member>) 71cdf0e10cSrcweir use indices from 0 to length.</p> 72cdf0e10cSrcweir 73cdf0e10cSrcweir <p>Please note that accessible text does not necessarily support 74cdf0e10cSrcweir selection. In this case it should behave as if there where no 75cdf0e10cSrcweir selection. An empty selection is used for example to express the 76cdf0e10cSrcweir current cursor position.</p> 77cdf0e10cSrcweir 780d3a54ffSJürgen Schmidt @since OpenOffice 1.1.2 79cdf0e10cSrcweir*/ 80cdf0e10cSrcweirpublished interface XAccessibleText : ::com::sun::star::uno::XInterface 81cdf0e10cSrcweir{ 82cdf0e10cSrcweir /** Return the position of the caret. 83cdf0e10cSrcweir 84cdf0e10cSrcweir <p>Returns the offset of the caret. The caret is often called text 85cdf0e10cSrcweir cursor. The caret is actually the position between two characters. 86cdf0e10cSrcweir Its position/offset is that of the character to the right of it.</p> 87cdf0e10cSrcweir 88cdf0e10cSrcweir @return 89cdf0e10cSrcweir The returned offset is relative to the text represented by this 90cdf0e10cSrcweir object. 91cdf0e10cSrcweir */ 92cdf0e10cSrcweir long getCaretPosition (); 93cdf0e10cSrcweir 94cdf0e10cSrcweir /** Set the position of the caret. 95cdf0e10cSrcweir 96cdf0e10cSrcweir <p>The caret is often called text cursor. The caret is actually the 97cdf0e10cSrcweir position between two characters. Its position/offset is that of the 98cdf0e10cSrcweir character to the right of it.</p> 99cdf0e10cSrcweir 100cdf0e10cSrcweir <p>Setting the caret position may or may not alter the current 101cdf0e10cSrcweir selection. A change of the selection is notified to the 102cdf0e10cSrcweir accessibility event listeners with an 103cdf0e10cSrcweir <const>AccessibleEventId::ACCESSIBLE_SELECTION_EVENT</const>.</p> 104cdf0e10cSrcweir 105cdf0e10cSrcweir <p>When the new caret position differs from the old one (which, of 106cdf0e10cSrcweir course, is the standard case) this is notified to the accessibility 107cdf0e10cSrcweir event listeners with an 108cdf0e10cSrcweir <const>AccessibleEventId::ACCESSIBLE_CARET_EVENT</const>.</p> 109cdf0e10cSrcweir 110cdf0e10cSrcweir @param nIndex 111cdf0e10cSrcweir The new index of the caret. This caret is actually placed to 112cdf0e10cSrcweir the left side of the character with that index. An index of 0 113cdf0e10cSrcweir places the caret so that the next insertion goes before the 114cdf0e10cSrcweir first character. An index of <member>getCharacterCount</member> 115cdf0e10cSrcweir leads to insertion after the last character. 116cdf0e10cSrcweir 117cdf0e10cSrcweir @return 118cdf0e10cSrcweir Returns <TRUE/> if the caret has been moved and <FALSE/> 119cdf0e10cSrcweir otherwise. A <TRUE/> value does not necessarily mean that the 120cdf0e10cSrcweir caret has been positioned exactly at the required position. 121cdf0e10cSrcweir If that position lies inside a read-only area the caret is 122cdf0e10cSrcweir positioned before or behind it. Listen to the caret event to 123cdf0e10cSrcweir determine the new position. 124cdf0e10cSrcweir 125cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 126cdf0e10cSrcweir if the index is not valid. 127cdf0e10cSrcweir */ 128cdf0e10cSrcweir boolean setCaretPosition ([in] long nIndex) 129cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException); 130cdf0e10cSrcweir 131cdf0e10cSrcweir /** Return the character at the specified position. 132cdf0e10cSrcweir 133cdf0e10cSrcweir <p>Returns the character at the given index.</p> 134cdf0e10cSrcweir 135cdf0e10cSrcweir @param nIndex 136cdf0e10cSrcweir The index of the character to return. 137cdf0e10cSrcweir The valid range is 0..length-1. 138cdf0e10cSrcweir 139cdf0e10cSrcweir @return 140cdf0e10cSrcweir the character at the index nIndex. 141cdf0e10cSrcweir 142cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 143cdf0e10cSrcweir if the index is invalid 144cdf0e10cSrcweir */ 145cdf0e10cSrcweir char getCharacter ([in] long nIndex) 146cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException); 147cdf0e10cSrcweir 148cdf0e10cSrcweir /** Get the attribute set for the specified position. 149cdf0e10cSrcweir 150cdf0e10cSrcweir <p>Returns a set of attributes that are associated for the character 151cdf0e10cSrcweir at the given index. To prevent the method from returning possibly 152cdf0e10cSrcweir large sets of attributes that the caller is not interested in the 153cdf0e10cSrcweir caller has to provide a list of attributes that he wants to be 154cdf0e10cSrcweir returned.</p> 155cdf0e10cSrcweir 156cdf0e10cSrcweir @param nIndex 157cdf0e10cSrcweir The index of the character for which to return its attributes. 158cdf0e10cSrcweir The valid range is 0..length-1. 159cdf0e10cSrcweir 160cdf0e10cSrcweir @param aRequestedAttributes 161cdf0e10cSrcweir This string sequence defines the set of attributes that the 162cdf0e10cSrcweir caller is interested in. When there are attributes defined that 163cdf0e10cSrcweir are not listed in the sequence then they are not returned. When 164cdf0e10cSrcweir there are requested attributes that are not defined for the 165cdf0e10cSrcweir character then they are ignored, too. 166cdf0e10cSrcweir 167cdf0e10cSrcweir <p>An empty sequence signals the callers interest in all the 168a893be29SPedro Giffuni attributes. This is useful in two cases: a) Simply as a way to 169cdf0e10cSrcweir avoid passing a potentially large array to the called object or 170cdf0e10cSrcweir b) when the caller does not know what attributes the called 171cdf0e10cSrcweir objects supports but is interested in all of them 172cdf0e10cSrcweir nevertheless.</p> 173cdf0e10cSrcweir 174cdf0e10cSrcweir @return 175cdf0e10cSrcweir Returns the explicitly or implicitly (empty 176cdf0e10cSrcweir <arg>aRequestedAttributes</arg> argument) requested attributes 177cdf0e10cSrcweir of the specified character. Each attribute is represented by a 178cdf0e10cSrcweir <type scope="::com::sun::star::beans">PropertyValue</type> 179cdf0e10cSrcweir object. The returned list of attribute descriptions contains 180cdf0e10cSrcweir all attributes that are both members of the sequence of 181cdf0e10cSrcweir requested attributes and are defined for the character at the 182cdf0e10cSrcweir specified index. 183cdf0e10cSrcweir 184cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 185cdf0e10cSrcweir if the index is invalid 186cdf0e10cSrcweir */ 187cdf0e10cSrcweir sequence<::com::sun::star::beans::PropertyValue> 188cdf0e10cSrcweir getCharacterAttributes ( 189cdf0e10cSrcweir [in] long nIndex, 190cdf0e10cSrcweir [in] sequence<string> aRequestedAttributes) 191cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException); 192cdf0e10cSrcweir 193cdf0e10cSrcweir 194cdf0e10cSrcweir /** Return the bounding box of the specified position. 195cdf0e10cSrcweir 196cdf0e10cSrcweir <p>Returns the bounding box of the indexed character.</p> 197cdf0e10cSrcweir 198cdf0e10cSrcweir <p>The virtual character after the last character of the represented 199cdf0e10cSrcweir text, i.e. the one at position length is a special case. It 200cdf0e10cSrcweir represents the current input position and will therefore typically 201cdf0e10cSrcweir be queried by AT more often than other positions. Because it does 202cdf0e10cSrcweir not represent an existing character its bounding box is defined in 203a893be29SPedro Giffuni relation to preceding characters. It should be roughly equivalent to 204cdf0e10cSrcweir the bounding box of some character when inserted at the end of the 205cdf0e10cSrcweir text. Its height typically being the maximal height of all the 206cdf0e10cSrcweir characters in the text or the height of the preceding character, its 207cdf0e10cSrcweir width being at least one pixel so that the bounding box is not 208cdf0e10cSrcweir degenerate.<br> 209cdf0e10cSrcweir Note that the index 'length' is not always valid. Whether it is 210cdf0e10cSrcweir or not is implementation dependent. It typically is when text is 211cdf0e10cSrcweir editable or otherwise when on the screen the caret can be placed 212cdf0e10cSrcweir behind the text. You can be sure that the index is valid after you 213cdf0e10cSrcweir have received a <const scope="AccessibleEventId">CARET</const> event 214cdf0e10cSrcweir for this index.</p> 215cdf0e10cSrcweir @param nIndex 216cdf0e10cSrcweir Index of the character for which to return its bounding box. 217cdf0e10cSrcweir The valid range is 0..length. 218cdf0e10cSrcweir 219cdf0e10cSrcweir @return 220cdf0e10cSrcweir The bounding box of the referenced character. The bounding box 221cdf0e10cSrcweir of the virtual character at position length has to have 222cdf0e10cSrcweir non-empty dimensions. 223cdf0e10cSrcweir 224cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 225cdf0e10cSrcweir if the index is invalid 226cdf0e10cSrcweir */ 227cdf0e10cSrcweir ::com::sun::star::awt::Rectangle getCharacterBounds ([in] long nIndex) 228cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException); 229cdf0e10cSrcweir 230cdf0e10cSrcweir 231cdf0e10cSrcweir /** Return the number of characters in the represented text. 232cdf0e10cSrcweir 233cdf0e10cSrcweir <p>Returns the number of characters in the text represented by this 234cdf0e10cSrcweir object or, in other words, the text length.</p> 235cdf0e10cSrcweir 236cdf0e10cSrcweir @return 237cdf0e10cSrcweir Returns the number of characters of this object's text. A zero 238cdf0e10cSrcweir value indicates an empty text. 239cdf0e10cSrcweir */ 240cdf0e10cSrcweir long getCharacterCount (); 241cdf0e10cSrcweir 242cdf0e10cSrcweir 243cdf0e10cSrcweir /** Return the text position for the specified screen position. 244cdf0e10cSrcweir 245cdf0e10cSrcweir <p>Given a point in local coordinates, i.e. relative to the 246cdf0e10cSrcweir coordinate system of the object, return the zero-based index of 247cdf0e10cSrcweir the character under that point. The same functionality could be 248cdf0e10cSrcweir achieved by using the bounding boxes for each character as returned 249cdf0e10cSrcweir by <member>XAccessibleText::getCharacterBounds</member>. The method 250cdf0e10cSrcweir <member>XAccessibleText::getIndexAtPoint</member>, however, can be 251cdf0e10cSrcweir implemented in a more efficient way.</p> 252cdf0e10cSrcweir 253cdf0e10cSrcweir @param aPoint 254cdf0e10cSrcweir The position for which to look up the index of the character 255cdf0e10cSrcweir that is rendered on to the display at that point. 256cdf0e10cSrcweir 257cdf0e10cSrcweir @return 258cdf0e10cSrcweir Index of the character under the given point or -1 if the point 259cdf0e10cSrcweir is invalid or there is no character under the point. 260cdf0e10cSrcweir */ 261cdf0e10cSrcweir long getIndexAtPoint ([in] ::com::sun::star::awt::Point aPoint); 262cdf0e10cSrcweir 263cdf0e10cSrcweir /** Return the selected text. 264cdf0e10cSrcweir 265cdf0e10cSrcweir <p>Returns the portion of the text that is selected.</p> 266cdf0e10cSrcweir 267cdf0e10cSrcweir @return 268cdf0e10cSrcweir The returned text is the selected portion of the object's text. 269cdf0e10cSrcweir If no text is selected when this method is called or when 270cdf0e10cSrcweir selection is not supported an empty string is returned. 271cdf0e10cSrcweir */ 272cdf0e10cSrcweir string getSelectedText (); 273cdf0e10cSrcweir 274cdf0e10cSrcweir /** Return the position of the start of the selection. 275cdf0e10cSrcweir 276cdf0e10cSrcweir <p>Returns the index of the start of the selected text.</p> 277cdf0e10cSrcweir 278cdf0e10cSrcweir @return 279cdf0e10cSrcweir If there is no selection or selection is not supported the 280cdf0e10cSrcweir position of selection start and end will be the same undefined 281cdf0e10cSrcweir value. 282cdf0e10cSrcweir */ 283cdf0e10cSrcweir long getSelectionStart (); 284cdf0e10cSrcweir 285cdf0e10cSrcweir /** Return the position of the end of the selection. 286cdf0e10cSrcweir 287cdf0e10cSrcweir <p>Returns the index of the end of the selected text.</p> 288cdf0e10cSrcweir 289cdf0e10cSrcweir @return 290cdf0e10cSrcweir If there is no selection or selection is not supported the 291cdf0e10cSrcweir position of selection start and end will be the same undefined 292cdf0e10cSrcweir value. 293cdf0e10cSrcweir */ 294cdf0e10cSrcweir long getSelectionEnd (); 295cdf0e10cSrcweir 296cdf0e10cSrcweir /** Set a new selection. 297cdf0e10cSrcweir 298cdf0e10cSrcweir <p>Sets the selected text portion according to the given indices. 299cdf0e10cSrcweir The old selection is replaced by the new selection.</p> 300cdf0e10cSrcweir 301cdf0e10cSrcweir <p>The selection encompasses the same string of text that 302cdf0e10cSrcweir <member>XAccessibleText::getTextRange</member> would have 303cdf0e10cSrcweir selected. See there for details.</p> 304cdf0e10cSrcweir 305cdf0e10cSrcweir <p>Setting the selection may or may not change the caret position. 306cdf0e10cSrcweir Typically the caret is moved to the position after the second 307cdf0e10cSrcweir argument. When the caret is moved this is notified to the 308cdf0e10cSrcweir accessibility event listeners with an 309cdf0e10cSrcweir <const>AccessibleEventId::ACCESSIBLE_CARET_EVENT</const>.</p> 310cdf0e10cSrcweir 311cdf0e10cSrcweir @param nStartIndex 312cdf0e10cSrcweir The first character of the new selection. 313cdf0e10cSrcweir The valid range is 0..length. 314cdf0e10cSrcweir 315*8e0daafcSTsutomu Uchino @param nEndIndex 316cdf0e10cSrcweir The position after the last character of the new selection. 317cdf0e10cSrcweir The valid range is 0..length. 318cdf0e10cSrcweir 319cdf0e10cSrcweir @return 320cdf0e10cSrcweir Returns <TRUE/> if the selection has been set successfully and 321cdf0e10cSrcweir <FALSE/> otherwise or when selection is not supported. 322cdf0e10cSrcweir 323cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 324cdf0e10cSrcweir if the indices are invalid 325cdf0e10cSrcweir */ 326cdf0e10cSrcweir boolean setSelection ([in] long nStartIndex, [in] long nEndIndex) 327cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException); 328cdf0e10cSrcweir 329cdf0e10cSrcweir /** Return the whole text. 330cdf0e10cSrcweir 331cdf0e10cSrcweir <p>Returns the complete text. This is equivalent to a call to 332cdf0e10cSrcweir <member>XAccessibleText::getTextRange</member> with the arguments 333cdf0e10cSrcweir zero and <code>getCharacterCount()-1</code>.</p> 334cdf0e10cSrcweir 335cdf0e10cSrcweir @return 336cdf0e10cSrcweir Returns a string that contains the complete text. 337cdf0e10cSrcweir */ 338cdf0e10cSrcweir string getText (); 339cdf0e10cSrcweir 340cdf0e10cSrcweir /** Return the specified text range. 341cdf0e10cSrcweir 342cdf0e10cSrcweir <p>Returns the substring between the two given indices.</p> 343cdf0e10cSrcweir 344cdf0e10cSrcweir <p>The substring starts with the character at nStartIndex 345cdf0e10cSrcweir (inclusive) and up to the character at nEndIndex (exclusive), 346cdf0e10cSrcweir if nStartIndex is less or equal nEndIndex. If nEndIndex is 347cdf0e10cSrcweir lower than nStartIndex, the result is the same as a call with 348cdf0e10cSrcweir the two arguments being exchanged.</p> 349cdf0e10cSrcweir 350cdf0e10cSrcweir <p>The whole text can be requested by passing the indices zero and 351cdf0e10cSrcweir <code>getCharacterCount()</code>. If both indices have the same 352cdf0e10cSrcweir value, an empty string is returned.</p> 353cdf0e10cSrcweir 354cdf0e10cSrcweir @param nStartIndex 355cdf0e10cSrcweir Index of the first character to include in the returned string. 356cdf0e10cSrcweir The valid range is 0..length. 357cdf0e10cSrcweir 358cdf0e10cSrcweir @param nEndIndex 359cdf0e10cSrcweir Index of the last character to exclude in the returned string. 360cdf0e10cSrcweir The valid range is 0..length. 361cdf0e10cSrcweir 362cdf0e10cSrcweir @return 363cdf0e10cSrcweir Returns the substring starting with the character at nStartIndex 364cdf0e10cSrcweir (inclusive) and up to the character at nEndIndex (exclusive), if 365cdf0e10cSrcweir nStartIndex is less than or equal to nEndIndex. 366cdf0e10cSrcweir 367cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 368cdf0e10cSrcweir if the indices are invalid 369cdf0e10cSrcweir */ 370cdf0e10cSrcweir string getTextRange ([in] long nStartIndex, [in] long nEndIndex) 371cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException); 372cdf0e10cSrcweir 373cdf0e10cSrcweir /** Get a text portion around the given position. 374cdf0e10cSrcweir 375cdf0e10cSrcweir <p>Returns the substring of the specified text type that contains 376cdf0e10cSrcweir the character at the given index, if any. For example, given the 377cdf0e10cSrcweir text type <const scope="AccessibleTextType">WORD</type>, the word 378cdf0e10cSrcweir which contains the character at position nIndex is returned, or an 379cdf0e10cSrcweir empty string if no word is found at the that position.</p> 380cdf0e10cSrcweir 381cdf0e10cSrcweir @param nIndex 382cdf0e10cSrcweir Index of the character whose containing text portion is to be 383cdf0e10cSrcweir returned. 384cdf0e10cSrcweir The valid range is 0..length. 385cdf0e10cSrcweir 386cdf0e10cSrcweir @param nTextType 387cdf0e10cSrcweir The type of the text portion to return. See 388cdf0e10cSrcweir <type>AccessibleTextType</type> for the complete list. 389cdf0e10cSrcweir 390cdf0e10cSrcweir @return 391cdf0e10cSrcweir Returns the requested text portion. This portion may be empty 392cdf0e10cSrcweir or invalid when no appropriate text portion is found or text 393cdf0e10cSrcweir type is invalid. 394cdf0e10cSrcweir 395cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 396cdf0e10cSrcweir if the index is invalid 397cdf0e10cSrcweir @throws ::com::sun::star::lang::InvalidArgumentException 398cdf0e10cSrcweir if the given text type is not valid. 399cdf0e10cSrcweir */ 400cdf0e10cSrcweir TextSegment getTextAtIndex([in] long nIndex, [in] short nTextType) 401cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException, 402cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException); 403cdf0e10cSrcweir 404cdf0e10cSrcweir /** Get a text portion before the given position. 405cdf0e10cSrcweir 406cdf0e10cSrcweir <p>Returns the substring of the specified text type that is 407cdf0e10cSrcweir located before the given character and does not include 408cdf0e10cSrcweir it. The result of this method should be same as a result for 409cdf0e10cSrcweir <member>XAccessibleText::getTextAtIndex</member> with a 410cdf0e10cSrcweir suitably decreased index value.</p> 411cdf0e10cSrcweir 412cdf0e10cSrcweir <p>For example, if text type is <const 413cdf0e10cSrcweir scope="AccessibleTextType">WORD</type>, then the complete word 414cdf0e10cSrcweir that is closest to and located before nIndex is returned.</p> 415cdf0e10cSrcweir 416cdf0e10cSrcweir <p>If the index is valid, but no suitable word (or other text 417cdf0e10cSrcweir type) is found, an empty text segment is returned.</p> 418cdf0e10cSrcweir 419cdf0e10cSrcweir @param nIndex 420cdf0e10cSrcweir Index of the character for which to return the text part before 421cdf0e10cSrcweir it. The index character will not be part of the returned 422cdf0e10cSrcweir string. 423cdf0e10cSrcweir The valid range is 0..length. 424cdf0e10cSrcweir 425cdf0e10cSrcweir @param nTextType 426cdf0e10cSrcweir The type of the text portion to return. See 427cdf0e10cSrcweir <type>AccessibleTextType</type> for the complete list. 428cdf0e10cSrcweir 429cdf0e10cSrcweir @return 430cdf0e10cSrcweir Returns the requested text portion. This portion may be empty 431cdf0e10cSrcweir or invalid when no appropriate text portion is found or text 432cdf0e10cSrcweir type is invalid. 433cdf0e10cSrcweir 434cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 435cdf0e10cSrcweir if the index is invalid. 436cdf0e10cSrcweir @throws ::com::sun::star::lang::InvalidArgumentException 437cdf0e10cSrcweir if the given text type is not valid. 438cdf0e10cSrcweir */ 439cdf0e10cSrcweir TextSegment getTextBeforeIndex([in] long nIndex, [in] short nTextType) 440cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException, 441cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException); 442cdf0e10cSrcweir 443cdf0e10cSrcweir /** Get a text portion behind the given position. 444cdf0e10cSrcweir 445cdf0e10cSrcweir <p>Returns the substring of the specified text type that is 446cdf0e10cSrcweir located after the given character and does not include 447cdf0e10cSrcweir it. The result of this method should be same as a result for 448cdf0e10cSrcweir <member>XAccessibleText::getTextAtIndex</member> with a 449cdf0e10cSrcweir suitably increased index value.</p> 450cdf0e10cSrcweir 451cdf0e10cSrcweir <p>For example, if text type is <const 452cdf0e10cSrcweir scope="AccessibleTextType">WORD</type>, then the complete word 453cdf0e10cSrcweir that is closest to and located behind nIndex is returned.</p> 454cdf0e10cSrcweir 455cdf0e10cSrcweir <p>If the index is valid, but no suitable word (or other text 456cdf0e10cSrcweir type) is found, an empty string is returned.</p> 457cdf0e10cSrcweir 458cdf0e10cSrcweir @param nIndex 459cdf0e10cSrcweir Index of the character for which to return the text part after 460cdf0e10cSrcweir it. The index character will be part of the returned string. 461cdf0e10cSrcweir The valid range is 0..length. 462cdf0e10cSrcweir 463cdf0e10cSrcweir @param nTextType 464cdf0e10cSrcweir The type of the text portion to return. See 465cdf0e10cSrcweir <type>AccessibleTextType</type> for the complete list. 466cdf0e10cSrcweir 467cdf0e10cSrcweir @return 468cdf0e10cSrcweir Returns the requested text portion. This portion may be empty 469cdf0e10cSrcweir or invalid when no appropriate text portion is found or text 470cdf0e10cSrcweir type is invalid. 471cdf0e10cSrcweir 472cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 473cdf0e10cSrcweir if the index is invalid 474cdf0e10cSrcweir @throws ::com::sun::star::lang::InvalidArgumentException 475cdf0e10cSrcweir if the given text type is not valid. 476cdf0e10cSrcweir */ 477cdf0e10cSrcweir TextSegment getTextBehindIndex([in] long nIndex, [in] short nTextType) 478cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException, 479cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException); 480cdf0e10cSrcweir 481cdf0e10cSrcweir /** Copy the specified text into the clipboard. 482cdf0e10cSrcweir 483cdf0e10cSrcweir <p>Copy the specified text into the clipboard. The text that is 484cdf0e10cSrcweir copied is the same text that would have been selected by the 485cdf0e10cSrcweir <member>XAccessibleText::getTextRange</member> method. </p> 486cdf0e10cSrcweir 487cdf0e10cSrcweir <p>The other clipboard related methods 488cdf0e10cSrcweir <member>XAccessibleEditableText::cutText</member> and 489cdf0e10cSrcweir <member>XAccessibleEditableText::deleteText</member> can be found in 490cdf0e10cSrcweir the <type>XAccessibleEditableText</type> because of their 491cdf0e10cSrcweir destructive nature.</p> 492cdf0e10cSrcweir 493cdf0e10cSrcweir @param nStartIndex 494cdf0e10cSrcweir Start index of the text to copied into the clipboard. 495cdf0e10cSrcweir The valid range is 0..length. 496cdf0e10cSrcweir 497cdf0e10cSrcweir @param nEndIndex 498cdf0e10cSrcweir End index of the text to copied into the clipboard. 499cdf0e10cSrcweir The valid range is 0..length. 500cdf0e10cSrcweir 501cdf0e10cSrcweir @return 502cdf0e10cSrcweir Returns <true/> if the specified text has been copied 503cdf0e10cSrcweir successfully into the clipboard. 504cdf0e10cSrcweir 505cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 506cdf0e10cSrcweir if the indices are invalid 507cdf0e10cSrcweir */ 508cdf0e10cSrcweir boolean copyText ([in] long nStartIndex, [in] long nEndIndex) 509cdf0e10cSrcweir raises (::com::sun::star::lang::IndexOutOfBoundsException); 510cdf0e10cSrcweir 511cdf0e10cSrcweir}; 512cdf0e10cSrcweir 513cdf0e10cSrcweir}; }; }; }; 514cdf0e10cSrcweir 515cdf0e10cSrcweir#endif 516