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