bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / unoparagraph.hxx
blobe326ad3cc3eaba32dc62690144018ad02b4e67a3
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_UNOPARAGRAPH_HXX
21 #define SW_UNOPARAGRAPH_HXX
23 #include <memory>
25 #include <com/sun/star/lang/XUnoTunnel.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/beans/XPropertyState.hpp>
29 #include <com/sun/star/beans/XMultiPropertySet.hpp>
30 #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
31 #include <com/sun/star/container/XEnumerationAccess.hpp>
32 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
33 #include <com/sun/star/text/XTextContent.hpp>
34 #include <com/sun/star/text/XTextRange.hpp>
36 #include <cppuhelper/implbase10.hxx>
38 #include <sfx2/Metadatable.hxx>
40 #include <unobaseclass.hxx>
43 struct SwPosition;
44 class SwPaM;
45 class SwUnoCrsr;
46 class SwStartNode;
47 class SwTxtNode;
48 class SwTable;
49 class SwXText;
52 typedef ::cppu::ImplInheritanceHelper10
53 < ::sfx2::MetadatableMixin
54 , ::com::sun::star::lang::XUnoTunnel
55 , ::com::sun::star::lang::XServiceInfo
56 , ::com::sun::star::beans::XPropertySet
57 , ::com::sun::star::beans::XPropertyState
58 , ::com::sun::star::beans::XMultiPropertySet
59 , ::com::sun::star::beans::XTolerantMultiPropertySet
60 , ::com::sun::star::container::XEnumerationAccess
61 , ::com::sun::star::container::XContentEnumerationAccess
62 , ::com::sun::star::text::XTextContent
63 , ::com::sun::star::text::XTextRange
64 > SwXParagraph_Base;
66 class SwXParagraph
67 : public SwXParagraph_Base
70 private:
72 class Impl;
73 ::sw::UnoImplPtr<Impl> m_pImpl;
75 virtual ~SwXParagraph();
77 SwXParagraph(::com::sun::star::uno::Reference<
78 ::com::sun::star::text::XText > const & xParent,
79 SwTxtNode & rTxtNode,
80 const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1);
82 public:
84 /// descriptor
85 SwXParagraph();
87 static ::com::sun::star::uno::Reference<
88 ::com::sun::star::text::XTextContent>
89 CreateXParagraph(SwDoc & rDoc, SwTxtNode& rTxtNode,
90 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText>
91 const& xParentText = 0,
92 const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1);
94 const SwTxtNode * GetTxtNode() const;
95 bool IsDescriptor() const;
96 /// make rPaM select the paragraph
97 bool SelectPaM(SwPaM & rPaM);
98 /// for SwXText
99 void attachToText(SwXText & rParent, SwTxtNode & rTxtNode);
101 // MetadatableMixin
102 virtual ::sfx2::Metadatable* GetCoreObject();
103 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
104 GetModel();
106 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
108 // XUnoTunnel
109 virtual sal_Int64 SAL_CALL getSomething(
110 const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
111 throw (::com::sun::star::uno::RuntimeException);
113 // XServiceInfo
114 virtual OUString SAL_CALL getImplementationName()
115 throw (::com::sun::star::uno::RuntimeException);
116 virtual sal_Bool SAL_CALL supportsService(
117 const OUString& rServiceName)
118 throw (::com::sun::star::uno::RuntimeException);
119 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
120 getSupportedServiceNames()
121 throw (::com::sun::star::uno::RuntimeException);
123 // XComponent
124 virtual void SAL_CALL dispose()
125 throw (::com::sun::star::uno::RuntimeException);
126 virtual void SAL_CALL addEventListener(
127 const ::com::sun::star::uno::Reference<
128 ::com::sun::star::lang::XEventListener > & xListener)
129 throw (::com::sun::star::uno::RuntimeException);
130 virtual void SAL_CALL removeEventListener(
131 const ::com::sun::star::uno::Reference<
132 ::com::sun::star::lang::XEventListener > & xListener)
133 throw (::com::sun::star::uno::RuntimeException);
135 // XPropertySet
136 virtual ::com::sun::star::uno::Reference<
137 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
138 getPropertySetInfo()
139 throw (::com::sun::star::uno::RuntimeException);
140 virtual void SAL_CALL setPropertyValue(
141 const OUString& rPropertyName,
142 const ::com::sun::star::uno::Any& rValue)
143 throw (::com::sun::star::beans::UnknownPropertyException,
144 ::com::sun::star::beans::PropertyVetoException,
145 ::com::sun::star::lang::IllegalArgumentException,
146 ::com::sun::star::lang::WrappedTargetException,
147 ::com::sun::star::uno::RuntimeException);
148 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
149 const OUString& rPropertyName)
150 throw (::com::sun::star::beans::UnknownPropertyException,
151 ::com::sun::star::lang::WrappedTargetException,
152 ::com::sun::star::uno::RuntimeException);
153 virtual void SAL_CALL addPropertyChangeListener(
154 const OUString& rPropertyName,
155 const ::com::sun::star::uno::Reference<
156 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
157 throw (::com::sun::star::beans::UnknownPropertyException,
158 ::com::sun::star::lang::WrappedTargetException,
159 ::com::sun::star::uno::RuntimeException);
160 virtual void SAL_CALL removePropertyChangeListener(
161 const OUString& rPropertyName,
162 const ::com::sun::star::uno::Reference<
163 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
164 throw (::com::sun::star::beans::UnknownPropertyException,
165 ::com::sun::star::lang::WrappedTargetException,
166 ::com::sun::star::uno::RuntimeException);
167 virtual void SAL_CALL addVetoableChangeListener(
168 const OUString& rPropertyName,
169 const ::com::sun::star::uno::Reference<
170 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
171 throw (::com::sun::star::beans::UnknownPropertyException,
172 ::com::sun::star::lang::WrappedTargetException,
173 ::com::sun::star::uno::RuntimeException);
174 virtual void SAL_CALL removeVetoableChangeListener(
175 const OUString& rPropertyName,
176 const ::com::sun::star::uno::Reference<
177 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
178 throw (::com::sun::star::beans::UnknownPropertyException,
179 ::com::sun::star::lang::WrappedTargetException,
180 ::com::sun::star::uno::RuntimeException);
182 // XPropertyState
183 virtual ::com::sun::star::beans::PropertyState SAL_CALL
184 getPropertyState(const OUString& rPropertyName)
185 throw (::com::sun::star::beans::UnknownPropertyException,
186 ::com::sun::star::uno::RuntimeException);
187 virtual ::com::sun::star::uno::Sequence<
188 ::com::sun::star::beans::PropertyState > SAL_CALL
189 getPropertyStates(
190 const ::com::sun::star::uno::Sequence<
191 OUString >& rPropertyNames)
192 throw (::com::sun::star::beans::UnknownPropertyException,
193 ::com::sun::star::uno::RuntimeException);
194 virtual void SAL_CALL setPropertyToDefault(
195 const OUString& rPropertyName)
196 throw (::com::sun::star::beans::UnknownPropertyException,
197 ::com::sun::star::uno::RuntimeException);
198 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
199 const OUString& rPropertyName)
200 throw (::com::sun::star::beans::UnknownPropertyException,
201 ::com::sun::star::lang::WrappedTargetException,
202 ::com::sun::star::uno::RuntimeException);
204 // XMultiPropertySet
205 virtual void SAL_CALL setPropertyValues(
206 const ::com::sun::star::uno::Sequence< OUString >&
207 rPropertyNames,
208 const ::com::sun::star::uno::Sequence<
209 ::com::sun::star::uno::Any >& rValues)
210 throw (::com::sun::star::beans::PropertyVetoException,
211 ::com::sun::star::lang::IllegalArgumentException,
212 ::com::sun::star::lang::WrappedTargetException,
213 ::com::sun::star::uno::RuntimeException);
214 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
215 SAL_CALL getPropertyValues(
216 const ::com::sun::star::uno::Sequence< OUString >&
217 rPropertyNames)
218 throw (::com::sun::star::uno::RuntimeException);
219 virtual void SAL_CALL addPropertiesChangeListener(
220 const ::com::sun::star::uno::Sequence< OUString >&
221 rPropertyNames,
222 const ::com::sun::star::uno::Reference<
223 ::com::sun::star::beans::XPropertiesChangeListener >& xListener)
224 throw (::com::sun::star::uno::RuntimeException);
225 virtual void SAL_CALL removePropertiesChangeListener(
226 const ::com::sun::star::uno::Reference<
227 ::com::sun::star::beans::XPropertiesChangeListener >& xListener)
228 throw (::com::sun::star::uno::RuntimeException);
229 virtual void SAL_CALL firePropertiesChangeEvent(
230 const ::com::sun::star::uno::Sequence< OUString >&
231 rPropertyNames,
232 const ::com::sun::star::uno::Reference<
233 ::com::sun::star::beans::XPropertiesChangeListener >& xListener)
234 throw (::com::sun::star::uno::RuntimeException);
236 // XTolerantMultiPropertySet
237 virtual ::com::sun::star::uno::Sequence<
238 ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL
239 setPropertyValuesTolerant(
240 const ::com::sun::star::uno::Sequence< OUString >&
241 rPropertyNames,
242 const ::com::sun::star::uno::Sequence<
243 ::com::sun::star::uno::Any >& rValues)
244 throw (::com::sun::star::lang::IllegalArgumentException,
245 ::com::sun::star::uno::RuntimeException);
246 virtual ::com::sun::star::uno::Sequence<
247 ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL
248 getPropertyValuesTolerant(
249 const ::com::sun::star::uno::Sequence< OUString >&
250 rPropertyNames)
251 throw (::com::sun::star::uno::RuntimeException);
252 virtual ::com::sun::star::uno::Sequence<
253 ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL
254 getDirectPropertyValuesTolerant(
255 const ::com::sun::star::uno::Sequence< OUString >&
256 rPropertyNames)
257 throw (::com::sun::star::uno::RuntimeException);
259 // XElementAccess
260 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
261 throw (::com::sun::star::uno::RuntimeException);
262 virtual sal_Bool SAL_CALL hasElements()
263 throw (::com::sun::star::uno::RuntimeException);
265 // XEnumerationAccess
266 virtual ::com::sun::star::uno::Reference<
267 ::com::sun::star::container::XEnumeration > SAL_CALL
268 createEnumeration()
269 throw (::com::sun::star::uno::RuntimeException);
271 // XContentEnumerationAccess
272 virtual ::com::sun::star::uno::Reference<
273 ::com::sun::star::container::XEnumeration > SAL_CALL
274 createContentEnumeration(const OUString& rServiceName)
275 throw (::com::sun::star::uno::RuntimeException);
276 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
277 getAvailableServiceNames()
278 throw (::com::sun::star::uno::RuntimeException);
280 // XTextContent
281 virtual void SAL_CALL attach(
282 const ::com::sun::star::uno::Reference<
283 ::com::sun::star::text::XTextRange > & xTextRange)
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::XTextRange > SAL_CALL getAnchor()
288 throw (::com::sun::star::uno::RuntimeException);
290 // XTextRange
291 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
292 SAL_CALL getText()
293 throw (::com::sun::star::uno::RuntimeException);
294 virtual ::com::sun::star::uno::Reference<
295 ::com::sun::star::text::XTextRange > SAL_CALL getStart()
296 throw (::com::sun::star::uno::RuntimeException);
297 virtual ::com::sun::star::uno::Reference<
298 ::com::sun::star::text::XTextRange > SAL_CALL getEnd()
299 throw (::com::sun::star::uno::RuntimeException);
300 virtual OUString SAL_CALL getString()
301 throw (::com::sun::star::uno::RuntimeException);
302 virtual void SAL_CALL setString(const OUString& rString)
303 throw (::com::sun::star::uno::RuntimeException);
308 class SwXParagraphEnumeration
309 : public SwSimpleEnumeration_Base
312 private:
314 class Impl;
315 ::sw::UnoImplPtr<Impl> m_pImpl;
317 virtual ~SwXParagraphEnumeration();
319 public:
321 /// takes ownership of cursor
322 SwXParagraphEnumeration(
323 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
324 const & xParent,
325 ::std::auto_ptr<SwUnoCrsr> pCursor,
326 const CursorType eType,
327 SwStartNode const*const pStartNode = 0,
328 SwTable const*const pTable = 0);
330 // XServiceInfo
331 virtual OUString SAL_CALL getImplementationName()
332 throw (::com::sun::star::uno::RuntimeException);
333 virtual sal_Bool SAL_CALL supportsService(
334 const OUString& rServiceName)
335 throw (::com::sun::star::uno::RuntimeException);
336 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
337 getSupportedServiceNames()
338 throw (::com::sun::star::uno::RuntimeException);
340 // XEnumeration
341 virtual sal_Bool SAL_CALL hasMoreElements()
342 throw (::com::sun::star::uno::RuntimeException);
343 virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
344 throw (::com::sun::star::container::NoSuchElementException,
345 ::com::sun::star::lang::WrappedTargetException,
346 ::com::sun::star::uno::RuntimeException);
350 #endif // SW_UNOPARAGRAPH_HXX
352 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */