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