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