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