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