nss: upgrade to release 3.73
[LibreOffice.git] / sd / inc / drawdoc.hxx
blob2d05e269ff58f4580656d99885ab5cf205ef145b
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::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;
112 PresentationSettings();
116 // SdDrawDocument
117 class SD_DLLPUBLIC SdDrawDocument final : public FmFormModel
119 public:
120 SAL_DLLPRIVATE void setDocAccTitle( const OUString& rTitle ) { msDocAccTitle = rTitle; }
121 SAL_DLLPRIVATE const OUString& getDocAccTitle() const { return msDocAccTitle; }
122 SAL_DLLPRIVATE bool getDocReadOnly() const { return m_bReadOnly; }
123 private:
124 OUString msDocAccTitle;
125 std::unique_ptr<SdOutliner>
126 mpOutliner; ///< local outliner for outline mode
127 std::unique_ptr<SdOutliner>
128 mpInternalOutliner; ///< internal outliner for creation of text objects
129 std::unique_ptr<Timer> mpWorkStartupTimer;
130 std::unique_ptr<Idle>
131 mpOnlineSpellingIdle;
132 std::unique_ptr<sd::ShapeList>
133 mpOnlineSpellingList;
134 std::unique_ptr<SvxSearchItem>
135 mpOnlineSearchItem;
136 std::vector<std::unique_ptr<sd::FrameView>>
137 maFrameViewList;
138 std::unique_ptr<SdCustomShowList> mpCustomShowList;
139 ::sd::DrawDocShell* mpDocSh;
140 SdTransferable * mpCreatingTransferable;
141 bool mbHasOnlineSpellErrors;
142 bool mbInitialOnlineSpellingEnabled;
143 OUString maBookmarkFile;
144 ::sd::DrawDocShellRef mxBookmarkDocShRef;
146 sd::PresentationSettings maPresentationSettings;
148 css::uno::Reference< css::presentation::XPresentation2 > mxPresentation;
150 bool mbNewOrLoadCompleted;
152 bool mbOnlineSpell;
153 bool mbSummationOfParagraphs;
154 bool mbStartWithPresentation; ///< is set to true when starting with command line parameter -start
155 bool mbExitAfterPresenting; ///< true if mbStartWithPresentation AND Presentation was shown fully
156 LanguageType meLanguage;
157 LanguageType meLanguageCJK;
158 LanguageType meLanguageCTL;
159 SvxNumType mePageNumType;
160 ::sd::DrawDocShellRef mxAllocedDocShRef; // => AllocModel()
161 bool mbAllocDocSh; // => AllocModel()
162 DocumentType meDocType;
163 std::unique_ptr<CharClass>
164 mpCharClass;
166 ::std::unique_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher;
167 ::std::unique_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher;
169 SAL_DLLPRIVATE void UpdatePageObjectsInNotes(sal_uInt16 nStartPos);
170 SAL_DLLPRIVATE void UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPos, sal_Int32 nIncrement);
171 SAL_DLLPRIVATE void FillOnlineSpellingList(SdPage const * pPage);
172 SAL_DLLPRIVATE void SpellObject(SdrTextObj* pObj);
174 DECL_DLLPRIVATE_LINK(WorkStartupHdl, Timer *, void);
175 DECL_DLLPRIVATE_LINK(OnlineSpellingHdl, Timer *, void);
176 DECL_DLLPRIVATE_LINK(OnlineSpellEventHdl, EditStatus&, void);
178 std::vector< OUString > maAnnotationAuthors;
179 std::vector<css::uno::Reference< css::xml::dom::XNode> > maLayoutInfo;
181 std::vector<css::uno::Reference< css::xml::dom::XNode> > maPresObjectInfo;
183 bool mbEmbedFonts : 1;
184 bool mbEmbedUsedFontsOnly : 1;
185 bool mbEmbedFontScriptLatin : 1;
186 bool mbEmbedFontScriptAsian : 1;
187 bool mbEmbedFontScriptComplex : 1;
189 SAL_DLLPRIVATE virtual css::uno::Reference< css::uno::XInterface > createUnoModel() override;
191 public:
194 SAL_DLLPRIVATE SdDrawDocument(DocumentType eType, SfxObjectShell* pDocSh);
195 SAL_DLLPRIVATE virtual ~SdDrawDocument() override;
197 // Adapt to given Size and Borders scaling all contained data, maybe
198 // including PresObj's in higher derivations
199 virtual void adaptSizeAndBorderForAllPages(
200 const Size& rNewSize,
201 tools::Long nLeft = 0,
202 tools::Long nRight = 0,
203 tools::Long nUpper = 0,
204 tools::Long nLower = 0) override;
206 // Adapt PageSize for all Pages of PageKind ePageKind. Also
207 // set Borders to left/right/upper/lower, ScaleAll, Orientation,
208 // PaperBin and BackgroundFullSize. Create Undo-Actions when
209 // a SdUndoGroup is given (then used from the View probably)
210 void AdaptPageSizeForAllPages(
211 const Size& rNewSize,
212 PageKind ePageKind,
213 SdUndoGroup* pUndoGroup = nullptr,
214 tools::Long nLeft = 0,
215 tools::Long nRight = 0,
216 tools::Long nUpper = 0,
217 tools::Long nLower = 0,
218 bool bScaleAll = false,
219 Orientation eOrientation = Orientation::Landscape,
220 sal_uInt16 nPaperBin = 0,
221 bool bBackgroundFullSize = false);
223 SAL_DLLPRIVATE SdDrawDocument* AllocSdDrawDocument() const;
224 SAL_DLLPRIVATE virtual SdrModel* AllocModel() const override; //forwards to AllocSdDrawDocument
226 SAL_DLLPRIVATE SdPage* AllocSdPage(bool bMasterPage);
227 SAL_DLLPRIVATE virtual SdrPage* AllocPage(bool bMasterPage) override; //forwards to AllocSdPage
229 SAL_DLLPRIVATE virtual bool IsReadOnly() const override;
230 SAL_DLLPRIVATE virtual void SetChanged(bool bFlag = true) override;
232 SAL_DLLPRIVATE SfxItemPool& GetPool() { return( *m_pItemPool ); }
234 SAL_DLLPRIVATE SdOutliner* GetOutliner(bool bCreateOutliner=true);
235 SdOutliner* GetInternalOutliner(bool bCreateOutliner=true);
237 SAL_DLLPRIVATE ::sd::DrawDocShell* GetDocSh() const { return mpDocSh; }
239 SAL_DLLPRIVATE LanguageType GetLanguage( const sal_uInt16 nId ) const;
240 SAL_DLLPRIVATE void SetLanguage( const LanguageType eLang, const sal_uInt16 nId );
242 SAL_DLLPRIVATE SvxNumType GetPageNumType() const override;
243 SAL_DLLPRIVATE void SetPageNumType(SvxNumType eType) { mePageNumType = eType; }
244 OUString CreatePageNumValue(sal_uInt16 nNum) const;
246 SAL_DLLPRIVATE DocumentType GetDocumentType() const { return meDocType; }
248 SAL_DLLPRIVATE void SetAllocDocSh(bool bAlloc);
250 SAL_DLLPRIVATE void CreatingDataObj( SdTransferable* pTransferable ) { mpCreatingTransferable = pTransferable; }
251 SAL_DLLPRIVATE virtual bool IsCreatingDataObj() const override { return mpCreatingTransferable != nullptr; }
253 /** if the document does not contain at least one handout, one slide and one notes page with
254 at least one master each this methods creates them.
255 If a reference document is given, the sizes and border settings of that document are used
256 for newly created slides.
258 void CreateFirstPages( SdDrawDocument const * pRefDocument = nullptr );
259 bool CreateMissingNotesAndHandoutPages();
261 SAL_DLLPRIVATE void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos) override;
262 SAL_DLLPRIVATE void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) override;
263 SAL_DLLPRIVATE void DeletePage(sal_uInt16 nPgNum) override;
264 SAL_DLLPRIVATE SdrPage* RemovePage(sal_uInt16 nPgNum) override;
266 SAL_DLLPRIVATE virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) override;
267 SAL_DLLPRIVATE virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum) override;
269 SAL_DLLPRIVATE void RemoveUnnecessaryMasterPages( SdPage* pMaster=nullptr, bool bOnlyDuplicatePages=false, bool bUndo=true );
270 void SetMasterPage(sal_uInt16 nSdPageNum, const OUString& rLayoutName,
271 SdDrawDocument* pSourceDoc, bool bMaster, bool bCheckMasters);
273 SdDrawDocument* OpenBookmarkDoc(const OUString& rBookmarkFile);
274 SAL_DLLPRIVATE SdDrawDocument* OpenBookmarkDoc(SfxMedium* pMedium);
276 SAL_DLLPRIVATE void InsertBookmark(const std::vector<OUString> &rBookmarkList,
277 std::vector<OUString> &rExchangeList, bool bLink,
278 sal_uInt16 nPgPos,
279 ::sd::DrawDocShell* pBookmarkDocSh,
280 Point const * pObjPos);
282 SAL_DLLPRIVATE bool IsStartWithPresentation() const { return mbStartWithPresentation;}
283 SAL_DLLPRIVATE void SetStartWithPresentation( bool bStartWithPresentation );
285 SAL_DLLPRIVATE bool IsExitAfterPresenting() const { return mbExitAfterPresenting;}
286 SAL_DLLPRIVATE void SetExitAfterPresenting( bool bExitAfterPresenting );
288 /// load xml-based impress layout definitions into document
289 SAL_DLLPRIVATE void InitLayoutVector();
290 /// return reference to vector of Impress layout definitions
291 SAL_DLLPRIVATE const std::vector<css::uno::Reference< css::xml::dom::XNode> >& GetLayoutVector() const
292 { return maLayoutInfo; }
294 /// load xml-based impress master presentation object definitions into document
295 SAL_DLLPRIVATE void InitObjectVector();
296 /// return reference to vector of master presentation object definitions
297 SAL_DLLPRIVATE const std::vector<css::uno::Reference<css::xml::dom::XNode> >& GetObjectVector() const { return maPresObjectInfo; }
298 /** Insert pages into this document
300 This method inserts whole pages into this document, either
301 selected ones (specified via pBookmarkList/pExchangeList), or
302 all from the source document.
304 @attention Beware! This method in its current state does not
305 handle all combinations of their input parameters
306 correctly. For example, for pBookmarkList=NULL, bReplace=true
307 is ignored (no replace happens).
309 @param pBookmarkList
310 A list of strings, denoting the names of the pages to be copied
312 @param pExchangeList
313 A list of strings, denoting the names of the pages to be renamed
315 @param bLink
316 Whether the inserted pages should be linked to the bookmark document
318 @param bReplace
319 Whether the pages should not be inserted, but replace the pages in
320 the destination document
322 @param nPgPos
323 Insertion point/start of replacement
325 @param bNoDialogs
326 Whether query dialogs are allowed (e.g. for page scaling)
328 @param pBookmarkDocSh
329 DocShell of the source document (used e.g. to extract the filename
330 for linked pages)
332 @param bCopy
333 Whether the source document should be treated as immutable (i.e.
334 inserted pages are not removed from it, but cloned)
336 @param bMergeMasterPages
337 Whether the source document's master pages should be copied, too.
339 @param bPreservePageNames
340 Whether the replace operation should take the name from the new
341 page, or preserve the old name
344 SAL_DLLPRIVATE bool InsertBookmarkAsPage(const std::vector<OUString> &rBookmarkList,
345 std::vector<OUString> *pExchangeList,
346 bool bLink, bool bReplace, sal_uInt16 nPgPos,
347 bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
348 bool bCopy, bool bMergeMasterPages,
349 bool bPreservePageNames);
351 SAL_DLLPRIVATE bool InsertBookmarkAsObject(const std::vector<OUString> &rBookmarkList,
352 const std::vector<OUString> &rExchangeList,
353 ::sd::DrawDocShell* pBookmarkDocSh,
354 Point const * pObjPos, bool bCalcObjCount);
356 void CloseBookmarkDoc();
358 SAL_DLLPRIVATE SdrObject* GetObj(const OUString& rObjName) const;
360 /** Return the first page that has the given name. Regular pages and
361 notes pages are searched first. When not found then the master
362 pages are searched.
363 @param rPgName
364 Name of the page to return.
365 @param rbIsMasterPage
366 Is set by the method to indicate whether the returned index
367 belongs to a master page (<TRUE/>) or a regular or notes page
368 (<FALSE/>). The given value is ignored.
369 @return
370 Returns the index of the page with the given name or
371 SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist.
373 SAL_DLLPRIVATE sal_uInt16 GetPageByName(const OUString& rPgName, bool& rbIsMasterPage ) const;
374 /** checks, if the given name is a *unique* name for an *existing* slide
376 @param rPageName the name of an existing slide
378 @return true, if the name is unique and the slide exists
380 bool IsPageNameUnique( const OUString& rPageName ) const;
381 SdPage*GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const;
382 sal_uInt16 GetSdPageCount(PageKind ePgKind) const;
384 SAL_DLLPRIVATE void SetSelected(SdPage* pPage, bool bSelect);
385 SAL_DLLPRIVATE void UnselectAllPages();
386 SAL_DLLPRIVATE bool MovePages(sal_uInt16 nTargetPage);
388 SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
389 sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const;
391 sal_uInt16 GetActiveSdPageCount() const;
393 SAL_DLLPRIVATE sal_uInt16 GetMasterPageUserCount(SdrPage const * pMaster) const;
395 SAL_DLLPRIVATE const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; }
396 SAL_DLLPRIVATE sd::PresentationSettings& getPresentationSettings() { return maPresentationSettings; }
398 SAL_DLLPRIVATE const css::uno::Reference< css::presentation::XPresentation2 >& getPresentation() const;
400 SAL_DLLPRIVATE void SetSummationOfParagraphs( bool bOn = true ) { mbSummationOfParagraphs = bOn; }
401 SAL_DLLPRIVATE bool IsSummationOfParagraphs() const { return mbSummationOfParagraphs; }
403 /** Set the mode that controls whether (and later how) the formatting of the document
404 depends on the current printer metrics.
405 @param nMode
406 Use <const
407 scope="css::document::PrinterIndependentLayout">ENABLED</const>
408 to make formatting printer-independent and <const
409 scope="css::document::PrinterIndependentLayout">DISABLED</const>
410 to make formatting depend on the current printer metrics.
412 SAL_DLLPRIVATE void SetPrinterIndependentLayout (sal_Int32 nMode);
414 /** Get the flag that controls whether the formatting of the document
415 depends on the current printer metrics.
416 @return
417 Use <const
418 scope="css::document::PrinterIndependentLayout">ENABLED</const>
419 when formatting is printer-independent and <const
420 scope="css::document::PrinterIndependentLayout">DISABLED</const>
421 when formatting depends on the current printer metrics.
423 SAL_DLLPRIVATE sal_Int32 GetPrinterIndependentLayout() const { return mnPrinterIndependentLayout;}
425 SAL_DLLPRIVATE void SetOnlineSpell( bool bIn );
426 SAL_DLLPRIVATE bool GetOnlineSpell() const { return mbOnlineSpell; }
427 SAL_DLLPRIVATE void StopOnlineSpelling();
428 SAL_DLLPRIVATE void StartOnlineSpelling(bool bForceSpelling=true);
430 SAL_DLLPRIVATE void ImpOnlineSpellCallback(SpellCallbackInfo const * pInfo, SdrObject* pObj, SdrOutliner const * pOutl);
432 SAL_DLLPRIVATE void InsertObject(SdrObject* pObj);
433 SAL_DLLPRIVATE void RemoveObject(SdrObject* pObj);
435 SAL_DLLPRIVATE sal_uLong GetLinkCount() const;
437 SAL_DLLPRIVATE std::vector<std::unique_ptr<sd::FrameView>>& GetFrameViewList() { return maFrameViewList; }
438 SdCustomShowList* GetCustomShowList(bool bCreate = false);
440 SAL_DLLPRIVATE void NbcSetChanged(bool bFlag);
442 SAL_DLLPRIVATE void SetTextDefaults() const;
444 SAL_DLLPRIVATE void CreateLayoutTemplates();
445 SAL_DLLPRIVATE void RenameLayoutTemplate(const OUString& rOldLayoutName, const OUString& rNewName);
447 SAL_DLLPRIVATE void CreateDefaultCellStyles();
449 void StopWorkStartupDelay();
451 SAL_DLLPRIVATE void NewOrLoadCompleted(DocCreationMode eMode);
452 SAL_DLLPRIVATE void NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool );
453 SAL_DLLPRIVATE bool IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted; }
455 SAL_DLLPRIVATE ::sd::FrameView* GetFrameView(sal_uLong nPos) {
456 return nPos < maFrameViewList.size() ? maFrameViewList[nPos].get() : nullptr; }
458 /** deprecated*/
459 SAL_DLLPRIVATE static SdAnimationInfo* GetAnimationInfo(SdrObject* pObject);
461 static SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false );
463 SAL_DLLPRIVATE CharClass* GetCharClass() const { return mpCharClass.get(); }
465 SAL_DLLPRIVATE void UpdateAllLinks();
467 SAL_DLLPRIVATE void CheckMasterPages();
469 SAL_DLLPRIVATE void Merge(SdrModel& rSourceModel,
470 sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
471 sal_uInt16 nDestPos,
472 bool bMergeMasterPages, bool bAllMasterPages,
473 bool bUndo = true, bool bTreadSourceAsConst = false) override;
475 css::text::WritingMode GetDefaultWritingMode() const;
476 SAL_DLLPRIVATE void SetDefaultWritingMode( css::text::WritingMode eMode );
478 /** replacespOldPage from all custom shows with pNewPage or removes pOldPage from
479 all custom shows if pNewPage is 0.
481 SAL_DLLPRIVATE void ReplacePageInCustomShows( const SdPage* pOldPage, const SdPage* pNewPage );
483 public:
485 /// static to prevent recursions while resolving links
486 SAL_DLLPRIVATE static SdDrawDocument* s_pDocLockedInsertingLinks;
488 /** Create and insert a set of two new pages: a standard (draw) page and
489 the associated notes page. The new pages are inserted directly
490 after the specified page set.
491 @param pCurrentPage
492 This page is used to retrieve the layout for the page to
493 create.
494 @param ePageKind
495 This specifies whether <argument>pCurrentPage</argument> is a
496 standard (draw) page or a notes page.
497 @param sStandardPageName
498 Name of the standard page. An empty string leads to using an
499 automatically created name.
500 @param sNotesPageName
501 Name of the standard page. An empty string leads to using an
502 automatically created name.
503 @param eStandardLayout
504 Layout to use for the new standard page. Note that this layout
505 is not used when the given <argument>pCurrentPage</argument> is
506 not a standard page. In this case the layout is taken from the
507 standard page associated with <argument>pCurrentPage</argument>.
508 @param eNotesLayout
509 Layout to use for the new notes page. Note that this layout
510 is not used when the given <argument>pCurrentPage</argument> is
511 not a notes page. In this case the layout is taken from the
512 notes page associated with <argument>pCurrentPage</argument>.
513 @param bIsPageBack
514 This flag indicates whether to show the background shape.
515 @param bIsPageObj
516 This flag indicates whether to show the shapes on the master page.
517 @param nInsertPosition
518 Position where to insert the standard page. When -1 then the
519 new page set is inserted after the current page.
521 @return
522 Returns an index of the inserted pages that can be used with the
523 <member>GetSdPage()</member> method.
525 SAL_DLLPRIVATE sal_uInt16 CreatePage (
526 SdPage* pCurrentPage,
527 PageKind ePageKind,
528 const OUString& sStandardPageName,
529 const OUString& sNotesPageName,
530 AutoLayout eStandardLayout,
531 AutoLayout eNotesLayout,
532 bool bIsPageBack,
533 bool bIsPageObj,
534 const sal_Int32 nInsertPosition);
536 /** This method acts as a simplified front end for the more complex
537 <member>DuplicatePage()</member> method.
538 @param nPageNum
539 The page number as passed to the <member>GetSdPage()</member>
540 method for which the standard page and the notes page are to be
541 copied.
542 @return
543 Returns an index of the inserted pages that can be used with the
544 <member>GetSdPage()</member> method.
546 SAL_DLLPRIVATE sal_uInt16 DuplicatePage (sal_uInt16 nPageNum);
548 /** Create and insert a set of two new pages that are copies of the
549 given <argument>pCurrentPage</argument> and its associated notes
550 resp. standard page. The copies are inserted directly after the
551 specified page set.
552 @param pCurrentPage
553 This page and its associated notes/standard page is copied.
554 @param ePageKind
555 This specifies whether <argument>pCurrentPage</argument> is a
556 standard (draw) page or a notes page.
557 @param sStandardPageName
558 Name of the standard page. An empty string leads to using an
559 automatically created name.
560 @param sNotesPageName
561 Name of the standard page. An empty string leads to using an
562 automatically created name.
563 @param bIsPageBack
564 This flag indicates whether to show the background shape.
565 @param bIsPageObj
566 This flag indicates whether to show the shapes on the master page.
567 @param nInsertPosition
568 Position where to insert the standard page. When -1 then the
569 new page set is inserted after the current page.
571 @return
572 Returns an index of the inserted pages that can be used with the
573 <member>GetSdPage()</member> method.
575 SAL_DLLPRIVATE sal_uInt16 DuplicatePage (
576 SdPage* pCurrentPage,
577 PageKind ePageKind,
578 const OUString& sStandardPageName,
579 const OUString& sNotesPageName,
580 bool bIsPageBack,
581 bool bIsPageObj,
582 const sal_Int32 nInsertPosition);
584 /** return the document fonts for latin, cjk and ctl according to the current
585 languages set at this document */
586 SAL_DLLPRIVATE void getDefaultFonts( vcl::Font& rLatinFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont );
588 sd::UndoManager* GetUndoManager() const;
590 /** converts the given western font height to a corresponding ctl font height, depending on the system language */
591 SAL_DLLPRIVATE static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight );
593 /** Get the style sheet pool if it was a SdStyleSheetPool.
595 SdStyleSheetPool* GetSdStyleSheetPool() const;
597 SAL_DLLPRIVATE void UpdatePageRelativeURLs(const OUString& rOldName, const OUString& rNewName);
599 SAL_DLLPRIVATE static void SetCalcFieldValueHdl( ::Outliner* pOutliner);
601 SAL_DLLPRIVATE sal_uInt16 GetAnnotationAuthorIndex( const OUString& rAuthor );
603 SAL_DLLPRIVATE bool IsEmbedFonts() const { return mbEmbedFonts; }
604 SAL_DLLPRIVATE bool IsEmbedUsedFontsOnly() const { return mbEmbedUsedFontsOnly; }
605 SAL_DLLPRIVATE bool IsEmbedFontScriptLatin() const { return mbEmbedFontScriptLatin; }
606 SAL_DLLPRIVATE bool IsEmbedFontScriptAsian() const { return mbEmbedFontScriptAsian; }
607 SAL_DLLPRIVATE bool IsEmbedFontScriptComplex() const { return mbEmbedFontScriptComplex; }
609 SAL_DLLPRIVATE void SetEmbedFonts(bool bUse) { mbEmbedFonts = bUse; }
610 SAL_DLLPRIVATE void SetEmbedUsedFontsOnly(bool bUse) { mbEmbedUsedFontsOnly = bUse; }
611 SAL_DLLPRIVATE void SetEmbedFontScriptLatin(bool bUse) { mbEmbedFontScriptLatin = bUse; }
612 SAL_DLLPRIVATE void SetEmbedFontScriptAsian(bool bUse) { mbEmbedFontScriptAsian = bUse; }
613 SAL_DLLPRIVATE void SetEmbedFontScriptComplex(bool bUse) { mbEmbedFontScriptComplex = bUse; }
615 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
617 private:
618 /** This member stores the printer independent layout mode. Please
619 refer to <member>SetPrinterIndependentLayout()</member> for its
620 values.
622 sal_Int32 mnPrinterIndependentLayout;
624 /** Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>.
625 @param pCurrentPage
626 This page and its associated notes/standard page is copied.
627 @param ePageKind
628 This specifies whether <argument>pCurrentPage</argument> is a
629 standard (draw) page or a notes page.
630 @param sStandardPageName
631 Name of the standard page. An empty string leads to using an
632 automatically created name.
633 @param sNotesPageName
634 Name of the standard page. An empty string leads to using an
635 automatically created name.
636 @param bIsPageBack
637 This flag indicates whether to show the background shape.
638 @param bIsPageObj
639 This flag indicates whether to show the shapes on the master page.
640 @param pStandardPage
641 The standard page to insert.
642 @param pNotesPage
643 The notes page to insert.
644 @param nInsertPosition
645 Position where to insert the standard page. When -1 then the
646 new page set is inserted after the current page.
648 @return
649 Returns an index of the inserted pages that can be used with the
650 <member>GetSdPage()</member> method.
652 SAL_DLLPRIVATE sal_uInt16 InsertPageSet (
653 SdPage* pCurrentPage,
654 PageKind ePageKind,
655 const OUString& sStandardPageName,
656 const OUString& sNotesPageName,
657 bool bIsPageBack,
658 bool bIsPageObj,
659 SdPage* pStandardPage,
660 SdPage* pNotesPage,
661 sal_Int32 nInsertPosition);
663 /** Set up a newly created page and insert it into the list of pages.
664 @param pPreviousPage
665 A page to take the size and border geometry from.
666 @param pPage
667 This is the page to set up and insert.
668 @param sPageName
669 The name of the new page.
670 @param nInsertionPoint
671 Index of the page before which the new page will be inserted.
672 @param bIsPageBack
673 This flag indicates whether to show the background shape.
674 @param bIsPageObj
675 This flag indicates whether to show the shapes on the master
676 page.
678 SAL_DLLPRIVATE void SetupNewPage (
679 SdPage const * pPreviousPage,
680 SdPage* pPage,
681 const OUString& sPageName,
682 sal_uInt16 nInsertionPoint,
683 bool bIsPageBack,
684 bool bIsPageObj);
686 SAL_DLLPRIVATE virtual void PageListChanged() override;
687 SAL_DLLPRIVATE virtual void MasterPageListChanged() override;
690 namespace sd
693 /**an instance of this guard disables modification of a document
694 during its lifetime*/
695 class ModifyGuard
697 public:
698 ModifyGuard( SdDrawDocument* pDoc );
699 ~ModifyGuard();
701 private:
702 void init();
704 DrawDocShell* mpDocShell;
705 SdDrawDocument* mpDoc;
706 bool mbIsEnableSetModified;
707 bool mbIsDocumentChanged;
712 #endif // INCLUDED_SD_INC_DRAWDOC_HXX
714 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */