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