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