update credits
[LibreOffice.git] / sw / inc / unotext.hxx
blobbb43f1d30f0b65a627eae192cca728b14f085c58
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SW_UNOTEXT_HXX
21 #define SW_UNOTEXT_HXX
23 #include <com/sun/star/lang/XUnoTunnel.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/text/XText.hpp>
26 #include <com/sun/star/text/XTextCopy.hpp>
27 #include <com/sun/star/text/XTextRangeCompare.hpp>
28 #include <com/sun/star/text/XRelativeTextContentInsert.hpp>
29 #include <com/sun/star/text/XRelativeTextContentRemove.hpp>
30 #include <com/sun/star/text/XTextAppendAndConvert.hpp>
32 #include <unobaseclass.hxx>
35 namespace com { namespace sun { namespace star {
36 namespace text {
37 class XTextContent;
39 } } }
41 class SfxItemPropertySet;
42 class SwDoc;
43 class SwStartNode;
44 class SwPaM;
45 class OTextCursorHelper;
46 class SwXTextRange;
50 class SwXText
51 : public ::com::sun::star::lang::XTypeProvider
52 , public ::com::sun::star::lang::XUnoTunnel
53 , public ::com::sun::star::beans::XPropertySet
54 , public ::com::sun::star::text::XTextAppendAndConvert
55 , public ::com::sun::star::text::XTextCopy
56 , public ::com::sun::star::text::XTextRangeCompare
57 , public ::com::sun::star::text::XRelativeTextContentInsert
58 , public ::com::sun::star::text::XRelativeTextContentRemove
61 private:
63 class Impl;
64 ::sw::UnoImplPtr<Impl> m_pImpl;
66 virtual void PrepareForAttach(
67 ::com::sun::star::uno::Reference<
68 ::com::sun::star::text::XTextRange > & xRange,
69 SwPaM const & rPam);
70 virtual bool CheckForOwnMemberMeta(
71 const SwPaM & rPam, const bool bAbsorb)
72 throw (::com::sun::star::lang::IllegalArgumentException,
73 ::com::sun::star::uno::RuntimeException);
75 protected:
77 bool IsValid() const;
78 void Invalidate();
79 void SetDoc(SwDoc *const pDoc);
81 virtual ~SwXText();
83 public: /*not protected because C++ is retarded*/
84 virtual const SwStartNode *GetStartNode() const;
86 public:
88 SwXText(SwDoc *const pDoc, const enum CursorType eType);
90 const SwDoc* GetDoc() const;
91 SwDoc* GetDoc();
93 virtual ::com::sun::star::uno::Reference<
94 ::com::sun::star::text::XTextCursor >
95 CreateCursor()
96 throw (::com::sun::star::uno::RuntimeException);
99 // XInterface
100 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
101 const ::com::sun::star::uno::Type& rType)
102 throw (::com::sun::star::uno::RuntimeException);
104 // XTypeProvider
105 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
106 SAL_CALL getTypes()
107 throw (::com::sun::star::uno::RuntimeException);
109 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
111 // XUnoTunnel
112 virtual sal_Int64 SAL_CALL getSomething(
113 const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
114 throw (::com::sun::star::uno::RuntimeException);
116 // XPropertySet
117 virtual ::com::sun::star::uno::Reference<
118 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
119 getPropertySetInfo()
120 throw (::com::sun::star::uno::RuntimeException);
121 virtual void SAL_CALL setPropertyValue(
122 const OUString& rPropertyName,
123 const ::com::sun::star::uno::Any& rValue)
124 throw (::com::sun::star::beans::UnknownPropertyException,
125 ::com::sun::star::beans::PropertyVetoException,
126 ::com::sun::star::lang::IllegalArgumentException,
127 ::com::sun::star::lang::WrappedTargetException,
128 ::com::sun::star::uno::RuntimeException);
129 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
130 const OUString& rPropertyName)
131 throw (::com::sun::star::beans::UnknownPropertyException,
132 ::com::sun::star::lang::WrappedTargetException,
133 ::com::sun::star::uno::RuntimeException);
134 virtual void SAL_CALL addPropertyChangeListener(
135 const OUString& rPropertyName,
136 const ::com::sun::star::uno::Reference<
137 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
138 throw (::com::sun::star::beans::UnknownPropertyException,
139 ::com::sun::star::lang::WrappedTargetException,
140 ::com::sun::star::uno::RuntimeException);
141 virtual void SAL_CALL removePropertyChangeListener(
142 const OUString& rPropertyName,
143 const ::com::sun::star::uno::Reference<
144 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
145 throw (::com::sun::star::beans::UnknownPropertyException,
146 ::com::sun::star::lang::WrappedTargetException,
147 ::com::sun::star::uno::RuntimeException);
148 virtual void SAL_CALL addVetoableChangeListener(
149 const OUString& rPropertyName,
150 const ::com::sun::star::uno::Reference<
151 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
152 throw (::com::sun::star::beans::UnknownPropertyException,
153 ::com::sun::star::lang::WrappedTargetException,
154 ::com::sun::star::uno::RuntimeException);
155 virtual void SAL_CALL removeVetoableChangeListener(
156 const OUString& rPropertyName,
157 const ::com::sun::star::uno::Reference<
158 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
159 throw (::com::sun::star::beans::UnknownPropertyException,
160 ::com::sun::star::lang::WrappedTargetException,
161 ::com::sun::star::uno::RuntimeException);
163 // XTextRange
164 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
165 SAL_CALL getText()
166 throw (::com::sun::star::uno::RuntimeException);
167 virtual ::com::sun::star::uno::Reference<
168 ::com::sun::star::text::XTextRange > SAL_CALL getStart()
169 throw (::com::sun::star::uno::RuntimeException);
170 virtual ::com::sun::star::uno::Reference<
171 ::com::sun::star::text::XTextRange > SAL_CALL getEnd()
172 throw (::com::sun::star::uno::RuntimeException);
173 virtual OUString SAL_CALL getString()
174 throw (::com::sun::star::uno::RuntimeException);
175 virtual void SAL_CALL setString(const OUString& rString)
176 throw (::com::sun::star::uno::RuntimeException);
178 // XSimpleText
179 virtual void SAL_CALL insertString(
180 const ::com::sun::star::uno::Reference<
181 ::com::sun::star::text::XTextRange > & xRange,
182 const OUString& aString, sal_Bool bAbsorb)
183 throw (::com::sun::star::uno::RuntimeException);
184 virtual void SAL_CALL insertControlCharacter(
185 const ::com::sun::star::uno::Reference<
186 ::com::sun::star::text::XTextRange > & xRange,
187 sal_Int16 nControlCharacter, sal_Bool bAbsorb)
188 throw (::com::sun::star::lang::IllegalArgumentException,
189 ::com::sun::star::uno::RuntimeException);
191 // XText
192 virtual void SAL_CALL insertTextContent(
193 const ::com::sun::star::uno::Reference<
194 ::com::sun::star::text::XTextRange > & xRange,
195 const ::com::sun::star::uno::Reference<
196 ::com::sun::star::text::XTextContent > & xContent,
197 sal_Bool bAbsorb)
198 throw (::com::sun::star::lang::IllegalArgumentException,
199 ::com::sun::star::uno::RuntimeException);
200 virtual void SAL_CALL removeTextContent(
201 const ::com::sun::star::uno::Reference<
202 ::com::sun::star::text::XTextContent > & xContent)
203 throw (::com::sun::star::container::NoSuchElementException,
204 ::com::sun::star::uno::RuntimeException);
206 // XParagraphAppend
207 virtual ::com::sun::star::uno::Reference<
208 ::com::sun::star::text::XTextRange > SAL_CALL
209 finishParagraph(
210 const ::com::sun::star::uno::Sequence<
211 ::com::sun::star::beans::PropertyValue >&
212 rCharacterAndParagraphProperties)
213 throw (::com::sun::star::lang::IllegalArgumentException,
214 ::com::sun::star::uno::RuntimeException);
215 virtual ::com::sun::star::uno::Reference<
216 ::com::sun::star::text::XTextRange > SAL_CALL
217 finishParagraphInsert(
218 const ::com::sun::star::uno::Sequence<
219 ::com::sun::star::beans::PropertyValue >&
220 rCharacterAndParagraphProperties,
221 const ::com::sun::star::uno::Reference<
222 ::com::sun::star::text::XTextRange >&
223 xInsertPosition)
224 throw (::com::sun::star::lang::IllegalArgumentException,
225 ::com::sun::star::uno::RuntimeException);
227 // XTextPortionAppend
228 virtual ::com::sun::star::uno::Reference<
229 ::com::sun::star::text::XTextRange > SAL_CALL
230 appendTextPortion(
231 const OUString& rText,
232 const ::com::sun::star::uno::Sequence<
233 ::com::sun::star::beans::PropertyValue >&
234 rCharacterAndParagraphProperties)
235 throw (::com::sun::star::lang::IllegalArgumentException,
236 ::com::sun::star::uno::RuntimeException);
238 virtual ::com::sun::star::uno::Reference<
239 ::com::sun::star::text::XTextRange > SAL_CALL
240 insertTextPortion(
241 const OUString& rText,
242 const ::com::sun::star::uno::Sequence<
243 ::com::sun::star::beans::PropertyValue >&
244 rCharacterAndParagraphProperties,
245 const ::com::sun::star::uno::Reference<
246 ::com::sun::star::text::XTextRange >&
247 rTextRange)
248 throw (::com::sun::star::lang::IllegalArgumentException,
249 ::com::sun::star::uno::RuntimeException);
251 // XTextContentAppend
252 virtual ::com::sun::star::uno::Reference<
253 ::com::sun::star::text::XTextRange > SAL_CALL
254 appendTextContent(
255 const ::com::sun::star::uno::Reference<
256 ::com::sun::star::text::XTextContent >& xTextContent,
257 const ::com::sun::star::uno::Sequence<
258 ::com::sun::star::beans::PropertyValue >&
259 rCharacterAndParagraphProperties)
260 throw (::com::sun::star::lang::IllegalArgumentException,
261 ::com::sun::star::uno::RuntimeException);
262 virtual ::com::sun::star::uno::Reference<
263 ::com::sun::star::text::XTextRange > SAL_CALL
264 insertTextContentWithProperties(
265 const ::com::sun::star::uno::Reference<
266 ::com::sun::star::text::XTextContent >& xTextContent,
267 const ::com::sun::star::uno::Sequence<
268 ::com::sun::star::beans::PropertyValue >&
269 rCharacterAndParagraphProperties,
270 const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xInsertPosition)
271 throw (::com::sun::star::lang::IllegalArgumentException,
272 ::com::sun::star::uno::RuntimeException);
274 // XTextConvert
275 virtual ::com::sun::star::uno::Reference<
276 ::com::sun::star::text::XTextContent > SAL_CALL
277 convertToTextFrame(
278 const ::com::sun::star::uno::Reference<
279 ::com::sun::star::text::XTextRange >& xStart,
280 const ::com::sun::star::uno::Reference<
281 ::com::sun::star::text::XTextRange >& xEnd,
282 const ::com::sun::star::uno::Sequence<
283 ::com::sun::star::beans::PropertyValue >& xFrameProperties)
284 throw (::com::sun::star::lang::IllegalArgumentException,
285 ::com::sun::star::uno::RuntimeException);
286 virtual ::com::sun::star::uno::Reference<
287 ::com::sun::star::text::XTextTable > SAL_CALL
288 convertToTable(
289 ::com::sun::star::uno::Sequence<
290 ::com::sun::star::uno::Sequence<
291 ::com::sun::star::uno::Sequence<
292 ::com::sun::star::uno::Reference<
293 ::com::sun::star::text::XTextRange > > > > const&
294 rTableRanges,
295 ::com::sun::star::uno::Sequence<
296 ::com::sun::star::uno::Sequence<
297 ::com::sun::star::uno::Sequence<
298 ::com::sun::star::beans::PropertyValue > > > const&
299 rCellProperties,
300 ::com::sun::star::uno::Sequence<
301 ::com::sun::star::uno::Sequence<
302 ::com::sun::star::beans::PropertyValue > > const&
303 rRowProperties,
304 ::com::sun::star::uno::Sequence<
305 ::com::sun::star::beans::PropertyValue > const&
306 rTableProperties)
307 throw (::com::sun::star::lang::IllegalArgumentException,
308 ::com::sun::star::uno::RuntimeException);
310 // XTextCopy
311 virtual void SAL_CALL copyText(
312 const ::com::sun::star::uno::Reference<
313 ::com::sun::star::text::XTextCopy >& xSource )
314 throw (::com::sun::star::uno::RuntimeException);
316 // XTextRangeCompare
317 sal_Int16 SAL_CALL compareRegionStarts(
318 const ::com::sun::star::uno::Reference<
319 ::com::sun::star::text::XTextRange >& xR1,
320 const ::com::sun::star::uno::Reference<
321 ::com::sun::star::text::XTextRange >& xR2)
322 throw (::com::sun::star::lang::IllegalArgumentException,
323 ::com::sun::star::uno::RuntimeException);
324 sal_Int16 SAL_CALL compareRegionEnds(
325 const ::com::sun::star::uno::Reference<
326 ::com::sun::star::text::XTextRange >& xR1,
327 const ::com::sun::star::uno::Reference<
328 ::com::sun::star::text::XTextRange >& xR2)
329 throw (::com::sun::star::lang::IllegalArgumentException,
330 ::com::sun::star::uno::RuntimeException);
332 // XRelativeTextContentInsert
333 virtual void SAL_CALL insertTextContentBefore(
334 const ::com::sun::star::uno::Reference<
335 ::com::sun::star::text::XTextContent>& xNewContent,
336 const ::com::sun::star::uno::Reference<
337 ::com::sun::star::text::XTextContent>& xSuccessor)
338 throw (::com::sun::star::lang::IllegalArgumentException,
339 ::com::sun::star::uno::RuntimeException);
340 virtual void SAL_CALL insertTextContentAfter(
341 const ::com::sun::star::uno::Reference<
342 ::com::sun::star::text::XTextContent>& xNewContent,
343 const ::com::sun::star::uno::Reference<
344 ::com::sun::star::text::XTextContent>& xPredecessor)
345 throw (::com::sun::star::lang::IllegalArgumentException,
346 ::com::sun::star::uno::RuntimeException);
348 // XRelativeTextContentRemove
349 virtual void SAL_CALL removeTextContentBefore(
350 const ::com::sun::star::uno::Reference<
351 ::com::sun::star::text::XTextContent>& xSuccessor)
352 throw (::com::sun::star::lang::IllegalArgumentException,
353 ::com::sun::star::uno::RuntimeException);
354 virtual void SAL_CALL removeTextContentAfter(
355 const ::com::sun::star::uno::Reference<
356 ::com::sun::star::text::XTextContent>& xPredecessor)
357 throw (::com::sun::star::lang::IllegalArgumentException,
358 ::com::sun::star::uno::RuntimeException);
361 #endif // SW_UNOTEXT_HXX
363 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */