1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifdef _MSC_VER 29*cdf0e10cSrcweir #pragma hdrstop 30*cdf0e10cSrcweir #endif 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #ifndef _ACCESSIBILITY_HXX_ 33*cdf0e10cSrcweir #define _ACCESSIBILITY_HXX_ 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir //#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ 36*cdf0e10cSrcweir //#include <com/sun/star/lang/XComponent.hpp> 37*cdf0e10cSrcweir //#endif 38*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleComponent.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleContext.hpp> 41*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleText.hpp> 42*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> 43*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp> 44*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_lang_XSERVICEINFO_HPP_ 45*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 46*cdf0e10cSrcweir #endif 47*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h> 48*cdf0e10cSrcweir #include <osl/mutex.hxx> 49*cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.h> 50*cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 51*cdf0e10cSrcweir #include <cppuhelper/implbase6.hxx> 52*cdf0e10cSrcweir #include <svl/brdcst.hxx> 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir #include <editeng/editeng.hxx> 55*cdf0e10cSrcweir #include <editeng/unoedsrc.hxx> // SvxEditSource, SvxTextForwarder, SvxViewForwarder, SvxEditViewForwarder 56*cdf0e10cSrcweir #include <svx/AccessibleTextHelper.hxx> 57*cdf0e10cSrcweir #include <edit.hxx> 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir class Window; 60*cdf0e10cSrcweir class SmGraphicWindow; 61*cdf0e10cSrcweir class SmEditWindow; 62*cdf0e10cSrcweir class SmDocShell; 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace accessibility { 65*cdf0e10cSrcweir struct AccessibleEventObject; 66*cdf0e10cSrcweir }}}} 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////// 69*cdf0e10cSrcweir // 70*cdf0e10cSrcweir // classes and helper-classes used for accessibility in the graphic-window 71*cdf0e10cSrcweir // 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir typedef 74*cdf0e10cSrcweir cppu::WeakImplHelper6 75*cdf0e10cSrcweir < 76*cdf0e10cSrcweir com::sun::star::lang::XServiceInfo, 77*cdf0e10cSrcweir com::sun::star::accessibility::XAccessible, 78*cdf0e10cSrcweir com::sun::star::accessibility::XAccessibleComponent, 79*cdf0e10cSrcweir com::sun::star::accessibility::XAccessibleContext, 80*cdf0e10cSrcweir com::sun::star::accessibility::XAccessibleText, 81*cdf0e10cSrcweir com::sun::star::accessibility::XAccessibleEventBroadcaster 82*cdf0e10cSrcweir > 83*cdf0e10cSrcweir SmGraphicAccessibleBaseClass; 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir class SmGraphicAccessible : 86*cdf0e10cSrcweir public SmGraphicAccessibleBaseClass 87*cdf0e10cSrcweir { 88*cdf0e10cSrcweir //vos::ORefCount aRefCount; // number of references to object 89*cdf0e10cSrcweir osl::Mutex aListenerMutex; 90*cdf0e10cSrcweir String aAccName; 91*cdf0e10cSrcweir /// client id in the AccessibleEventNotifier queue 92*cdf0e10cSrcweir sal_uInt32 nClientId; 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir SmGraphicWindow *pWin; 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir // disallow copy-ctor and assignment-operator for now 97*cdf0e10cSrcweir SmGraphicAccessible( const SmGraphicAccessible & ); 98*cdf0e10cSrcweir SmGraphicAccessible & operator = ( const SmGraphicAccessible & ); 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir protected: 101*cdf0e10cSrcweir SmDocShell * GetDoc_Impl(); 102*cdf0e10cSrcweir String GetAccessibleText_Impl(); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir public: 105*cdf0e10cSrcweir SmGraphicAccessible( SmGraphicWindow *pGraphicWin ); 106*cdf0e10cSrcweir virtual ~SmGraphicAccessible(); 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir SmGraphicWindow * GetWin() { return pWin; } 109*cdf0e10cSrcweir void ClearWin(); // to be called when view is destroyed 110*cdf0e10cSrcweir void LaunchEvent( 111*cdf0e10cSrcweir const sal_Int16 nAccesibleEventId, 112*cdf0e10cSrcweir const ::com::sun::star::uno::Any &rOldVal, 113*cdf0e10cSrcweir const ::com::sun::star::uno::Any &rNewVal); 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir // XAccessible 116*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir // XAccessibleComponent 119*cdf0e10cSrcweir virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 120*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 121*cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException); 122*cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException); 123*cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException); 124*cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException); 125*cdf0e10cSrcweir virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); 126*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); 127*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); 128*cdf0e10cSrcweir 129*cdf0e10cSrcweir // XAccessibleContext 130*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); 131*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 132*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); 133*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); 134*cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); 135*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); 136*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); 137*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); 138*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); 139*cdf0e10cSrcweir virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir // XAccessibleEventBroadcaster 142*cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 143*cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir // XAccessibleText 146*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException); 147*cdf0e10cSrcweir virtual sal_Bool SAL_CALL setCaretPosition ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 148*cdf0e10cSrcweir virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 149*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 150*cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 151*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException); 152*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 153*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getSelectedText( ) throw (::com::sun::star::uno::RuntimeException); 154*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException); 155*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException); 156*cdf0e10cSrcweir virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 157*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); 158*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 159*cdf0e10cSrcweir virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 160*cdf0e10cSrcweir virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 161*cdf0e10cSrcweir virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 162*cdf0e10cSrcweir virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir // XServiceInfo 165*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); 166*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 167*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); 168*cdf0e10cSrcweir }; 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////// 171*cdf0e10cSrcweir // 172*cdf0e10cSrcweir // classes and helper-classes used for accessibility in the command-window 173*cdf0e10cSrcweir // 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir class SmEditAccessible; 176*cdf0e10cSrcweir class SmEditSource; 177*cdf0e10cSrcweir class EditEngine; 178*cdf0e10cSrcweir class EditView; 179*cdf0e10cSrcweir class SvxFieldItem; 180*cdf0e10cSrcweir struct ESelection; 181*cdf0e10cSrcweir 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir class SmViewForwarder : 184*cdf0e10cSrcweir public SvxViewForwarder 185*cdf0e10cSrcweir { 186*cdf0e10cSrcweir SmEditAccessible & rEditAcc; 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir // disallow copy-ctor and assignment-operator for now 189*cdf0e10cSrcweir SmViewForwarder( const SmViewForwarder & ); 190*cdf0e10cSrcweir SmViewForwarder & operator = ( const SmViewForwarder & ); 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir public: 193*cdf0e10cSrcweir SmViewForwarder( SmEditAccessible &rAcc ); 194*cdf0e10cSrcweir virtual ~SmViewForwarder(); 195*cdf0e10cSrcweir 196*cdf0e10cSrcweir virtual sal_Bool IsValid() const; 197*cdf0e10cSrcweir virtual Rectangle GetVisArea() const; 198*cdf0e10cSrcweir virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const; 199*cdf0e10cSrcweir virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const; 200*cdf0e10cSrcweir }; 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir class SmTextForwarder : /* analog to SvxEditEngineForwarder */ 204*cdf0e10cSrcweir public SvxTextForwarder 205*cdf0e10cSrcweir { 206*cdf0e10cSrcweir SmEditAccessible & rEditAcc; 207*cdf0e10cSrcweir SmEditSource & rEditSource; 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir DECL_LINK( NotifyHdl, EENotify * ); 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir // disallow copy-ctor and assignment-operator for now 212*cdf0e10cSrcweir SmTextForwarder( const SmTextForwarder & ); 213*cdf0e10cSrcweir SmTextForwarder & operator = ( const SmTextForwarder & ); 214*cdf0e10cSrcweir 215*cdf0e10cSrcweir public: 216*cdf0e10cSrcweir SmTextForwarder( SmEditAccessible& rAcc, SmEditSource & rSource ); 217*cdf0e10cSrcweir virtual ~SmTextForwarder(); 218*cdf0e10cSrcweir 219*cdf0e10cSrcweir virtual sal_uInt16 GetParagraphCount() const; 220*cdf0e10cSrcweir virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const; 221*cdf0e10cSrcweir virtual String GetText( const ESelection& rSel ) const; 222*cdf0e10cSrcweir virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const; 223*cdf0e10cSrcweir virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; 224*cdf0e10cSrcweir virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); 225*cdf0e10cSrcweir virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); 226*cdf0e10cSrcweir virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const; 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; 229*cdf0e10cSrcweir virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const; 230*cdf0e10cSrcweir 231*cdf0e10cSrcweir virtual void QuickInsertText( const String& rText, const ESelection& rSel ); 232*cdf0e10cSrcweir virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ); 233*cdf0e10cSrcweir virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ); 234*cdf0e10cSrcweir virtual void QuickInsertLineBreak( const ESelection& rSel ); 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir virtual SfxItemPool* GetPool() const; 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ); 239*cdf0e10cSrcweir virtual void FieldClicked(const SvxFieldItem&, sal_uInt16, sal_uInt16); 240*cdf0e10cSrcweir virtual sal_Bool IsValid() const; 241*cdf0e10cSrcweir 242*cdf0e10cSrcweir virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const; 243*cdf0e10cSrcweir virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const; 244*cdf0e10cSrcweir virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const; 245*cdf0e10cSrcweir virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const; 246*cdf0e10cSrcweir virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const; 247*cdf0e10cSrcweir virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const; 248*cdf0e10cSrcweir virtual MapMode GetMapMode() const; 249*cdf0e10cSrcweir virtual OutputDevice* GetRefDevice() const; 250*cdf0e10cSrcweir virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const; 251*cdf0e10cSrcweir virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const; 252*cdf0e10cSrcweir virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const; 253*cdf0e10cSrcweir virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const; 254*cdf0e10cSrcweir virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const; 255*cdf0e10cSrcweir virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const; 256*cdf0e10cSrcweir virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nLine ) const; 257*cdf0e10cSrcweir virtual sal_Bool Delete( const ESelection& ); 258*cdf0e10cSrcweir virtual sal_Bool InsertText( const String&, const ESelection& ); 259*cdf0e10cSrcweir virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False ); 260*cdf0e10cSrcweir 261*cdf0e10cSrcweir virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const; 262*cdf0e10cSrcweir virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth ); 263*cdf0e10cSrcweir 264*cdf0e10cSrcweir virtual const SfxItemSet* GetEmptyItemSetPtr(); 265*cdf0e10cSrcweir // implementation functions for XParagraphAppend and XTextPortionAppend 266*cdf0e10cSrcweir virtual void AppendParagraph(); 267*cdf0e10cSrcweir virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet ); 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir virtual void CopyText(const SvxTextForwarder& rSource); 270*cdf0e10cSrcweir }; 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir 273*cdf0e10cSrcweir class SmEditViewForwarder : /* analog to SvxEditEngineViewForwarder */ 274*cdf0e10cSrcweir public SvxEditViewForwarder 275*cdf0e10cSrcweir { 276*cdf0e10cSrcweir SmEditAccessible& rEditAcc; 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir // disallow copy-ctor and assignment-operator for now 279*cdf0e10cSrcweir SmEditViewForwarder( const SmEditViewForwarder & ); 280*cdf0e10cSrcweir SmEditViewForwarder & operator = ( const SmEditViewForwarder & ); 281*cdf0e10cSrcweir 282*cdf0e10cSrcweir public: 283*cdf0e10cSrcweir SmEditViewForwarder( SmEditAccessible& rAcc ); 284*cdf0e10cSrcweir virtual ~SmEditViewForwarder(); 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir virtual sal_Bool IsValid() const; 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir virtual Rectangle GetVisArea() const; 289*cdf0e10cSrcweir virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const; 290*cdf0e10cSrcweir virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const; 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir virtual sal_Bool GetSelection( ESelection& rSelection ) const; 293*cdf0e10cSrcweir virtual sal_Bool SetSelection( const ESelection& rSelection ); 294*cdf0e10cSrcweir virtual sal_Bool Copy(); 295*cdf0e10cSrcweir virtual sal_Bool Cut(); 296*cdf0e10cSrcweir virtual sal_Bool Paste(); 297*cdf0e10cSrcweir }; 298*cdf0e10cSrcweir 299*cdf0e10cSrcweir 300*cdf0e10cSrcweir class SmEditSource : 301*cdf0e10cSrcweir public SvxEditSource 302*cdf0e10cSrcweir { 303*cdf0e10cSrcweir SfxBroadcaster aBroadCaster; 304*cdf0e10cSrcweir SmViewForwarder aViewFwd; 305*cdf0e10cSrcweir SmTextForwarder aTextFwd; 306*cdf0e10cSrcweir SmEditViewForwarder aEditViewFwd; 307*cdf0e10cSrcweir 308*cdf0e10cSrcweir SmEditAccessible& rEditAcc; 309*cdf0e10cSrcweir 310*cdf0e10cSrcweir // disallow copy-ctor and assignment-operator for now 311*cdf0e10cSrcweir SmEditSource( const SmEditSource &rSrc ); 312*cdf0e10cSrcweir SmEditSource & operator = ( const SmEditSource & ); 313*cdf0e10cSrcweir 314*cdf0e10cSrcweir public: 315*cdf0e10cSrcweir SmEditSource( SmEditWindow *pWin, SmEditAccessible &rAcc ); 316*cdf0e10cSrcweir virtual ~SmEditSource(); 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir virtual SvxEditSource* Clone() const; 319*cdf0e10cSrcweir virtual SvxTextForwarder* GetTextForwarder(); 320*cdf0e10cSrcweir virtual SvxViewForwarder* GetViewForwarder(); 321*cdf0e10cSrcweir virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate = sal_False ); 322*cdf0e10cSrcweir virtual void UpdateData(); 323*cdf0e10cSrcweir virtual SfxBroadcaster& GetBroadcaster() const; 324*cdf0e10cSrcweir }; 325*cdf0e10cSrcweir 326*cdf0e10cSrcweir 327*cdf0e10cSrcweir 328*cdf0e10cSrcweir 329*cdf0e10cSrcweir typedef 330*cdf0e10cSrcweir cppu::WeakImplHelper5 331*cdf0e10cSrcweir < 332*cdf0e10cSrcweir com::sun::star::lang::XServiceInfo, 333*cdf0e10cSrcweir com::sun::star::accessibility::XAccessible, 334*cdf0e10cSrcweir com::sun::star::accessibility::XAccessibleComponent, 335*cdf0e10cSrcweir com::sun::star::accessibility::XAccessibleContext, 336*cdf0e10cSrcweir com::sun::star::accessibility::XAccessibleEventBroadcaster 337*cdf0e10cSrcweir > 338*cdf0e10cSrcweir SmEditAccessibleBaseClass; 339*cdf0e10cSrcweir 340*cdf0e10cSrcweir class SmEditAccessible : 341*cdf0e10cSrcweir public SmEditAccessibleBaseClass 342*cdf0e10cSrcweir { 343*cdf0e10cSrcweir osl::Mutex aListenerMutex; 344*cdf0e10cSrcweir String aAccName; 345*cdf0e10cSrcweir ::accessibility::AccessibleTextHelper *pTextHelper; 346*cdf0e10cSrcweir SmEditWindow *pWin; 347*cdf0e10cSrcweir 348*cdf0e10cSrcweir // disallow copy-ctor and assignment-operator for now 349*cdf0e10cSrcweir SmEditAccessible( const SmEditAccessible & ); 350*cdf0e10cSrcweir SmEditAccessible & operator = ( const SmEditAccessible & ); 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir protected: 353*cdf0e10cSrcweir #ifdef TL_NOT_YET_USED 354*cdf0e10cSrcweir SmDocShell * GetDoc_Impl(); 355*cdf0e10cSrcweir #endif //TL_NOT_YET_USED 356*cdf0e10cSrcweir 357*cdf0e10cSrcweir public: 358*cdf0e10cSrcweir SmEditAccessible( SmEditWindow *pEditWin ); 359*cdf0e10cSrcweir virtual ~SmEditAccessible(); 360*cdf0e10cSrcweir 361*cdf0e10cSrcweir ::accessibility::AccessibleTextHelper * GetTextHelper() { return pTextHelper; } 362*cdf0e10cSrcweir 363*cdf0e10cSrcweir void Init(); 364*cdf0e10cSrcweir SmEditWindow * GetWin() { return pWin; } 365*cdf0e10cSrcweir void ClearWin(); // to be called when view is destroyed 366*cdf0e10cSrcweir 367*cdf0e10cSrcweir //! access EditEngine and EditView via the functions in the respective window 368*cdf0e10cSrcweir //! pointers may be 0 (e.g. during reload) 369*cdf0e10cSrcweir EditEngine * GetEditEngine() { return pWin ? pWin->GetEditEngine() : 0; } 370*cdf0e10cSrcweir EditView * GetEditView() { return pWin ? pWin->GetEditView() : 0; } 371*cdf0e10cSrcweir 372*cdf0e10cSrcweir // XAccessible 373*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); 374*cdf0e10cSrcweir 375*cdf0e10cSrcweir // XAccessibleComponent 376*cdf0e10cSrcweir virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 377*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 378*cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException); 379*cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException); 380*cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException); 381*cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException); 382*cdf0e10cSrcweir virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); 383*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); 384*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); 385*cdf0e10cSrcweir 386*cdf0e10cSrcweir // XAccessibleContext 387*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); 388*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 389*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); 390*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); 391*cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); 392*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); 393*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); 394*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); 395*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); 396*cdf0e10cSrcweir virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); 397*cdf0e10cSrcweir 398*cdf0e10cSrcweir // XAccessibleEventBroadcaster 399*cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 400*cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 401*cdf0e10cSrcweir 402*cdf0e10cSrcweir // XServiceInfo 403*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); 404*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 405*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); 406*cdf0e10cSrcweir }; 407*cdf0e10cSrcweir 408*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////// 409*cdf0e10cSrcweir 410*cdf0e10cSrcweir #endif 411*cdf0e10cSrcweir 412