lok: avoid ILibreOfficeKitNotifier null ptr de-reference on shutdown.
[LibreOffice.git] / sd / inc / drawdoc.hxx
blobb5b6e574ca0c44ec8a4d19734bbf9ab14a4a8628
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/text/WritingMode.hpp>
24 #include <svl/style.hxx>
25 #include <svx/fmmodel.hxx>
26 #include <vcl/prntypes.hxx>
27 #include <xmloff/autolayout.hxx>
29 #include <vector>
30 #include <memory>
32 #include "sddllapi.h"
33 #include "pres.hxx"
35 namespace com { namespace sun { namespace star { namespace xml { namespace dom { class XNode; } } } } }
36 namespace com { namespace sun { namespace star { namespace uno { class XInterface; } } } }
37 namespace vcl { class Font; }
39 namespace com
41 namespace sun
43 namespace star
45 namespace presentation
47 class XPresentation2;
53 class SdOutliner;
54 class Timer;
55 class SfxObjectShell;
56 class SdPage;
57 class SdAnimationInfo;
58 class SdStyleSheetPool;
59 class SfxMedium;
60 class SvxSearchItem;
61 class EditStatus;
62 class Point;
63 class SdTransferable;
64 struct SpellCallbackInfo;
65 class SdCustomShowList;
66 class SdUndoGroup;
67 class SdrObject;
68 class CharClass;
69 class Idle;
70 class ImageMap;
71 class Outliner;
72 class SdrModel;
73 class SdrOutliner;
74 class SdrPage;
75 class SdrTextObj;
76 class SfxItemPool;
77 class Size;
79 namespace sd
81 class DrawDocShell;
82 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
83 #define SV_DECL_DRAW_DOC_SHELL_DEFINED
84 typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
85 #endif
86 class UndoManager;
87 class ShapeList;
88 class FrameView;
91 class ImpDrawPageListWatcher;
92 class ImpMasterPageListWatcher;
94 struct StyleReplaceData
96 SfxStyleFamily nFamily;
97 SfxStyleFamily nNewFamily;
98 OUString aName;
99 OUString aNewName;
102 enum DocCreationMode
104 NEW_DOC,
105 DOC_LOADED
108 namespace sd
110 struct PresentationSettings
112 OUString maPresPage;
113 bool mbAll;
114 bool mbEndless;
115 bool mbCustomShow;
116 bool mbManual;
117 bool mbMouseVisible;
118 bool mbMouseAsPen;
119 bool mbLockedPages;
120 bool mbAlwaysOnTop;
121 bool mbFullScreen;
122 bool mbAnimationAllowed;
123 sal_Int32 mnPauseTimeout;
124 bool mbShowPauseLogo;
126 PresentationSettings();
130 // SdDrawDocument
131 class SD_DLLPUBLIC SdDrawDocument final : public FmFormModel
133 public:
134 SAL_DLLPRIVATE void setDocAccTitle( const OUString& rTitle ) { msDocAccTitle = rTitle; }
135 SAL_DLLPRIVATE const OUString& getDocAccTitle() const { return msDocAccTitle; }
136 SAL_DLLPRIVATE bool getDocReadOnly() const { return m_bReadOnly; }
137 private:
138 OUString msDocAccTitle;
139 std::unique_ptr<SdOutliner>
140 mpOutliner; ///< local outliner for outline mode
141 std::unique_ptr<SdOutliner>
142 mpInternalOutliner; ///< internal outliner for creation of text objects
143 std::unique_ptr<Timer> mpWorkStartupTimer;
144 std::unique_ptr<Idle>
145 mpOnlineSpellingIdle;
146 std::unique_ptr<sd::ShapeList>
147 mpOnlineSpellingList;
148 std::unique_ptr<SvxSearchItem>
149 mpOnlineSearchItem;
150 std::vector<std::unique_ptr<sd::FrameView>>
151 maFrameViewList;
152 std::unique_ptr<SdCustomShowList> mpCustomShowList;
153 ::sd::DrawDocShell* mpDocSh;
154 SdTransferable * mpCreatingTransferable;
155 bool mbHasOnlineSpellErrors;
156 bool mbInitialOnlineSpellingEnabled;
157 OUString maBookmarkFile;
158 ::sd::DrawDocShellRef mxBookmarkDocShRef;
160 sd::PresentationSettings maPresentationSettings;
162 css::uno::Reference< css::presentation::XPresentation2 > mxPresentation;
164 bool mbNewOrLoadCompleted;
166 bool mbOnlineSpell;
167 bool mbSummationOfParagraphs;
168 bool mbStartWithPresentation; ///< is set to true when starting with command line parameter -start
169 bool mbExitAfterPresenting; ///< true if mbStartWithPresentation AND Presentation was shown fully
170 LanguageType meLanguage;
171 LanguageType meLanguageCJK;
172 LanguageType meLanguageCTL;
173 SvxNumType mePageNumType;
174 ::sd::DrawDocShellRef mxAllocedDocShRef; // => AllocModel()
175 bool mbAllocDocSh; // => AllocModel()
176 DocumentType const meDocType;
177 std::unique_ptr<CharClass>
178 mpCharClass;
180 ::std::unique_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher;
181 ::std::unique_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher;
183 SAL_DLLPRIVATE void UpdatePageObjectsInNotes(sal_uInt16 nStartPos);
184 SAL_DLLPRIVATE void UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPos, sal_Int32 nIncrement);
185 SAL_DLLPRIVATE void FillOnlineSpellingList(SdPage const * pPage);
186 SAL_DLLPRIVATE void SpellObject(SdrTextObj* pObj);
188 DECL_DLLPRIVATE_LINK(WorkStartupHdl, Timer *, void);
189 DECL_DLLPRIVATE_LINK(OnlineSpellingHdl, Timer *, void);
190 DECL_DLLPRIVATE_LINK(OnlineSpellEventHdl, EditStatus&, void);
192 std::vector< OUString > maAnnotationAuthors;
193 std::vector<css::uno::Reference< css::xml::dom::XNode> > maLayoutInfo;
195 std::vector<css::uno::Reference< css::xml::dom::XNode> > maPresObjectInfo;
197 bool mbEmbedFonts : 1;
198 bool mbEmbedUsedFontsOnly : 1;
199 bool mbEmbedFontScriptLatin : 1;
200 bool mbEmbedFontScriptAsian : 1;
201 bool mbEmbedFontScriptComplex : 1;
203 SAL_DLLPRIVATE virtual css::uno::Reference< css::uno::XInterface > createUnoModel() override;
205 public:
208 SAL_DLLPRIVATE SdDrawDocument(DocumentType eType, SfxObjectShell* pDocSh);
209 SAL_DLLPRIVATE virtual ~SdDrawDocument() override;
211 // Adapt to given Size and Borders scaling all contained data, maybe
212 // including PresObj's in higher derivations
213 virtual void adaptSizeAndBorderForAllPages(
214 const Size& rNewSize,
215 long nLeft = 0,
216 long nRight = 0,
217 long nUpper = 0,
218 long nLower = 0) override;
220 // Adapt PageSize for all Pages of PageKind ePageKind. Also
221 // set Borders to left/right/upper/lower, ScaleAll, Orientation,
222 // PaperBin and BackgroundFullSize. Create Undo-Actions when
223 // a SdUndoGroup is given (then used from the View probably)
224 void AdaptPageSizeForAllPages(
225 const Size& rNewSize,
226 PageKind ePageKind,
227 SdUndoGroup* pUndoGroup = nullptr,
228 long nLeft = 0,
229 long nRight = 0,
230 long nUpper = 0,
231 long nLower = 0,
232 bool bScaleAll = false,
233 Orientation eOrientation = Orientation::Landscape,
234 sal_uInt16 nPaperBin = 0,
235 bool bBackgroundFullSize = false);
237 SAL_DLLPRIVATE SdDrawDocument* AllocSdDrawDocument() const;
238 SAL_DLLPRIVATE virtual SdrModel* AllocModel() const override; //forwards to AllocSdDrawDocument
240 SAL_DLLPRIVATE SdPage* AllocSdPage(bool bMasterPage);
241 SAL_DLLPRIVATE virtual SdrPage* AllocPage(bool bMasterPage) override; //forwards to AllocSdPage
243 SAL_DLLPRIVATE virtual bool IsReadOnly() const override;
244 SAL_DLLPRIVATE virtual void SetChanged(bool bFlag = true) override;
246 SAL_DLLPRIVATE SfxItemPool& GetPool() { return( *m_pItemPool ); }
248 SAL_DLLPRIVATE SdOutliner* GetOutliner(bool bCreateOutliner=true);
249 SdOutliner* GetInternalOutliner(bool bCreateOutliner=true);
251 SAL_DLLPRIVATE ::sd::DrawDocShell* GetDocSh() const { return mpDocSh; }
253 SAL_DLLPRIVATE LanguageType GetLanguage( const sal_uInt16 nId ) const;
254 SAL_DLLPRIVATE void SetLanguage( const LanguageType eLang, const sal_uInt16 nId );
256 SAL_DLLPRIVATE SvxNumType GetPageNumType() const override;
257 SAL_DLLPRIVATE void SetPageNumType(SvxNumType eType) { mePageNumType = eType; }
258 OUString CreatePageNumValue(sal_uInt16 nNum) const;
260 SAL_DLLPRIVATE DocumentType GetDocumentType() const { return meDocType; }
262 SAL_DLLPRIVATE void SetAllocDocSh(bool bAlloc);
264 SAL_DLLPRIVATE void CreatingDataObj( SdTransferable* pTransferable ) { mpCreatingTransferable = pTransferable; }
265 SAL_DLLPRIVATE virtual bool IsCreatingDataObj() const override { return mpCreatingTransferable != nullptr; }
267 /** if the document does not contain at least one handout, one slide and one notes page with
268 at least one master each this methods creates them.
269 If a reference document is given, the sizes and border settings of that document are used
270 for newly created slides.
272 void CreateFirstPages( SdDrawDocument const * pRefDocument = nullptr );
273 bool CreateMissingNotesAndHandoutPages();
275 SAL_DLLPRIVATE void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos) override;
276 SAL_DLLPRIVATE void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) override;
277 SAL_DLLPRIVATE void DeletePage(sal_uInt16 nPgNum) override;
278 SAL_DLLPRIVATE SdrPage* RemovePage(sal_uInt16 nPgNum) override;
280 SAL_DLLPRIVATE virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) override;
281 SAL_DLLPRIVATE virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum) override;
283 SAL_DLLPRIVATE void RemoveUnnecessaryMasterPages( SdPage* pMaster=nullptr, bool bOnlyDuplicatePages=false, bool bUndo=true );
284 void SetMasterPage(sal_uInt16 nSdPageNum, const OUString& rLayoutName,
285 SdDrawDocument* pSourceDoc, bool bMaster, bool bCheckMasters);
287 SdDrawDocument* OpenBookmarkDoc(const OUString& rBookmarkFile);
288 SAL_DLLPRIVATE SdDrawDocument* OpenBookmarkDoc(SfxMedium* pMedium);
290 SAL_DLLPRIVATE void InsertBookmark(const std::vector<OUString> &rBookmarkList,
291 std::vector<OUString> &rExchangeList, bool bLink,
292 sal_uInt16 nPgPos,
293 ::sd::DrawDocShell* pBookmarkDocSh,
294 Point const * pObjPos);
296 SAL_DLLPRIVATE bool IsStartWithPresentation() const { return mbStartWithPresentation;}
297 SAL_DLLPRIVATE void SetStartWithPresentation( bool bStartWithPresentation );
299 SAL_DLLPRIVATE bool IsExitAfterPresenting() const { return mbExitAfterPresenting;}
300 SAL_DLLPRIVATE void SetExitAfterPresenting( bool bExitAfterPresenting );
302 /// load xml-based impress layout definitions into document
303 SAL_DLLPRIVATE void InitLayoutVector();
304 /// return reference to vector of Impress layout definitions
305 SAL_DLLPRIVATE const std::vector<css::uno::Reference< css::xml::dom::XNode> >& GetLayoutVector() const
306 { return maLayoutInfo; }
308 /// load xml-based impress master presentation object definitions into document
309 SAL_DLLPRIVATE void InitObjectVector();
310 /// return reference to vector of master presentation object definitions
311 SAL_DLLPRIVATE const std::vector<css::uno::Reference<css::xml::dom::XNode> >& GetObjectVector() const { return maPresObjectInfo; }
312 /** Insert pages into this document
314 This method inserts whole pages into this document, either
315 selected ones (specified via pBookmarkList/pExchangeList), or
316 all from the source document.
318 @attention Beware! This method in its current state does not
319 handle all combinations of their input parameters
320 correctly. For example, for pBookmarkList=NULL, bReplace=true
321 is ignored (no replace happens).
323 @param pBookmarkList
324 A list of strings, denoting the names of the pages to be copied
326 @param pExchangeList
327 A list of strings, denoting the names of the pages to be renamed
329 @param bLink
330 Whether the inserted pages should be linked to the bookmark document
332 @param bReplace
333 Whether the pages should not be inserted, but replace the pages in
334 the destination document
336 @param nPgPos
337 Insertion point/start of replacement
339 @param bNoDialogs
340 Whether query dialogs are allowed (e.g. for page scaling)
342 @param pBookmarkDocSh
343 DocShell of the source document (used e.g. to extract the filename
344 for linked pages)
346 @param bCopy
347 Whether the source document should be treated as immutable (i.e.
348 inserted pages are not removed from it, but cloned)
350 @param bMergeMasterPages
351 Whether the source document's master pages should be copied, too.
353 @param bPreservePageNames
354 Whether the replace operation should take the name from the new
355 page, or preserve the old name
358 SAL_DLLPRIVATE bool InsertBookmarkAsPage(const std::vector<OUString> &rBookmarkList,
359 std::vector<OUString> *pExchangeList,
360 bool bLink, bool bReplace, sal_uInt16 nPgPos,
361 bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
362 bool bCopy, bool bMergeMasterPages,
363 bool bPreservePageNames);
365 SAL_DLLPRIVATE bool InsertBookmarkAsObject(const std::vector<OUString> &rBookmarkList,
366 const std::vector<OUString> &rExchangeList,
367 ::sd::DrawDocShell* pBookmarkDocSh,
368 Point const * pObjPos, bool bCalcObjCount);
370 void CloseBookmarkDoc();
372 SAL_DLLPRIVATE SdrObject* GetObj(const OUString& rObjName) const;
374 /** Return the first page that has the given name. Regular pages and
375 notes pages are searched first. When not found then the master
376 pages are searched.
377 @param rPgName
378 Name of the page to return.
379 @param rbIsMasterPage
380 Is set by the method to indicate whether the returned index
381 belongs to a master page (<TRUE/>) or a regular or notes page
382 (<FALSE/>). The given value is ignored.
383 @return
384 Returns the index of the page with the given name or
385 SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist.
387 SAL_DLLPRIVATE sal_uInt16 GetPageByName(const OUString& rPgName, bool& rbIsMasterPage ) const;
388 /** checks, if the given name is a *unique* name for an *existing* slide
390 @param rPageName the name of an existing slide
392 @return true, if the name is unique and the slide exists
394 bool IsPageNameUnique( const OUString& rPageName ) const;
395 SdPage*GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const;
396 sal_uInt16 GetSdPageCount(PageKind ePgKind) const;
398 SAL_DLLPRIVATE void SetSelected(SdPage* pPage, bool bSelect);
399 SAL_DLLPRIVATE void UnselectAllPages();
400 SAL_DLLPRIVATE bool MovePages(sal_uInt16 nTargetPage);
402 SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
403 sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const;
405 sal_uInt16 GetActiveSdPageCount() const;
407 SAL_DLLPRIVATE sal_uInt16 GetMasterPageUserCount(SdrPage const * pMaster) const;
409 SAL_DLLPRIVATE const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; }
410 SAL_DLLPRIVATE sd::PresentationSettings& getPresentationSettings() { return maPresentationSettings; }
412 SAL_DLLPRIVATE const css::uno::Reference< css::presentation::XPresentation2 >& getPresentation() const;
414 SAL_DLLPRIVATE void SetSummationOfParagraphs( bool bOn = true ) { mbSummationOfParagraphs = bOn; }
415 SAL_DLLPRIVATE bool IsSummationOfParagraphs() const { return mbSummationOfParagraphs; }
417 /** Set the mode that controls whether (and later how) the formatting of the document
418 depends on the current printer metrics.
419 @param nMode
420 Use <const
421 scope="css::document::PrinterIndependentLayout">ENABLED</const>
422 to make formatting printer-independent and <const
423 scope="css::document::PrinterIndependentLayout">DISABLED</const>
424 to make formatting depend on the current printer metrics.
426 SAL_DLLPRIVATE void SetPrinterIndependentLayout (sal_Int32 nMode);
428 /** Get the flag that controls whether the formatting of the document
429 depends on the current printer metrics.
430 @return
431 Use <const
432 scope="css::document::PrinterIndependentLayout">ENABLED</const>
433 when formatting is printer-independent and <const
434 scope="css::document::PrinterIndependentLayout">DISABLED</const>
435 when formatting depends on the current printer metrics.
437 SAL_DLLPRIVATE sal_Int32 GetPrinterIndependentLayout() const { return mnPrinterIndependentLayout;}
439 SAL_DLLPRIVATE void SetOnlineSpell( bool bIn );
440 SAL_DLLPRIVATE bool GetOnlineSpell() const { return mbOnlineSpell; }
441 SAL_DLLPRIVATE void StopOnlineSpelling();
442 SAL_DLLPRIVATE void StartOnlineSpelling(bool bForceSpelling=true);
444 SAL_DLLPRIVATE void ImpOnlineSpellCallback(SpellCallbackInfo const * pInfo, SdrObject* pObj, SdrOutliner const * pOutl);
446 SAL_DLLPRIVATE void InsertObject(SdrObject* pObj);
447 SAL_DLLPRIVATE void RemoveObject(SdrObject* pObj);
449 SAL_DLLPRIVATE sal_uLong GetLinkCount() const;
451 SAL_DLLPRIVATE std::vector<std::unique_ptr<sd::FrameView>>& GetFrameViewList() { return maFrameViewList; }
452 SdCustomShowList* GetCustomShowList(bool bCreate = false);
454 SAL_DLLPRIVATE void NbcSetChanged(bool bFlag);
456 SAL_DLLPRIVATE void SetTextDefaults() const;
458 SAL_DLLPRIVATE void CreateLayoutTemplates();
459 SAL_DLLPRIVATE void RenameLayoutTemplate(const OUString& rOldLayoutName, const OUString& rNewName);
461 SAL_DLLPRIVATE void CreateDefaultCellStyles();
463 void StopWorkStartupDelay();
465 SAL_DLLPRIVATE void NewOrLoadCompleted(DocCreationMode eMode);
466 SAL_DLLPRIVATE void NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool );
467 SAL_DLLPRIVATE bool IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted; }
469 SAL_DLLPRIVATE ::sd::FrameView* GetFrameView(sal_uLong nPos) {
470 return nPos < maFrameViewList.size() ? maFrameViewList[nPos].get() : nullptr; }
472 /** deprecated*/
473 SAL_DLLPRIVATE static SdAnimationInfo* GetAnimationInfo(SdrObject* pObject);
475 static SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false );
477 SAL_DLLPRIVATE CharClass* GetCharClass() const { return mpCharClass.get(); }
479 SAL_DLLPRIVATE void UpdateAllLinks();
481 SAL_DLLPRIVATE void CheckMasterPages();
483 SAL_DLLPRIVATE void Merge(SdrModel& rSourceModel,
484 sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
485 sal_uInt16 nDestPos,
486 bool bMergeMasterPages, bool bAllMasterPages,
487 bool bUndo = true, bool bTreadSourceAsConst = false) override;
489 css::text::WritingMode GetDefaultWritingMode() const;
490 SAL_DLLPRIVATE void SetDefaultWritingMode( css::text::WritingMode eMode );
492 /** replacespOldPage from all custom shows with pNewPage or removes pOldPage from
493 all custom shows if pNewPage is 0.
495 SAL_DLLPRIVATE void ReplacePageInCustomShows( const SdPage* pOldPage, const SdPage* pNewPage );
497 public:
499 /// static to prevent recursions while resolving links
500 SAL_DLLPRIVATE static SdDrawDocument* s_pDocLockedInsertingLinks;
502 /** Create and insert a set of two new pages: a standard (draw) page and
503 the associated notes page. The new pages are inserted directly
504 after the specified page set.
505 @param pCurrentPage
506 This page is used to retrieve the layout for the page to
507 create.
508 @param ePageKind
509 This specifies whether <argument>pCurrentPage</argument> is a
510 standard (draw) page or a notes page.
511 @param sStandardPageName
512 Name of the standard page. An empty string leads to using an
513 automatically created name.
514 @param sNotesPageName
515 Name of the standard page. An empty string leads to using an
516 automatically created name.
517 @param eStandardLayout
518 Layout to use for the new standard page. Note that this layout
519 is not used when the given <argument>pCurrentPage</argument> is
520 not a standard page. In this case the layout is taken from the
521 standard page associated with <argument>pCurrentPage</argument>.
522 @param eNotesLayout
523 Layout to use for the new notes page. Note that this layout
524 is not used when the given <argument>pCurrentPage</argument> is
525 not a notes page. In this case the layout is taken from the
526 notes page associated with <argument>pCurrentPage</argument>.
527 @param bIsPageBack
528 This flag indicates whether to show the background shape.
529 @param bIsPageObj
530 This flag indicates whether to show the shapes on the master page.
531 @param nInsertPosition
532 Position where to insert the standard page. When -1 then the
533 new page set is inserted after the current page.
535 @return
536 Returns an index of the inserted pages that can be used with the
537 <member>GetSdPage()</member> method.
539 SAL_DLLPRIVATE sal_uInt16 CreatePage (
540 SdPage* pCurrentPage,
541 PageKind ePageKind,
542 const OUString& sStandardPageName,
543 const OUString& sNotesPageName,
544 AutoLayout eStandardLayout,
545 AutoLayout eNotesLayout,
546 bool bIsPageBack,
547 bool bIsPageObj,
548 const sal_Int32 nInsertPosition);
550 /** This method acts as a simplified front end for the more complex
551 <member>DuplicatePage()</member> method.
552 @param nPageNum
553 The page number as passed to the <member>GetSdPage()</member>
554 method for which the standard page and the notes page are to be
555 copied.
556 @return
557 Returns an index of the inserted pages that can be used with the
558 <member>GetSdPage()</member> method.
560 SAL_DLLPRIVATE sal_uInt16 DuplicatePage (sal_uInt16 nPageNum);
562 /** Create and insert a set of two new pages that are copies of the
563 given <argument>pCurrentPage</argument> and its associated notes
564 resp. standard page. The copies are inserted directly after the
565 specified page set.
566 @param pCurrentPage
567 This page and its associated notes/standard page is copied.
568 @param ePageKind
569 This specifies whether <argument>pCurrentPage</argument> is a
570 standard (draw) page or a notes page.
571 @param sStandardPageName
572 Name of the standard page. An empty string leads to using an
573 automatically created name.
574 @param sNotesPageName
575 Name of the standard page. An empty string leads to using an
576 automatically created name.
577 @param bIsPageBack
578 This flag indicates whether to show the background shape.
579 @param bIsPageObj
580 This flag indicates whether to show the shapes on the master page.
581 @param nInsertPosition
582 Position where to insert the standard page. When -1 then the
583 new page set is inserted after the current page.
585 @return
586 Returns an index of the inserted pages that can be used with the
587 <member>GetSdPage()</member> method.
589 SAL_DLLPRIVATE sal_uInt16 DuplicatePage (
590 SdPage* pCurrentPage,
591 PageKind ePageKind,
592 const OUString& sStandardPageName,
593 const OUString& sNotesPageName,
594 bool bIsPageBack,
595 bool bIsPageObj,
596 const sal_Int32 nInsertPosition);
598 /** return the document fonts for latin, cjk and ctl according to the current
599 languages set at this document */
600 SAL_DLLPRIVATE void getDefaultFonts( vcl::Font& rLatinFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont );
602 sd::UndoManager* GetUndoManager() const;
604 /** converts the given western font height to a corresponding ctl font height, depending on the system language */
605 SAL_DLLPRIVATE static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight );
607 /** Get the style sheet pool if it was a SdStyleSheetPool.
609 SdStyleSheetPool* GetSdStyleSheetPool() const;
611 SAL_DLLPRIVATE void UpdatePageRelativeURLs(const OUString& rOldName, const OUString& rNewName);
613 SAL_DLLPRIVATE static void SetCalcFieldValueHdl( ::Outliner* pOutliner);
615 SAL_DLLPRIVATE sal_uInt16 GetAnnotationAuthorIndex( const OUString& rAuthor );
617 SAL_DLLPRIVATE bool IsEmbedFonts() const { return mbEmbedFonts; }
618 SAL_DLLPRIVATE bool IsEmbedUsedFontsOnly() const { return mbEmbedUsedFontsOnly; }
619 SAL_DLLPRIVATE bool IsEmbedFontScriptLatin() const { return mbEmbedFontScriptLatin; }
620 SAL_DLLPRIVATE bool IsEmbedFontScriptAsian() const { return mbEmbedFontScriptAsian; }
621 SAL_DLLPRIVATE bool IsEmbedFontScriptComplex() const { return mbEmbedFontScriptComplex; }
623 SAL_DLLPRIVATE void SetEmbedFonts(bool bUse) { mbEmbedFonts = bUse; }
624 SAL_DLLPRIVATE void SetEmbedUsedFontsOnly(bool bUse) { mbEmbedUsedFontsOnly = bUse; }
625 SAL_DLLPRIVATE void SetEmbedFontScriptLatin(bool bUse) { mbEmbedFontScriptLatin = bUse; }
626 SAL_DLLPRIVATE void SetEmbedFontScriptAsian(bool bUse) { mbEmbedFontScriptAsian = bUse; }
627 SAL_DLLPRIVATE void SetEmbedFontScriptComplex(bool bUse) { mbEmbedFontScriptComplex = bUse; }
629 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
631 private:
632 /** This member stores the printer independent layout mode. Please
633 refer to <member>SetPrinterIndependentLayout()</member> for its
634 values.
636 sal_Int32 mnPrinterIndependentLayout;
638 /** Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>.
639 @param pCurrentPage
640 This page and its associated notes/standard page is copied.
641 @param ePageKind
642 This specifies whether <argument>pCurrentPage</argument> is a
643 standard (draw) page or a notes page.
644 @param sStandardPageName
645 Name of the standard page. An empty string leads to using an
646 automatically created name.
647 @param sNotesPageName
648 Name of the standard page. An empty string leads to using an
649 automatically created name.
650 @param bIsPageBack
651 This flag indicates whether to show the background shape.
652 @param bIsPageObj
653 This flag indicates whether to show the shapes on the master page.
654 @param pStandardPage
655 The standard page to insert.
656 @param pNotesPage
657 The notes page to insert.
658 @param nInsertPosition
659 Position where to insert the standard page. When -1 then the
660 new page set is inserted after the current page.
662 @return
663 Returns an index of the inserted pages that can be used with the
664 <member>GetSdPage()</member> method.
666 SAL_DLLPRIVATE sal_uInt16 InsertPageSet (
667 SdPage* pCurrentPage,
668 PageKind ePageKind,
669 const OUString& sStandardPageName,
670 const OUString& sNotesPageName,
671 bool bIsPageBack,
672 bool bIsPageObj,
673 SdPage* pStandardPage,
674 SdPage* pNotesPage,
675 sal_Int32 nInsertPosition);
677 /** Set up a newly created page and insert it into the list of pages.
678 @param pPreviousPage
679 A page to take the size and border geometry from.
680 @param pPage
681 This is the page to set up and insert.
682 @param sPageName
683 The name of the new page.
684 @param nInsertionPoint
685 Index of the page before which the new page will be inserted.
686 @param bIsPageBack
687 This flag indicates whether to show the background shape.
688 @param bIsPageObj
689 This flag indicates whether to show the shapes on the master
690 page.
692 SAL_DLLPRIVATE void SetupNewPage (
693 SdPage const * pPreviousPage,
694 SdPage* pPage,
695 const OUString& sPageName,
696 sal_uInt16 nInsertionPoint,
697 bool bIsPageBack,
698 bool bIsPageObj);
700 SAL_DLLPRIVATE virtual void PageListChanged() override;
701 SAL_DLLPRIVATE virtual void MasterPageListChanged() override;
704 namespace sd
707 /**an instance of this guard disables modification of a document
708 during its lifetime*/
709 class ModifyGuard
711 public:
712 ModifyGuard( SdDrawDocument* pDoc );
713 ~ModifyGuard();
715 private:
716 void init();
718 DrawDocShell* mpDocShell;
719 SdDrawDocument* mpDoc;
720 bool mbIsEnableSetModified;
721 bool mbIsDocumentChanged;
726 #endif // INCLUDED_SD_INC_DRAWDOC_HXX
728 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */