1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SW_UNOTEXT_HXX
29 #define SW_UNOTEXT_HXX
31 #include <com/sun/star/lang/XUnoTunnel.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/text/XText.hpp>
34 #include <com/sun/star/text/XTextCopy.hpp>
35 #include <com/sun/star/text/XTextRangeCompare.hpp>
36 #include <com/sun/star/text/XRelativeTextContentInsert.hpp>
37 #include <com/sun/star/text/XRelativeTextContentRemove.hpp>
38 #include <com/sun/star/text/XTextAppendAndConvert.hpp>
40 #include <unobaseclass.hxx>
43 namespace com
{ namespace sun
{ namespace star
{
49 class SfxItemPropertySet
;
53 class OTextCursorHelper
;
57 /* -----------------03.12.98 12:22-------------------
59 * --------------------------------------------------*/
62 : public ::com::sun::star::lang::XTypeProvider
63 , public ::com::sun::star::lang::XUnoTunnel
64 , public ::com::sun::star::beans::XPropertySet
65 , public ::com::sun::star::text::XTextAppendAndConvert
66 , public ::com::sun::star::text::XTextCopy
67 , public ::com::sun::star::text::XTextRangeCompare
68 , public ::com::sun::star::text::XRelativeTextContentInsert
69 , public ::com::sun::star::text::XRelativeTextContentRemove
75 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
77 virtual void PrepareForAttach(
78 ::com::sun::star::uno::Reference
<
79 ::com::sun::star::text::XTextRange
> & xRange
,
81 virtual bool CheckForOwnMemberMeta(
82 const SwPaM
& rPam
, const bool bAbsorb
)
83 throw (::com::sun::star::lang::IllegalArgumentException
,
84 ::com::sun::star::uno::RuntimeException
);
90 void SetDoc(SwDoc
*const pDoc
);
94 public: /*not protected because C++ is retarded*/
95 virtual const SwStartNode
*GetStartNode() const;
99 SwXText(SwDoc
*const pDoc
, const enum CursorType eType
);
101 const SwDoc
* GetDoc() const;
104 virtual ::com::sun::star::uno::Reference
<
105 ::com::sun::star::text::XTextCursor
>
107 throw (::com::sun::star::uno::RuntimeException
);
111 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
112 const ::com::sun::star::uno::Type
& rType
)
113 throw (::com::sun::star::uno::RuntimeException
);
116 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>
118 throw (::com::sun::star::uno::RuntimeException
);
120 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& getUnoTunnelId();
123 virtual sal_Int64 SAL_CALL
getSomething(
124 const ::com::sun::star::uno::Sequence
< sal_Int8
>& rIdentifier
)
125 throw (::com::sun::star::uno::RuntimeException
);
128 virtual ::com::sun::star::uno::Reference
<
129 ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
131 throw (::com::sun::star::uno::RuntimeException
);
132 virtual void SAL_CALL
setPropertyValue(
133 const ::rtl::OUString
& rPropertyName
,
134 const ::com::sun::star::uno::Any
& rValue
)
135 throw (::com::sun::star::beans::UnknownPropertyException
,
136 ::com::sun::star::beans::PropertyVetoException
,
137 ::com::sun::star::lang::IllegalArgumentException
,
138 ::com::sun::star::lang::WrappedTargetException
,
139 ::com::sun::star::uno::RuntimeException
);
140 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue(
141 const ::rtl::OUString
& rPropertyName
)
142 throw (::com::sun::star::beans::UnknownPropertyException
,
143 ::com::sun::star::lang::WrappedTargetException
,
144 ::com::sun::star::uno::RuntimeException
);
145 virtual void SAL_CALL
addPropertyChangeListener(
146 const ::rtl::OUString
& rPropertyName
,
147 const ::com::sun::star::uno::Reference
<
148 ::com::sun::star::beans::XPropertyChangeListener
>& xListener
)
149 throw (::com::sun::star::beans::UnknownPropertyException
,
150 ::com::sun::star::lang::WrappedTargetException
,
151 ::com::sun::star::uno::RuntimeException
);
152 virtual void SAL_CALL
removePropertyChangeListener(
153 const ::rtl::OUString
& rPropertyName
,
154 const ::com::sun::star::uno::Reference
<
155 ::com::sun::star::beans::XPropertyChangeListener
>& xListener
)
156 throw (::com::sun::star::beans::UnknownPropertyException
,
157 ::com::sun::star::lang::WrappedTargetException
,
158 ::com::sun::star::uno::RuntimeException
);
159 virtual void SAL_CALL
addVetoableChangeListener(
160 const ::rtl::OUString
& rPropertyName
,
161 const ::com::sun::star::uno::Reference
<
162 ::com::sun::star::beans::XVetoableChangeListener
>& xListener
)
163 throw (::com::sun::star::beans::UnknownPropertyException
,
164 ::com::sun::star::lang::WrappedTargetException
,
165 ::com::sun::star::uno::RuntimeException
);
166 virtual void SAL_CALL
removeVetoableChangeListener(
167 const ::rtl::OUString
& rPropertyName
,
168 const ::com::sun::star::uno::Reference
<
169 ::com::sun::star::beans::XVetoableChangeListener
>& xListener
)
170 throw (::com::sun::star::beans::UnknownPropertyException
,
171 ::com::sun::star::lang::WrappedTargetException
,
172 ::com::sun::star::uno::RuntimeException
);
175 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XText
>
177 throw (::com::sun::star::uno::RuntimeException
);
178 virtual ::com::sun::star::uno::Reference
<
179 ::com::sun::star::text::XTextRange
> SAL_CALL
getStart()
180 throw (::com::sun::star::uno::RuntimeException
);
181 virtual ::com::sun::star::uno::Reference
<
182 ::com::sun::star::text::XTextRange
> SAL_CALL
getEnd()
183 throw (::com::sun::star::uno::RuntimeException
);
184 virtual ::rtl::OUString SAL_CALL
getString()
185 throw (::com::sun::star::uno::RuntimeException
);
186 virtual void SAL_CALL
setString(const ::rtl::OUString
& rString
)
187 throw (::com::sun::star::uno::RuntimeException
);
190 virtual void SAL_CALL
insertString(
191 const ::com::sun::star::uno::Reference
<
192 ::com::sun::star::text::XTextRange
> & xRange
,
193 const ::rtl::OUString
& aString
, sal_Bool bAbsorb
)
194 throw (::com::sun::star::uno::RuntimeException
);
195 virtual void SAL_CALL
insertControlCharacter(
196 const ::com::sun::star::uno::Reference
<
197 ::com::sun::star::text::XTextRange
> & xRange
,
198 sal_Int16 nControlCharacter
, sal_Bool bAbsorb
)
199 throw (::com::sun::star::lang::IllegalArgumentException
,
200 ::com::sun::star::uno::RuntimeException
);
203 virtual void SAL_CALL
insertTextContent(
204 const ::com::sun::star::uno::Reference
<
205 ::com::sun::star::text::XTextRange
> & xRange
,
206 const ::com::sun::star::uno::Reference
<
207 ::com::sun::star::text::XTextContent
> & xContent
,
209 throw (::com::sun::star::lang::IllegalArgumentException
,
210 ::com::sun::star::uno::RuntimeException
);
211 virtual void SAL_CALL
removeTextContent(
212 const ::com::sun::star::uno::Reference
<
213 ::com::sun::star::text::XTextContent
> & xContent
)
214 throw (::com::sun::star::container::NoSuchElementException
,
215 ::com::sun::star::uno::RuntimeException
);
218 virtual ::com::sun::star::uno::Reference
<
219 ::com::sun::star::text::XTextRange
> SAL_CALL
221 const ::com::sun::star::uno::Sequence
<
222 ::com::sun::star::beans::PropertyValue
>&
223 rCharacterAndParagraphProperties
)
224 throw (::com::sun::star::lang::IllegalArgumentException
,
225 ::com::sun::star::uno::RuntimeException
);
226 virtual ::com::sun::star::uno::Reference
<
227 ::com::sun::star::text::XTextRange
> SAL_CALL
229 const ::com::sun::star::uno::Sequence
<
230 ::com::sun::star::beans::PropertyValue
>&
231 rCharacterAndParagraphProperties
)
232 throw (::com::sun::star::lang::IllegalArgumentException
,
233 ::com::sun::star::uno::RuntimeException
);
235 // XTextPortionAppend
236 virtual ::com::sun::star::uno::Reference
<
237 ::com::sun::star::text::XTextRange
> SAL_CALL
239 const ::rtl::OUString
& rText
,
240 const ::com::sun::star::uno::Sequence
<
241 ::com::sun::star::beans::PropertyValue
>&
242 rCharacterAndParagraphProperties
)
243 throw (::com::sun::star::lang::IllegalArgumentException
,
244 ::com::sun::star::uno::RuntimeException
);
246 // XTextContentAppend
247 virtual ::com::sun::star::uno::Reference
<
248 ::com::sun::star::text::XTextRange
> SAL_CALL
250 const ::com::sun::star::uno::Reference
<
251 ::com::sun::star::text::XTextContent
>& xTextContent
,
252 const ::com::sun::star::uno::Sequence
<
253 ::com::sun::star::beans::PropertyValue
>&
254 rCharacterAndParagraphProperties
)
255 throw (::com::sun::star::lang::IllegalArgumentException
,
256 ::com::sun::star::uno::RuntimeException
);
259 virtual ::com::sun::star::uno::Reference
<
260 ::com::sun::star::text::XTextContent
> SAL_CALL
262 const ::com::sun::star::uno::Reference
<
263 ::com::sun::star::text::XTextRange
>& xStart
,
264 const ::com::sun::star::uno::Reference
<
265 ::com::sun::star::text::XTextRange
>& xEnd
,
266 const ::com::sun::star::uno::Sequence
<
267 ::com::sun::star::beans::PropertyValue
>& xFrameProperties
)
268 throw (::com::sun::star::lang::IllegalArgumentException
,
269 ::com::sun::star::uno::RuntimeException
);
270 virtual ::com::sun::star::uno::Reference
<
271 ::com::sun::star::text::XTextTable
> SAL_CALL
273 ::com::sun::star::uno::Sequence
<
274 ::com::sun::star::uno::Sequence
<
275 ::com::sun::star::uno::Sequence
<
276 ::com::sun::star::uno::Reference
<
277 ::com::sun::star::text::XTextRange
> > > > const&
279 ::com::sun::star::uno::Sequence
<
280 ::com::sun::star::uno::Sequence
<
281 ::com::sun::star::uno::Sequence
<
282 ::com::sun::star::beans::PropertyValue
> > > const&
284 ::com::sun::star::uno::Sequence
<
285 ::com::sun::star::uno::Sequence
<
286 ::com::sun::star::beans::PropertyValue
> > const&
288 ::com::sun::star::uno::Sequence
<
289 ::com::sun::star::beans::PropertyValue
> const&
291 throw (::com::sun::star::lang::IllegalArgumentException
,
292 ::com::sun::star::uno::RuntimeException
);
295 sal_Int16 SAL_CALL
compareRegionStarts(
296 const ::com::sun::star::uno::Reference
<
297 ::com::sun::star::text::XTextRange
>& xR1
,
298 const ::com::sun::star::uno::Reference
<
299 ::com::sun::star::text::XTextRange
>& xR2
)
300 throw (::com::sun::star::lang::IllegalArgumentException
,
301 ::com::sun::star::uno::RuntimeException
);
302 sal_Int16 SAL_CALL
compareRegionEnds(
303 const ::com::sun::star::uno::Reference
<
304 ::com::sun::star::text::XTextRange
>& xR1
,
305 const ::com::sun::star::uno::Reference
<
306 ::com::sun::star::text::XTextRange
>& xR2
)
307 throw (::com::sun::star::lang::IllegalArgumentException
,
308 ::com::sun::star::uno::RuntimeException
);
310 // XRelativeTextContentInsert
311 virtual void SAL_CALL
insertTextContentBefore(
312 const ::com::sun::star::uno::Reference
<
313 ::com::sun::star::text::XTextContent
>& xNewContent
,
314 const ::com::sun::star::uno::Reference
<
315 ::com::sun::star::text::XTextContent
>& xSuccessor
)
316 throw (::com::sun::star::lang::IllegalArgumentException
,
317 ::com::sun::star::uno::RuntimeException
);
318 virtual void SAL_CALL
insertTextContentAfter(
319 const ::com::sun::star::uno::Reference
<
320 ::com::sun::star::text::XTextContent
>& xNewContent
,
321 const ::com::sun::star::uno::Reference
<
322 ::com::sun::star::text::XTextContent
>& xPredecessor
)
323 throw (::com::sun::star::lang::IllegalArgumentException
,
324 ::com::sun::star::uno::RuntimeException
);
326 // XRelativeTextContentRemove
327 virtual void SAL_CALL
removeTextContentBefore(
328 const ::com::sun::star::uno::Reference
<
329 ::com::sun::star::text::XTextContent
>& xSuccessor
)
330 throw (::com::sun::star::lang::IllegalArgumentException
,
331 ::com::sun::star::uno::RuntimeException
);
332 virtual void SAL_CALL
removeTextContentAfter(
333 const ::com::sun::star::uno::Reference
<
334 ::com::sun::star::text::XTextContent
>& xPredecessor
)
335 throw (::com::sun::star::lang::IllegalArgumentException
,
336 ::com::sun::star::uno::RuntimeException
);
339 virtual void SAL_CALL
copyText(
340 const ::com::sun::star::uno::Reference
<
341 ::com::sun::star::text::XTextCopy
>& xSource
)
342 throw (::com::sun::star::uno::RuntimeException
);
345 #endif // SW_UNOTEXT_HXX