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