xref: /aoo42x/main/sw/inc/unoport.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew 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,
84cdf0e10cSrcweir 	PORTION_FIELD_START_END
85cdf0e10cSrcweir };
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 
88cdf0e10cSrcweir class SwXTextPortion : public cppu::WeakImplHelper8
89cdf0e10cSrcweir <
90cdf0e10cSrcweir     ::com::sun::star::beans::XTolerantMultiPropertySet,
91cdf0e10cSrcweir     ::com::sun::star::beans::XMultiPropertySet,
92cdf0e10cSrcweir     ::com::sun::star::beans::XPropertySet,
93cdf0e10cSrcweir 	::com::sun::star::text::XTextRange,
94cdf0e10cSrcweir 	::com::sun::star::beans::XPropertyState,
95cdf0e10cSrcweir 	::com::sun::star::container::XContentEnumerationAccess,
96cdf0e10cSrcweir     ::com::sun::star::lang::XUnoTunnel,
97cdf0e10cSrcweir     ::com::sun::star::lang::XServiceInfo
98cdf0e10cSrcweir >,
99cdf0e10cSrcweir 	public SwClient
100cdf0e10cSrcweir {
101cdf0e10cSrcweir private:
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     SwEventListenerContainer    m_ListenerContainer;
104cdf0e10cSrcweir     const SfxItemPropertySet *  m_pPropSet;
105cdf0e10cSrcweir     const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
106cdf0e10cSrcweir         m_xParentText;
107cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >
108cdf0e10cSrcweir         m_xRefMark;
109cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >
110cdf0e10cSrcweir         m_xTOXMark;
111cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >
112cdf0e10cSrcweir         m_xBookmark;
113cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote >
114cdf0e10cSrcweir         m_xFootnote;
115cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField >
116cdf0e10cSrcweir         m_xTextField;
117cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >
118cdf0e10cSrcweir         m_xMeta;
119cdf0e10cSrcweir     ::std::auto_ptr< ::com::sun::star::uno::Any > m_pRubyText;
120cdf0e10cSrcweir     ::std::auto_ptr< ::com::sun::star::uno::Any > m_pRubyStyle;
121cdf0e10cSrcweir     ::std::auto_ptr< ::com::sun::star::uno::Any > m_pRubyAdjust;
122cdf0e10cSrcweir     ::std::auto_ptr< ::com::sun::star::uno::Any > m_pRubyIsAbove;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     const SwDepend              m_FrameDepend;
125cdf0e10cSrcweir     SwFrmFmt *                  m_pFrameFmt;
126cdf0e10cSrcweir     const SwTextPortionType     m_ePortionType;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     bool                        m_bIsCollapsed;
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     SwFmtFld * GetFldFmt(bool bInit = false);
131cdf0e10cSrcweir 
132cdf0e10cSrcweir     void init(const SwUnoCrsr* pPortionCursor);
133cdf0e10cSrcweir 
134cdf0e10cSrcweir protected:
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     void SAL_CALL SetPropertyValues_Impl(
137cdf0e10cSrcweir         const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
138cdf0e10cSrcweir         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
139cdf0e10cSrcweir             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);
140cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl(
141cdf0e10cSrcweir         const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
142cdf0e10cSrcweir             throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     void        GetPropertyValues( const ::rtl::OUString *pPropertyNames,
145cdf0e10cSrcweir                                     ::com::sun::star::uno::Any *pValues,
146cdf0e10cSrcweir                                     sal_Int32 nLength );
147cdf0e10cSrcweir 
148cdf0e10cSrcweir     void GetPropertyValue( ::com::sun::star::uno::Any &rVal,
149cdf0e10cSrcweir                 const SfxItemPropertySimpleEntry& rEntry, SwUnoCrsr *pUnoCrsr, SfxItemSet *&pSet );
150cdf0e10cSrcweir 
151cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl(
152cdf0e10cSrcweir         const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames,
153cdf0e10cSrcweir         sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException);
154cdf0e10cSrcweir 
155cdf0e10cSrcweir     virtual ~SwXTextPortion();
156cdf0e10cSrcweir 
157cdf0e10cSrcweir 	//SwClient
158cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
159cdf0e10cSrcweir 
160cdf0e10cSrcweir public:
161cdf0e10cSrcweir 	SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType	eType	);
162cdf0e10cSrcweir 	SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwFrmFmt& rFmt );
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     // for Ruby
165cdf0e10cSrcweir     SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
166cdf0e10cSrcweir         SwTxtRuby const& rAttr,
167cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
168cdf0e10cSrcweir             const& xParent,
169cdf0e10cSrcweir         sal_Bool bIsEnd );
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 	//XTextRange
172cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >  SAL_CALL getText() throw( ::com::sun::star::uno::RuntimeException );
173cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL  getStart() throw( ::com::sun::star::uno::RuntimeException );
174cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL   getEnd() throw( ::com::sun::star::uno::RuntimeException );
175cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL  getString() throw( ::com::sun::star::uno::RuntimeException );
176cdf0e10cSrcweir 	virtual void SAL_CALL  setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException );
177cdf0e10cSrcweir 
178cdf0e10cSrcweir     //XTolerantMultiPropertySet
179cdf0e10cSrcweir     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);
180cdf0e10cSrcweir     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);
181cdf0e10cSrcweir     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);
182cdf0e10cSrcweir 
183cdf0e10cSrcweir     //XMultiPropertySet
184cdf0e10cSrcweir //    virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
185cdf0e10cSrcweir     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);
186cdf0e10cSrcweir     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);
187cdf0e10cSrcweir     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);
188cdf0e10cSrcweir     virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
189cdf0e10cSrcweir     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);
190cdf0e10cSrcweir 
191cdf0e10cSrcweir     //XPropertySet
192cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
193cdf0e10cSrcweir     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);
194cdf0e10cSrcweir     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);
195cdf0e10cSrcweir     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);
196cdf0e10cSrcweir     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);
197cdf0e10cSrcweir     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);
198cdf0e10cSrcweir     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);
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	//XPropertyState
201cdf0e10cSrcweir     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
202cdf0e10cSrcweir     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);
203cdf0e10cSrcweir     virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
204cdf0e10cSrcweir     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);
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 	//XTextContent
207cdf0e10cSrcweir 	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 );
208cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(  ) throw(::com::sun::star::uno::RuntimeException);
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 	//XComponent
211cdf0e10cSrcweir     virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
212cdf0e10cSrcweir 	virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
213cdf0e10cSrcweir 	virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
214cdf0e10cSrcweir 
215cdf0e10cSrcweir     //XUnoTunnel
216cdf0e10cSrcweir 	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
217cdf0e10cSrcweir 	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
218cdf0e10cSrcweir 
219cdf0e10cSrcweir     //XServiceInfo
220cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
221cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
222cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 	//XContentEnumerationAccess
225cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException );
226cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames() throw( ::com::sun::star::uno::RuntimeException );
227cdf0e10cSrcweir 
228cdf0e10cSrcweir     void SetRefMark( ::com::sun::star::uno::Reference<
229cdf0e10cSrcweir                         ::com::sun::star::text::XTextContent >  xMark)
230cdf0e10cSrcweir     { m_xRefMark = xMark; }
231cdf0e10cSrcweir 
232cdf0e10cSrcweir     void SetTOXMark( ::com::sun::star::uno::Reference<
233cdf0e10cSrcweir                         ::com::sun::star::text::XTextContent >  xMark)
234cdf0e10cSrcweir     { m_xTOXMark = xMark; }
235cdf0e10cSrcweir 
236cdf0e10cSrcweir     void SetBookmark( ::com::sun::star::uno::Reference<
237cdf0e10cSrcweir                         ::com::sun::star::text::XTextContent >  xMark)
238cdf0e10cSrcweir     { m_xBookmark = xMark; }
239cdf0e10cSrcweir 
240cdf0e10cSrcweir     void SetFootnote( ::com::sun::star::uno::Reference<
241cdf0e10cSrcweir                         ::com::sun::star::text::XFootnote > xNote)
242cdf0e10cSrcweir     { m_xFootnote = xNote; }
243cdf0e10cSrcweir 
244cdf0e10cSrcweir     void SetTextField( ::com::sun::star::uno::Reference<
245cdf0e10cSrcweir                         ::com::sun::star::text::XTextField> xField)
246cdf0e10cSrcweir     { m_xTextField = xField; }
247cdf0e10cSrcweir 
248cdf0e10cSrcweir     void SetMeta( ::com::sun::star::uno::Reference<
249cdf0e10cSrcweir                         ::com::sun::star::text::XTextContent >  xMeta)
250cdf0e10cSrcweir     { m_xMeta = xMeta; }
251cdf0e10cSrcweir 
252cdf0e10cSrcweir     bool IsCollapsed() const { return m_bIsCollapsed; }
253cdf0e10cSrcweir     void SetCollapsed(bool bSet)        { m_bIsCollapsed = bSet;}
254cdf0e10cSrcweir 
255cdf0e10cSrcweir     SwTextPortionType GetTextPortionType() const { return m_ePortionType; }
256cdf0e10cSrcweir 
257cdf0e10cSrcweir     SwUnoCrsr* GetCursor() const
258cdf0e10cSrcweir     {return static_cast<SwUnoCrsr*>(const_cast<SwModify*>(GetRegisteredIn()));}
259cdf0e10cSrcweir };
260cdf0e10cSrcweir 
261cdf0e10cSrcweir /* -----------------29.05.98 14:42-------------------
262cdf0e10cSrcweir  *
263cdf0e10cSrcweir  * --------------------------------------------------*/
264cdf0e10cSrcweir class SwXTextPortionEnumeration
265cdf0e10cSrcweir     : public ::cppu::WeakImplHelper3
266cdf0e10cSrcweir         < ::com::sun::star::container::XEnumeration
267cdf0e10cSrcweir         , ::com::sun::star::lang::XServiceInfo
268cdf0e10cSrcweir         , ::com::sun::star::lang::XUnoTunnel
269cdf0e10cSrcweir         >
270cdf0e10cSrcweir    , public SwClient
271cdf0e10cSrcweir {
272cdf0e10cSrcweir     TextRangeList_t m_Portions; // contains all portions, filled by ctor
273cdf0e10cSrcweir 
274cdf0e10cSrcweir     SwUnoCrsr*          GetCursor() const
275cdf0e10cSrcweir     {return static_cast<SwUnoCrsr*>(const_cast<SwModify*>(GetRegisteredIn()));}
276cdf0e10cSrcweir 
277cdf0e10cSrcweir protected:
278cdf0e10cSrcweir     virtual ~SwXTextPortionEnumeration();
279cdf0e10cSrcweir 
280cdf0e10cSrcweir public:
281cdf0e10cSrcweir     SwXTextPortionEnumeration(SwPaM& rParaCrsr,
282cdf0e10cSrcweir             ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
283cdf0e10cSrcweir                 const & xParent,
284cdf0e10cSrcweir             const sal_Int32 nStart, const sal_Int32 nEnd );
285cdf0e10cSrcweir 
286cdf0e10cSrcweir     SwXTextPortionEnumeration(SwPaM& rParaCrsr,
287cdf0e10cSrcweir         TextRangeList_t const & rPortions );
288cdf0e10cSrcweir 
289cdf0e10cSrcweir 
290cdf0e10cSrcweir     static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
291cdf0e10cSrcweir 
292cdf0e10cSrcweir     //XUnoTunnel
293cdf0e10cSrcweir     virtual sal_Int64 SAL_CALL getSomething(
294cdf0e10cSrcweir             const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
295cdf0e10cSrcweir         throw(::com::sun::star::uno::RuntimeException);
296cdf0e10cSrcweir 
297cdf0e10cSrcweir     //XEnumeration
298cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasMoreElements()
299cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
300cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
301cdf0e10cSrcweir         throw( ::com::sun::star::container::NoSuchElementException,
302cdf0e10cSrcweir                ::com::sun::star::lang::WrappedTargetException,
303cdf0e10cSrcweir                ::com::sun::star::uno::RuntimeException );
304cdf0e10cSrcweir 
305cdf0e10cSrcweir     //XServiceInfo
306cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName()
307cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
308cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
309cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
310cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
311cdf0e10cSrcweir         getSupportedServiceNames()
312cdf0e10cSrcweir         throw( ::com::sun::star::uno::RuntimeException );
313cdf0e10cSrcweir protected:
314cdf0e10cSrcweir     //SwClient
315cdf0e10cSrcweir     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
316cdf0e10cSrcweir };
317cdf0e10cSrcweir 
318cdf0e10cSrcweir #endif
319