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