/src/libreoffice/sw/inc/unotxdoc.hxx
Line | Count | Source |
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/style/XStyleFamiliesSupplier.hpp> |
26 | | #include <com/sun/star/style/XAutoStylesSupplier.hpp> |
27 | | #include <com/sun/star/document/XLinkTargetSupplier.hpp> |
28 | | #include <com/sun/star/document/XRedlinesSupplier.hpp> |
29 | | #include <com/sun/star/text/XNumberingRulesSupplier.hpp> |
30 | | #include <com/sun/star/text/XFootnotesSupplier.hpp> |
31 | | #include <com/sun/star/text/XEndnotesSupplier.hpp> |
32 | | #include <com/sun/star/text/XContentControlsSupplier.hpp> |
33 | | #include <com/sun/star/text/XTextSectionsSupplier.hpp> |
34 | | #include <com/sun/star/text/XLineNumberingProperties.hpp> |
35 | | #include <com/sun/star/text/XChapterNumberingSupplier.hpp> |
36 | | #include <com/sun/star/text/XPagePrintable.hpp> |
37 | | #include <com/sun/star/text/XTextFieldsSupplier.hpp> |
38 | | #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp> |
39 | | #include <com/sun/star/text/XTextTablesSupplier.hpp> |
40 | | #include <com/sun/star/text/XDocumentIndexesSupplier.hpp> |
41 | | #include <com/sun/star/text/XBookmarksSupplier.hpp> |
42 | | #include <com/sun/star/text/XTextDocument.hpp> |
43 | | #include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp> |
44 | | #include <com/sun/star/text/XReferenceMarksSupplier.hpp> |
45 | | #include <com/sun/star/text/XTextFramesSupplier.hpp> |
46 | | #include <com/sun/star/drawing/XDrawPageSupplier.hpp> |
47 | | #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> |
48 | | #include <com/sun/star/util/XReplaceable.hpp> |
49 | | #include <com/sun/star/util/XRefreshable.hpp> |
50 | | #include <com/sun/star/util/XLinkUpdate.hpp> |
51 | | #include <com/sun/star/view/XRenderable.hpp> |
52 | | #include <com/sun/star/lang/XServiceInfo.hpp> |
53 | | #include <com/sun/star/beans/XPropertySet.hpp> |
54 | | #include <com/sun/star/beans/XPropertyState.hpp> |
55 | | #include <com/sun/star/xforms/XFormsSupplier.hpp> |
56 | | #include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp> |
57 | | #include <com/sun/star/document/XDocumentLanguages.hpp> |
58 | | #include <com/sun/star/util/XCloneable.hpp> |
59 | | #include <o3tl/deleter.hxx> |
60 | | #include <rtl/ref.hxx> |
61 | | #include <svx/fmdmod.hxx> |
62 | | #include <editeng/UnoForbiddenCharsTable.hxx> |
63 | | #include <cppuhelper/implbase.hxx> |
64 | | #include <vcl/ITiledRenderable.hxx> |
65 | | #include <com/sun/star/text/XPasteBroadcaster.hpp> |
66 | | |
67 | | #include "unobaseclass.hxx" |
68 | | #include "viewopt.hxx" |
69 | | |
70 | | #include <deque> |
71 | | |
72 | | class SwDoc; |
73 | | class SwDocShell; |
74 | | class SwXBodyText; |
75 | | class SwFmDrawPage; |
76 | | class SwUnoCursor; |
77 | | class SwXDocumentPropertyHelper; |
78 | | class SfxViewFrame; |
79 | | class SfxViewShell; |
80 | | class SwPrintUIOptions; |
81 | | class SwPrintData; |
82 | | class SwRenderData; |
83 | | class SwViewShell; |
84 | | class SfxItemPropertySet; |
85 | | class SwXTextTables; |
86 | | class SwXTextFrames; |
87 | | class SwXTextGraphicObjects; |
88 | | class SwXTextEmbeddedObjects; |
89 | | class SwXTextFieldTypes; |
90 | | class SwXTextFieldMasters; |
91 | | class SwXTextSections; |
92 | | class SwXNumberingRulesCollection; |
93 | | class SwXFootnote; |
94 | | class SwXFootnotes; |
95 | | class SwXContentControls; |
96 | | class SwXDocumentIndexes; |
97 | | class SwXStyleFamilies; |
98 | | class SwXStyle; |
99 | | class SwXAutoStyles; |
100 | | class SwXBookmarks; |
101 | | class SwXChapterNumbering; |
102 | | class SwXFootnoteProperties; |
103 | | class SwXEndnoteProperties; |
104 | | class SwXLineNumberingProperties; |
105 | | class SwXReferenceMarks; |
106 | | class SwXLinkTargetSupplier; |
107 | | class SwXRedlines; |
108 | | class SwXDocumentSettings; |
109 | | class SwXTextDefaults; |
110 | | class SwXBookmark; |
111 | | class SwXTextSection; |
112 | | class SwXTextField; |
113 | | class SwXLineBreak; |
114 | | class SwXTextFrame; |
115 | | class SwXTextGraphicObject; |
116 | | class SwXPageStyle; |
117 | | class SwXContentControl; |
118 | | class SwXTextEmbeddedObject; |
119 | | class SvXMLEmbeddedObjectHelper; |
120 | | class SwXFieldmark; |
121 | | class SwXSection; |
122 | | class SwXFieldMaster; |
123 | | class SwXDocumentIndex; |
124 | | class SvNumberFormatsSupplierObj; |
125 | | namespace com::sun::star::frame { class XController; } |
126 | | |
127 | | typedef cppu::ImplInheritanceHelper |
128 | | < |
129 | | SfxBaseModel, |
130 | | css::text::XTextDocument, |
131 | | css::text::XLineNumberingProperties, |
132 | | css::text::XChapterNumberingSupplier, |
133 | | css::text::XNumberingRulesSupplier, |
134 | | css::text::XFootnotesSupplier, |
135 | | css::text::XEndnotesSupplier, |
136 | | css::text::XContentControlsSupplier, |
137 | | css::util::XReplaceable, |
138 | | css::text::XPagePrintable, |
139 | | css::text::XReferenceMarksSupplier, |
140 | | css::text::XTextTablesSupplier, |
141 | | css::text::XTextFramesSupplier, |
142 | | css::text::XBookmarksSupplier, |
143 | | css::text::XTextSectionsSupplier, |
144 | | css::text::XTextGraphicObjectsSupplier, |
145 | | css::text::XTextEmbeddedObjectsSupplier, |
146 | | css::text::XTextFieldsSupplier, |
147 | | css::style::XStyleFamiliesSupplier, |
148 | | css::style::XAutoStylesSupplier, |
149 | | css::lang::XServiceInfo, |
150 | | css::drawing::XDrawPageSupplier, |
151 | | css::drawing::XDrawPagesSupplier, |
152 | | css::text::XDocumentIndexesSupplier, |
153 | | css::beans::XPropertySet, |
154 | | css::beans::XPropertyState, |
155 | | css::document::XLinkTargetSupplier, |
156 | | css::document::XRedlinesSupplier, |
157 | | css::util::XRefreshable, |
158 | | css::util::XLinkUpdate, |
159 | | css::view::XRenderable, |
160 | | css::xforms::XFormsSupplier, |
161 | | css::text::XFlatParagraphIteratorProvider, |
162 | | css::document::XDocumentLanguages, |
163 | | css::util::XCloneable, |
164 | | css::text::XPasteBroadcaster |
165 | | > |
166 | | SwXTextDocumentBaseClass; |
167 | | |
168 | | class SW_DLLPUBLIC SwXTextDocument final : public SwXTextDocumentBaseClass, |
169 | | public SvxFmMSFactory, |
170 | | public vcl::ITiledRenderable |
171 | | { |
172 | | private: |
173 | | class Impl; |
174 | | ::sw::UnoImplPtr<Impl> m_pImpl; |
175 | | |
176 | | std::deque<std::unique_ptr<UnoActionContext, o3tl::default_delete<UnoActionContext>>> maActionArr; |
177 | | |
178 | | const SfxItemPropertySet* m_pPropSet; |
179 | | |
180 | | SwDocShell* m_pDocShell; |
181 | | |
182 | | rtl::Reference<SwFmDrawPage> m_xDrawPage; |
183 | | |
184 | | rtl::Reference<SwXBodyText> m_xBodyText; |
185 | | rtl::Reference< SvNumberFormatsSupplierObj > m_xNumFormatAgg; |
186 | | |
187 | | rtl::Reference<SwXNumberingRulesCollection> mxXNumberingRules; |
188 | | rtl::Reference<SwXFootnotes> mxXFootnotes; |
189 | | rtl::Reference<SwXFootnoteProperties> mxXFootnoteSettings; |
190 | | rtl::Reference<SwXFootnotes> mxXEndnotes; |
191 | | rtl::Reference<SwXEndnoteProperties> mxXEndnoteSettings; |
192 | | rtl::Reference<SwXContentControls> mxXContentControls; |
193 | | rtl::Reference<SwXReferenceMarks> mxXReferenceMarks; |
194 | | rtl::Reference<SwXTextFieldTypes> mxXTextFieldTypes; |
195 | | rtl::Reference<SwXTextFieldMasters> mxXTextFieldMasters; |
196 | | rtl::Reference<SwXTextSections> mxXTextSections; |
197 | | rtl::Reference<SwXBookmarks> mxXBookmarks; |
198 | | rtl::Reference<SwXTextTables> mxXTextTables; |
199 | | rtl::Reference<SwXTextFrames> mxXTextFrames; |
200 | | rtl::Reference<SwXTextGraphicObjects> mxXGraphicObjects; |
201 | | rtl::Reference<SwXTextEmbeddedObjects> mxXEmbeddedObjects; |
202 | | rtl::Reference<SwXStyleFamilies> mxXStyleFamilies; |
203 | | mutable rtl::Reference<SwXAutoStyles> mxXAutoStyles; |
204 | | rtl::Reference<SwXChapterNumbering> mxXChapterNumbering; |
205 | | rtl::Reference<SwXDocumentIndexes> mxXDocumentIndexes; |
206 | | |
207 | | rtl::Reference<SwXLineNumberingProperties> mxXLineNumberingProperties; |
208 | | rtl::Reference<SwXLinkTargetSupplier> mxLinkTargetSupplier; |
209 | | rtl::Reference<SwXRedlines> mxXRedlines; |
210 | | |
211 | | //temporary frame to enable PDF export if no valid view is available |
212 | | SfxViewFrame* m_pHiddenViewFrame; |
213 | | rtl::Reference<SwXDocumentPropertyHelper> mxPropertyHelper; |
214 | | |
215 | | std::unique_ptr<SwPrintUIOptions> m_pPrintUIOptions; |
216 | | std::unique_ptr<SwRenderData> m_pRenderData; |
217 | | |
218 | | void GetNumberFormatter(); |
219 | | |
220 | | css::uno::Reference<css::uno::XInterface> create( |
221 | | OUString const & rServiceName, |
222 | | css::uno::Sequence<css::uno::Any> const * arguments); |
223 | | |
224 | | // used for XRenderable implementation |
225 | | SfxViewShell * GuessViewShell( /* out */ bool &rbIsSwSrcView, const css::uno::Reference< css::frame::XController >& rController = css::uno::Reference< css::frame::XController >() ); |
226 | | SwDoc * GetRenderDoc( SfxViewShell *&rpView, const css::uno::Any& rSelection, bool bIsPDFExport ); |
227 | | SfxViewShell * GetRenderView( bool &rbIsSwSrcView, const css::uno::Sequence< css::beans::PropertyValue >& rxOptions, bool bIsPDFExport ); |
228 | | |
229 | | OUString maBuildId; |
230 | | |
231 | | // boolean for XPagePrintable |
232 | | // set in XPagePrintable::printPages(..) to indicate that the PagePrintSettings |
233 | | // has to be applied in XRenderable::getRenderer(..) through which the printing |
234 | | // is implemented. |
235 | | bool m_bApplyPagePrintSettingsFromXPagePrintable; |
236 | | |
237 | | /** abstract SdrModel provider */ |
238 | | virtual SdrModel& getSdrModelFromUnoModel() const override; |
239 | | |
240 | | virtual ~SwXTextDocument() override; |
241 | | |
242 | | void ThrowIfInvalid() const; |
243 | | SwDoc& GetDocOrThrow() const; |
244 | | bool partHasComments() const; |
245 | | |
246 | | public: |
247 | | SwXTextDocument(SwDocShell* pShell); |
248 | | |
249 | | void NotifyRefreshListeners(); |
250 | | virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; |
251 | | virtual void SAL_CALL acquire( ) noexcept override; |
252 | | virtual void SAL_CALL release( ) noexcept override; |
253 | | |
254 | | //XWeak |
255 | | virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; |
256 | | |
257 | | static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); |
258 | | |
259 | | //XUnoTunnel |
260 | | virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; |
261 | | |
262 | | //XTextDocument |
263 | | virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override; |
264 | | rtl::Reference< SwXBodyText > getBodyText(); |
265 | | virtual void SAL_CALL reformat() override; |
266 | | |
267 | | using SfxBaseModel::addEventListener; |
268 | | using SfxBaseModel::removeEventListener; |
269 | | |
270 | | //XModel |
271 | | virtual sal_Bool SAL_CALL attachResource( const OUString& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) override; |
272 | | virtual OUString SAL_CALL getURL( ) override; |
273 | | virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs( ) override; |
274 | | virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) override; |
275 | | virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) override; |
276 | | virtual void SAL_CALL lockControllers( ) override; |
277 | | virtual void SAL_CALL unlockControllers( ) override; |
278 | | virtual sal_Bool SAL_CALL hasControllersLocked( ) override; |
279 | | virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController( ) override; |
280 | | virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController ) override; |
281 | | virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection( ) override; |
282 | | |
283 | | //XComponent |
284 | | virtual void SAL_CALL dispose() override; |
285 | | virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override; |
286 | | virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override; |
287 | | |
288 | | //XCloseable |
289 | | virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) override; |
290 | | |
291 | | //XLineNumberingProperties |
292 | | virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getLineNumberingProperties() override; |
293 | | |
294 | | //XChapterNumberingSupplier |
295 | | virtual css::uno::Reference< css::container::XIndexReplace > SAL_CALL getChapterNumberingRules() override; |
296 | | |
297 | | //XNumberingRulesSupplier |
298 | | virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getNumberingRules() override; |
299 | | |
300 | | //XFootnotesSupplier |
301 | | virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getFootnotes() override; |
302 | | virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getFootnoteSettings() override; |
303 | | |
304 | | //XEndnotesSupplier |
305 | | virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getEndnotes() override; |
306 | | virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getEndnoteSettings() override; |
307 | | |
308 | | // XContentControlsSupplier |
309 | | css::uno::Reference<css::container::XIndexAccess> SAL_CALL getContentControls() override; |
310 | | |
311 | | //XReplaceable |
312 | | virtual css::uno::Reference< css::util::XReplaceDescriptor > SAL_CALL createReplaceDescriptor() override; |
313 | | virtual sal_Int32 SAL_CALL replaceAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) override; |
314 | | |
315 | | //XSearchable |
316 | | virtual css::uno::Reference< css::util::XSearchDescriptor > SAL_CALL createSearchDescriptor() override; |
317 | | virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL findAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) override; |
318 | | virtual css::uno::Reference< css::uno::XInterface > SAL_CALL findFirst(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) override; |
319 | | 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) override; |
320 | | |
321 | | //XPagePrintable |
322 | | virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPagePrintSettings() override; |
323 | | virtual void SAL_CALL setPagePrintSettings(const css::uno::Sequence< css::beans::PropertyValue >& aSettings) override; |
324 | | virtual void SAL_CALL printPages(const css::uno::Sequence< css::beans::PropertyValue >& xOptions) override; |
325 | | |
326 | | //XReferenceMarksSupplier |
327 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getReferenceMarks() override; |
328 | | |
329 | | // css::text::XTextFieldsSupplier |
330 | | virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getTextFields() override; |
331 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextFieldMasters() override; |
332 | | |
333 | | // css::text::XTextEmbeddedObjectsSupplier |
334 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getEmbeddedObjects() override; |
335 | | |
336 | | // css::text::XBookmarksSupplier |
337 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getBookmarks() override; |
338 | | |
339 | | // css::text::XTextSectionsSupplier |
340 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextSections() override; |
341 | | |
342 | | // css::text::XTextTablesSupplier |
343 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextTables() override; |
344 | | |
345 | | // css::text::XTextGraphicObjectsSupplier |
346 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getGraphicObjects() override; |
347 | | |
348 | | // css::text::XTextFramesSupplier |
349 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextFrames() override; |
350 | | |
351 | | //XStyleFamiliesSupplier |
352 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getStyleFamilies() override; |
353 | | |
354 | | //XAutoStylesSupplier |
355 | | virtual css::uno::Reference< css::style::XAutoStyles > SAL_CALL getAutoStyles( ) override; |
356 | | |
357 | | //XMultiServiceFactory |
358 | | virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString& ServiceSpecifier) override; |
359 | | virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString& ServiceSpecifier, |
360 | | const css::uno::Sequence< css::uno::Any >& Arguments) override; |
361 | | virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override; |
362 | | |
363 | | //XServiceInfo |
364 | | virtual OUString SAL_CALL getImplementationName() override; |
365 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
366 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
367 | | |
368 | | // css::drawing::XDrawPageSupplier |
369 | | virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getDrawPage() override; |
370 | | |
371 | | // css::drawing::XDrawPagesSupplier |
372 | | virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL getDrawPages() override; |
373 | | |
374 | | // css::text::XDocumentIndexesSupplier |
375 | | virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getDocumentIndexes() override; |
376 | | |
377 | | //XPropertySet |
378 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
379 | | virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; |
380 | | virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; |
381 | | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; |
382 | | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; |
383 | | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
384 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
385 | | |
386 | | //XPropertyState |
387 | | virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& rPropertyName ) override; |
388 | | virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& rPropertyNames ) override; |
389 | | virtual void SAL_CALL setPropertyToDefault( const OUString& rPropertyName ) override; |
390 | | virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& rPropertyName ) override; |
391 | | |
392 | | //XLinkTargetSupplier |
393 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks() override; |
394 | | |
395 | | //XRedlinesSupplier |
396 | | virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getRedlines( ) override; |
397 | | |
398 | | // css::util::XRefreshable |
399 | | virtual void SAL_CALL refresh() override; |
400 | | virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) override; |
401 | | virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) override; |
402 | | |
403 | | // css::util::XLinkUpdate, |
404 | | virtual void SAL_CALL updateLinks( ) override; |
405 | | |
406 | | // css::view::XRenderable |
407 | | virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override; |
408 | | 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 ) override; |
409 | | virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override; |
410 | | |
411 | | // css::xforms::XFormsSupplier |
412 | | virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getXForms( ) override; |
413 | | |
414 | | // css::document::XDocumentLanguages |
415 | | virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getDocumentLanguages( ::sal_Int16 nScriptTypes, ::sal_Int16 nCount ) override; |
416 | | |
417 | | // css::text::XFlatParagraphIteratorProvider: |
418 | | virtual css::uno::Reference< css::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) override; |
419 | | |
420 | | // css::util::XCloneable |
421 | | virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; |
422 | | |
423 | | // css::text::XPasteBroadcaster |
424 | | void SAL_CALL addPasteEventListener( |
425 | | const ::css::uno::Reference<::css::text::XPasteListener>& xListener) override; |
426 | | void SAL_CALL removePasteEventListener( |
427 | | const ::css::uno::Reference<::css::text::XPasteListener>& xListener) override; |
428 | | |
429 | | /// @see vcl::ITiledRenderable::paintTile(). |
430 | | virtual void paintTile( VirtualDevice &rDevice, |
431 | | int nOutputWidth, |
432 | | int nOutputHeight, |
433 | | int nTilePosX, |
434 | | int nTilePosY, |
435 | | tools::Long nTileWidth, |
436 | | tools::Long nTileHeight ) override; |
437 | | /// @see vcl::ITiledRenderable::getDocumentSize(). |
438 | | virtual Size getDocumentSize() override; |
439 | | /// @see vcl::ITiledRenderable::setPart(). |
440 | | virtual void setPart(int nPart, bool bAllowChangeFocus = true) override; |
441 | | /// @see vcl::ITiledRenderable::getParts(). |
442 | | virtual int getParts() override; |
443 | | /// @see vcl::ITiledRenderable::getPart(). |
444 | | virtual int getPart() override; |
445 | | /// @see vcl::ITiledRenderable::getPartName(). |
446 | | virtual OUString getPartName(int nPart) override; |
447 | | /// @see vcl::ITiledRenderable::getPartHash(). |
448 | | virtual OUString getPartHash(int nPart) override; |
449 | | /// @see vcl::ITiledRenderable::getDocWindow(). |
450 | | virtual VclPtr<vcl::Window> getDocWindow() override; |
451 | | /// @see vcl::ITiledRenderable::initializeForTiledRendering(). |
452 | | virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override; |
453 | | /// @see vcl::ITiledRenderable::postKeyEvent(). |
454 | | virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) override; |
455 | | /// @see vcl::ITiledRenderable::postMouseEvent(). |
456 | | virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override; |
457 | | /// @see vcl::ITiledRenderable::setTextSelection(). |
458 | | virtual void setTextSelection(int nType, int nX, int nY) override; |
459 | | /// @see vcl::ITiledRenderable::getSelection(). |
460 | | virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override; |
461 | | /// @see vcl::ITiledRenderable::setGraphicSelection(). |
462 | | virtual void setGraphicSelection(int nType, int nX, int nY) override; |
463 | | /// @see vcl::ITiledRenderable::resetSelection(). |
464 | | virtual void resetSelection() override; |
465 | | /// @see vcl::ITiledRenderable::getPartPageRectangles(). |
466 | | virtual OUString getPartPageRectangles() override; |
467 | | /// @see vcl::ITiledRenderable::setClipboard(). |
468 | | virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) override; |
469 | | /// @see vcl::ITiledRenderable::isMimeTypeSupported(). |
470 | | virtual bool isMimeTypeSupported() override; |
471 | | /// @see vcl::ITiledRenderable::setClientVisibleArea(). |
472 | | virtual void setClientVisibleArea(const tools::Rectangle& rRectangle) override; |
473 | | /// @see vcl::ITiledRenderable::setClientZoom. |
474 | | virtual void setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int nTileTwipWidth_, int nTileTwipHeight_) override; |
475 | | /// @see vcl::ITiledRenderable::getPointer(). |
476 | | virtual PointerStyle getPointer() override; |
477 | | /// @see vcl::ITiledRenderable::getTrackedChanges(). |
478 | | void getTrackedChanges(tools::JsonWriter&) override; |
479 | | /// @see vcl::ITiledRenderable::getTrackedChangeAuthors(). |
480 | | void getTrackedChangeAuthors(tools::JsonWriter& rJsonWriter) override; |
481 | | |
482 | | void getRulerState(tools::JsonWriter& rJsonWriter) override; |
483 | | /// @see vcl::ITiledRenderable::getPostIts(). |
484 | | void getPostIts(tools::JsonWriter& rJsonWriter) override; |
485 | | |
486 | | /// @see vcl::ITiledRenderable::executeFromFieldEvent(). |
487 | | virtual void executeFromFieldEvent(const StringMap& aArguments) override; |
488 | | |
489 | | /// @see vcl::ITiledRenderable::getSearchResultRectangles(). |
490 | | std::vector<basegfx::B2DRange> getSearchResultRectangles(const char* pPayload) override; |
491 | | |
492 | | /// @see vcl::ITiledRenderable::executeContentControlEvent(). |
493 | | void executeContentControlEvent(const StringMap& aArguments) override; |
494 | | |
495 | | /// @see vcl::ITiledRenderable::getCommandValues(). |
496 | | void getCommandValues(tools::JsonWriter& rJsonWriter, std::string_view rCommand) override; |
497 | | |
498 | | /// @see vcl::ITiledRenderable::getViewRenderState(). |
499 | | OString getViewRenderState(SfxViewShell* pViewShell = nullptr) override; |
500 | | |
501 | | /// @see vcl::ITiledRenderable::supportsCommand(). |
502 | | bool supportsCommand(std::u16string_view rCommand) override; |
503 | | |
504 | | /// @see vcl::ITiledRenderable::getEditMode(). |
505 | | int getEditMode() override; |
506 | | /// @see vcl::ITiledRenderable::setEditMode(). |
507 | | void setEditMode(int nEditMode) override; |
508 | | /// @see vcl::ITiledRenderable::getPartInfo(). |
509 | | OUString getPartInfo(int nPart) override; |
510 | | |
511 | | void Invalidate(); |
512 | | void Reactivate(SwDocShell* pNewDocShell); |
513 | | SwXDocumentPropertyHelper * GetPropertyHelper (); |
514 | | |
515 | | void InitNewDoc(); |
516 | | |
517 | | SwUnoCursor* CreateCursorForSearch(css::uno::Reference< css::text::XTextCursor > & xCursor); |
518 | | SwUnoCursor* FindAny(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc, |
519 | | css::uno::Reference< css::text::XTextCursor > & xCursor, bool bAll, |
520 | | sal_Int32& nResult, |
521 | | css::uno::Reference< css::uno::XInterface > const & xLastResult); |
522 | | |
523 | 388k | SwDocShell* GetDocShell() {return m_pDocShell;} |
524 | | |
525 | | rtl::Reference<SwXDocumentIndexes> getSwDocumentIndexes(); |
526 | | rtl::Reference<SwXTextTables> getSwTextTables(); |
527 | | rtl::Reference<SwFmDrawPage> getSwDrawPage(); |
528 | | rtl::Reference<SwXFootnotes> getSwXFootnotes(); |
529 | | rtl::Reference<SwXFootnotes> getSwXEndnotes(); |
530 | | rtl::Reference<SwXTextFieldMasters> getSwXTextFieldMasters(); |
531 | | rtl::Reference<SwXFieldMaster> createFieldMaster(std::u16string_view sServiceName); |
532 | | rtl::Reference<SwXTextField> createTextField(std::u16string_view sServiceName); |
533 | | rtl::Reference<SwXFieldmark> createFieldmark(std::u16string_view sServiceName); |
534 | | rtl::Reference<SwXDocumentIndex> createDocumentIndex(std::u16string_view sServiceName); |
535 | | /// returns either SwXDocumentIndex or SwXTextSection |
536 | | rtl::Reference<SwXSection> createSection(std::u16string_view rObjectType); |
537 | | rtl::Reference<SwXDocumentSettings> createDocumentSettings(); |
538 | | rtl::Reference<SwXTextDefaults> createTextDefaults(); |
539 | | rtl::Reference<SwXBookmark> createBookmark(); |
540 | | rtl::Reference<SwXFieldmark> createFieldmark(); |
541 | | rtl::Reference<SwXTextSection> createTextSection(); |
542 | | rtl::Reference<SwXTextField> createFieldAnnotation(); |
543 | | rtl::Reference<SwXLineBreak> createLineBreak(); |
544 | | rtl::Reference<SwXTextFrame> createTextFrame(); |
545 | | rtl::Reference<SwXTextGraphicObject> createTextGraphicObject(); |
546 | | rtl::Reference<SwXStyle> createNumberingStyle(); |
547 | | rtl::Reference<SwXStyle> createCharacterStyle(); |
548 | | rtl::Reference<SwXStyle> createParagraphStyle(); |
549 | | rtl::Reference<SwXPageStyle> createPageStyle(); |
550 | | rtl::Reference<SwXContentControl> createContentControl(); |
551 | | rtl::Reference<SwXFootnote> createFootnote(); |
552 | | rtl::Reference<SwXFootnote> createEndnote(); |
553 | | rtl::Reference<SwXTextEmbeddedObject> createTextEmbeddedObject(); |
554 | | rtl::Reference<SvXMLEmbeddedObjectHelper> createEmbeddedObjectResolver(); |
555 | | rtl::Reference< SwXStyleFamilies > getSwStyleFamilies(); |
556 | | const rtl::Reference< SwXRedlines > & getSwRedlines(); |
557 | | rtl::Reference<SwXTextFieldTypes> getSwTextFields(); |
558 | | rtl::Reference<SwXTextFrames> getSwTextFrames(); |
559 | | rtl::Reference<SwXTextSections> getSwTextSections(); |
560 | | rtl::Reference<SwXChapterNumbering> getSwChapterNumberingRules(); |
561 | | rtl::Reference< SwXLineNumberingProperties > getSwLineNumberingProperties(); |
562 | | rtl::Reference< SwXBookmarks > getSwBookmarks(); |
563 | | }; |
564 | | |
565 | | class SwXLinkTargetSupplier final : public cppu::WeakImplHelper |
566 | | < |
567 | | css::container::XNameAccess, |
568 | | css::lang::XServiceInfo |
569 | | > |
570 | | { |
571 | | SwXTextDocument* m_pxDoc; |
572 | | OUString m_sTables; |
573 | | OUString m_sFrames; |
574 | | OUString m_sGraphics; |
575 | | OUString m_sOLEs; |
576 | | OUString m_sSections; |
577 | | OUString m_sOutlines; |
578 | | OUString m_sBookmarks; |
579 | | OUString m_sDrawingObjects; |
580 | | |
581 | | public: |
582 | | SwXLinkTargetSupplier(SwXTextDocument& rxDoc); |
583 | | virtual ~SwXLinkTargetSupplier() override; |
584 | | |
585 | | //XNameAccess |
586 | | virtual css::uno::Any SAL_CALL getByName(const OUString& Name) override; |
587 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
588 | | virtual sal_Bool SAL_CALL hasByName(const OUString& Name) override; |
589 | | |
590 | | //XElementAccess |
591 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
592 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
593 | | |
594 | | //XServiceInfo |
595 | | virtual OUString SAL_CALL getImplementationName() override; |
596 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
597 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
598 | | |
599 | 0 | void Invalidate() {m_pxDoc = nullptr;} |
600 | | }; |
601 | | |
602 | | class SwXLinkNameAccessWrapper final : public cppu::WeakImplHelper |
603 | | < |
604 | | css::beans::XPropertySet, |
605 | | css::container::XNameAccess, |
606 | | css::lang::XServiceInfo, |
607 | | css::document::XLinkTargetSupplier |
608 | | > |
609 | | { |
610 | | css::uno::Reference< css::container::XNameAccess > m_xRealAccess; |
611 | | const SfxItemPropertySet* m_pPropSet; |
612 | | const OUString m_sLinkSuffix; |
613 | | const OUString m_sLinkDisplayName; |
614 | | SwXTextDocument* m_pxDoc; |
615 | | |
616 | | public: |
617 | | SwXLinkNameAccessWrapper(css::uno::Reference< css::container::XNameAccess > const & xAccess, |
618 | | OUString aLinkDisplayName, OUString sSuffix); |
619 | | SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc, |
620 | | OUString aLinkDisplayName, OUString sSuffix); |
621 | | virtual ~SwXLinkNameAccessWrapper() override; |
622 | | |
623 | | //XNameAccess |
624 | | virtual css::uno::Any SAL_CALL getByName(const OUString& Name) override; |
625 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
626 | | virtual sal_Bool SAL_CALL hasByName(const OUString& Name) override; |
627 | | |
628 | | //XElementAccess |
629 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
630 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
631 | | |
632 | | //XPropertySet |
633 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
634 | | virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; |
635 | | virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; |
636 | | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; |
637 | | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; |
638 | | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
639 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
640 | | |
641 | | //XLinkTargetSupplier |
642 | | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks() override; |
643 | | |
644 | | //XServiceInfo |
645 | | virtual OUString SAL_CALL getImplementationName() override; |
646 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
647 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
648 | | |
649 | | }; |
650 | | |
651 | | class SwXOutlineTarget final : public cppu::WeakImplHelper |
652 | | < |
653 | | css::beans::XPropertySet, |
654 | | css::lang::XServiceInfo |
655 | | > |
656 | | { |
657 | | const SfxItemPropertySet* m_pPropSet; |
658 | | OUString m_sOutlineText; |
659 | | OUString m_sActualText; |
660 | | const sal_Int32 m_nOutlineLevel; |
661 | | |
662 | | public: |
663 | | SwXOutlineTarget(OUString aOutlineText, OUString aActualText, |
664 | | const sal_Int32 nOutlineLevel); |
665 | | virtual ~SwXOutlineTarget() override; |
666 | | |
667 | | //XPropertySet |
668 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
669 | | virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; |
670 | | virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; |
671 | | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; |
672 | | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; |
673 | | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
674 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
675 | | |
676 | | //XServiceInfo |
677 | | virtual OUString SAL_CALL getImplementationName() override; |
678 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
679 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
680 | | }; |
681 | | |
682 | | class SwXDrawingObjectTarget final : public cppu::WeakImplHelper |
683 | | < |
684 | | css::beans::XPropertySet, |
685 | | css::lang::XServiceInfo |
686 | | > |
687 | | { |
688 | | const SfxItemPropertySet* m_pPropSet; |
689 | | OUString m_sDrawingObjectText; |
690 | | |
691 | | public: |
692 | | SwXDrawingObjectTarget(OUString aDrawingObjectText); |
693 | | virtual ~SwXDrawingObjectTarget() override; |
694 | | |
695 | | //XPropertySet |
696 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
697 | | virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; |
698 | | virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; |
699 | | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; |
700 | | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; |
701 | | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
702 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
703 | | |
704 | | //XServiceInfo |
705 | | virtual OUString SAL_CALL getImplementationName() override; |
706 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
707 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
708 | | }; |
709 | | |
710 | | |
711 | | enum class SwCreateDrawTable { |
712 | | Dash = 1, Gradient, Hatch, Bitmap, TransGradient, Marker, Defaults |
713 | | }; |
714 | | |
715 | | class SwXDocumentPropertyHelper final : public SvxUnoForbiddenCharsTable |
716 | | { |
717 | | css::uno::Reference < css::uno::XInterface > m_xDashTable; |
718 | | css::uno::Reference < css::uno::XInterface > m_xGradientTable; |
719 | | css::uno::Reference < css::uno::XInterface > m_xHatchTable; |
720 | | css::uno::Reference < css::uno::XInterface > m_xBitmapTable; |
721 | | css::uno::Reference < css::uno::XInterface > m_xTransGradientTable; |
722 | | css::uno::Reference < css::uno::XInterface > m_xMarkerTable; |
723 | | css::uno::Reference < css::uno::XInterface > m_xDrawDefaults; |
724 | | |
725 | | SwDoc* m_pDoc; |
726 | | public: |
727 | | SwXDocumentPropertyHelper(SwDoc& rDoc); |
728 | | virtual ~SwXDocumentPropertyHelper() override; |
729 | | css::uno::Reference<css::uno::XInterface> GetDrawTable(SwCreateDrawTable nWhich); |
730 | | void Invalidate(); |
731 | | |
732 | | virtual void onChange() override; |
733 | | }; |
734 | | |
735 | | // The class SwViewOptionAdjust_Impl is used to adjust the SwViewOption of |
736 | | // the current SwViewShell so that fields are not printed as commands and |
737 | | // hidden characters are always invisible. Hidden text and place holders |
738 | | // should be printed according to the current print options. |
739 | | // After printing the view options are restored |
740 | | class SwViewOptionAdjust_Impl |
741 | | { |
742 | | SwViewShell * m_pShell; |
743 | | SwViewOption m_aOldViewOptions; |
744 | | public: |
745 | | SwViewOptionAdjust_Impl( SwViewShell& rSh, const SwViewOption &rViewOptions ); |
746 | | ~SwViewOptionAdjust_Impl(); |
747 | | void AdjustViewOptions( SwPrintData const* const pPrtOptions, bool setShowPlaceHoldersInPDF ); |
748 | | bool checkShell( const SwViewShell& rCompare ) const |
749 | 0 | { return &rCompare == m_pShell; } |
750 | 0 | void DontTouchThatViewShellItSmellsFunny() { m_pShell = nullptr; } |
751 | | }; |
752 | | |
753 | | #endif |
754 | | |
755 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |