bump product version to 5.0.4.1
[LibreOffice.git] / sd / inc / drawdoc.hxx
blob1a3e359b3f4c78e04e2a9542b5b1254447f7ea55
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SD_INC_DRAWDOC_HXX
21 #define INCLUDED_SD_INC_DRAWDOC_HXX
23 #include <com/sun/star/lang/Locale.hpp>
24 #include <com/sun/star/text/WritingMode.hpp>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <vcl/print.hxx>
27 #include <vcl/idle.hxx>
28 #include <svx/fmmodel.hxx>
29 #include "pres.hxx"
30 #include <svx/pageitem.hxx>
31 #include <unotools/charclass.hxx>
32 #include <sot/storage.hxx>
33 #include <rsc/rscsfx.hxx>
34 #include <com/sun/star/xml/dom/XNode.hpp>
36 #include <svx/svdundo.hxx>
38 #include <vector>
39 #include <memory>
41 #include "sddllapi.h"
42 #include "sdpage.hxx"
44 namespace com
46 namespace sun
48 namespace star
50 namespace presentation
52 class XPresentation2;
58 namespace sd
60 class FrameView;
61 class Outliner;
64 class Timer;
65 class SfxObjectShell;
66 class SdPage;
67 class SdAnimationInfo;
68 class SdIMapInfo;
69 class IMapObject;
70 class SdStyleSheetPool;
71 class SfxMedium;
72 class SvxSearchItem;
73 class EditStatus;
74 class Point;
75 namespace vcl { class Window; }
76 class SdTransferable;
77 struct SpellCallbackInfo;
78 struct StyleRequestData;
79 class SdDrawDocument;
80 class SdCustomShow;
81 class SdCustomShowList;
83 namespace sd
85 class DrawDocShell;
86 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
87 #define SV_DECL_DRAW_DOC_SHELL_DEFINED
88 typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
89 #endif
90 class UndoManager;
91 class ShapeList;
92 class FrameView;
95 class ImpDrawPageListWatcher;
96 class ImpMasterPageListWatcher;
98 struct StyleReplaceData
100 SfxStyleFamily nFamily;
101 SfxStyleFamily nNewFamily;
102 OUString aName;
103 OUString aNewName;
106 enum DocCreationMode
108 NEW_DOC,
109 DOC_LOADED
112 namespace sd
114 struct PresentationSettings
116 OUString maPresPage;
117 bool mbAll;
118 bool mbEndless;
119 bool mbCustomShow;
120 bool mbManual;
121 bool mbMouseVisible;
122 bool mbMouseAsPen;
123 bool mbLockedPages;
124 bool mbAlwaysOnTop;
125 bool mbFullScreen;
126 bool mbAnimationAllowed;
127 sal_Int32 mnPauseTimeout;
128 bool mbShowPauseLogo;
129 bool mbStartWithNavigator;
131 PresentationSettings();
132 PresentationSettings( const PresentationSettings& r );
136 // SdDrawDocument
137 class SD_DLLPUBLIC SdDrawDocument : public FmFormModel
139 private:
140 OUString msDocAccTitle;
141 public:
142 SAL_DLLPRIVATE virtual void setDocAccTitle( const OUString& rTitle ) { msDocAccTitle = rTitle; }
143 SAL_DLLPRIVATE virtual const OUString getDocAccTitle() const { return msDocAccTitle; }
144 private:
145 bool bReadOnly;
146 public:
147 SAL_DLLPRIVATE virtual void setDocReadOnly( bool b){ bReadOnly = b; }
148 SAL_DLLPRIVATE virtual bool getDocReadOnly() const { return bReadOnly; }
149 private:
150 ::sd::Outliner* mpOutliner; ///< local outliner for outline mode
151 ::sd::Outliner* mpInternalOutliner; ///< internal outliner for creation of text objects
152 Timer* mpWorkStartupTimer;
153 Idle* mpOnlineSpellingIdle;
154 sd::ShapeList* mpOnlineSpellingList;
155 SvxSearchItem* mpOnlineSearchItem;
156 std::vector<sd::FrameView*> maFrameViewList;
157 SdCustomShowList* mpCustomShowList;
158 ::sd::DrawDocShell* mpDocSh;
159 SdTransferable * mpCreatingTransferable;
160 bool mbHasOnlineSpellErrors;
161 bool mbInitialOnlineSpellingEnabled;
162 OUString maBookmarkFile;
163 ::sd::DrawDocShellRef mxBookmarkDocShRef;
165 sd::PresentationSettings maPresentationSettings;
167 ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 > mxPresentation;
169 bool mbNewOrLoadCompleted;
171 bool mbOnlineSpell;
172 bool mbSummationOfParagraphs;
173 bool mbStartWithPresentation; ///< is set to true when starting with command line parameter -start
174 bool mbExitAfterPresenting; ///< true if mbStartWithPresentation AND Presentation was shown fully
175 LanguageType meLanguage;
176 LanguageType meLanguageCJK;
177 LanguageType meLanguageCTL;
178 SvxNumType mePageNumType;
179 ::sd::DrawDocShellRef mxAllocedDocShRef; // => AllocModel()
180 bool mbAllocDocSh; // => AllocModel()
181 DocumentType meDocType;
182 CharClass* mpCharClass;
183 ::com::sun::star::lang::Locale* mpLocale;
185 ::std::unique_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher;
186 ::std::unique_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher;
188 SAL_DLLPRIVATE void UpdatePageObjectsInNotes(sal_uInt16 nStartPos);
189 SAL_DLLPRIVATE void UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_Int32 nIncrement);
190 SAL_DLLPRIVATE void FillOnlineSpellingList(SdPage* pPage);
191 SAL_DLLPRIVATE void SpellObject(SdrTextObj* pObj);
193 DECL_DLLPRIVATE_LINK_TYPED(WorkStartupHdl, Timer *, void);
194 DECL_DLLPRIVATE_LINK_TYPED(OnlineSpellingHdl, Idle *, void);
195 DECL_DLLPRIVATE_LINK(OnlineSpellEventHdl, EditStatus*);
197 std::vector< OUString > maAnnotationAuthors;
198 std::vector<com::sun::star::uno::Reference<
199 com::sun::star::xml::dom::XNode> > maLayoutInfo;
201 std::vector<com::sun::star::uno::Reference<
202 com::sun::star::xml::dom::XNode> > maPresObjectInfo;
204 bool mbUseEmbedFonts;
205 protected:
207 SAL_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel() SAL_OVERRIDE;
209 public:
211 TYPEINFO_VISIBILITY_OVERRIDE(SAL_DLLPRIVATE);
213 SAL_DLLPRIVATE SdDrawDocument(DocumentType eType, SfxObjectShell* pDocSh);
214 SAL_DLLPRIVATE virtual ~SdDrawDocument();
216 SAL_DLLPRIVATE SdDrawDocument* AllocSdDrawDocument() const;
217 SAL_DLLPRIVATE virtual SdrModel* AllocModel() const SAL_OVERRIDE; //forwards to AllocSdDrawDocument
219 SAL_DLLPRIVATE SdPage* AllocSdPage(bool bMasterPage);
220 SAL_DLLPRIVATE virtual SdrPage* AllocPage(bool bMasterPage) SAL_OVERRIDE; //forwards to AllocSdPage
222 SAL_DLLPRIVATE virtual bool IsReadOnly() const SAL_OVERRIDE;
223 SAL_DLLPRIVATE virtual void SetChanged(bool bFlag = true) SAL_OVERRIDE;
225 SAL_DLLPRIVATE SfxItemPool& GetPool() { return( *pItemPool ); }
227 SAL_DLLPRIVATE ::sd::Outliner* GetOutliner(bool bCreateOutliner=true);
228 ::sd::Outliner* GetInternalOutliner(bool bCreateOutliner=true);
230 SAL_DLLPRIVATE ::sd::DrawDocShell* GetDocSh() const { return mpDocSh; }
232 SAL_DLLPRIVATE LanguageType GetLanguage( const sal_uInt16 nId ) const;
233 SAL_DLLPRIVATE void SetLanguage( const LanguageType eLang, const sal_uInt16 nId );
235 SAL_DLLPRIVATE SvxNumType GetPageNumType() const SAL_OVERRIDE;
236 SAL_DLLPRIVATE void SetPageNumType(SvxNumType eType) { mePageNumType = eType; }
237 OUString CreatePageNumValue(sal_uInt16 nNum) const;
239 SAL_DLLPRIVATE DocumentType GetDocumentType() const { return meDocType; }
241 SAL_DLLPRIVATE void SetAllocDocSh(bool bAlloc);
243 SAL_DLLPRIVATE void CreatingDataObj( SdTransferable* pTransferable ) { mpCreatingTransferable = pTransferable; }
245 /** if the document does not contain at least one handout, one slide and one notes page with
246 at least one master each this methods creates them.
247 If a reference document is given, the sizes and border settings of that document are used
248 for newly created slides.
250 void CreateFirstPages( SdDrawDocument* pRefDocument = 0 );
251 bool CreateMissingNotesAndHandoutPages();
253 SAL_DLLPRIVATE void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos) SAL_OVERRIDE;
254 SAL_DLLPRIVATE void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) SAL_OVERRIDE;
255 SAL_DLLPRIVATE void DeletePage(sal_uInt16 nPgNum) SAL_OVERRIDE;
256 SAL_DLLPRIVATE SdrPage* RemovePage(sal_uInt16 nPgNum) SAL_OVERRIDE;
258 SAL_DLLPRIVATE virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) SAL_OVERRIDE;
259 SAL_DLLPRIVATE virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum) SAL_OVERRIDE;
261 SAL_DLLPRIVATE void RemoveUnnecessaryMasterPages( SdPage* pMaster=NULL, bool bOnlyDuplicatePages=false, bool bUndo=true );
262 void SetMasterPage(sal_uInt16 nSdPageNum, const OUString& rLayoutName,
263 SdDrawDocument* pSourceDoc, bool bMaster, bool bCheckMasters);
265 SdDrawDocument* OpenBookmarkDoc(const OUString& rBookmarkFile);
266 SAL_DLLPRIVATE SdDrawDocument* OpenBookmarkDoc(SfxMedium& rMedium);
268 SAL_DLLPRIVATE bool InsertBookmark(const std::vector<OUString> &rBookmarkList,
269 std::vector<OUString> &rExchangeList, bool bLink,
270 bool bReplace, sal_uInt16 nPgPos, bool bNoDialogs,
271 ::sd::DrawDocShell* pBookmarkDocSh, bool bCopy,
272 Point* pObjPos);
274 SAL_DLLPRIVATE bool IsStartWithPresentation() const { return mbStartWithPresentation;}
275 SAL_DLLPRIVATE void SetStartWithPresentation( bool bStartWithPresentation );
277 SAL_DLLPRIVATE bool IsExitAfterPresenting() const { return mbExitAfterPresenting;}
278 SAL_DLLPRIVATE void SetExitAfterPresenting( bool bExitAfterPresenting );
280 /// load xml-based impress layout definitions into document
281 SAL_DLLPRIVATE void InitLayoutVector();
282 /// return reference to vector of Impress layout definitions
283 SAL_DLLPRIVATE const std::vector<com::sun::star::uno::Reference<
284 com::sun::star::xml::dom::XNode> >& GetLayoutVector() const
285 { return maLayoutInfo; }
287 /// load xml-based impress master presentation object definitions into document
288 SAL_DLLPRIVATE void InitObjectVector();
289 /// return reference to vector of master presentation object definitions
290 SAL_DLLPRIVATE const std::vector<com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode> >& GetObjectVector() const { return maPresObjectInfo; }
291 /** Insert pages into this document
293 This method inserts whole pages into this document, either
294 selected ones (specified via pBookmarkList/pExchangeList), or
295 all from the source document.
297 @attention Beware! This method in its current state does not
298 handle all combinations of their input parameters
299 correctly. For example, for pBookmarkList=NULL, bReplace=true
300 is ignored (no replace happens).
302 @param pBookmarkList
303 A list of strings, denoting the names of the pages to be copied
305 @param pExchangeList
306 A list of strings, denoting the names of the pages to be renamed
308 @param bLink
309 Whether the inserted pages should be links to the bookmark document
311 @param bReplace
312 Whether the pages should not be inserted, but replace the pages in
313 the destination document
315 @param nPgPos
316 Insertion point/start of replacement
318 @param bNoDialogs
319 Whether query dialogs are allowed (e.g. for page scaling)
321 @param pBookmarkDocSh
322 DocShell of the source document (used e.g. to extract the filename
323 for linked pages)
325 @param bCopy
326 Whether the source document should be treated as immutable (i.e.
327 inserted pages are not removed from it, but cloned)
329 @param bMergeMasterPages
330 Whether the source document's master pages should be copied, too.
332 @param bPreservePageNames
333 Whether the replace operation should take the name from the new
334 page, or preserve the old name
337 SAL_DLLPRIVATE bool InsertBookmarkAsPage(const std::vector<OUString> &rBookmarkList,
338 std::vector<OUString> *pExchangeList,
339 bool bLink, bool bReplace, sal_uInt16 nPgPos,
340 bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
341 bool bCopy, bool bMergeMasterPages,
342 bool bPreservePageNames);
344 SAL_DLLPRIVATE bool InsertBookmarkAsObject(const std::vector<OUString> &rBookmarkList,
345 const std::vector<OUString> &rExchangeList,
346 bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
347 Point* pObjPos, bool bCalcObjCount = false);
349 void CloseBookmarkDoc();
351 SAL_DLLPRIVATE SdrObject* GetObj(const OUString& rObjName) const;
353 /** Return the first page that has the given name. Regular pages and
354 notes pages are searched first. When not found then the master
355 pages are searched.
356 @param rPgName
357 Name of the page to return.
358 @param rbIsMasterPage
359 Is set by the method to indicate whether the returned index
360 belongs to a master page (<TRUE/>) or a regular or notes page
361 (<FALSE/>). The given value is ignored.
362 @return
363 Returns the index of the page with the given name or
364 SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist.
366 SAL_DLLPRIVATE sal_uInt16 GetPageByName(const OUString& rPgName, bool& rbIsMasterPage ) const;
367 SdPage*GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const;
368 sal_uInt16 GetSdPageCount(PageKind ePgKind) const;
370 SAL_DLLPRIVATE void SetSelected(SdPage* pPage, bool bSelect);
371 SAL_DLLPRIVATE bool MovePages(sal_uInt16 nTargetPage);
373 SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
374 sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const;
376 sal_uInt16 GetActiveSdPageCount() const;
378 SAL_DLLPRIVATE sal_uInt16 GetMasterPageUserCount(SdrPage* pMaster) const;
380 SAL_DLLPRIVATE const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; }
381 SAL_DLLPRIVATE sd::PresentationSettings& getPresentationSettings() { return maPresentationSettings; }
383 SAL_DLLPRIVATE const ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 >& getPresentation() const;
385 SAL_DLLPRIVATE void SetSummationOfParagraphs( bool bOn = true ) { mbSummationOfParagraphs = bOn; }
386 SAL_DLLPRIVATE bool IsSummationOfParagraphs() const { return mbSummationOfParagraphs; }
388 /** Set the mode that controls whether (and later how) the formatting of the document
389 depends on the current printer metrics.
390 @param nMode
391 Use <const
392 scope="com::sun::star::document::PrinterIndependentLayout">ENABLED</const>
393 to make formatting printer-independent and <const
394 scope="com::sun::star::document::PrinterIndependentLayout">DISABLED</const>
395 to make formatting depend on the current printer metrics.
397 SAL_DLLPRIVATE void SetPrinterIndependentLayout (sal_Int32 nMode);
399 /** Get the flag that controls whether the formatting of the document
400 depends on the current printer metrics.
401 @return
402 Use <const
403 scope="com::sun::star::document::PrinterIndependentLayout">ENABLED</const>
404 when formatting is printer-independent and <const
405 scope="com::sun::star::document::PrinterIndependentLayout">DISABLED</const>
406 when formatting depends on the current printer metrics.
408 SAL_DLLPRIVATE sal_Int32 GetPrinterIndependentLayout() { return mnPrinterIndependentLayout;}
410 SAL_DLLPRIVATE void SetOnlineSpell( bool bIn );
411 SAL_DLLPRIVATE bool GetOnlineSpell() const { return mbOnlineSpell; }
412 SAL_DLLPRIVATE void StopOnlineSpelling();
413 SAL_DLLPRIVATE void StartOnlineSpelling(bool bForceSpelling=true);
415 SAL_DLLPRIVATE void ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj, SdrOutliner* pOutl);
417 SAL_DLLPRIVATE void InsertObject(SdrObject* pObj, SdPage* pPage);
418 SAL_DLLPRIVATE void RemoveObject(SdrObject* pObj, SdPage* pPage);
420 SAL_DLLPRIVATE sal_uLong GetLinkCount();
422 SAL_DLLPRIVATE std::vector<sd::FrameView*>& GetFrameViewList() { return maFrameViewList; }
423 SdCustomShowList* GetCustomShowList(bool bCreate = false);
425 SAL_DLLPRIVATE void NbcSetChanged(bool bFlag = true);
427 SAL_DLLPRIVATE void SetTextDefaults() const;
429 SAL_DLLPRIVATE void CreateLayoutTemplates();
430 SAL_DLLPRIVATE void RenameLayoutTemplate(const OUString& rOldLayoutName, const OUString& rNewName);
432 SAL_DLLPRIVATE void CreateDefaultCellStyles();
434 void StopWorkStartupDelay();
436 SAL_DLLPRIVATE void NewOrLoadCompleted(DocCreationMode eMode);
437 SAL_DLLPRIVATE void NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool );
438 SAL_DLLPRIVATE bool IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted; }
440 SAL_DLLPRIVATE ::sd::FrameView* GetFrameView(sal_uLong nPos) {
441 return nPos < maFrameViewList.size() ? maFrameViewList[nPos] : NULL; }
443 /** deprecated*/
444 SAL_DLLPRIVATE SdAnimationInfo* GetAnimationInfo(SdrObject* pObject) const;
446 static SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false );
448 SAL_DLLPRIVATE SdIMapInfo* GetIMapInfo( SdrObject* pObject ) const;
449 SAL_DLLPRIVATE IMapObject* GetHitIMapObject( SdrObject* pObject, const Point& rWinPoint, const vcl::Window& rCmpWnd );
451 SAL_DLLPRIVATE CharClass* GetCharClass() const { return mpCharClass; }
453 SAL_DLLPRIVATE void RestoreLayerNames();
455 SAL_DLLPRIVATE void UpdateAllLinks();
457 SAL_DLLPRIVATE void CheckMasterPages();
459 SAL_DLLPRIVATE void Merge(SdrModel& rSourceModel,
460 sal_uInt16 nFirstPageNum=0, sal_uInt16 nLastPageNum=0xFFFF,
461 sal_uInt16 nDestPos=0xFFFF,
462 bool bMergeMasterPages = false, bool bAllMasterPages = false,
463 bool bUndo = true, bool bTreadSourceAsConst = false) SAL_OVERRIDE;
465 ::com::sun::star::text::WritingMode GetDefaultWritingMode() const;
466 SAL_DLLPRIVATE void SetDefaultWritingMode( ::com::sun::star::text::WritingMode eMode );
468 /** replacespOldPage from all custom shows with pNewPage or removes pOldPage from
469 all custom shows if pNewPage is 0.
471 SAL_DLLPRIVATE void ReplacePageInCustomShows( const SdPage* pOldPage, const SdPage* pNewPage );
473 public:
475 SAL_DLLPRIVATE static SdDrawDocument* pDocLockedInsertingLinks; // static to prevent recursions while resolving links
477 /** Create and insert a set of two new pages: a standard (draw) page and
478 the associated notes page. The new pages are inserted directly
479 after the specified page set.
480 @param pCurrentPage
481 This page is used to retrieve the layout for the page to
482 create.
483 @param ePageKind
484 This specifies whether <argument>pCurrentPage</argument> is a
485 standard (draw) page or a notes page.
486 @param sStandardPageName
487 Name of the standard page. An empty string leads to using an
488 automatically created name.
489 @param sNotesPageName
490 Name of the standard page. An empty string leads to using an
491 automatically created name.
492 @param eStandardLayout
493 Layout to use for the new standard page. Note that this layout
494 is not used when the given <argument>pCurrentPage</argument> is
495 not a standard page. In this case the layout is taken from the
496 standard page associated with <argument>pCurrentPage</argument>.
497 @param eNotesLayout
498 Layout to use for the new notes page. Note that this layout
499 is not used when the given <argument>pCurrentPage</argument> is
500 not a notes page. In this case the layout is taken from the
501 notes page associated with <argument>pCurrentPage</argument>.
502 @param bIsPageBack
503 This flag indicates whether to show the background shape.
504 @param bIsPageObj
505 This flag indicates whether to show the shapes on the master page.
506 @param nInsertPosition
507 Position where to insert the standard page. When -1 then the
508 new page set is inserted after the current page.
510 @return
511 Returns an index of the inserted pages that can be used with the
512 <member>GetSdPage()</member> method.
514 SAL_DLLPRIVATE sal_uInt16 CreatePage (
515 SdPage* pCurrentPage,
516 PageKind ePageKind,
517 const OUString& sStandardPageName,
518 const OUString& sNotesPageName,
519 AutoLayout eStandardLayout,
520 AutoLayout eNotesLayout,
521 bool bIsPageBack,
522 bool bIsPageObj,
523 const sal_Int32 nInsertPosition = -1);
525 /** This method acts as a simplified front end for the more complex
526 <member>DuplicatePage()</member> method.
527 @param nPageNum
528 The page number as passed to the <member>GetSdPage()</member>
529 method for which the standard page and the notes page are to be
530 copied.
531 @return
532 Returns an index of the inserted pages that can be used with the
533 <member>GetSdPage()</member> method.
535 SAL_DLLPRIVATE sal_uInt16 DuplicatePage (sal_uInt16 nPageNum);
537 /** Create and insert a set of two new pages that are copies of the
538 given <argument>pCurrentPage</argument> and its associated notes
539 resp. standard page. The copies are inserted directly after the
540 specified page set.
541 @param pCurrentPage
542 This page and its associated notes/standard page is copied.
543 @param ePageKind
544 This specifies whether <argument>pCurrentPage</argument> is a
545 standard (draw) page or a notes page.
546 @param sStandardPageName
547 Name of the standard page. An empty string leads to using an
548 automatically created name.
549 @param sNotesPageName
550 Name of the standard page. An empty string leads to using an
551 automatically created name.
552 @param bIsPageBack
553 This flag indicates whether to show the background shape.
554 @param bIsPageObj
555 This flag indicates whether to show the shapes on the master page.
556 @param nInsertPosition
557 Position where to insert the standard page. When -1 then the
558 new page set is inserted after the current page.
560 @return
561 Returns an index of the inserted pages that can be used with the
562 <member>GetSdPage()</member> method.
564 SAL_DLLPRIVATE sal_uInt16 DuplicatePage (
565 SdPage* pCurrentPage,
566 PageKind ePageKind,
567 const OUString& sStandardPageName,
568 const OUString& sNotesPageName,
569 bool bIsPageBack,
570 bool bIsPageObj,
571 const sal_Int32 nInsertPosition = -1);
573 /** return the document fonts for latin, cjk and ctl according to the current
574 languages set at this document */
575 SAL_DLLPRIVATE void getDefaultFonts( vcl::Font& rLatinFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont );
577 SAL_DLLPRIVATE sd::UndoManager* GetUndoManager() const;
579 /** converts the given western font height to a corresponding ctl font height, depending on the system language */
580 SAL_DLLPRIVATE static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight );
582 /** Get the style sheet pool if it was a SdStyleSheetPool.
584 SdStyleSheetPool* GetSdStyleSheetPool() const;
586 SAL_DLLPRIVATE void UpdatePageRelativeURLs(const OUString& rOldName, const OUString& rNewName);
588 SAL_DLLPRIVATE void SetCalcFieldValueHdl( ::Outliner* pOutliner);
590 SAL_DLLPRIVATE sal_uInt16 GetAnnotationAuthorIndex( const OUString& rAuthor );
592 SAL_DLLPRIVATE bool IsUsingEmbededFonts() { return mbUseEmbedFonts; }
593 SAL_DLLPRIVATE void SetIsUsingEmbededFonts( bool bUse ) { mbUseEmbedFonts = bUse; }
595 void dumpAsXml(struct _xmlTextWriter* pWriter) const SAL_OVERRIDE;
597 private:
598 /** This member stores the printer independent layout mode. Please
599 refer to <member>SetPrinterIndependentLayout()</member> for its
600 values.
602 sal_Int32 mnPrinterIndependentLayout;
604 /** Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>.
605 @param pCurrentPage
606 This page and its associated notes/standard page is copied.
607 @param ePageKind
608 This specifies whether <argument>pCurrentPage</argument> is a
609 standard (draw) page or a notes page.
610 @param sStandardPageName
611 Name of the standard page. An empty string leads to using an
612 automatically created name.
613 @param sNotesPageName
614 Name of the standard page. An empty string leads to using an
615 automatically created name.
616 @param bIsPageBack
617 This flag indicates whether to show the background shape.
618 @param bIsPageObj
619 This flag indicates whether to show the shapes on the master page.
620 @param pStandardPage
621 The standard page to insert.
622 @param pNotesPage
623 The notes page to insert.
624 @param nInsertPosition
625 Position where to insert the standard page. When -1 then the
626 new page set is inserted after the current page.
628 @return
629 Returns an index of the inserted pages that can be used with the
630 <member>GetSdPage()</member> method.
632 SAL_DLLPRIVATE sal_uInt16 InsertPageSet (
633 SdPage* pCurrentPage,
634 PageKind ePageKind,
635 const OUString& sStandardPageName,
636 const OUString& sNotesPageName,
637 bool bIsPageBack,
638 bool bIsPageObj,
639 SdPage* pStandardPage,
640 SdPage* pNotesPage,
641 sal_Int32 nInsertPosition = -1);
643 /** Set up a newly created page and insert it into the list of pages.
644 @param pPreviousPage
645 A page to take the size and border geometry from.
646 @param pPage
647 This is the page to set up and insert.
648 @param sPageName
649 The name of the new page.
650 @param nInsertionPoint
651 Index of the page before which the new page will be inserted.
652 @param bIsPageBack
653 This flag indicates whether to show the background shape.
654 @param bIsPageObj
655 This flag indicates whether to show the shapes on the master
656 page.
658 SAL_DLLPRIVATE void SetupNewPage (
659 SdPage* pPreviousPage,
660 SdPage* pPage,
661 const OUString& sPageName,
662 sal_uInt16 nInsertionPoint,
663 bool bIsPageBack,
664 bool bIsPageObj);
666 SAL_DLLPRIVATE virtual void PageListChanged() SAL_OVERRIDE;
667 SAL_DLLPRIVATE virtual void MasterPageListChanged() SAL_OVERRIDE;
668 SAL_DLLPRIVATE virtual ImageMap* GetImageMapForObject(SdrObject* pObj) SAL_OVERRIDE;
671 namespace sd
674 /**an instance of this guard disables modification of a document
675 during its lifetime*/
676 class ModifyGuard
678 public:
679 ModifyGuard( SdDrawDocument* pDoc );
680 ~ModifyGuard();
682 private:
683 void init();
685 DrawDocShell* mpDocShell;
686 SdDrawDocument* mpDoc;
687 bool mbIsEnableSetModified;
688 bool mbIsDocumentChanged;
693 #endif // INCLUDED_SD_INC_DRAWDOC_HXX
695 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */