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 #ifndef _UNOPORT_HXX 28*cdf0e10cSrcweir #define _UNOPORT_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <unocrsr.hxx> 31*cdf0e10cSrcweir #include <unoevtlstnr.hxx> 32*cdf0e10cSrcweir #include <calbck.hxx> 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/text/XTextRange.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/container/XEnumeration.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/container/XContentEnumerationAccess.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/container/XEnumerationAccess.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyState.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/beans/XMultiPropertySet.hpp> 41*cdf0e10cSrcweir #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> 42*cdf0e10cSrcweir #include <com/sun/star/text/XTextField.hpp> 43*cdf0e10cSrcweir #include <com/sun/star/text/XFootnote.hpp> 44*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 45*cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 46*cdf0e10cSrcweir #include <cppuhelper/implbase8.hxx> 47*cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> 48*cdf0e10cSrcweir #include <svl/itemprop.hxx> 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir #include <memory> 51*cdf0e10cSrcweir #include <deque> 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir class SwFmtFld; 55*cdf0e10cSrcweir class SwFrmFmt; 56*cdf0e10cSrcweir class SwTxtRuby; 57*cdf0e10cSrcweir 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir typedef ::std::deque< 60*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > > 61*cdf0e10cSrcweir TextRangeList_t; 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir /* -----------------29.05.98 14:42------------------- 65*cdf0e10cSrcweir * 66*cdf0e10cSrcweir * --------------------------------------------------*/ 67*cdf0e10cSrcweir enum SwTextPortionType 68*cdf0e10cSrcweir { 69*cdf0e10cSrcweir PORTION_TEXT, 70*cdf0e10cSrcweir PORTION_FIELD, 71*cdf0e10cSrcweir PORTION_FRAME, 72*cdf0e10cSrcweir PORTION_FOOTNOTE, 73*cdf0e10cSrcweir // obsolete! PORTION_CONTROL_CHAR, 74*cdf0e10cSrcweir PORTION_REFMARK_START, 75*cdf0e10cSrcweir PORTION_REFMARK_END, 76*cdf0e10cSrcweir PORTION_TOXMARK_START, 77*cdf0e10cSrcweir PORTION_TOXMARK_END, 78*cdf0e10cSrcweir PORTION_BOOKMARK_START, 79*cdf0e10cSrcweir PORTION_BOOKMARK_END, 80*cdf0e10cSrcweir PORTION_REDLINE_START, 81*cdf0e10cSrcweir PORTION_REDLINE_END, 82*cdf0e10cSrcweir PORTION_RUBY_START, 83*cdf0e10cSrcweir PORTION_RUBY_END, 84*cdf0e10cSrcweir PORTION_SOFT_PAGEBREAK, 85*cdf0e10cSrcweir PORTION_META, 86*cdf0e10cSrcweir PORTION_FIELD_START, 87*cdf0e10cSrcweir PORTION_FIELD_END, 88*cdf0e10cSrcweir PORTION_FIELD_START_END 89*cdf0e10cSrcweir }; 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir class SwXTextPortion : public cppu::WeakImplHelper8 93*cdf0e10cSrcweir < 94*cdf0e10cSrcweir ::com::sun::star::beans::XTolerantMultiPropertySet, 95*cdf0e10cSrcweir ::com::sun::star::beans::XMultiPropertySet, 96*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet, 97*cdf0e10cSrcweir ::com::sun::star::text::XTextRange, 98*cdf0e10cSrcweir ::com::sun::star::beans::XPropertyState, 99*cdf0e10cSrcweir ::com::sun::star::container::XContentEnumerationAccess, 100*cdf0e10cSrcweir ::com::sun::star::lang::XUnoTunnel, 101*cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo 102*cdf0e10cSrcweir >, 103*cdf0e10cSrcweir public SwClient 104*cdf0e10cSrcweir { 105*cdf0e10cSrcweir private: 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir SwEventListenerContainer m_ListenerContainer; 108*cdf0e10cSrcweir const SfxItemPropertySet * m_pPropSet; 109*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > 110*cdf0e10cSrcweir m_xParentText; 111*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > 112*cdf0e10cSrcweir m_xRefMark; 113*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > 114*cdf0e10cSrcweir m_xTOXMark; 115*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > 116*cdf0e10cSrcweir m_xBookmark; 117*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote > 118*cdf0e10cSrcweir m_xFootnote; 119*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > 120*cdf0e10cSrcweir m_xTextField; 121*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > 122*cdf0e10cSrcweir m_xMeta; 123*cdf0e10cSrcweir ::std::auto_ptr< ::com::sun::star::uno::Any > m_pRubyText; 124*cdf0e10cSrcweir ::std::auto_ptr< ::com::sun::star::uno::Any > m_pRubyStyle; 125*cdf0e10cSrcweir ::std::auto_ptr< ::com::sun::star::uno::Any > m_pRubyAdjust; 126*cdf0e10cSrcweir ::std::auto_ptr< ::com::sun::star::uno::Any > m_pRubyIsAbove; 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir const SwDepend m_FrameDepend; 129*cdf0e10cSrcweir SwFrmFmt * m_pFrameFmt; 130*cdf0e10cSrcweir const SwTextPortionType m_ePortionType; 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir bool m_bIsCollapsed; 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir SwFmtFld * GetFldFmt(bool bInit = false); 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir void init(const SwUnoCrsr* pPortionCursor); 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir protected: 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir void SAL_CALL SetPropertyValues_Impl( 141*cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, 142*cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) 143*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 144*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( 145*cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) 146*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir void GetPropertyValues( const ::rtl::OUString *pPropertyNames, 149*cdf0e10cSrcweir ::com::sun::star::uno::Any *pValues, 150*cdf0e10cSrcweir sal_Int32 nLength ); 151*cdf0e10cSrcweir 152*cdf0e10cSrcweir void GetPropertyValue( ::com::sun::star::uno::Any &rVal, 153*cdf0e10cSrcweir const SfxItemPropertySimpleEntry& rEntry, SwUnoCrsr *pUnoCrsr, SfxItemSet *&pSet ); 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl( 156*cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, 157*cdf0e10cSrcweir sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException); 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir virtual ~SwXTextPortion(); 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir //SwClient 162*cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir public: 165*cdf0e10cSrcweir SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType eType ); 166*cdf0e10cSrcweir SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwFrmFmt& rFmt ); 167*cdf0e10cSrcweir 168*cdf0e10cSrcweir // for Ruby 169*cdf0e10cSrcweir SwXTextPortion(const SwUnoCrsr* pPortionCrsr, 170*cdf0e10cSrcweir SwTxtRuby const& rAttr, 171*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > 172*cdf0e10cSrcweir const& xParent, 173*cdf0e10cSrcweir sal_Bool bIsEnd ); 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir //XTextRange 176*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw( ::com::sun::star::uno::RuntimeException ); 177*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart() throw( ::com::sun::star::uno::RuntimeException ); 178*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd() throw( ::com::sun::star::uno::RuntimeException ); 179*cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getString() throw( ::com::sun::star::uno::RuntimeException ); 180*cdf0e10cSrcweir virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); 181*cdf0e10cSrcweir 182*cdf0e10cSrcweir //XTolerantMultiPropertySet 183*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 184*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); 185*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir //XMultiPropertySet 188*cdf0e10cSrcweir // virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 189*cdf0e10cSrcweir virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 190*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); 191*cdf0e10cSrcweir virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); 192*cdf0e10cSrcweir virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); 193*cdf0e10cSrcweir virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir //XPropertySet 196*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 197*cdf0e10cSrcweir virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 198*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 199*cdf0e10cSrcweir virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 200*cdf0e10cSrcweir virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 201*cdf0e10cSrcweir virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 202*cdf0e10cSrcweir virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir //XPropertyState 205*cdf0e10cSrcweir virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 206*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 207*cdf0e10cSrcweir virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 208*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir //XTextContent 211*cdf0e10cSrcweir virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); 212*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); 213*cdf0e10cSrcweir 214*cdf0e10cSrcweir //XComponent 215*cdf0e10cSrcweir virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException ); 216*cdf0e10cSrcweir virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); 217*cdf0e10cSrcweir virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); 218*cdf0e10cSrcweir 219*cdf0e10cSrcweir //XUnoTunnel 220*cdf0e10cSrcweir static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); 221*cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); 222*cdf0e10cSrcweir 223*cdf0e10cSrcweir //XServiceInfo 224*cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); 225*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 226*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir //XContentEnumerationAccess 229*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); 230*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames() throw( ::com::sun::star::uno::RuntimeException ); 231*cdf0e10cSrcweir 232*cdf0e10cSrcweir void SetRefMark( ::com::sun::star::uno::Reference< 233*cdf0e10cSrcweir ::com::sun::star::text::XTextContent > xMark) 234*cdf0e10cSrcweir { m_xRefMark = xMark; } 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir void SetTOXMark( ::com::sun::star::uno::Reference< 237*cdf0e10cSrcweir ::com::sun::star::text::XTextContent > xMark) 238*cdf0e10cSrcweir { m_xTOXMark = xMark; } 239*cdf0e10cSrcweir 240*cdf0e10cSrcweir void SetBookmark( ::com::sun::star::uno::Reference< 241*cdf0e10cSrcweir ::com::sun::star::text::XTextContent > xMark) 242*cdf0e10cSrcweir { m_xBookmark = xMark; } 243*cdf0e10cSrcweir 244*cdf0e10cSrcweir void SetFootnote( ::com::sun::star::uno::Reference< 245*cdf0e10cSrcweir ::com::sun::star::text::XFootnote > xNote) 246*cdf0e10cSrcweir { m_xFootnote = xNote; } 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir void SetTextField( ::com::sun::star::uno::Reference< 249*cdf0e10cSrcweir ::com::sun::star::text::XTextField> xField) 250*cdf0e10cSrcweir { m_xTextField = xField; } 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir void SetMeta( ::com::sun::star::uno::Reference< 253*cdf0e10cSrcweir ::com::sun::star::text::XTextContent > xMeta) 254*cdf0e10cSrcweir { m_xMeta = xMeta; } 255*cdf0e10cSrcweir 256*cdf0e10cSrcweir bool IsCollapsed() const { return m_bIsCollapsed; } 257*cdf0e10cSrcweir void SetCollapsed(bool bSet) { m_bIsCollapsed = bSet;} 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir SwTextPortionType GetTextPortionType() const { return m_ePortionType; } 260*cdf0e10cSrcweir 261*cdf0e10cSrcweir SwUnoCrsr* GetCursor() const 262*cdf0e10cSrcweir {return static_cast<SwUnoCrsr*>(const_cast<SwModify*>(GetRegisteredIn()));} 263*cdf0e10cSrcweir }; 264*cdf0e10cSrcweir 265*cdf0e10cSrcweir /* -----------------29.05.98 14:42------------------- 266*cdf0e10cSrcweir * 267*cdf0e10cSrcweir * --------------------------------------------------*/ 268*cdf0e10cSrcweir class SwXTextPortionEnumeration 269*cdf0e10cSrcweir : public ::cppu::WeakImplHelper3 270*cdf0e10cSrcweir < ::com::sun::star::container::XEnumeration 271*cdf0e10cSrcweir , ::com::sun::star::lang::XServiceInfo 272*cdf0e10cSrcweir , ::com::sun::star::lang::XUnoTunnel 273*cdf0e10cSrcweir > 274*cdf0e10cSrcweir , public SwClient 275*cdf0e10cSrcweir { 276*cdf0e10cSrcweir TextRangeList_t m_Portions; // contains all portions, filled by ctor 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir SwUnoCrsr* GetCursor() const 279*cdf0e10cSrcweir {return static_cast<SwUnoCrsr*>(const_cast<SwModify*>(GetRegisteredIn()));} 280*cdf0e10cSrcweir 281*cdf0e10cSrcweir protected: 282*cdf0e10cSrcweir virtual ~SwXTextPortionEnumeration(); 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir public: 285*cdf0e10cSrcweir SwXTextPortionEnumeration(SwPaM& rParaCrsr, 286*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > 287*cdf0e10cSrcweir const & xParent, 288*cdf0e10cSrcweir const sal_Int32 nStart, const sal_Int32 nEnd ); 289*cdf0e10cSrcweir 290*cdf0e10cSrcweir SwXTextPortionEnumeration(SwPaM& rParaCrsr, 291*cdf0e10cSrcweir TextRangeList_t const & rPortions ); 292*cdf0e10cSrcweir 293*cdf0e10cSrcweir 294*cdf0e10cSrcweir static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); 295*cdf0e10cSrcweir 296*cdf0e10cSrcweir //XUnoTunnel 297*cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( 298*cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) 299*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir //XEnumeration 302*cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasMoreElements() 303*cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ); 304*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL nextElement() 305*cdf0e10cSrcweir throw( ::com::sun::star::container::NoSuchElementException, 306*cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 307*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 308*cdf0e10cSrcweir 309*cdf0e10cSrcweir //XServiceInfo 310*cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName() 311*cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ); 312*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) 313*cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ); 314*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL 315*cdf0e10cSrcweir getSupportedServiceNames() 316*cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ); 317*cdf0e10cSrcweir protected: 318*cdf0e10cSrcweir //SwClient 319*cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); 320*cdf0e10cSrcweir }; 321*cdf0e10cSrcweir 322*cdf0e10cSrcweir #endif 323