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