1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_INC_UNOTXDOC_HXX
20 #define INCLUDED_SW_INC_UNOTXDOC_HXX
23 #include <sfx2/sfxbasemodel.hxx>
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/tiledrendering/XTiledRenderable.hpp>
66 #include <com/sun/star/text/XPasteBroadcaster.hpp>
68 #include "unobaseclass.hxx"
69 #include "viewopt.hxx"
75 class UnoActionContext
;
79 class SwXDocumentPropertyHelper
;
82 class SwPrintUIOptions
;
86 class SfxItemPropertySet
;
87 namespace com::sun::star::container
{ class XNameContainer
; }
88 namespace com::sun::star::frame
{ class XController
; }
89 namespace com::sun::star::lang
{ struct Locale
; }
90 namespace com::sun::star::uno
{ class XAggregation
; }
92 namespace com::sun::star::util
{ class XReplaceDescriptor
; }
94 typedef cppu::ImplInheritanceHelper
97 css::text::XTextDocument
,
98 css::text::XLineNumberingProperties
,
99 css::text::XChapterNumberingSupplier
,
100 css::text::XNumberingRulesSupplier
,
101 css::text::XFootnotesSupplier
,
102 css::text::XEndnotesSupplier
,
103 css::text::XContentControlsSupplier
,
104 css::util::XReplaceable
,
105 css::text::XPagePrintable
,
106 css::text::XReferenceMarksSupplier
,
107 css::text::XTextTablesSupplier
,
108 css::text::XTextFramesSupplier
,
109 css::text::XBookmarksSupplier
,
110 css::text::XTextSectionsSupplier
,
111 css::text::XTextGraphicObjectsSupplier
,
112 css::text::XTextEmbeddedObjectsSupplier
,
113 css::text::XTextFieldsSupplier
,
114 css::style::XStyleFamiliesSupplier
,
115 css::style::XAutoStylesSupplier
,
116 css::lang::XServiceInfo
,
117 css::drawing::XDrawPageSupplier
,
118 css::drawing::XDrawPagesSupplier
,
119 css::text::XDocumentIndexesSupplier
,
120 css::beans::XPropertySet
,
121 css::beans::XPropertyState
,
122 css::document::XLinkTargetSupplier
,
123 css::document::XRedlinesSupplier
,
124 css::util::XRefreshable
,
125 css::util::XLinkUpdate
,
126 css::view::XRenderable
,
127 css::xforms::XFormsSupplier
,
128 css::text::XFlatParagraphIteratorProvider
,
129 css::document::XDocumentLanguages
,
130 css::util::XCloneable
,
131 css::text::XPasteBroadcaster
133 SwXTextDocumentBaseClass
;
135 class SW_DLLPUBLIC SwXTextDocument final
: public SwXTextDocumentBaseClass
,
136 public SvxFmMSFactory
,
137 public vcl::ITiledRenderable
,
138 public css::tiledrendering::XTiledRenderable
142 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
144 std::deque
<std::unique_ptr
<UnoActionContext
, o3tl::default_delete
<UnoActionContext
>>> maActionArr
;
146 const SfxItemPropertySet
* m_pPropSet
;
148 SwDocShell
* m_pDocShell
;
151 rtl::Reference
<SwFmDrawPage
> m_xDrawPage
;
153 rtl::Reference
<SwXBodyText
> m_xBodyText
;
154 css::uno::Reference
< css::uno::XAggregation
> m_xNumFormatAgg
;
156 css::uno::Reference
< css::container::XIndexAccess
> mxXNumberingRules
;
157 css::uno::Reference
< css::container::XIndexAccess
> mxXFootnotes
;
158 css::uno::Reference
< css::beans::XPropertySet
> mxXFootnoteSettings
;
159 css::uno::Reference
< css::container::XIndexAccess
> mxXEndnotes
;
160 css::uno::Reference
< css::beans::XPropertySet
> mxXEndnoteSettings
;
161 css::uno::Reference
< css::container::XIndexAccess
> mxXContentControls
;
162 css::uno::Reference
< css::container::XNameAccess
> mxXReferenceMarks
;
163 css::uno::Reference
< css::container::XEnumerationAccess
> mxXTextFieldTypes
;
164 css::uno::Reference
< css::container::XNameAccess
> mxXTextFieldMasters
;
165 css::uno::Reference
< css::container::XNameAccess
> mxXTextSections
;
166 css::uno::Reference
< css::container::XNameAccess
> mxXBookmarks
;
167 css::uno::Reference
< css::container::XNameAccess
> mxXTextTables
;
168 css::uno::Reference
< css::container::XNameAccess
> mxXTextFrames
;
169 css::uno::Reference
< css::container::XNameAccess
> mxXGraphicObjects
;
170 css::uno::Reference
< css::container::XNameAccess
> mxXEmbeddedObjects
;
171 css::uno::Reference
< css::container::XNameAccess
> mxXStyleFamilies
;
172 mutable css::uno::Reference
< css::style::XAutoStyles
> mxXAutoStyles
;
173 css::uno::Reference
< css::container::XIndexReplace
> mxXChapterNumbering
;
174 css::uno::Reference
< css::container::XIndexAccess
> mxXDocumentIndexes
;
176 css::uno::Reference
< css::beans::XPropertySet
> mxXLineNumberingProperties
;
177 css::uno::Reference
< css::container::XNameAccess
> mxLinkTargetSupplier
;
178 css::uno::Reference
< css::container::XEnumerationAccess
> mxXRedlines
;
180 //temporary frame to enable PDF export if no valid view is available
181 SfxViewFrame
* m_pHiddenViewFrame
;
182 rtl::Reference
<SwXDocumentPropertyHelper
> mxPropertyHelper
;
184 std::unique_ptr
<SwPrintUIOptions
> m_pPrintUIOptions
;
185 std::unique_ptr
<SwRenderData
> m_pRenderData
;
187 void GetNumberFormatter();
189 css::uno::Reference
<css::uno::XInterface
> create(
190 OUString
const & rServiceName
,
191 css::uno::Sequence
<css::uno::Any
> const * arguments
);
193 // used for XRenderable implementation
194 SfxViewShell
* GuessViewShell( /* out */ bool &rbIsSwSrcView
, const css::uno::Reference
< css::frame::XController
>& rController
= css::uno::Reference
< css::frame::XController
>() );
195 SwDoc
* GetRenderDoc( SfxViewShell
*&rpView
, const css::uno::Any
& rSelection
, bool bIsPDFExport
);
196 SfxViewShell
* GetRenderView( bool &rbIsSwSrcView
, const css::uno::Sequence
< css::beans::PropertyValue
>& rxOptions
, bool bIsPDFExport
);
200 // boolean for XPagePrintable
201 // set in XPagePrintable::printPages(..) to indicate that the PagePrintSettings
202 // has to be applied in XRenderable::getRenderer(..) through which the printing
204 bool m_bApplyPagePrintSettingsFromXPagePrintable
;
206 using SfxBaseModel::addEventListener
;
207 using SfxBaseModel::removeEventListener
;
209 /** abstract SdrModel provider */
210 virtual SdrModel
& getSdrModelFromUnoModel() const override
;
212 virtual ~SwXTextDocument() override
;
214 SwXTextDocument(SwDocShell
* pShell
);
216 void NotifyRefreshListeners();
217 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& aType
) override
;
218 virtual void SAL_CALL
acquire( ) noexcept override
;
219 virtual void SAL_CALL
release( ) noexcept override
;
222 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
224 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
227 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
230 virtual css::uno::Reference
< css::text::XText
> SAL_CALL
getText() override
;
231 rtl::Reference
< SwXBodyText
> getBodyText();
232 virtual void SAL_CALL
reformat() override
;
235 virtual sal_Bool SAL_CALL
attachResource( const OUString
& aURL
, const css::uno::Sequence
< css::beans::PropertyValue
>& aArgs
) override
;
236 virtual OUString SAL_CALL
getURL( ) override
;
237 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getArgs( ) override
;
238 virtual void SAL_CALL
connectController( const css::uno::Reference
< css::frame::XController
>& xController
) override
;
239 virtual void SAL_CALL
disconnectController( const css::uno::Reference
< css::frame::XController
>& xController
) override
;
240 virtual void SAL_CALL
lockControllers( ) override
;
241 virtual void SAL_CALL
unlockControllers( ) override
;
242 virtual sal_Bool SAL_CALL
hasControllersLocked( ) override
;
243 virtual css::uno::Reference
< css::frame::XController
> SAL_CALL
getCurrentController( ) override
;
244 virtual void SAL_CALL
setCurrentController( const css::uno::Reference
< css::frame::XController
>& xController
) override
;
245 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getCurrentSelection( ) override
;
248 virtual void SAL_CALL
dispose() override
;
249 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
) override
;
250 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
) override
;
253 virtual void SAL_CALL
close( sal_Bool bDeliverOwnership
) override
;
255 //XLineNumberingProperties
256 virtual css::uno::Reference
< css::beans::XPropertySet
> SAL_CALL
getLineNumberingProperties() override
;
258 //XChapterNumberingSupplier
259 virtual css::uno::Reference
< css::container::XIndexReplace
> SAL_CALL
getChapterNumberingRules() override
;
261 //XNumberingRulesSupplier
262 virtual css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getNumberingRules() override
;
265 virtual css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getFootnotes() override
;
266 virtual css::uno::Reference
< css::beans::XPropertySet
> SAL_CALL
getFootnoteSettings() override
;
269 virtual css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getEndnotes() override
;
270 virtual css::uno::Reference
< css::beans::XPropertySet
> SAL_CALL
getEndnoteSettings() override
;
272 // XContentControlsSupplier
273 css::uno::Reference
<css::container::XIndexAccess
> SAL_CALL
getContentControls() override
;
276 virtual css::uno::Reference
< css::util::XReplaceDescriptor
> SAL_CALL
createReplaceDescriptor() override
;
277 virtual sal_Int32 SAL_CALL
replaceAll(const css::uno::Reference
< css::util::XSearchDescriptor
> & xDesc
) override
;
280 virtual css::uno::Reference
< css::util::XSearchDescriptor
> SAL_CALL
createSearchDescriptor() override
;
281 virtual css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
findAll(const css::uno::Reference
< css::util::XSearchDescriptor
> & xDesc
) override
;
282 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
findFirst(const css::uno::Reference
< css::util::XSearchDescriptor
> & xDesc
) override
;
283 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
;
286 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
getPagePrintSettings() override
;
287 virtual void SAL_CALL
setPagePrintSettings(const css::uno::Sequence
< css::beans::PropertyValue
>& aSettings
) override
;
288 virtual void SAL_CALL
printPages(const css::uno::Sequence
< css::beans::PropertyValue
>& xOptions
) override
;
290 //XReferenceMarksSupplier
291 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getReferenceMarks() override
;
293 // css::text::XTextFieldsSupplier
294 virtual css::uno::Reference
< css::container::XEnumerationAccess
> SAL_CALL
getTextFields() override
;
295 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getTextFieldMasters() override
;
297 // css::text::XTextEmbeddedObjectsSupplier
298 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getEmbeddedObjects() override
;
300 // css::text::XBookmarksSupplier
301 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getBookmarks() override
;
303 // css::text::XTextSectionsSupplier
304 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getTextSections() override
;
306 // css::text::XTextTablesSupplier
307 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getTextTables() override
;
309 // css::text::XTextGraphicObjectsSupplier
310 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getGraphicObjects() override
;
312 // css::text::XTextFramesSupplier
313 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getTextFrames() override
;
315 //XStyleFamiliesSupplier
316 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getStyleFamilies() override
;
318 //XAutoStylesSupplier
319 virtual css::uno::Reference
< css::style::XAutoStyles
> SAL_CALL
getAutoStyles( ) override
;
321 //XMultiServiceFactory
322 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
createInstance(const OUString
& ServiceSpecifier
) override
;
323 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
createInstanceWithArguments(const OUString
& ServiceSpecifier
,
324 const css::uno::Sequence
< css::uno::Any
>& Arguments
) override
;
325 virtual css::uno::Sequence
< OUString
> SAL_CALL
getAvailableServiceNames() override
;
328 virtual OUString SAL_CALL
getImplementationName() override
;
329 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
330 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
332 // css::drawing::XDrawPageSupplier
333 virtual css::uno::Reference
< css::drawing::XDrawPage
> SAL_CALL
getDrawPage() override
;
335 // css::drawing::XDrawPagesSupplier
336 virtual css::uno::Reference
< css::drawing::XDrawPages
> SAL_CALL
getDrawPages() override
;
338 // css::text::XDocumentIndexesSupplier
339 virtual css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getDocumentIndexes() override
;
342 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
343 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
344 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
345 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
346 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
347 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
348 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
351 virtual css::beans::PropertyState SAL_CALL
getPropertyState( const OUString
& rPropertyName
) override
;
352 virtual css::uno::Sequence
< css::beans::PropertyState
> SAL_CALL
getPropertyStates( const css::uno::Sequence
< OUString
>& rPropertyNames
) override
;
353 virtual void SAL_CALL
setPropertyToDefault( const OUString
& rPropertyName
) override
;
354 virtual css::uno::Any SAL_CALL
getPropertyDefault( const OUString
& rPropertyName
) override
;
356 //XLinkTargetSupplier
357 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getLinks() override
;
360 virtual css::uno::Reference
< css::container::XEnumerationAccess
> SAL_CALL
getRedlines( ) override
;
362 // css::util::XRefreshable
363 virtual void SAL_CALL
refresh() override
;
364 virtual void SAL_CALL
addRefreshListener(const css::uno::Reference
< css::util::XRefreshListener
> & l
) override
;
365 virtual void SAL_CALL
removeRefreshListener(const css::uno::Reference
< css::util::XRefreshListener
> & l
) override
;
367 // css::util::XLinkUpdate,
368 virtual void SAL_CALL
updateLinks( ) override
;
370 // css::view::XRenderable
371 virtual sal_Int32 SAL_CALL
getRendererCount( const css::uno::Any
& aSelection
, const css::uno::Sequence
< css::beans::PropertyValue
>& xOptions
) override
;
372 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
;
373 virtual void SAL_CALL
render( sal_Int32 nRenderer
, const css::uno::Any
& aSelection
, const css::uno::Sequence
< css::beans::PropertyValue
>& xOptions
) override
;
375 // css::xforms::XFormsSupplier
376 virtual css::uno::Reference
< css::container::XNameContainer
> SAL_CALL
getXForms( ) override
;
378 // css::document::XDocumentLanguages
379 virtual css::uno::Sequence
< css::lang::Locale
> SAL_CALL
getDocumentLanguages( ::sal_Int16 nScriptTypes
, ::sal_Int16 nCount
) override
;
381 // css::text::XFlatParagraphIteratorProvider:
382 virtual css::uno::Reference
< css::text::XFlatParagraphIterator
> SAL_CALL
getFlatParagraphIterator(::sal_Int32 nTextMarkupType
, sal_Bool bAutomatic
) override
;
384 // css::util::XCloneable
385 virtual css::uno::Reference
< css::util::XCloneable
> SAL_CALL
createClone( ) override
;
387 // css::text::XPasteBroadcaster
388 void SAL_CALL
addPasteEventListener(
389 const ::css::uno::Reference
<::css::text::XPasteListener
>& xListener
) override
;
390 void SAL_CALL
removePasteEventListener(
391 const ::css::uno::Reference
<::css::text::XPasteListener
>& xListener
) override
;
393 /// @see vcl::ITiledRenderable::paintTile().
394 virtual void paintTile( VirtualDevice
&rDevice
,
399 tools::Long nTileWidth
,
400 tools::Long nTileHeight
) override
;
401 /// @see vcl::ITiledRenderable::getDocumentSize().
402 virtual Size
getDocumentSize() override
;
403 /// @see vcl::ITiledRenderable::setPart().
404 virtual void setPart(int nPart
, bool bAllowChangeFocus
= true) override
;
405 /// @see vcl::ITiledRenderable::getParts().
406 virtual int getParts() override
;
407 /// @see vcl::ITiledRenderable::getPart().
408 virtual int getPart() override
;
409 /// @see vcl::ITiledRenderable::getPartName().
410 virtual OUString
getPartName(int nPart
) override
;
411 /// @see vcl::ITiledRenderable::getPartHash().
412 virtual OUString
getPartHash(int nPart
) override
;
413 /// @see vcl::ITiledRenderable::getDocWindow().
414 virtual VclPtr
<vcl::Window
> getDocWindow() override
;
415 /// @see vcl::ITiledRenderable::initializeForTiledRendering().
416 virtual void initializeForTiledRendering(const css::uno::Sequence
<css::beans::PropertyValue
>& rArguments
) override
;
417 /// @see vcl::ITiledRenderable::postKeyEvent().
418 virtual void postKeyEvent(int nType
, int nCharCode
, int nKeyCode
) override
;
419 /// @see vcl::ITiledRenderable::postMouseEvent().
420 virtual void postMouseEvent(int nType
, int nX
, int nY
, int nCount
, int nButtons
, int nModifier
) override
;
421 /// @see vcl::ITiledRenderable::setTextSelection().
422 virtual void setTextSelection(int nType
, int nX
, int nY
) override
;
423 /// @see vcl::ITiledRenderable::getSelection().
424 virtual css::uno::Reference
<css::datatransfer::XTransferable
> getSelection() override
;
425 /// @see vcl::ITiledRenderable::setGraphicSelection().
426 virtual void setGraphicSelection(int nType
, int nX
, int nY
) override
;
427 /// @see vcl::ITiledRenderable::resetSelection().
428 virtual void resetSelection() override
;
429 /// @see vcl::ITiledRenderable::getPartPageRectangles().
430 virtual OUString
getPartPageRectangles() override
;
431 /// @see vcl::ITiledRenderable::setClipboard().
432 virtual void setClipboard(const css::uno::Reference
<css::datatransfer::clipboard::XClipboard
>& xClipboard
) override
;
433 /// @see vcl::ITiledRenderable::isMimeTypeSupported().
434 virtual bool isMimeTypeSupported() override
;
435 /// @see vcl::ITiledRenderable::setClientVisibleArea().
436 virtual void setClientVisibleArea(const tools::Rectangle
& rRectangle
) override
;
437 /// @see vcl::ITiledRenderable::setClientZoom.
438 virtual void setClientZoom(int nTilePixelWidth_
, int nTilePixelHeight_
, int nTileTwipWidth_
, int nTileTwipHeight_
) override
;
439 /// @see vcl::ITiledRenderable::getPointer().
440 virtual PointerStyle
getPointer() override
;
441 /// @see vcl::ITiledRenderable::getTrackedChanges().
442 void getTrackedChanges(tools::JsonWriter
&) override
;
443 /// @see vcl::ITiledRenderable::getTrackedChangeAuthors().
444 void getTrackedChangeAuthors(tools::JsonWriter
& rJsonWriter
) override
;
446 void getRulerState(tools::JsonWriter
& rJsonWriter
) override
;
447 /// @see vcl::ITiledRenderable::getPostIts().
448 void getPostIts(tools::JsonWriter
& rJsonWriter
) override
;
450 /// @see vcl::ITiledRenderable::executeFromFieldEvent().
451 virtual void executeFromFieldEvent(const StringMap
& aArguments
) override
;
453 /// @see vcl::ITiledRenderable::getSearchResultRectangles().
454 std::vector
<basegfx::B2DRange
> getSearchResultRectangles(const char* pPayload
) override
;
456 // css::tiledrendering::XTiledRenderable
457 virtual void SAL_CALL
paintTile( const ::css::uno::Any
& Parent
, ::sal_Int32 nOutputWidth
, ::sal_Int32 nOutputHeight
, ::sal_Int32 nTilePosX
, ::sal_Int32 nTilePosY
, ::sal_Int32 nTileWidth
, ::sal_Int32 nTileHeight
) override
;
459 /// @see vcl::ITiledRenderable::executeContentControlEvent().
460 void executeContentControlEvent(const StringMap
& aArguments
) override
;
462 /// @see vcl::ITiledRenderable::getCommandValues().
463 void getCommandValues(tools::JsonWriter
& rJsonWriter
, std::string_view rCommand
) override
;
465 /// @see vcl::ITiledRenderable::getViewRenderState().
466 OString
getViewRenderState() override
;
468 /// @see vcl::ITiledRenderable::supportsCommand().
469 bool supportsCommand(std::u16string_view rCommand
) override
;
472 void Reactivate(SwDocShell
* pNewDocShell
);
473 SwXDocumentPropertyHelper
* GetPropertyHelper ();
474 bool IsValid() const {return m_bObjectValid
;}
478 SwUnoCursor
* CreateCursorForSearch(css::uno::Reference
< css::text::XTextCursor
> & xCursor
);
479 SwUnoCursor
* FindAny(const css::uno::Reference
< css::util::XSearchDescriptor
> & xDesc
,
480 css::uno::Reference
< css::text::XTextCursor
> & xCursor
, bool bAll
,
482 css::uno::Reference
< css::uno::XInterface
> const & xLastResult
);
484 SwDocShell
* GetDocShell() {return m_pDocShell
;}
487 class SwXLinkTargetSupplier final
: public cppu::WeakImplHelper
489 css::container::XNameAccess
,
490 css::lang::XServiceInfo
493 SwXTextDocument
* m_pxDoc
;
496 OUString m_sGraphics
;
498 OUString m_sSections
;
499 OUString m_sOutlines
;
500 OUString m_sBookmarks
;
501 OUString m_sDrawingObjects
;
504 SwXLinkTargetSupplier(SwXTextDocument
& rxDoc
);
505 virtual ~SwXLinkTargetSupplier() override
;
508 virtual css::uno::Any SAL_CALL
getByName(const OUString
& Name
) override
;
509 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames() override
;
510 virtual sal_Bool SAL_CALL
hasByName(const OUString
& Name
) override
;
513 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
514 virtual sal_Bool SAL_CALL
hasElements( ) override
;
517 virtual OUString SAL_CALL
getImplementationName() override
;
518 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
519 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
521 void Invalidate() {m_pxDoc
= nullptr;}
524 class SwXLinkNameAccessWrapper final
: public cppu::WeakImplHelper
526 css::beans::XPropertySet
,
527 css::container::XNameAccess
,
528 css::lang::XServiceInfo
,
529 css::document::XLinkTargetSupplier
532 css::uno::Reference
< css::container::XNameAccess
> m_xRealAccess
;
533 const SfxItemPropertySet
* m_pPropSet
;
534 const OUString m_sLinkSuffix
;
535 const OUString m_sLinkDisplayName
;
536 SwXTextDocument
* m_pxDoc
;
539 SwXLinkNameAccessWrapper(css::uno::Reference
< css::container::XNameAccess
> const & xAccess
,
540 OUString aLinkDisplayName
, OUString sSuffix
);
541 SwXLinkNameAccessWrapper(SwXTextDocument
& rxDoc
,
542 OUString aLinkDisplayName
, OUString sSuffix
);
543 virtual ~SwXLinkNameAccessWrapper() override
;
546 virtual css::uno::Any SAL_CALL
getByName(const OUString
& Name
) override
;
547 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames() override
;
548 virtual sal_Bool SAL_CALL
hasByName(const OUString
& Name
) override
;
551 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
552 virtual sal_Bool SAL_CALL
hasElements( ) override
;
555 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
556 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
557 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
558 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
559 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
560 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
561 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
563 //XLinkTargetSupplier
564 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getLinks() override
;
567 virtual OUString SAL_CALL
getImplementationName() override
;
568 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
569 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
573 class SwXOutlineTarget final
: public cppu::WeakImplHelper
575 css::beans::XPropertySet
,
576 css::lang::XServiceInfo
579 const SfxItemPropertySet
* m_pPropSet
;
580 OUString m_sOutlineText
;
581 OUString m_sActualText
;
582 const sal_Int32 m_nOutlineLevel
;
585 SwXOutlineTarget(OUString aOutlineText
, OUString aActualText
,
586 const sal_Int32 nOutlineLevel
);
587 virtual ~SwXOutlineTarget() override
;
590 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
591 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
592 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
593 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
594 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
595 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
596 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
599 virtual OUString SAL_CALL
getImplementationName() override
;
600 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
601 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
604 class SwXDrawingObjectTarget final
: public cppu::WeakImplHelper
606 css::beans::XPropertySet
,
607 css::lang::XServiceInfo
610 const SfxItemPropertySet
* m_pPropSet
;
611 OUString m_sDrawingObjectText
;
614 SwXDrawingObjectTarget(OUString aDrawingObjectText
);
615 virtual ~SwXDrawingObjectTarget() override
;
618 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
619 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
620 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
621 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
622 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
623 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
624 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
627 virtual OUString SAL_CALL
getImplementationName() override
;
628 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
629 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
633 enum class SwCreateDrawTable
{
634 Dash
= 1, Gradient
, Hatch
, Bitmap
, TransGradient
, Marker
, Defaults
637 class SwXDocumentPropertyHelper final
: public SvxUnoForbiddenCharsTable
639 css::uno::Reference
< css::uno::XInterface
> m_xDashTable
;
640 css::uno::Reference
< css::uno::XInterface
> m_xGradientTable
;
641 css::uno::Reference
< css::uno::XInterface
> m_xHatchTable
;
642 css::uno::Reference
< css::uno::XInterface
> m_xBitmapTable
;
643 css::uno::Reference
< css::uno::XInterface
> m_xTransGradientTable
;
644 css::uno::Reference
< css::uno::XInterface
> m_xMarkerTable
;
645 css::uno::Reference
< css::uno::XInterface
> m_xDrawDefaults
;
649 SwXDocumentPropertyHelper(SwDoc
& rDoc
);
650 virtual ~SwXDocumentPropertyHelper() override
;
651 css::uno::Reference
<css::uno::XInterface
> GetDrawTable(SwCreateDrawTable nWhich
);
654 virtual void onChange() override
;
657 // The class SwViewOptionAdjust_Impl is used to adjust the SwViewOption of
658 // the current SwViewShell so that fields are not printed as commands and
659 // hidden characters are always invisible. Hidden text and place holders
660 // should be printed according to the current print options.
661 // After printing the view options are restored
662 class SwViewOptionAdjust_Impl
664 SwViewShell
* m_pShell
;
665 SwViewOption m_aOldViewOptions
;
667 SwViewOptionAdjust_Impl( SwViewShell
& rSh
, const SwViewOption
&rViewOptions
);
668 ~SwViewOptionAdjust_Impl();
669 void AdjustViewOptions( SwPrintData
const* const pPrtOptions
, bool setShowPlaceHoldersInPDF
);
670 bool checkShell( const SwViewShell
& rCompare
) const
671 { return &rCompare
== m_pShell
; }
672 void DontTouchThatViewShellItSmellsFunny() { m_pShell
= nullptr; }
677 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */