xref: /aoo42x/main/sw/inc/unotxdoc.hxx (revision 0dccdc5d)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 #ifndef _UNOTXDOC_HXX
28 #define _UNOTXDOC_HXX
29 
30 #include "swdllapi.h"
31 #include <svl/svarray.hxx>
32 #include <sfx2/sfxbasemodel.hxx>
33 
34 #include <com/sun/star/beans/PropertyValues.hpp>
35 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
36 #include <com/sun/star/style/XAutoStylesSupplier.hpp>
37 #include <com/sun/star/document/XLinkTargetSupplier.hpp>
38 #include <com/sun/star/document/XRedlinesSupplier.hpp>
39 #include <com/sun/star/text/XNumberingRulesSupplier.hpp>
40 #include <com/sun/star/text/XFootnotesSupplier.hpp>
41 #include <com/sun/star/text/XEndnotesSupplier.hpp>
42 #include <com/sun/star/text/XEndnotesSettingsSupplier.hpp>
43 #include <com/sun/star/text/XTextSectionsSupplier.hpp>
44 #include <com/sun/star/text/XLineNumberingProperties.hpp>
45 #include <com/sun/star/text/XChapterNumberingSupplier.hpp>
46 #include <com/sun/star/text/XPagePrintable.hpp>
47 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
48 #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
49 #include <com/sun/star/text/XTextTablesSupplier.hpp>
50 #include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
51 #include <com/sun/star/text/XBookmarksSupplier.hpp>
52 #include <com/sun/star/text/XTextDocument.hpp>
53 #include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
54 #include <com/sun/star/text/XReferenceMarksSupplier.hpp>
55 #include <com/sun/star/text/XTextFramesSupplier.hpp>
56 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
57 #include <com/sun/star/util/XReplaceable.hpp>
58 #include <com/sun/star/util/XReplaceDescriptor.hpp>
59 #include <com/sun/star/util/XRefreshable.hpp>
60 #include <com/sun/star/util/XLinkUpdate.hpp>
61 #include <com/sun/star/view/XRenderable.hpp>
62 #include <com/sun/star/lang/XServiceInfo.hpp>
63 #include <com/sun/star/frame/XController.hpp>
64 #include <com/sun/star/beans/XPropertySet.hpp>
65 #include <com/sun/star/beans/XPropertyState.hpp>
66 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
67 #include <com/sun/star/lang/Locale.hpp>
68 #include <com/sun/star/xforms/XFormsSupplier.hpp>
69 #include <com/sun/star/container/XNameContainer.hpp>
70 #include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp>
71 #include <com/sun/star/document/XDocumentLanguages.hpp>
72 #include <com/sun/star/util/XCloneable.hpp>
73 #include <svl/itemprop.hxx>
74 #include <svx/fmdmod.hxx>
75 #include <editeng/UnoForbiddenCharsTable.hxx>
76 #include <cppuhelper/weak.hxx>
77 #include <cppuhelper/implbase2.hxx>	// helper for implementations
78 #include <cppuhelper/implbase4.hxx>	// helper for implementations
79 #include <RefreshListenerContainer.hxx>
80 
81 #include <viewopt.hxx>
82 
83 #define __IFC32 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \
84 Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27, Ifc28, Ifc29, Ifc30, Ifc31, Ifc32
85 
86 #define __CLASS_IFC32 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, \
87 class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12, class Ifc13, class Ifc14, class Ifc15, class Ifc16, \
88 class Ifc17, class Ifc18, class Ifc19, class Ifc20, class Ifc21, class Ifc22, class Ifc23, class Ifc24,\
89 class Ifc25, class Ifc26, class Ifc27, class Ifc28, class Ifc29, class Ifc30, class Ifc31 , class Ifc32
90 
91 #define __PUBLIC_IFC32 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12, \
92 public Ifc13, public Ifc14, public Ifc15, public Ifc16, public Ifc17, public Ifc18, \
93 public Ifc19, public Ifc20, public Ifc21, public Ifc22, public Ifc23, public Ifc24, \
94 public Ifc25, public Ifc26, public Ifc27, public Ifc28, public Ifc29, public Ifc30, \
95 public Ifc31, public Ifc32
96 #include <cppuhelper/implbase_ex.hxx>
97 #include <cppuhelper/implbase_ex_pre.hxx>
98 #define __IFC_EX_TYPE_INIT32( class_cast ) \
99     __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \
100     __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \
101     __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \
102     __IFC_EX_TYPE_INIT( class_cast, 7 ), __IFC_EX_TYPE_INIT( class_cast, 8 ), \
103     __IFC_EX_TYPE_INIT( class_cast, 9 ), __IFC_EX_TYPE_INIT( class_cast, 10 ), \
104     __IFC_EX_TYPE_INIT( class_cast, 11 ), __IFC_EX_TYPE_INIT( class_cast, 12 ), \
105     __IFC_EX_TYPE_INIT( class_cast, 13 ), __IFC_EX_TYPE_INIT( class_cast, 14 ), \
106     __IFC_EX_TYPE_INIT( class_cast, 15 ), __IFC_EX_TYPE_INIT( class_cast, 16 ), \
107     __IFC_EX_TYPE_INIT( class_cast, 17 ), __IFC_EX_TYPE_INIT( class_cast, 18 ), \
108     __IFC_EX_TYPE_INIT( class_cast, 19 ), __IFC_EX_TYPE_INIT( class_cast, 20 ), \
109     __IFC_EX_TYPE_INIT( class_cast, 21 ), __IFC_EX_TYPE_INIT( class_cast, 22 ), \
110     __IFC_EX_TYPE_INIT( class_cast, 23 ), __IFC_EX_TYPE_INIT( class_cast, 24 ), \
111     __IFC_EX_TYPE_INIT( class_cast, 25 ), __IFC_EX_TYPE_INIT( class_cast, 26 ), \
112     __IFC_EX_TYPE_INIT( class_cast, 27 ), __IFC_EX_TYPE_INIT( class_cast, 28 ), \
113     __IFC_EX_TYPE_INIT( class_cast, 29 ), __IFC_EX_TYPE_INIT( class_cast, 30 ), \
114     __IFC_EX_TYPE_INIT( class_cast, 31 ), __IFC_EX_TYPE_INIT( class_cast, 32)
115 #include <cppuhelper/implbase_ex_post.hxx>
116 
117 __DEF_IMPLHELPER_EX( 32 )
118 
119 namespace css = ::com::sun::star;
120 
121 class SwDoc;
122 class SwDocShell;
123 class UnoActionContext;
124 class SwXBodyText;
125 class SwXDrawPage;
126 class SwUnoCrsr;
127 class SwXDocumentPropertyHelper;
128 class SfxViewFrame;
129 class SwPrintUIOptions;
130 class SwPrintData;
131 class SwRenderData;
132 class ViewShell;
133 
134 typedef UnoActionContext* UnoActionContextPtr;
135 SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4)
136 
137 
138 /******************************************************************************
139  *
140  ******************************************************************************/
141 
142 
143 typedef cppu::WeakImplHelper32
144 <
145 	css::text::XTextDocument,
146 	css::text::XLineNumberingProperties,
147 	css::text::XChapterNumberingSupplier,
148     css::text::XNumberingRulesSupplier,
149 	css::text::XFootnotesSupplier,
150 	css::text::XEndnotesSupplier,
151 	css::util::XReplaceable,
152 	css::text::XPagePrintable,
153 	css::text::XReferenceMarksSupplier,
154 	css::text::XTextTablesSupplier,
155 	css::text::XTextFramesSupplier,
156 	css::text::XBookmarksSupplier,
157 	css::text::XTextSectionsSupplier,
158 	css::text::XTextGraphicObjectsSupplier,
159 	css::text::XTextEmbeddedObjectsSupplier,
160 	css::text::XTextFieldsSupplier,
161 	css::style::XStyleFamiliesSupplier,
162 	css::style::XAutoStylesSupplier,
163 	css::lang::XServiceInfo,
164 	css::drawing::XDrawPageSupplier,
165 	css::text::XDocumentIndexesSupplier,
166 	css::beans::XPropertySet,
167 	css::beans::XPropertyState,
168 	css::document::XLinkTargetSupplier,
169 	css::document::XRedlinesSupplier,
170 	css::util::XRefreshable,
171 	css::util::XLinkUpdate,
172     css::view::XRenderable,
173     css::xforms::XFormsSupplier,
174     css::text::XFlatParagraphIteratorProvider,
175 	css::document::XDocumentLanguages,
176     css::util::XCloneable
177 >
178 SwXTextDocumentBaseClass;
179 
180 class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass,
181 	public SvxFmMSFactory,
182 	public SfxBaseModel
183 {
184 	ActionContextArr		aActionArr;
185 	SwRefreshListenerContainer	aRefreshCont;
186 
187     const SfxItemPropertySet* pPropSet;
188 
189 	SwDocShell* 			pDocShell;
190 	sal_Bool					bObjectValid;
191 
192 	SwXDrawPage*			pDrawPage;
193 	css::uno::Reference< css::drawing::XDrawPage > *			pxXDrawPage;
194 
195 	css::uno::Reference< css::text::XText > 				xBodyText;
196 	SwXBodyText*			pBodyText;
197 	css::uno::Reference< css::uno::XAggregation > 			xNumFmtAgg;
198 
199     css::uno::Reference< css::container::XIndexAccess > *     pxXNumberingRules;
200     css::uno::Reference< css::container::XIndexAccess > *     pxXFootnotes;
201 	css::uno::Reference< css::beans::XPropertySet > *        pxXFootnoteSettings;
202 	css::uno::Reference< css::container::XIndexAccess > *		pxXEndnotes;
203 	css::uno::Reference< css::beans::XPropertySet > *        pxXEndnoteSettings;
204 	css::uno::Reference< css::container::XNameAccess > *			pxXReferenceMarks;
205 	css::uno::Reference< css::container::XEnumerationAccess > *	pxXTextFieldTypes;
206 	css::uno::Reference< css::container::XNameAccess > *			pxXTextFieldMasters;
207 	css::uno::Reference< css::container::XNameAccess > *			pxXTextSections;
208 	css::uno::Reference< css::container::XNameAccess > *			pxXBookmarks;
209 	css::uno::Reference< css::container::XNameAccess > *			pxXTextTables;
210 	css::uno::Reference< css::container::XNameAccess > *			pxXTextFrames;
211 	css::uno::Reference< css::container::XNameAccess > *			pxXGraphicObjects;
212 	css::uno::Reference< css::container::XNameAccess > *			pxXEmbeddedObjects;
213 	css::uno::Reference< css::container::XNameAccess > *			pxXStyleFamilies;
214     mutable css::uno::Reference< css::style::XAutoStyles > *  pxXAutoStyles;
215     css::uno::Reference< css::container::XIndexReplace > *        pxXChapterNumbering;
216 	css::uno::Reference< css::container::XIndexAccess > *		pxXDocumentIndexes;
217 
218 	css::uno::Reference< css::beans::XPropertySet > * 		pxXLineNumberingProperties;
219 	css::uno::Reference< css::container::XNameAccess > *			pxLinkTargetSupplier;
220 	css::uno::Reference< css::container::XEnumerationAccess >* 	pxXRedlines;
221 	css::uno::Reference< css::container::XNameContainer> 		xXFormsContainer;
222 
223     //temporary frame to enable PDF export if no valid view is available
224     SfxViewFrame*                                   m_pHiddenViewFrame;
225     css::uno::Reference< css::uno::XInterface>      xPropertyHelper;
226     SwXDocumentPropertyHelper*                      pPropertyHelper;
227 
228     SwPrintUIOptions *                              m_pPrintUIOptions;
229     SwRenderData *                               m_pRenderData;
230 
231 	void					GetBodyText();
232 	void					GetNumberFormatter();
233 
234     // used for XRenderable implementation
235     SfxViewShell *  GuessViewShell( /* out */ bool &rbIsSwSrcView, const css::uno::Reference< css::frame::XController > xController = css::uno::Reference< css::frame::XController >() );
236     SwDoc *         GetRenderDoc( SfxViewShell *&rpView, const css::uno::Any& rSelection, bool bIsPDFExport );
237     SfxViewShell *  GetRenderView( bool &rbIsSwSrcView, const css::uno::Sequence< css::beans::PropertyValue >& rxOptions, bool bIsPDFExport );
238 
239 	rtl::OUString			maBuildId;
240 
241     // --> OD #i117783#
242     // boolean for XPagePrintable
243     // set in XPagePrintable::printPages(..) to indicate that the PagePrintSettings
244     // has to be applied in XRenderable::getRenderer(..) through which the printing
245     // is implemented.
246     sal_Bool bApplyPagePrintSettingsFromXPagePrintable;
247     // <--
248 
249     using SfxBaseModel::addEventListener;
250     using SfxBaseModel::removeEventListener;
251 
252 protected:
253 	virtual ~SwXTextDocument();
254 public:
255 	SwXTextDocument(SwDocShell* pShell);
256 
257 	inline void notifyRefreshListeners() { aRefreshCont.Refreshed(); }
258     virtual 	css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException);
259     virtual void SAL_CALL acquire(  ) throw();
260     virtual void SAL_CALL release(  ) throw();
261 
262 	//XWeak
263     virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter(  ) throw(css::uno::RuntimeException);
264 
265 	virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) throw(css::uno::RuntimeException);
266 
267 	static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
268 
269 	//XUnoTunnel
270 	virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException);
271 
272 	//XTextDocument
273 	virtual css::uno::Reference< css::text::XText >  SAL_CALL getText(void) throw( css::uno::RuntimeException );
274 	virtual void SAL_CALL reformat(void) throw( css::uno::RuntimeException );
275 
276 	//XModel
277     virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) throw(css::uno::RuntimeException);
278     virtual ::rtl::OUString SAL_CALL getURL(  ) throw(css::uno::RuntimeException);
279     virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs(  ) throw(css::uno::RuntimeException);
280     virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::uno::RuntimeException);
281     virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::uno::RuntimeException);
282     virtual void SAL_CALL lockControllers(  ) throw(css::uno::RuntimeException);
283     virtual void SAL_CALL unlockControllers(  ) throw(css::uno::RuntimeException);
284     virtual sal_Bool SAL_CALL hasControllersLocked(  ) throw(css::uno::RuntimeException);
285     virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController(  ) throw(css::uno::RuntimeException);
286     virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::container::NoSuchElementException, css::uno::RuntimeException);
287     virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection(  ) throw(css::uno::RuntimeException);
288 
289 	//XComponent
290 	virtual void SAL_CALL dispose(void) throw( css::uno::RuntimeException );
291 	virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException );
292 	virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException );
293 
294     //XCloseable
295     virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw (css::util::CloseVetoException, css::uno::RuntimeException);
296 
297     //XLineNumberingProperties
298 	virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getLineNumberingProperties(void) throw( css::uno::RuntimeException );
299 
300 	//XChapterNumberingSupplier
301 	virtual css::uno::Reference< css::container::XIndexReplace >  SAL_CALL getChapterNumberingRules(void) throw( css::uno::RuntimeException );
302 
303     //XNumberingRulesSupplier
304     virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getNumberingRules() throw (css::uno::RuntimeException);
305 
306 	//XFootnotesSupplier
307 	virtual css::uno::Reference< css::container::XIndexAccess >  SAL_CALL getFootnotes(void) throw( css::uno::RuntimeException );
308 	virtual css::uno::Reference< css::beans::XPropertySet >  SAL_CALL getFootnoteSettings(void) throw( css::uno::RuntimeException );
309 
310 	//XEndnotesSupplier
311 	virtual css::uno::Reference< css::container::XIndexAccess >  SAL_CALL getEndnotes(void) throw( css::uno::RuntimeException );
312 	virtual css::uno::Reference< css::beans::XPropertySet >  SAL_CALL getEndnoteSettings(void) throw( css::uno::RuntimeException );
313 
314 	//XReplaceable
315 	virtual css::uno::Reference< css::util::XReplaceDescriptor >  SAL_CALL createReplaceDescriptor(void) throw( css::uno::RuntimeException );
316 	virtual sal_Int32 SAL_CALL replaceAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException );
317 
318 	//XSearchable
319 	virtual css::uno::Reference< css::util::XSearchDescriptor >  SAL_CALL createSearchDescriptor(void) throw( css::uno::RuntimeException );
320 	virtual css::uno::Reference< css::container::XIndexAccess >  SAL_CALL findAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException );
321 	virtual css::uno::Reference< css::uno::XInterface >  SAL_CALL findFirst(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException );
322 	virtual css::uno::Reference< css::uno::XInterface >  SAL_CALL findNext(const css::uno::Reference< css::uno::XInterface > & xStartAt, const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException );
323 
324 	//XPagePrintable
325 	virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPagePrintSettings(void) throw( css::uno::RuntimeException );
326 	virtual void SAL_CALL setPagePrintSettings(const css::uno::Sequence< css::beans::PropertyValue >& aSettings) throw( css::uno::RuntimeException );
327 	virtual void SAL_CALL printPages(const css::uno::Sequence< css::beans::PropertyValue >& xOptions) throw( css::lang::IllegalArgumentException, css::uno::RuntimeException );
328 
329 	//XReferenceMarksSupplier
330 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getReferenceMarks(void) throw( css::uno::RuntimeException );
331 
332 	// css::text::XTextFieldsSupplier
333 	virtual css::uno::Reference< css::container::XEnumerationAccess >  SAL_CALL getTextFields(void) throw( css::uno::RuntimeException );
334 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getTextFieldMasters(void) throw( css::uno::RuntimeException );
335 
336 	// css::text::XTextEmbeddedObjectsSupplier
337 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getEmbeddedObjects(void) throw( css::uno::RuntimeException );
338 
339 //	// css::text::XTextShapesSupplier
340 //    virtual css::uno::Reference< css::container::XIndexAccess >  getShapes(void) throw( css::uno::RuntimeException );
341 
342 	// css::text::XBookmarksSupplier
343 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getBookmarks(void) throw( css::uno::RuntimeException );
344 
345 	// css::text::XTextSectionsSupplier
346 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getTextSections(void) throw( css::uno::RuntimeException );
347 
348 	// css::text::XTextTablesSupplier
349 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getTextTables(void) throw( css::uno::RuntimeException );
350 
351 	// css::text::XTextGraphicObjectsSupplier
352 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getGraphicObjects(void) throw( css::uno::RuntimeException );
353 
354 	// css::text::XTextFramesSupplier
355 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getTextFrames(void) throw( css::uno::RuntimeException );
356 
357 	//XStyleFamiliesSupplier
358 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getStyleFamilies(void) throw( css::uno::RuntimeException );
359 
360     //XAutoStylesSupplier
361     virtual css::uno::Reference< css::style::XAutoStyles > SAL_CALL getAutoStyles(  ) throw (css::uno::RuntimeException);
362 
363     //XMultiServiceFactory
364 	virtual css::uno::Reference< css::uno::XInterface >  SAL_CALL createInstance(const rtl::OUString& ServiceSpecifier)
365 				throw( css::uno::Exception, css::uno::RuntimeException );
366 	virtual css::uno::Reference< css::uno::XInterface >  SAL_CALL createInstanceWithArguments(const rtl::OUString& ServiceSpecifier,
367 				const css::uno::Sequence< css::uno::Any >& Arguments)
368 				throw( css::uno::Exception, css::uno::RuntimeException );
369 	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void)
370 				throw( css::uno::RuntimeException );
371 
372 	//XServiceInfo
373 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException );
374 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException );
375 	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException );
376 
377 	// css::drawing::XDrawPageSupplier
378 	virtual css::uno::Reference< css::drawing::XDrawPage >  SAL_CALL getDrawPage(void) throw( css::uno::RuntimeException );
379 
380 	// css::text::XDocumentIndexesSupplier
381 	virtual css::uno::Reference< css::container::XIndexAccess >  SAL_CALL getDocumentIndexes(void) throw( css::uno::RuntimeException );
382 
383 	//XPropertySet
384     virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(css::uno::RuntimeException);
385     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException);
386     virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
387     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
388     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
389     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
390     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
391 
392 	//XPropertyState
393 	virtual css::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
394     virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< ::rtl::OUString >& rPropertyNames ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
395     virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
396     virtual css::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
397 
398 	//XLinkTargetSupplier
399 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getLinks(void) throw( css::uno::RuntimeException );
400 
401 	//XRedlinesSupplier
402 	virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getRedlines(  ) throw(css::uno::RuntimeException);
403 
404 	// css::util::XRefreshable
405 	virtual void SAL_CALL refresh(void) throw( css::uno::RuntimeException );
406 	virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) throw( css::uno::RuntimeException );
407 	virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) throw( css::uno::RuntimeException );
408 
409 	// css::util::XLinkUpdate,
410     virtual void SAL_CALL updateLinks(  ) throw(css::uno::RuntimeException);
411 
412     // css::view::XRenderable
413     virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
414     virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
415     virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
416 
417     // css::xforms::XFormsSupplier
418     virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getXForms(  ) throw (css::uno::RuntimeException);
419 
420     // css::document::XDocumentLanguages
421     virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getDocumentLanguages( ::sal_Int16 nScriptTypes, ::sal_Int16 nCount ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
422 
423     // css::text::XFlatParagraphIteratorProvider:
424     virtual css::uno::Reference< css::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) throw (css::uno::RuntimeException);
425 
426     // ::com::sun::star::util::XCloneable
427     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone(  ) throw (::com::sun::star::uno::RuntimeException);
428 
429 
430     //
431 	void						Invalidate();
432 	void						Reactivate(SwDocShell* pNewDocShell);
433 	SwXDocumentPropertyHelper * GetPropertyHelper ();
434 	sal_Bool 			  		IsValid() const {return bObjectValid;}
435 
436 	void						InitNewDoc();
437 
438 	SwUnoCrsr* 					CreateCursorForSearch(css::uno::Reference< css::text::XTextCursor > & xCrsr);
439 	SwUnoCrsr* 					FindAny(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc,
440 											css::uno::Reference< css::text::XTextCursor > & xCrsr, sal_Bool bAll,
441 											sal_Int32& nResult,
442 											css::uno::Reference< css::uno::XInterface >  xLastResult);
443 
444 	SwXDrawPage*				GetDrawPage();
445 	SwDocShell* 				GetDocShell() {return pDocShell;}
446 
447 
448     void * SAL_CALL operator new( size_t ) throw();
449 	void SAL_CALL operator delete( void * ) throw();
450 
451 };
452 /* -----------------25.10.99 11:02-------------------
453 
454  --------------------------------------------------*/
455 class SwXLinkTargetSupplier : public cppu::WeakImplHelper2
456 <
457 	css::container::XNameAccess,
458 	css::lang::XServiceInfo
459 >
460 {
461 	SwXTextDocument* pxDoc;
462 	String sTables;
463 	String sFrames;
464 	String sGraphics;
465 	String sOLEs;
466 	String sSections;
467 	String sOutlines;
468 	String sBookmarks;
469 
470 public:
471 	SwXLinkTargetSupplier(SwXTextDocument& rxDoc);
472 	~SwXLinkTargetSupplier();
473 
474 	//XNameAccess
475 	virtual css::uno::Any SAL_CALL getByName(const rtl::OUString& Name)  throw( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException );
476 	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( css::uno::RuntimeException );
477 	virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( css::uno::RuntimeException );
478 
479 	//XElementAccess
480     virtual css::uno::Type SAL_CALL getElementType(  ) throw(css::uno::RuntimeException);
481     virtual sal_Bool SAL_CALL hasElements(  ) throw(css::uno::RuntimeException);
482 
483 	//XServiceInfo
484 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException );
485 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException );
486 	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException );
487 
488 	//
489 	void	Invalidate() {pxDoc = 0;}
490 };
491 /* -----------------26.10.99 09:05-------------------
492 
493  --------------------------------------------------*/
494 class SwXLinkNameAccessWrapper : public cppu::WeakImplHelper4
495 <
496 	css::beans::XPropertySet,
497 	css::container::XNameAccess,
498 	css::lang::XServiceInfo,
499 	css::document::XLinkTargetSupplier
500 >
501 {
502     css::uno::Reference< css::container::XNameAccess >    xRealAccess;
503     const SfxItemPropertySet*                                                       pPropSet;
504     const String                                                                    sLinkSuffix;
505     const String                                                                    sLinkDisplayName;
506 	css::uno::Reference< css::text::XTextDocument >  		xDoc;
507     SwXTextDocument*                                                                pxDoc;
508 
509 
510 public:
511 	SwXLinkNameAccessWrapper(css::uno::Reference< css::container::XNameAccess >  xAccess,
512 			const String& rLinkDisplayName, String sSuffix);
513 	SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc,
514 			const String& rLinkDisplayName, String sSuffix);
515 	~SwXLinkNameAccessWrapper();
516 
517 	//XNameAccess
518 	virtual css::uno::Any SAL_CALL getByName(const rtl::OUString& Name)  throw( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException );
519 	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( css::uno::RuntimeException );
520 	virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( css::uno::RuntimeException );
521 
522 	//XElementAccess
523     virtual css::uno::Type SAL_CALL getElementType(  ) throw(css::uno::RuntimeException);
524     virtual sal_Bool SAL_CALL hasElements(  ) throw(css::uno::RuntimeException);
525 
526 	//XPropertySet
527     virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(css::uno::RuntimeException);
528     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException);
529     virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
530     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
531     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
532     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
533     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
534 
535 	//XLinkTargetSupplier
536 	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getLinks(void) throw( css::uno::RuntimeException );
537 
538 	//XServiceInfo
539 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException );
540 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException );
541 	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException );
542 
543 };
544 /* -----------------26.10.99 15:46-------------------
545 
546  --------------------------------------------------*/
547 class SwXOutlineTarget : public cppu::WeakImplHelper2
548 <
549 	css::beans::XPropertySet,
550 	css::lang::XServiceInfo
551 >
552 {
553     const SfxItemPropertySet*   pPropSet;
554     String                      sOutlineText;
555 
556 public:
557 	SwXOutlineTarget(const String& rOutlineText);
558 	~SwXOutlineTarget();
559 
560 	//XPropertySet
561     virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(css::uno::RuntimeException);
562     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException);
563     virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
564     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
565     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
566     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
567     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
568 
569 	//XServiceInfo
570 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException );
571 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException );
572 	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException );
573 };
574 #endif
575 
576 class SwXDocumentPropertyHelper : public SvxUnoForbiddenCharsTable
577 {
578 	css::uno::Reference < css::uno::XInterface > xDashTable;
579 	css::uno::Reference < css::uno::XInterface > xGradientTable;
580 	css::uno::Reference < css::uno::XInterface > xHatchTable;
581 	css::uno::Reference < css::uno::XInterface > xBitmapTable;
582 	css::uno::Reference < css::uno::XInterface > xTransGradientTable;
583 	css::uno::Reference < css::uno::XInterface > xMarkerTable;
584 	css::uno::Reference < css::uno::XInterface > xDrawDefaults;
585 
586     SwDoc*  m_pDoc;
587 public:
588 	SwXDocumentPropertyHelper(SwDoc& rDoc);
589 	~SwXDocumentPropertyHelper();
590 	css::uno::Reference<css::uno::XInterface> GetDrawTable(short nWhich);
591 	void Invalidate();
592 
593     virtual void onChange();
594 };
595 
596 
597 /*-- 06.01.2004 15:08:34---------------------------------------------------
598     The class SwViewOptionAdjust_Impl is used to adjust the SwViewOption of
599     the current ViewShell so that fields are not printed as commands and
600     hidden characters are always invisible. Hidden text and place holders
601     should be printed according to the current print options.
602     After printing the view options are restored
603   -----------------------------------------------------------------------*/
604 class SwViewOptionAdjust_Impl
605 {
606     ViewShell &    m_rShell;
607     SwViewOption    m_aOldViewOptions;
608 //    SwViewOption    m_aRenderViewOptions;   // view options to use when rendering for PDF export or printing
609 //    bool            m_bRestoreViewOptions;
610 
611 public:
612     SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions );
613     ~SwViewOptionAdjust_Impl();
614     void AdjustViewOptions( SwPrintData const* const pPrtOptions );
615     bool checkShell( const ViewShell& rCompare ) const
616     { return &rCompare == &m_rShell; }
617 };
618 
619 
620