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