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 // AccTextBase.h: interface for the CAccTextBase class. 235fdc4257SSteve Yin // 245fdc4257SSteve Yin ////////////////////////////////////////////////////////////////////// 255fdc4257SSteve Yin 265fdc4257SSteve Yin #if !defined(AFX_ACCTEXTBASE_H__B9AE05F6_E28B_4CF3_A8F2_EEE5D2E00B82__INCLUDED_) 275fdc4257SSteve Yin #define AFX_ACCTEXTBASE_H__B9AE05F6_E28B_4CF3_A8F2_EEE5D2E00B82__INCLUDED_ 285fdc4257SSteve Yin 295fdc4257SSteve Yin #if _MSC_VER > 1000 305fdc4257SSteve Yin #pragma once 315fdc4257SSteve Yin #endif // _MSC_VER > 1000 325fdc4257SSteve Yin 335fdc4257SSteve Yin #define WNT 345fdc4257SSteve Yin 355fdc4257SSteve Yin #include <com/sun/star/uno/reference.hxx> 365fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessibleText.hpp> 375fdc4257SSteve Yin #include "UNOXWrapper.h" 385fdc4257SSteve Yin 395fdc4257SSteve Yin class ATL_NO_VTABLE CAccTextBase : public CUNOXWrapper 405fdc4257SSteve Yin { 415fdc4257SSteve Yin public: 425fdc4257SSteve Yin CAccTextBase(); 435fdc4257SSteve Yin virtual ~CAccTextBase(); 445fdc4257SSteve Yin 455fdc4257SSteve Yin // IAccessibleText 465fdc4257SSteve Yin public: 475fdc4257SSteve Yin // IAccessibleText 485fdc4257SSteve Yin 495fdc4257SSteve Yin // Adds a text selection. 505fdc4257SSteve Yin STDMETHOD(get_addSelection)(long startOffset, long endOffset); 515fdc4257SSteve Yin 525fdc4257SSteve Yin // Gets text attributes. 535fdc4257SSteve Yin STDMETHOD(get_attributes)(long offset, long * startOffset, long * endOffset, BSTR * textAttributes); 545fdc4257SSteve Yin 555fdc4257SSteve Yin // Gets caret offset. 565fdc4257SSteve Yin STDMETHOD(get_caretOffset)(long * offset); 575fdc4257SSteve Yin 585fdc4257SSteve Yin // Gets total number of characters. 595fdc4257SSteve Yin STDMETHOD(get_characterCount)(long * nCharacters); 605fdc4257SSteve Yin 615fdc4257SSteve Yin // Gets bounding rect containing the glyph(s) representing the character 625fdc4257SSteve Yin // at the specified text offset 635fdc4257SSteve Yin STDMETHOD(get_characterExtents)(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height); 645fdc4257SSteve Yin 655fdc4257SSteve Yin // Gets number of active non-contiguous selections. 665fdc4257SSteve Yin STDMETHOD(get_nSelections)(long * nSelections); 675fdc4257SSteve Yin 685fdc4257SSteve Yin // Gets bounding rect for the glyph at a certain point. 695fdc4257SSteve Yin STDMETHOD(get_offsetAtPoint)(long x, long y, IA2CoordinateType coordType, long * offset); 705fdc4257SSteve Yin 715fdc4257SSteve Yin // Gets character offsets of N-th active text selection. 725fdc4257SSteve Yin STDMETHOD(get_selection)(long selectionIndex, long * startOffset, long * endOffset); 735fdc4257SSteve Yin 745fdc4257SSteve Yin // Gets a range of text by offset NOTE: returned string may be longer 755fdc4257SSteve Yin // than endOffset-startOffset bytes if text contains multi-byte characters. 765fdc4257SSteve Yin STDMETHOD(get_text)(long startOffset, long endOffset, BSTR * text); 775fdc4257SSteve Yin 785fdc4257SSteve Yin // Gets a specified amount of text that ends before a specified offset. 795fdc4257SSteve Yin STDMETHOD(get_textBeforeOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text); 805fdc4257SSteve Yin 815fdc4257SSteve Yin // Gets a specified amount of text that spans the specified offset. 825fdc4257SSteve Yin STDMETHOD(get_textAfterOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text); 835fdc4257SSteve Yin 845fdc4257SSteve Yin // Gets a specified amount of text that starts after a specified offset. 855fdc4257SSteve Yin STDMETHOD(get_textAtOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text); 865fdc4257SSteve Yin 875fdc4257SSteve Yin // Unselects a range of text. 885fdc4257SSteve Yin STDMETHOD(removeSelection)(long selectionIndex); 895fdc4257SSteve Yin 905fdc4257SSteve Yin // Moves text caret. 915fdc4257SSteve Yin STDMETHOD(setCaretOffset)(long offset); 925fdc4257SSteve Yin 935fdc4257SSteve Yin // Changes the bounds of an existing selection. 945fdc4257SSteve Yin STDMETHOD(setSelection)(long selectionIndex, long startOffset, long endOffset); 955fdc4257SSteve Yin 965fdc4257SSteve Yin // Gets total number of characters. 975fdc4257SSteve Yin // NOTE: this may be different than the total number of bytes required 985fdc4257SSteve Yin // to store the text, if the text contains multi-byte characters. 995fdc4257SSteve Yin STDMETHOD(get_nCharacters)(long * nCharacters); 1005fdc4257SSteve Yin 1015fdc4257SSteve Yin STDMETHOD(get_newText)( IA2TextSegment *newText); 1025fdc4257SSteve Yin 1035fdc4257SSteve Yin STDMETHOD(get_oldText)( IA2TextSegment *oldText); 1045fdc4257SSteve Yin 1055fdc4257SSteve Yin // Makes specific part of string visible on screen. 1065fdc4257SSteve Yin STDMETHOD(scrollSubstringTo)(long startIndex, long endIndex,enum IA2ScrollType scrollType); 1075fdc4257SSteve Yin STDMETHOD(scrollSubstringToPoint)(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y ); 1085fdc4257SSteve Yin 1095fdc4257SSteve Yin // Overide of IUNOXWrapper. 1105fdc4257SSteve Yin STDMETHOD(put_XInterface)(long pXInterface); 1115fdc4257SSteve Yin 1125fdc4257SSteve Yin private: 1135fdc4257SSteve Yin 1145fdc4257SSteve Yin com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleText> pRXText; 1155fdc4257SSteve Yin GetXInterface()1165fdc4257SSteve Yin inline com::sun::star::accessibility::XAccessibleText* GetXInterface() 1175fdc4257SSteve Yin { 1185fdc4257SSteve Yin return pRXText.get(); 1195fdc4257SSteve Yin } 1205fdc4257SSteve Yin }; 1215fdc4257SSteve Yin 1225fdc4257SSteve Yin #endif // !defined(AFX_ACCTEXTBASE_H__B9AE05F6_E28B_4CF3_A8F2_EEE5D2E00B82__INCLUDED_) 123