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 24 #ifndef _DRAWDOC_HXX 25 #define _DRAWDOC_HXX 26 27 #include <com/sun/star/lang/Locale.hpp> 28 #include <com/sun/star/text/WritingMode.hpp> 29 #include <com/sun/star/frame/XModel.hdl> 30 #include <vcl/print.hxx> 31 #include <svx/fmmodel.hxx> 32 #include "pres.hxx" 33 #include <svx/pageitem.hxx> 34 #include <unotools/charclass.hxx> 35 #include <sot/storage.hxx> 36 #include <rsc/rscsfx.hxx> 37 #include <com/sun/star/lang/Locale.hpp> 38 #include <com/sun/star/text/WritingMode.hpp> 39 40 // #107844# 41 #include <svx/svdundo.hxx> 42 43 #include <vector> 44 45 #ifndef INCLUDED_MEMORY 46 #include <memory> 47 #define INCLUDED_MEMORY 48 #endif 49 #include "sddllapi.h" 50 #include "sdpage.hxx" 51 52 namespace com 53 { 54 namespace sun 55 { 56 namespace star 57 { 58 namespace embed 59 { 60 class XStorage; 61 } 62 namespace io 63 { 64 class XStream; 65 } 66 namespace presentation 67 { 68 class XPresentation2; 69 } 70 } 71 } 72 } 73 74 namespace sd 75 { 76 class FrameView; 77 class Outliner; 78 } 79 80 81 class Timer; 82 class SfxObjectShell; 83 class SdDrawDocShell; 84 class SdPage; 85 class SdAnimationInfo; 86 class SdIMapInfo; 87 class IMapObject; 88 class SdStyleSheetPool; 89 class SfxMedium; 90 class SvxSearchItem; 91 class SdrOle2Obj; 92 class EditStatus; 93 class Graphic; 94 class Point; 95 class Window; 96 class SdTransferable; 97 struct SpellCallbackInfo; 98 struct StyleRequestData; 99 class SdDrawDocument; 100 101 namespace sd 102 { 103 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED 104 #define SV_DECL_DRAW_DOC_SHELL_DEFINED 105 SV_DECL_REF(DrawDocShell) 106 #endif 107 class DrawDocShell; 108 class UndoManager; 109 class ShapeList; 110 } 111 112 class ImpDrawPageListWatcher; 113 class ImpMasterPageListWatcher; 114 115 struct StyleReplaceData 116 { 117 SfxStyleFamily nFamily; 118 SfxStyleFamily nNewFamily; 119 String aName; 120 String aNewName; 121 }; 122 123 enum DocCreationMode 124 { 125 NEW_DOC, 126 DOC_LOADED 127 }; 128 129 namespace sd 130 { 131 struct PresentationSettings 132 { 133 rtl::OUString maPresPage; 134 sal_Bool mbAll; 135 sal_Bool mbEndless; 136 sal_Bool mbCustomShow; 137 sal_Bool mbManual; 138 sal_Bool mbMouseVisible; 139 sal_Bool mbMouseAsPen; 140 sal_Bool mbLockedPages; 141 sal_Bool mbAlwaysOnTop; 142 sal_Bool mbFullScreen; 143 sal_Bool mbAnimationAllowed; 144 sal_Int32 mnPauseTimeout; 145 sal_Bool mbShowPauseLogo; 146 sal_Bool mbStartWithNavigator; 147 148 PresentationSettings(); 149 PresentationSettings( const PresentationSettings& r ); 150 PresentationSettings& operator=(const PresentationSettings&) = default; 151 }; 152 } 153 154 // ------------------ 155 // - SdDrawDocument - 156 // ------------------ 157 158 class SdDrawDocument : public FmFormModel 159 { 160 private: 161 String msDocAccTitle; 162 public: setDocAccTitle(const String & rTitle)163 virtual void setDocAccTitle( const String& rTitle ) { msDocAccTitle = rTitle; } getDocAccTitle() const164 virtual const String getDocAccTitle() const { return msDocAccTitle; } 165 private: 166 sal_Bool bReadOnly; 167 public: setDocReadOnly(sal_Bool b)168 virtual void setDocReadOnly( sal_Bool b){ bReadOnly = b; } getDocReadOnly() const169 virtual sal_Bool getDocReadOnly() const { return bReadOnly; } 170 private: 171 ::sd::Outliner* mpOutliner; // local outliner for outline mode 172 ::sd::Outliner* mpInternalOutliner; // internal outliner for creation of text objects 173 Timer* mpWorkStartupTimer; 174 Timer* mpOnlineSpellingTimer; 175 sd::ShapeList* mpOnlineSpellingList; 176 SvxSearchItem* mpOnlineSearchItem; 177 List* mpFrameViewList; 178 List* mpCustomShowList; 179 ::sd::DrawDocShell* mpDocSh; 180 SdTransferable * mpCreatingTransferable; 181 sal_Bool mbHasOnlineSpellErrors; 182 sal_Bool mbInitialOnlineSpellingEnabled; 183 String maBookmarkFile; 184 ::sd::DrawDocShellRef mxBookmarkDocShRef; 185 186 sd::PresentationSettings maPresentationSettings; 187 188 ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 > mxPresentation; 189 190 sal_Bool mbNewOrLoadCompleted; 191 192 sal_Bool mbOnlineSpell; 193 sal_Bool mbSummationOfParagraphs; 194 bool mbStartWithPresentation; // is set to true when starting with command line parameter -start 195 LanguageType meLanguage; 196 LanguageType meLanguageCJK; 197 LanguageType meLanguageCTL; 198 SvxNumType mePageNumType; 199 ::sd::DrawDocShellRef mxAllocedDocShRef; // => AllocModel() 200 sal_Bool mbAllocDocSh; // => AllocModel() 201 DocumentType meDocType; 202 CharClass* mpCharClass; 203 ::com::sun::star::lang::Locale* mpLocale; 204 205 // #109538# 206 ::std::unique_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher; 207 ::std::unique_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher; 208 209 void UpdatePageObjectsInNotes(sal_uInt16 nStartPos); 210 void UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_Int32 nIncrement); 211 void FillOnlineSpellingList(SdPage* pPage); 212 void SpellObject(SdrTextObj* pObj); 213 214 DECL_LINK(WorkStartupHdl, Timer*); 215 DECL_LINK(OnlineSpellingHdl, Timer*); 216 DECL_LINK(OnlineSpellEventHdl, EditStatus*); 217 218 std::vector< rtl::OUString > maAnnotationAuthors; 219 220 protected: 221 222 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel(); 223 224 public: 225 226 class InsertBookmarkAsPage_PageFunctorBase; 227 228 TYPEINFO(); 229 230 SdDrawDocument(DocumentType eType, SfxObjectShell* pDocSh); 231 ~SdDrawDocument(); 232 233 virtual SdrModel* AllocModel() const; 234 virtual SdrPage* AllocPage(FASTBOOL bMasterPage); 235 virtual const SdrModel* LoadModel(const String& rFileName); 236 virtual void DisposeLoadedModels(); 237 virtual FASTBOOL IsReadOnly() const; 238 virtual void SetChanged(sal_Bool bFlag = sal_True); 239 virtual SvStream* GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const; 240 GetPool()241 SfxItemPool& GetPool() { return( *pItemPool ); } 242 243 ::sd::Outliner* GetOutliner(sal_Bool bCreateOutliner=sal_True); 244 SD_DLLPUBLIC ::sd::Outliner* GetInternalOutliner(sal_Bool bCreateOutliner=sal_True); 245 GetDocSh() const246 ::sd::DrawDocShell* GetDocSh() const { return mpDocSh; } 247 248 LanguageType GetLanguage( const sal_uInt16 nId ) const; 249 void SetLanguage( const LanguageType eLang, const sal_uInt16 nId ); 250 251 SvxNumType GetPageNumType() const; SetPageNumType(SvxNumType eType)252 void SetPageNumType(SvxNumType eType) { mePageNumType = eType; } 253 SD_DLLPUBLIC String CreatePageNumValue(sal_uInt16 nNum) const; 254 GetDocumentType() const255 DocumentType GetDocumentType() const { return meDocType; } 256 257 void SetAllocDocSh(sal_Bool bAlloc); 258 CreatingDataObj(SdTransferable * pTransferable)259 void CreatingDataObj( SdTransferable* pTransferable ) { mpCreatingTransferable = pTransferable; } 260 261 /** if the document does not contain at least one handout, one slide and one notes page with 262 at least one master each this methods creates them. 263 If a reference document is given, the sizes and border settings of that document are used 264 for newly created slides. 265 */ 266 SD_DLLPUBLIC void CreateFirstPages( SdDrawDocument* pRefDocument = 0 ); 267 SD_DLLPUBLIC sal_Bool CreateMissingNotesAndHandoutPages(); 268 269 void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos); 270 void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF); 271 void DeletePage(sal_uInt16 nPgNum); 272 SdrPage* RemovePage(sal_uInt16 nPgNum); 273 274 virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF); 275 virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum); 276 277 void RemoveUnnecessaryMasterPages( SdPage* pMaster=NULL, sal_Bool bOnlyDuplicatePages=sal_False, sal_Bool bUndo=sal_True ); 278 SD_DLLPUBLIC void SetMasterPage(sal_uInt16 nSdPageNum, const String& rLayoutName, 279 SdDrawDocument* pSourceDoc, sal_Bool bMaster, sal_Bool bCheckMasters); 280 281 SD_DLLPUBLIC SdDrawDocument* OpenBookmarkDoc(const String& rBookmarkFile); 282 SdDrawDocument* OpenBookmarkDoc(SfxMedium& rMedium); 283 sal_Bool InsertBookmark(List* pBookmarkList, List* pExchangeList, sal_Bool bLink, 284 sal_Bool bReplace, sal_uInt16 nPgPos, sal_Bool bNoDialogs, 285 ::sd::DrawDocShell* pBookmarkDocSh, sal_Bool bCopy, 286 Point* pObjPos); 287 288 bool IsStartWithPresentation() const; 289 void SetStartWithPresentation( bool bStartWithPresentation ); 290 291 /** Insert pages into this document 292 293 This method inserts whole pages into this document, either 294 selected ones (specified via pBookmarkList/pExchangeList), or 295 all from the source document. 296 297 @attention Beware! This method in it's current state does not 298 handle all combinations of their input parameters 299 correctly. For example, for pBookmarkList=NULL, bReplace=sal_True 300 is ignored (no replace happens). 301 302 @param pBookmarkList 303 A list of strings, denoting the names of the pages to be copied 304 305 @param pExchangeList 306 A list of strings, denoting the names of the pages to be renamed 307 308 @param bLink 309 Whether the inserted pages should be links to the bookmark document 310 311 @param bReplace 312 Whether the pages should not be inserted, but replace the pages in 313 the destination document 314 315 @param nPgPos 316 Insertion point/start of replacement 317 318 @param bNoDialogs 319 Whether query dialogs are allowed (e.g. for page scaling) 320 321 @param pBookmarkDocSh 322 DocShell of the source document (used e.g. to extract the filename 323 for linked pages) 324 325 @param bCopy 326 Whether the source document should be treated as immutable (i.e. 327 inserted pages are not removed from it, but cloned) 328 329 @param bMergeMasterPages 330 Whether the source document's master pages should be copied, too. 331 332 @param bPreservePageNames 333 Whether the replace operation should take the name from the new 334 page, or preserve the old name 335 */ 336 sal_Bool InsertBookmarkAsPage(List* pBookmarkList, List* pExchangeList, 337 sal_Bool bLink, sal_Bool bReplace, sal_uInt16 nPgPos, 338 sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh, 339 sal_Bool bCopy, sal_Bool bMergeMasterPages, 340 sal_Bool bPreservePageNames); 341 sal_Bool InsertBookmarkAsObject(List* pBookmarkList, List* pExchangeListL, 342 sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh, 343 Point* pObjPos); 344 void IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* pBookmarkList, 345 sal_uInt16 nBMSdPageCount, 346 InsertBookmarkAsPage_PageFunctorBase& rPageIterator ); 347 SD_DLLPUBLIC void CloseBookmarkDoc(); 348 349 SdrObject* GetObj(const String& rObjName) const; 350 351 /** Return the first page that has the given name. Regular pages and 352 notes pages are searched first. When not found then the master 353 pages are searched. 354 @param rPgName 355 Name of the page to return. 356 @param rbIsMasterPage 357 Is set by the method to indicate whether the returned index 358 belongs to a master page (<TRUE/>) or a regular or notes page 359 (<FALSE/>). The given value is ignored. 360 @return 361 Returns the index of the page with the given name or 362 SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist. 363 */ 364 sal_uInt16 GetPageByName(const String& rPgName, sal_Bool& rbIsMasterPage ) const; 365 SD_DLLPUBLIC SdPage*GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const; 366 SD_DLLPUBLIC sal_uInt16 GetSdPageCount(PageKind ePgKind) const; 367 368 void SetSelected(SdPage* pPage, sal_Bool bSelect); 369 sal_Bool MovePages(sal_uInt16 nTargetPage); 370 371 SD_DLLPUBLIC SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind); 372 SD_DLLPUBLIC sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const; 373 374 sal_uInt16 GetMasterPageUserCount(SdrPage* pMaster) const; 375 getPresentationSettings() const376 const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; } getPresentationSettings()377 sd::PresentationSettings& getPresentationSettings() { return maPresentationSettings; } 378 379 const ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 >& getPresentation() const; 380 SetSummationOfParagraphs(sal_Bool bOn=sal_True)381 void SetSummationOfParagraphs( sal_Bool bOn = sal_True ) { mbSummationOfParagraphs = bOn; } IsSummationOfParagraphs() const382 sal_Bool IsSummationOfParagraphs() const { return mbSummationOfParagraphs; } 383 384 /** Set the mode that controls whether (and later how) the formatting of the document 385 depends on the current printer metrics. 386 @param nMode 387 Use <const 388 scope="com::sun::star::document::PrinterIndependentLayout">ENABLED</const> 389 to make formatting printer-independent and <const 390 scope="com::sun::star::document::PrinterIndependentLayout">DISABLED</const> 391 to make formatting depend on the current printer metrics. 392 */ 393 void SetPrinterIndependentLayout (sal_Int32 nMode); 394 395 /** Get the flag that controls whether the formatting of the document 396 depends on the current printer metrics. 397 @return 398 Use <const 399 scope="com::sun::star::document::PrinterIndependentLayout">ENABLED</const> 400 when formatting is printer-independent and <const 401 scope="com::sun::star::document::PrinterIndependentLayout">DISABLED</const> 402 when formatting depends on the current printer metrics. 403 */ 404 sal_Int32 GetPrinterIndependentLayout (void); 405 406 void SetOnlineSpell( sal_Bool bIn ); GetOnlineSpell() const407 sal_Bool GetOnlineSpell() const { return mbOnlineSpell; } 408 void StopOnlineSpelling(); 409 void StartOnlineSpelling(sal_Bool bForceSpelling=sal_True); 410 411 void ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj, SdrOutliner* pOutl); 412 413 void InsertObject(SdrObject* pObj, SdPage* pPage); 414 void RemoveObject(SdrObject* pObj, SdPage* pPage); 415 416 sal_uLong GetLinkCount(); 417 GetFrameViewList() const418 List* GetFrameViewList() const { return mpFrameViewList; } 419 SD_DLLPUBLIC List* GetCustomShowList(sal_Bool bCreate = sal_False); 420 421 void NbcSetChanged(sal_Bool bFlag = sal_True); 422 423 void SetTextDefaults() const; 424 425 void CreateLayoutTemplates(); 426 void RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName); 427 428 void CreateDefaultCellStyles(); 429 430 SD_DLLPUBLIC void StopWorkStartupDelay(); 431 432 void NewOrLoadCompleted(DocCreationMode eMode); 433 void NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool ); IsNewOrLoadCompleted() const434 sal_Bool IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted; } 435 GetFrameView(sal_uLong nPos)436 ::sd::FrameView* GetFrameView(sal_uLong nPos) { 437 return static_cast< ::sd::FrameView*>( 438 mpFrameViewList->GetObject(nPos));} 439 440 /** deprecated*/ 441 SdAnimationInfo* GetAnimationInfo(SdrObject* pObject) const; 442 443 SD_DLLPUBLIC static SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false ); 444 445 SdIMapInfo* GetIMapInfo( SdrObject* pObject ) const; 446 IMapObject* GetHitIMapObject( SdrObject* pObject, const Point& rWinPoint, const ::Window& rCmpWnd ); 447 GetCharClass() const448 CharClass* GetCharClass() const { return mpCharClass; } 449 450 void RestoreLayerNames(); 451 452 void UpdateAllLinks(); 453 454 void CheckMasterPages(); 455 456 void Merge(SdrModel& rSourceModel, 457 sal_uInt16 nFirstPageNum=0, sal_uInt16 nLastPageNum=0xFFFF, 458 sal_uInt16 nDestPos=0xFFFF, 459 FASTBOOL bMergeMasterPages=sal_False, FASTBOOL bAllMasterPages=sal_False, 460 FASTBOOL bUndo=sal_True, FASTBOOL bTreadSourceAsConst=sal_False); 461 462 SD_DLLPUBLIC ::com::sun::star::text::WritingMode GetDefaultWritingMode() const; 463 void SetDefaultWritingMode( ::com::sun::star::text::WritingMode eMode ); 464 465 /** replacespOldPage from all custom shows with pNewPage or removes pOldPage from 466 all custom shows if pNewPage is 0. 467 */ 468 void ReplacePageInCustomShows( const SdPage* pOldPage, const SdPage* pNewPage ); 469 470 public: 471 472 static SdDrawDocument* pDocLockedInsertingLinks; // static to prevent recursions while resolving links 473 474 /** Create and insert a set of two new pages: a standard (draw) page and 475 the associated notes page. The new pages are inserted directly 476 after the specified page set. 477 @param pCurrentPage 478 This page is used to retrieve the layout for the page to 479 create. 480 @param ePageKind 481 This specifies whether <argument>pCurrentPage</argument> is a 482 standard (draw) page or a notes page. 483 @param sStandardPageName 484 Name of the standard page. An empty string leads to using an 485 automatically created name. 486 @param sNotesPageName 487 Name of the standard page. An empty string leads to using an 488 automatically created name. 489 @param eStandardLayout 490 Layout to use for the new standard page. Note that this layout 491 is not used when the given <argument>pCurrentPage</argument> is 492 not a standard page. In this case the layout is taken from the 493 standard page associated with <argument>pCurrentPage</argument>. 494 @param eNotesLayout 495 Layout to use for the new notes page. Note that this layout 496 is not used when the given <argument>pCurrentPage</argument> is 497 not a notes page. In this case the layout is taken from the 498 notes page associated with <argument>pCurrentPage</argument>. 499 @param bIsPageBack 500 This flag indicates whether to show the background shape. 501 @param bIsPageObj 502 This flag indicates whether to show the shapes on the master page. 503 @param nInsertPosition 504 Position where to insert the standard page. When -1 then the 505 new page set is inserted after the current page. 506 507 @return 508 Returns an index of the inserted pages that can be used with the 509 <member>GetSdPage()</member> method. 510 */ 511 sal_uInt16 CreatePage ( 512 SdPage* pCurrentPage, 513 PageKind ePageKind, 514 const String& sStandardPageName, 515 const String& sNotesPageName, 516 AutoLayout eStandardLayout, 517 AutoLayout eNotesLayout, 518 sal_Bool bIsPageBack, 519 sal_Bool bIsPageObj, 520 const sal_Int32 nInsertPosition = -1); 521 522 /** This method acts as a simplified front end for the more complex 523 <member>DuplicatePage()</member> method. 524 @param nPageNum 525 The page number as passed to the <member>GetSdPage()</member> 526 method for which the standard page and the notes page are to be 527 copied. 528 @return 529 Returns an index of the inserted pages that can be used with the 530 <member>GetSdPage()</member> method. 531 */ 532 sal_uInt16 DuplicatePage (sal_uInt16 nPageNum); 533 534 /** Create and insert a set of two new pages that are copies of the 535 given <argument>pCurrentPage</argument> and its associated notes 536 resp. standard page. The copies are inserted directly after the 537 specified page set. 538 @param pCurrentPage 539 This page and its associated notes/standard page is copied. 540 @param ePageKind 541 This specifies whether <argument>pCurrentPage</argument> is a 542 standard (draw) page or a notes page. 543 @param sStandardPageName 544 Name of the standard page. An empty string leads to using an 545 automatically created name. 546 @param sNotesPageName 547 Name of the standard page. An empty string leads to using an 548 automatically created name. 549 @param eStandardLayout 550 Layout to use for the new standard page. Note that this layout 551 is not used when the given <argument>pCurrentPage</argument> is 552 not a standard page. In this case the layout is taken from the 553 standard page associated with <argument>pCurrentPage</argument>. 554 @param eNotesLayout 555 Layout to use for the new notes page. Note that this layout 556 is not used when the given <argument>pCurrentPage</argument> is 557 not a notes page. In this case the layout is taken from the 558 notes page associated with <argument>pCurrentPage</argument>. 559 @param bIsPageBack 560 This flag indicates whether to show the background shape. 561 @param bIsPageObj 562 This flag indicates whether to show the shapes on the master page. 563 @param nInsertPosition 564 Position where to insert the standard page. When -1 then the 565 new page set is inserted after the current page. 566 567 @return 568 Returns an index of the inserted pages that can be used with the 569 <member>GetSdPage()</member> method. 570 */ 571 sal_uInt16 DuplicatePage ( 572 SdPage* pCurrentPage, 573 PageKind ePageKind, 574 const String& sStandardPageName, 575 const String& sNotesPageName, 576 AutoLayout eStandardLayout, 577 AutoLayout eNotesLayout, 578 sal_Bool bIsPageBack, 579 sal_Bool bIsPageObj, 580 const sal_Int32 nInsertPosition = -1); 581 582 /** return the document fonts for latin, cjk and ctl according to the current 583 languages set at this document */ 584 void getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont ); 585 586 sd::UndoManager* GetUndoManager() const; 587 588 /* converts the given western font height to a corresponding ctl font height, depending on the system language */ 589 static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight ); 590 591 /** Get the style sheet pool if it was a SdStyleSheetPool. 592 */ 593 SD_DLLPUBLIC SdStyleSheetPool* GetSdStyleSheetPool() const; 594 595 void UpdatePageRelativeURLs(const String& rOldName, const String& rNewName); 596 597 void SetCalcFieldValueHdl( ::Outliner* pOutliner); 598 599 sal_uInt16 GetAnnotationAuthorIndex( const rtl::OUString& rAuthor ); 600 601 private: 602 /** This member stores the printer independent layout mode. Please 603 refer to <member>SetPrinterIndependentLayout()</member> for its 604 values. 605 */ 606 sal_Int32 mnPrinterIndependentLayout; 607 608 /** Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>. 609 @param pCurrentPage 610 This page and its associated notes/standard page is copied. 611 @param ePageKind 612 This specifies whether <argument>pCurrentPage</argument> is a 613 standard (draw) page or a notes page. 614 @param sStandardPageName 615 Name of the standard page. An empty string leads to using an 616 automatically created name. 617 @param sNotesPageName 618 Name of the standard page. An empty string leads to using an 619 automatically created name. 620 @param eStandardLayout 621 Layout to use for the new standard page. Note that this layout 622 is not used when the given <argument>pCurrentPage</argument> is 623 not a standard page. In this case the layout is taken from the 624 standard page associated with <argument>pCurrentPage</argument>. 625 @param eNotesLayout 626 Layout to use for the new notes page. Note that this layout 627 is not used when the given <argument>pCurrentPage</argument> is 628 not a notes page. In this case the layout is taken from the 629 notes page associated with <argument>pCurrentPage</argument>. 630 @param bIsPageBack 631 This flag indicates whether to show the background shape. 632 @param bIsPageObj 633 This flag indicates whether to show the shapes on the master page. 634 @param pStandardPage 635 The standard page to insert. 636 @param pNotesPage 637 The notes page to insert. 638 @param nInsertPosition 639 Position where to insert the standard page. When -1 then the 640 new page set is inserted after the current page. 641 642 @return 643 Returns an index of the inserted pages that can be used with the 644 <member>GetSdPage()</member> method. 645 */ 646 sal_uInt16 InsertPageSet ( 647 SdPage* pCurrentPage, 648 PageKind ePageKind, 649 const String& sStandardPageName, 650 const String& sNotesPageName, 651 AutoLayout eStandardLayout, 652 AutoLayout eNotesLayout, 653 sal_Bool bIsPageBack, 654 sal_Bool bIsPageObj, 655 SdPage* pStandardPage, 656 SdPage* pNotesPage, 657 sal_Int32 nInsertPosition = -1); 658 659 /** Set up a newly created page and insert it into the list of pages. 660 @param pPreviousPage 661 A page to take the size and border geometry from. 662 @param pPage 663 This is the page to set up and insert. 664 @param sPageName 665 The name of the new page. 666 @param nInsertionPoint 667 Index of the page before which the new page will be inserted. 668 @param bIsPageBack 669 This flag indicates whether to show the background shape. 670 @param bIsPageObj 671 This flag indicates whether to show the shapes on the master 672 page. 673 */ 674 void SetupNewPage ( 675 SdPage* pPreviousPage, 676 SdPage* pPage, 677 const String& sPageName, 678 sal_uInt16 nInsertionPoint, 679 sal_Bool bIsPageBack, 680 sal_Bool bIsPageObj); 681 682 // #109538# 683 virtual void PageListChanged(); 684 virtual void MasterPageListChanged(); 685 virtual ImageMap* GetImageMapForObject(SdrObject* pObj); 686 }; 687 688 namespace sd 689 { 690 691 // an instance of this guard disables modification of a document 692 // during its lifetime 693 class ModifyGuard 694 { 695 public: 696 ModifyGuard( SdDrawDocument* pDoc ); 697 ~ModifyGuard(); 698 699 private: 700 void init(); 701 702 DrawDocShell* mpDocShell; 703 SdDrawDocument* mpDoc; 704 sal_Bool mbIsEnableSetModified; 705 sal_Bool mbIsDocumentChanged; 706 }; 707 708 } 709 710 #endif // _DRAWDOC_HXX 711