| 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 | #pragma once |
| 20 | |
| 21 | #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> |
| 22 | #include <com/sun/star/document/XLinkTargetSupplier.hpp> |
| 23 | #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> |
| 24 | #include <com/sun/star/drawing/XDrawPages2.hpp> |
| 25 | #include <com/sun/star/drawing/XDrawPageDuplicator.hpp> |
| 26 | #include <com/sun/star/drawing/XLayerSupplier.hpp> |
| 27 | #include <com/sun/star/drawing/XMasterPagesSupplier.hpp> |
| 28 | #include <com/sun/star/presentation/XPresentationSupplier.hpp> |
| 29 | #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp> |
| 30 | #include <com/sun/star/lang/XServiceInfo.hpp> |
| 31 | #include <com/sun/star/drawing/XDrawPages.hpp> |
| 32 | #include <com/sun/star/ucb/XAnyCompareFactory.hpp> |
| 33 | #include <com/sun/star/presentation/XHandoutMasterSupplier.hpp> |
| 34 | #include <com/sun/star/view/XRenderable.hpp> |
| 35 | #include <com/sun/star/beans/XPropertySet.hpp> |
| 36 | |
| 37 | #include <rtl/ref.hxx> |
| 38 | #include <unotools/weakref.hxx> |
| 39 | |
| 40 | #include <sfx2/sfxbasemodel.hxx> |
| 41 | #include <svx/fmdmod.hxx> |
| 42 | |
| 43 | #include <vcl/ITiledRenderable.hxx> |
| 44 | |
| 45 | #include <comphelper/servicehelper.hxx> |
| 46 | #include <cppuhelper/implbase.hxx> |
| 47 | #include <cppuhelper/weakref.hxx> |
| 48 | #include "sddllapi.h" |
| 49 | |
| 50 | namespace com::sun::star::i18n { class XForbiddenCharacters; } |
| 51 | |
| 52 | class SdDrawDocument; |
| 53 | class SdPage; |
| 54 | class SvxItemPropertySet; |
| 55 | class SdUnoForbiddenCharsTable; |
| 56 | class SdDrawPagesAccess; |
| 57 | class SdMasterPagesAccess; |
| 58 | class SdLayerManager; |
| 59 | class SdXCustomPresentationAccess; |
| 60 | class SdDocLinkTargets; |
| 61 | class SdGenericDrawPage; |
| 62 | |
| 63 | namespace sd { |
| 64 | class DrawDocShell; |
| 65 | class DrawViewShell; |
| 66 | class SlideshowLayerRenderer; |
| 67 | } |
| 68 | |
| 69 | extern OUString getPageApiName( SdPage const * pPage ); |
| 70 | extern OUString getPageApiNameFromUiName( const OUString& rUIName ); |
| 71 | |
| 72 | class SAL_DLLPUBLIC_RTTI SdXImpressDocument final : public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other |
| 73 | public SvxFmMSFactory, |
| 74 | public css::drawing::XDrawPageDuplicator, |
| 75 | public css::drawing::XLayerSupplier, |
| 76 | public css::drawing::XMasterPagesSupplier, |
| 77 | public css::drawing::XDrawPagesSupplier, |
| 78 | public css::presentation::XPresentationSupplier, |
| 79 | public css::presentation::XCustomPresentationSupplier, |
| 80 | public css::document::XLinkTargetSupplier, |
| 81 | public css::beans::XPropertySet, |
| 82 | public css::style::XStyleFamiliesSupplier, |
| 83 | public css::lang::XServiceInfo, |
| 84 | public css::ucb::XAnyCompareFactory, |
| 85 | public css::presentation::XHandoutMasterSupplier, |
| 86 | public css::view::XRenderable, |
| 87 | public vcl::ITiledRenderable |
| 88 | { |
| 89 | friend class SdDrawPagesAccess; |
| 90 | friend class SdMasterPagesAccess; |
| 91 | friend class SdLayerManager; |
| 92 | |
| 93 | private: |
| 94 | ::sd::DrawDocShell* mpDocShell; |
| 95 | SdDrawDocument* mpDoc; |
| 96 | bool mbDisposed; |
| 97 | |
| 98 | std::unique_ptr<sd::SlideshowLayerRenderer> mpSlideshowLayerRenderer; |
| 99 | |
| 100 | css::uno::Reference<css::uno::XInterface> create( |
| 101 | OUString const & aServiceSpecifier, OUString const & referer); |
| 102 | |
| 103 | /// @throws css::uno::RuntimeException |
| 104 | SdPage* InsertSdPage( sal_uInt16 nPage, bool bDuplicate ); |
| 105 | |
| 106 | const bool mbImpressDoc; |
| 107 | bool mbClipBoard; |
| 108 | |
| 109 | unotools::WeakReference< SdDrawPagesAccess > mxDrawPagesAccess; |
| 110 | unotools::WeakReference< SdMasterPagesAccess > mxMasterPagesAccess; |
| 111 | unotools::WeakReference< SdLayerManager > mxLayerManager; |
| 112 | unotools::WeakReference< SdXCustomPresentationAccess > mxCustomPresentationAccess; |
| 113 | unotools::WeakReference< SdUnoForbiddenCharsTable > mxForbiddenCharacters; |
| 114 | unotools::WeakReference< SdDocLinkTargets > mxLinks; |
| 115 | |
| 116 | css::uno::Reference< css::uno::XInterface > mxDashTable; |
| 117 | css::uno::Reference< css::uno::XInterface > mxGradientTable; |
| 118 | css::uno::Reference< css::uno::XInterface > mxHatchTable; |
| 119 | css::uno::Reference< css::uno::XInterface > mxBitmapTable; |
| 120 | css::uno::Reference< css::uno::XInterface > mxTransGradientTable; |
| 121 | css::uno::Reference< css::uno::XInterface > mxMarkerTable; |
| 122 | css::uno::Reference< css::uno::XInterface > mxDrawingPool; |
| 123 | |
| 124 | const SvxItemPropertySet* mpPropSet; |
| 125 | |
| 126 | css::uno::Sequence< css::uno::Type > maTypeSequence; |
| 127 | |
| 128 | OUString maBuildId; |
| 129 | |
| 130 | bool mbPaintTextEdit; |
| 131 | |
| 132 | void initializeDocument(); |
| 133 | |
| 134 | SAL_RET_MAYBENULL sd::DrawViewShell* GetViewShell(); |
| 135 | |
| 136 | /** abstract SdrModel provider */ |
| 137 | virtual SdrModel& getSdrModelFromUnoModel() const override; |
| 138 | |
| 139 | public: |
| 140 | SdXImpressDocument(::sd::DrawDocShell* pShell, bool bClipBoard); |
| 141 | SdXImpressDocument(SdDrawDocument* pDoc, bool bClipBoard); |
| 142 | virtual ~SdXImpressDocument() noexcept override; |
| 143 | |
| 144 | static rtl::Reference< SdXImpressDocument > GetModel( SdDrawDocument const & rDoc ); |
| 145 | |
| 146 | // internal |
| 147 | bool operator==( const SdXImpressDocument& rModel ) const { return mpDoc == rModel.mpDoc; } |
| 148 | bool operator!=( const SdXImpressDocument& rModel ) const { return mpDoc != rModel.mpDoc; } |
| 149 | |
| 150 | ::sd::DrawDocShell* GetDocShell() const { return mpDocShell; } |
| 151 | SdDrawDocument* GetDoc() const { return mpDoc; } |
| 152 | bool IsImpressDocument() const { return mbImpressDoc; } |
| 153 | |
| 154 | void SetModified() noexcept; |
| 155 | |
| 156 | css::uno::Reference< css::i18n::XForbiddenCharacters > getForbiddenCharsTable(); |
| 157 | |
| 158 | // SfxListener |
| 159 | virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; |
| 160 | |
| 161 | UNO3_GETIMPLEMENTATION_DECL(SdXImpressDocument) |
| 162 | |
| 163 | // XInterface |
| 164 | virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; |
| 165 | SD_DLLPUBLIC virtual void SAL_CALL acquire() noexcept override; |
| 166 | SD_DLLPUBLIC virtual void SAL_CALL release() noexcept override; |
| 167 | |
| 168 | // XModel |
| 169 | virtual void SAL_CALL lockControllers( ) override; |
| 170 | virtual void SAL_CALL unlockControllers( ) override; |
| 171 | virtual sal_Bool SAL_CALL hasControllersLocked( ) override; |
| 172 | virtual css::uno::Reference < css::container::XIndexAccess > SAL_CALL getViewData() override; |
| 173 | virtual void SAL_CALL setViewData( const css::uno::Reference < css::container::XIndexAccess >& aData ) override; |
| 174 | |
| 175 | // XTypeProvider |
| 176 | virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; |
| 177 | virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; |
| 178 | |
| 179 | // XDrawPageDuplicator |
| 180 | virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL duplicate( const css::uno::Reference< css::drawing::XDrawPage >& xPage ) override; |
| 181 | |
| 182 | // XDrawPagesSupplier |
| 183 | SD_DLLPUBLIC virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL getDrawPages( ) override; |
| 184 | |
| 185 | // XMasterPagesSupplier |
| 186 | virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL getMasterPages( ) override; |
| 187 | |
| 188 | // XLayerManagerSupplier |
| 189 | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLayerManager( ) override; |
| 190 | |
| 191 | // XCustomPresentationSupplier |
| 192 | virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getCustomPresentations( ) override; |
| 193 | |
| 194 | // XHandoutMasterSupplier |
| 195 | virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getHandoutMasterPage( ) override; |
| 196 | |
| 197 | // XPresentationSupplier |
| 198 | virtual css::uno::Reference< css::presentation::XPresentation > SAL_CALL getPresentation( ) override; |
| 199 | |
| 200 | // XMultiServiceFactory ( SvxFmMSFactory ) |
| 201 | SD_DLLPUBLIC virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override; |
| 202 | virtual css::uno::Reference<css::uno::XInterface> SAL_CALL |
| 203 | createInstanceWithArguments( |
| 204 | OUString const & ServiceSpecifier, |
| 205 | css::uno::Sequence<css::uno::Any> const & Arguments) override; |
| 206 | virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) override; |
| 207 | |
| 208 | // XServiceInfo |
| 209 | virtual OUString SAL_CALL getImplementationName() override; |
| 210 | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
| 211 | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
| 212 | |
| 213 | // XPropertySet |
| 214 | virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
| 215 | virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; |
| 216 | virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; |
| 217 | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; |
| 218 | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; |
| 219 | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
| 220 | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
| 221 | |
| 222 | // XLinkTargetSupplier |
| 223 | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks( ) override; |
| 224 | |
| 225 | // XStyleFamiliesSupplier |
| 226 | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getStyleFamilies( ) override; |
| 227 | |
| 228 | // XAnyCompareFactory |
| 229 | virtual css::uno::Reference< css::ucb::XAnyCompare > SAL_CALL createAnyCompareByName( const OUString& PropertyName ) override; |
| 230 | |
| 231 | // XRenderable |
| 232 | virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override; |
| 233 | 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; |
| 234 | virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override; |
| 235 | |
| 236 | // ITiledRenderable |
| 237 | SD_DLLPUBLIC virtual void paintTile( VirtualDevice& rDevice, |
| 238 | int nOutputWidth, |
| 239 | int nOutputHeight, |
| 240 | int nTilePosX, |
| 241 | int nTilePosY, |
| 242 | tools::Long nTileWidth, |
| 243 | tools::Long nTileHeight ) override; |
| 244 | virtual Size getDocumentSize() override; |
| 245 | SD_DLLPUBLIC virtual void setPart( int nPart, bool bAllowChangeFocus = true ) override; |
| 246 | SD_DLLPUBLIC virtual int getPart() override; |
| 247 | SD_DLLPUBLIC virtual int getParts() override; |
| 248 | SD_DLLPUBLIC virtual OUString getPartName( int nPart ) override; |
| 249 | SD_DLLPUBLIC virtual OUString getPartHash( int nPart ) override; |
| 250 | SD_DLLPUBLIC virtual VclPtr<vcl::Window> getDocWindow() override; |
| 251 | bool isMasterViewMode(); |
| 252 | |
| 253 | /// @see vcl::ITiledRenderable::setPartMode(). |
| 254 | virtual void setPartMode( int nPartMode ) override; |
| 255 | /// @see vcl::ITiledRenderable::getEditMode(). |
| 256 | virtual int getEditMode() override; |
| 257 | /// @see vcl::ITiledRenderable::setEditMode(). |
| 258 | virtual void setEditMode(int) override; |
| 259 | /// @see vcl::ITiledRenderable::initializeForTiledRendering(). |
| 260 | SD_DLLPUBLIC virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override; |
| 261 | /// @see vcl::ITiledRenderable::postKeyEvent(). |
| 262 | SD_DLLPUBLIC virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) override; |
| 263 | /// @see vcl::ITiledRenderable::postMouseEvent(). |
| 264 | SD_DLLPUBLIC virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override; |
| 265 | /// @see vcl::ITiledRenderable::setTextSelection(). |
| 266 | SD_DLLPUBLIC virtual void setTextSelection(int nType, int nX, int nY) override; |
| 267 | /// @see vcl::ITiledRenderable::getSelection(). |
| 268 | SD_DLLPUBLIC virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override; |
| 269 | /// @see vcl::ITiledRenderable::setGraphicSelection(). |
| 270 | SD_DLLPUBLIC virtual void setGraphicSelection(int nType, int nX, int nY) override; |
| 271 | /// @see lok::Document::resetSelection(). |
| 272 | SD_DLLPUBLIC virtual void resetSelection() override; |
| 273 | /// @see vcl::ITiledRenderable::setClientVisibleArea(). |
| 274 | virtual void setClientVisibleArea(const tools::Rectangle& rRectangle) override; |
| 275 | /// @see vcl::ITiledRenderable::setClipboard(). |
| 276 | virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) override; |
| 277 | /// @see vcl::ITiledRenderable::isMimeTypeSupported(). |
| 278 | virtual bool isMimeTypeSupported() override; |
| 279 | /// @see vcl::ITiledRenderable::getPointer(). |
| 280 | virtual PointerStyle getPointer() override; |
| 281 | /// @see vcl::ITiledRenderable::getPostIts(). |
| 282 | virtual void getPostIts(tools::JsonWriter& /*rJsonWriter*/) override; |
| 283 | /// @see vcl::ITiledRenderable::selectPart(). |
| 284 | virtual void selectPart(int nPart, int nSelect) override; |
| 285 | /// @see vcl::ITiledRenderable::moveSelectedParts(). |
| 286 | virtual void moveSelectedParts(int nPosition, bool bDuplicate) override; |
| 287 | /// @see vcl::ITiledRenderable::getPartInfo(). |
| 288 | virtual OUString getPartInfo(int nPart) override; |
| 289 | /// @see vcl::ITiledRenderable::isDisposed(). |
| 290 | virtual bool isDisposed() const override |
| 291 | { |
| 292 | return mbDisposed; |
| 293 | } |
| 294 | /// @see vcl::ITiledRenderable::setPaintTextEdit(). |
| 295 | virtual void setPaintTextEdit(bool bPaint) override { mbPaintTextEdit = bPaint; } |
| 296 | /// @see vcl::ITiledRenderable::getViewRenderState(). |
| 297 | SD_DLLPUBLIC OString getViewRenderState(SfxViewShell* pViewShell = nullptr) override; |
| 298 | |
| 299 | SD_DLLPUBLIC virtual void getCommandValues(tools::JsonWriter& rJsonWriter, std::string_view rCommand) override; |
| 300 | |
| 301 | /// @see vcl::ITiledRenderable::getPresentationInfo(). |
| 302 | SD_DLLPUBLIC OString getPresentationInfo(bool bAllyState = false) const override; |
| 303 | /// @see vcl::ITiledRenderable::createSlideRenderer(). |
| 304 | SD_DLLPUBLIC bool createSlideRenderer( |
| 305 | const OString& rSlideHash, |
| 306 | sal_Int32 nSlideNumber, sal_Int32& nViewWidth, sal_Int32& nViewHeight, |
| 307 | bool bRenderBackground, bool bRenderMasterPage) override; |
| 308 | /// @see vcl::ITiledRenderable::postSlideshowCleanup(). |
| 309 | SD_DLLPUBLIC void postSlideshowCleanup() override; |
| 310 | /// @see vcl::ITiledRenderable::renderNextSlideLayer(). |
| 311 | SD_DLLPUBLIC bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, double& rScale, OUString& rJsonMsg) override; |
| 312 | |
| 313 | SD_DLLPUBLIC rtl::Reference< SdDrawPagesAccess > getSdDrawPages(); |
| 314 | |
| 315 | // XComponent |
| 316 | |
| 317 | /** This dispose implementation releases the resources held by the |
| 318 | called object and forwards the call to its base class. |
| 319 | When close() has not yet been called then this is done first. As a |
| 320 | consequence the implementation has to cope with being called twice |
| 321 | and still has to forward the second call to the base class. |
| 322 | See also comments of issue 27847. |
| 323 | */ |
| 324 | virtual void SAL_CALL dispose() override; |
| 325 | }; |
| 326 | |
| 327 | /*********************************************************************** |
| 328 | * * |
| 329 | ***********************************************************************/ |
| 330 | |
| 331 | class SAL_DLLPUBLIC_RTTI SdDrawPagesAccess final : public ::cppu::WeakImplHelper< css::drawing::XDrawPages, css::container::XNameAccess, css::lang::XServiceInfo, css::lang::XComponent > |
| 332 | { |
| 333 | private: |
| 334 | SdXImpressDocument* mpModel; |
| 335 | |
| 336 | public: |
| 337 | SdDrawPagesAccess( SdXImpressDocument& rMyModel ) noexcept; |
| 338 | virtual ~SdDrawPagesAccess() noexcept override; |
| 339 | |
| 340 | // XDrawPages |
| 341 | virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL insertNewByIndex( sal_Int32 nIndex ) override; |
| 342 | virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XDrawPage >& xPage ) override; |
| 343 | |
| 344 | // XNameAccess |
| 345 | virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override; |
| 346 | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
| 347 | virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override; |
| 348 | |
| 349 | // XIndexAccess |
| 350 | virtual sal_Int32 SAL_CALL getCount() override ; |
| 351 | virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; |
| 352 | |
| 353 | // XElementAccess |
| 354 | virtual css::uno::Type SAL_CALL getElementType() override; |
| 355 | virtual sal_Bool SAL_CALL hasElements() override; |
| 356 | |
| 357 | // XServiceInfo |
| 358 | virtual OUString SAL_CALL getImplementationName( ) override; |
| 359 | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
| 360 | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; |
| 361 | |
| 362 | // XComponent |
| 363 | virtual void SAL_CALL dispose( ) override; |
| 364 | virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; |
| 365 | virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; |
| 366 | |
| 367 | SD_DLLPUBLIC SdGenericDrawPage* getDrawPageByIndex( sal_Int32 Index ); |
| 368 | }; |
| 369 | |
| 370 | /*********************************************************************** |
| 371 | * * |
| 372 | ***********************************************************************/ |
| 373 | |
| 374 | class SdMasterPagesAccess final : public ::cppu::WeakImplHelper< css::drawing::XDrawPages2, css::lang::XServiceInfo, css::lang::XComponent > |
| 375 | { |
| 376 | private: |
| 377 | SdXImpressDocument* mpModel; |
| 378 | |
| 379 | public: |
| 380 | SdMasterPagesAccess( SdXImpressDocument& rMyModel ) noexcept; |
| 381 | virtual ~SdMasterPagesAccess() noexcept override; |
| 382 | |
| 383 | // XDrawPages |
| 384 | virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL insertNewByIndex( sal_Int32 nIndex ) override; |
| 385 | virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XDrawPage >& xPage ) override; |
| 386 | |
| 387 | // XDrawPages2 |
| 388 | virtual css::uno::Reference< ::css::drawing::XDrawPage > SAL_CALL insertNamedNewByIndex( sal_Int32 nIndex, const OUString& sName ) override; |
| 389 | |
| 390 | // XIndexAccess |
| 391 | virtual sal_Int32 SAL_CALL getCount() override ; |
| 392 | virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; |
| 393 | |
| 394 | // XElementAccess |
| 395 | virtual css::uno::Type SAL_CALL getElementType() override; |
| 396 | virtual sal_Bool SAL_CALL hasElements() override; |
| 397 | |
| 398 | // XServiceInfo |
| 399 | virtual OUString SAL_CALL getImplementationName( ) override; |
| 400 | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
| 401 | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; |
| 402 | |
| 403 | // XComponent |
| 404 | virtual void SAL_CALL dispose( ) override; |
| 405 | virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; |
| 406 | virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; |
| 407 | |
| 408 | private: |
| 409 | css::uno::Reference< ::css::drawing::XDrawPage > insertNewImpl( sal_Int32 nIndex, std::optional<OUString> oName ); |
| 410 | }; |
| 411 | |
| 412 | /*********************************************************************** |
| 413 | * * |
| 414 | ***********************************************************************/ |
| 415 | |
| 416 | enum SdLinkTargetType |
| 417 | { |
| 418 | Page = 0, |
| 419 | Notes, |
| 420 | Handout, |
| 421 | MasterPage, |
| 422 | Count |
| 423 | }; |
| 424 | |
| 425 | class SdDocLinkTargets final : public ::cppu::WeakImplHelper< css::container::XNameAccess, |
| 426 | css::lang::XServiceInfo , css::lang::XComponent > |
| 427 | { |
| 428 | private: |
| 429 | SdXImpressDocument* mpModel; |
| 430 | OUString aNames[SdLinkTargetType::Count]; |
| 431 | |
| 432 | public: |
| 433 | SdDocLinkTargets(SdXImpressDocument& rMyModel); |
| 434 | virtual ~SdDocLinkTargets() noexcept override; |
| 435 | |
| 436 | // XNameAccess |
| 437 | virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override; |
| 438 | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
| 439 | virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override; |
| 440 | |
| 441 | // XElementAccess |
| 442 | virtual css::uno::Type SAL_CALL getElementType() override; |
| 443 | virtual sal_Bool SAL_CALL hasElements() override; |
| 444 | |
| 445 | // XServiceInfo |
| 446 | virtual OUString SAL_CALL getImplementationName() override; |
| 447 | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
| 448 | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
| 449 | |
| 450 | // XComponent |
| 451 | virtual void SAL_CALL dispose( ) override; |
| 452 | virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; |
| 453 | virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; |
| 454 | }; |
| 455 | |
| 456 | class SdDocLinkTargetType final : public ::cppu::WeakImplHelper< css::document::XLinkTargetSupplier, |
| 457 | css::beans::XPropertySet, |
| 458 | css::lang::XServiceInfo > |
| 459 | { |
| 460 | SdXImpressDocument* mpModel; |
| 461 | sal_uInt16 mnType; |
| 462 | OUString maName; |
| 463 | |
| 464 | public: |
| 465 | SdDocLinkTargetType(SdXImpressDocument* pModel, sal_uInt16 nT); |
| 466 | |
| 467 | // css::document::XLinkTargetSupplier |
| 468 | virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks() override; |
| 469 | |
| 470 | // css::lang::XServiceInfo |
| 471 | virtual OUString SAL_CALL getImplementationName() override; |
| 472 | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
| 473 | virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override; |
| 474 | |
| 475 | // css::beans::XPropertySet |
| 476 | virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; |
| 477 | virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, |
| 478 | const css::uno::Any& aValue) override; |
| 479 | virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& PropertyName) override; |
| 480 | virtual void SAL_CALL addPropertyChangeListener(const OUString& aPropertyName, |
| 481 | const css::uno::Reference< css::beans::XPropertyChangeListener > & xListener) override; |
| 482 | virtual void SAL_CALL removePropertyChangeListener(const OUString& aPropertyName, |
| 483 | const css::uno::Reference< css::beans::XPropertyChangeListener > & aListener) override; |
| 484 | virtual void SAL_CALL addVetoableChangeListener(const OUString& PropertyName, |
| 485 | const css::uno::Reference< css::beans::XVetoableChangeListener > & aListener) override; |
| 486 | virtual void SAL_CALL removeVetoableChangeListener(const OUString& PropertyName, |
| 487 | const css::uno::Reference< css::beans::XVetoableChangeListener > & aListener) override; |
| 488 | }; |
| 489 | |
| 490 | class SdDocLinkTarget final : public ::cppu::WeakImplHelper< css::container::XNameAccess, |
| 491 | css::lang::XServiceInfo > |
| 492 | { |
| 493 | private: |
| 494 | SdXImpressDocument* mpModel; |
| 495 | sal_uInt16 mnType; |
| 496 | |
| 497 | public: |
| 498 | SdDocLinkTarget( SdXImpressDocument* pModel, sal_uInt16 nT ); |
| 499 | |
| 500 | // css::container::XNameAccess |
| 501 | virtual css::uno::Any SAL_CALL getByName(const OUString& aName) override; |
| 502 | virtual css::uno::Sequence< OUString> SAL_CALL getElementNames() override; |
| 503 | virtual sal_Bool SAL_CALL hasByName(const OUString& aName) override; |
| 504 | |
| 505 | // css::container::XElementAccess |
| 506 | virtual css::uno::Type SAL_CALL getElementType() override; |
| 507 | virtual sal_Bool SAL_CALL hasElements() override; |
| 508 | |
| 509 | // css::lang::XServiceInfo |
| 510 | virtual OUString SAL_CALL getImplementationName() override; |
| 511 | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
| 512 | virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override; |
| 513 | |
| 514 | // internal |
| 515 | /// @throws std::exception |
| 516 | SdPage* FindPage( std::u16string_view rName ) const; |
| 517 | }; |
| 518 | |
| 519 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |