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