1*3a700b0aSSteve Yin /************************************************************** 25fdc4257SSteve Yin * 3*3a700b0aSSteve Yin * Licensed to the Apache Software Foundation (ASF) under one 4*3a700b0aSSteve Yin * or more contributor license agreements. See the NOTICE file 5*3a700b0aSSteve Yin * distributed with this work for additional information 6*3a700b0aSSteve Yin * regarding copyright ownership. The ASF licenses this file 7*3a700b0aSSteve Yin * to you under the Apache License, Version 2.0 (the 8*3a700b0aSSteve Yin * "License"); you may not use this file except in compliance 9*3a700b0aSSteve Yin * with the License. You may obtain a copy of the License at 105fdc4257SSteve Yin * 11*3a700b0aSSteve Yin * http://www.apache.org/licenses/LICENSE-2.0 125fdc4257SSteve Yin * 13*3a700b0aSSteve Yin * Unless required by applicable law or agreed to in writing, 14*3a700b0aSSteve Yin * software distributed under the License is distributed on an 15*3a700b0aSSteve Yin * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3a700b0aSSteve Yin * KIND, either express or implied. See the License for the 17*3a700b0aSSteve Yin * specific language governing permissions and limitations 18*3a700b0aSSteve Yin * under the License. 195fdc4257SSteve Yin * 20*3a700b0aSSteve Yin *************************************************************/ 215fdc4257SSteve Yin 225fdc4257SSteve Yin #include "stdafx.h" 235fdc4257SSteve Yin #include "UAccCOM2.h" 245fdc4257SSteve Yin #include "AccText.h" 255fdc4257SSteve Yin 265fdc4257SSteve Yin using namespace com::sun::star::accessibility; 275fdc4257SSteve Yin using namespace com::sun::star::uno; 285fdc4257SSteve Yin 295fdc4257SSteve Yin /** 305fdc4257SSteve Yin * Get special selection. 315fdc4257SSteve Yin * @param startOffset Start selection offset. 325fdc4257SSteve Yin * @param endOffset End selection offset. 335fdc4257SSteve Yin * @param success Variant to accept the result of if the method call is successful. 345fdc4257SSteve Yin * @return Result. 355fdc4257SSteve Yin */ 365fdc4257SSteve Yin STDMETHODIMP CAccText::addSelection(long startOffset, long endOffset)//, unsigned char * success) 375fdc4257SSteve Yin { 385fdc4257SSteve Yin 395fdc4257SSteve Yin return CAccTextBase::get_addSelection(startOffset, endOffset);//, success); 405fdc4257SSteve Yin } 415fdc4257SSteve Yin 425fdc4257SSteve Yin /** 435fdc4257SSteve Yin * Get special attributes. 445fdc4257SSteve Yin * @param offset Offset. 455fdc4257SSteve Yin * @param startOffset Variant to accept start offset. 465fdc4257SSteve Yin * @param endOffset Variant to accept end offset. 475fdc4257SSteve Yin * @param textAttributes Variant to accept attributes. 485fdc4257SSteve Yin * @return Result. 495fdc4257SSteve Yin */ 505fdc4257SSteve Yin STDMETHODIMP CAccText::get_attributes(long offset, long * startOffset, long * endOffset, BSTR * textAttributes) 515fdc4257SSteve Yin { 525fdc4257SSteve Yin 535fdc4257SSteve Yin return CAccTextBase::get_attributes(offset, startOffset, endOffset, textAttributes); 545fdc4257SSteve Yin } 555fdc4257SSteve Yin 565fdc4257SSteve Yin /** 575fdc4257SSteve Yin * Get caret position. 585fdc4257SSteve Yin * @param offset Variant to accept caret offset. 595fdc4257SSteve Yin * @return Result. 605fdc4257SSteve Yin */ 615fdc4257SSteve Yin STDMETHODIMP CAccText::get_caretOffset(long * offset) 625fdc4257SSteve Yin { 635fdc4257SSteve Yin 645fdc4257SSteve Yin return CAccTextBase::get_caretOffset(offset); 655fdc4257SSteve Yin } 665fdc4257SSteve Yin 675fdc4257SSteve Yin /** 685fdc4257SSteve Yin * Get character count. 695fdc4257SSteve Yin * @param nCharacters Variant to accept character count. 705fdc4257SSteve Yin * @return Result. 715fdc4257SSteve Yin */ 725fdc4257SSteve Yin STDMETHODIMP CAccText::get_characterCount(long * nCharacters) 735fdc4257SSteve Yin { 745fdc4257SSteve Yin 755fdc4257SSteve Yin return CAccTextBase::get_characterCount(nCharacters); 765fdc4257SSteve Yin } 775fdc4257SSteve Yin 785fdc4257SSteve Yin /** 795fdc4257SSteve Yin * Get character extents. 805fdc4257SSteve Yin * @param offset Offset. 815fdc4257SSteve Yin * @param x Variant to accpet x position. 825fdc4257SSteve Yin * @param y Variant to accpet y position. 835fdc4257SSteve Yin * @param width Variant to accpet width. 845fdc4257SSteve Yin * @param Height Variant to accpet height. 855fdc4257SSteve Yin * @return Result. 865fdc4257SSteve Yin */ 875fdc4257SSteve Yin STDMETHODIMP CAccText::get_characterExtents(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height) 885fdc4257SSteve Yin { 895fdc4257SSteve Yin 905fdc4257SSteve Yin return CAccTextBase::get_characterExtents(offset, coordType, x, y, width, height); 915fdc4257SSteve Yin } 925fdc4257SSteve Yin 935fdc4257SSteve Yin /** 945fdc4257SSteve Yin * Get slections count. 955fdc4257SSteve Yin * @param nSelections Variant to accpet slections count. 965fdc4257SSteve Yin * @return Result. 975fdc4257SSteve Yin */ 985fdc4257SSteve Yin STDMETHODIMP CAccText::get_nSelections(long * nSelections) 995fdc4257SSteve Yin { 1005fdc4257SSteve Yin 1015fdc4257SSteve Yin return CAccTextBase::get_nSelections(nSelections); 1025fdc4257SSteve Yin } 1035fdc4257SSteve Yin 1045fdc4257SSteve Yin /** 1055fdc4257SSteve Yin * Get offset of some special point. 1065fdc4257SSteve Yin * @param x X position of one point. 1075fdc4257SSteve Yin * @param x Y position of one point. 1085fdc4257SSteve Yin * @param coordType Type. 1095fdc4257SSteve Yin * @param offset Variant to accept offset. 1105fdc4257SSteve Yin * @return Result. 1115fdc4257SSteve Yin */ 1125fdc4257SSteve Yin 1135fdc4257SSteve Yin STDMETHODIMP CAccText::get_offsetAtPoint(long x, long y, IA2CoordinateType coordType, long * offset) 1145fdc4257SSteve Yin { 1155fdc4257SSteve Yin 1165fdc4257SSteve Yin return CAccTextBase::get_offsetAtPoint(x, y, coordType, offset); 1175fdc4257SSteve Yin } 1185fdc4257SSteve Yin 1195fdc4257SSteve Yin /** 1205fdc4257SSteve Yin * Get selection range. 1215fdc4257SSteve Yin * @param selection selection count. 1225fdc4257SSteve Yin * @param startOffset Variant to accept the start offset of special selection. 1235fdc4257SSteve Yin * @param endOffset Variant to accept the end offset of special selection. 1245fdc4257SSteve Yin * @return Result. 1255fdc4257SSteve Yin */ 1265fdc4257SSteve Yin STDMETHODIMP CAccText::get_selection(long selection, long * startOffset, long * endOffset) 1275fdc4257SSteve Yin { 1285fdc4257SSteve Yin 1295fdc4257SSteve Yin return CAccTextBase::get_selection(selection, startOffset, endOffset); 1305fdc4257SSteve Yin } 1315fdc4257SSteve Yin 1325fdc4257SSteve Yin /** 1335fdc4257SSteve Yin * Get special text. 1345fdc4257SSteve Yin * @param startOffset Start position of special range. 1355fdc4257SSteve Yin * @param endOffset End position of special range. 1365fdc4257SSteve Yin * @param text Variant to accept the text of special range. 1375fdc4257SSteve Yin * @return Result. 1385fdc4257SSteve Yin */ 1395fdc4257SSteve Yin STDMETHODIMP CAccText::get_text(long startOffset, long endOffset, BSTR * text) 1405fdc4257SSteve Yin { 1415fdc4257SSteve Yin 1425fdc4257SSteve Yin return CAccTextBase::get_text(startOffset, endOffset, text); 1435fdc4257SSteve Yin } 1445fdc4257SSteve Yin 1455fdc4257SSteve Yin /** 1465fdc4257SSteve Yin * Get special text before some position. 1475fdc4257SSteve Yin * @param offset Special position. 1485fdc4257SSteve Yin * @param boundaryType Boundary type. 1495fdc4257SSteve Yin * @param startOffset Variant to accept the start offset. 1505fdc4257SSteve Yin * @param endOffset Variant to accept the end offset. 1515fdc4257SSteve Yin * @param text Variant to accept the special text. 1525fdc4257SSteve Yin * @return Result. 1535fdc4257SSteve Yin */ 1545fdc4257SSteve Yin STDMETHODIMP CAccText::get_textBeforeOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text) 1555fdc4257SSteve Yin { 1565fdc4257SSteve Yin 1575fdc4257SSteve Yin return CAccTextBase::get_textBeforeOffset(offset, boundaryType, 1585fdc4257SSteve Yin startOffset, endOffset, text); 1595fdc4257SSteve Yin } 1605fdc4257SSteve Yin 1615fdc4257SSteve Yin /** 1625fdc4257SSteve Yin * Get special text after some position. 1635fdc4257SSteve Yin * @param offset Special position. 1645fdc4257SSteve Yin * @param boundaryType Boundary type. 1655fdc4257SSteve Yin * @param startOffset Variant to accept the start offset. 1665fdc4257SSteve Yin * @param endOffset Variant to accept the end offset. 1675fdc4257SSteve Yin * @param text Variant to accept the special text. 1685fdc4257SSteve Yin * @return Result. 1695fdc4257SSteve Yin */ 1705fdc4257SSteve Yin STDMETHODIMP CAccText::get_textAfterOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text) 1715fdc4257SSteve Yin { 1725fdc4257SSteve Yin 1735fdc4257SSteve Yin return CAccTextBase::get_textAfterOffset(offset, boundaryType, 1745fdc4257SSteve Yin startOffset, endOffset, text); 1755fdc4257SSteve Yin } 1765fdc4257SSteve Yin 1775fdc4257SSteve Yin /** 1785fdc4257SSteve Yin * Get special text at some position. 1795fdc4257SSteve Yin * @param offset Special position. 1805fdc4257SSteve Yin * @param boundaryType Boundary type. 1815fdc4257SSteve Yin * @param startOffset Variant to accept the start offset. 1825fdc4257SSteve Yin * @param endOffset Variant to accept the end offset. 1835fdc4257SSteve Yin * @param text Variant to accept the special text. 1845fdc4257SSteve Yin * @return Result. 1855fdc4257SSteve Yin */ 1865fdc4257SSteve Yin STDMETHODIMP CAccText::get_textAtOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text) 1875fdc4257SSteve Yin { 1885fdc4257SSteve Yin 1895fdc4257SSteve Yin return CAccTextBase::get_textAtOffset(offset, boundaryType, 1905fdc4257SSteve Yin startOffset, endOffset, text); 1915fdc4257SSteve Yin } 1925fdc4257SSteve Yin 1935fdc4257SSteve Yin /** 1945fdc4257SSteve Yin * Remove selection. 1955fdc4257SSteve Yin * @param selectionIndex Special selection index 1965fdc4257SSteve Yin * @param success Variant to accept the memthod called result. 1975fdc4257SSteve Yin * @return Result. 1985fdc4257SSteve Yin */ 1995fdc4257SSteve Yin STDMETHODIMP CAccText::removeSelection(long selectionIndex)//, unsigned char * success) 2005fdc4257SSteve Yin { 2015fdc4257SSteve Yin 2025fdc4257SSteve Yin return CAccTextBase::removeSelection(selectionIndex);//, success); 2035fdc4257SSteve Yin } 2045fdc4257SSteve Yin 2055fdc4257SSteve Yin /** 2065fdc4257SSteve Yin * Set caret position. 2075fdc4257SSteve Yin * @param offset Special position. 2085fdc4257SSteve Yin * @param success Variant to accept the memthod called result. 2095fdc4257SSteve Yin * @return Result. 2105fdc4257SSteve Yin */ 2115fdc4257SSteve Yin STDMETHODIMP CAccText::setCaretOffset(long offset) 2125fdc4257SSteve Yin { 2135fdc4257SSteve Yin 2145fdc4257SSteve Yin return CAccTextBase::setCaretOffset(offset); 2155fdc4257SSteve Yin } 2165fdc4257SSteve Yin 2175fdc4257SSteve Yin /** 2185fdc4257SSteve Yin * Set special selection. 2195fdc4257SSteve Yin * @param selectionIndex Special selection index. 2205fdc4257SSteve Yin * @param startOffset start position. 2215fdc4257SSteve Yin * @param endOffset end position. 2225fdc4257SSteve Yin * @param success Variant to accept the memthod called result. 2235fdc4257SSteve Yin * @return Result. 2245fdc4257SSteve Yin */ 2255fdc4257SSteve Yin 2265fdc4257SSteve Yin STDMETHODIMP CAccText::setSelection(long selectionIndex, long startOffset, long endOffset) 2275fdc4257SSteve Yin { 2285fdc4257SSteve Yin 2295fdc4257SSteve Yin return CAccTextBase::setSelection(selectionIndex, startOffset, 2305fdc4257SSteve Yin endOffset); 2315fdc4257SSteve Yin } 2325fdc4257SSteve Yin 2335fdc4257SSteve Yin /** 2345fdc4257SSteve Yin * Get characters count. 2355fdc4257SSteve Yin * @param nCharacters Variant to accept the characters count. 2365fdc4257SSteve Yin * @return Result. 2375fdc4257SSteve Yin */ 2385fdc4257SSteve Yin STDMETHODIMP CAccText::get_nCharacters(long * nCharacters) 2395fdc4257SSteve Yin { 2405fdc4257SSteve Yin 2415fdc4257SSteve Yin return CAccTextBase::get_nCharacters(nCharacters); 2425fdc4257SSteve Yin } 2435fdc4257SSteve Yin 2445fdc4257SSteve Yin STDMETHODIMP CAccText::get_newText( IA2TextSegment *newText) 2455fdc4257SSteve Yin { 2465fdc4257SSteve Yin return CAccTextBase::get_newText(newText); 2475fdc4257SSteve Yin } 2485fdc4257SSteve Yin 2495fdc4257SSteve Yin STDMETHODIMP CAccText::get_oldText( IA2TextSegment *oldText) 2505fdc4257SSteve Yin { 2515fdc4257SSteve Yin return CAccTextBase::get_oldText(oldText); 2525fdc4257SSteve Yin } 2535fdc4257SSteve Yin 2545fdc4257SSteve Yin /** 2555fdc4257SSteve Yin * Scroll to special sub-string . 2565fdc4257SSteve Yin * @param startIndex Start index of sub string. 2575fdc4257SSteve Yin * @param endIndex End index of sub string. 2585fdc4257SSteve Yin * @return Result. 2595fdc4257SSteve Yin */ 2605fdc4257SSteve Yin STDMETHODIMP CAccText::scrollSubstringToPoint(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y ) 2615fdc4257SSteve Yin { 2625fdc4257SSteve Yin 2635fdc4257SSteve Yin return CAccTextBase::scrollSubstringToPoint(startIndex, endIndex, coordinateType, x, y); 2645fdc4257SSteve Yin } 2655fdc4257SSteve Yin 2665fdc4257SSteve Yin STDMETHODIMP CAccText::scrollSubstringTo(long startIndex, long endIndex,enum IA2ScrollType scrollType) 2675fdc4257SSteve Yin { 2685fdc4257SSteve Yin 2695fdc4257SSteve Yin return CAccTextBase::scrollSubstringTo(startIndex, endIndex,scrollType); 2705fdc4257SSteve Yin } 2715fdc4257SSteve Yin 2725fdc4257SSteve Yin /** 2735fdc4257SSteve Yin * Put UNO interface. 2745fdc4257SSteve Yin * @param pXInterface UNO interface. 2755fdc4257SSteve Yin * @return Result. 2765fdc4257SSteve Yin */ 2775fdc4257SSteve Yin STDMETHODIMP CAccText::put_XInterface(long pXInterface) 2785fdc4257SSteve Yin { 2795fdc4257SSteve Yin 2805fdc4257SSteve Yin return CAccTextBase::put_XInterface(pXInterface); 2815fdc4257SSteve Yin } 2825fdc4257SSteve Yin 283