1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <com/sun/star/text/WritingMode.hpp>
23 #include <svl/style.hxx>
24 #include <svx/fmmodel.hxx>
25 #include <unotools/charclass.hxx>
26 #include <vcl/prntypes.hxx>
27 #include <xmloff/autolayout.hxx>
32 #include <string_view>
37 namespace com::sun::star::xml::dom
{ class XNode
; }
38 namespace com::sun::star::uno
{ class XInterface
; }
39 namespace editeng
{ class SvxFieldItemUpdater
; }
40 namespace vcl
{ class Font
; }
41 namespace com::sun::star::presentation
{ class XPresentation2
; }
46 class SdAnimationInfo
;
47 class SdStyleSheetPool
;
53 struct SpellCallbackInfo
;
54 class SdCustomShowList
;
66 class SdXImpressDocument
;
71 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
72 #define SV_DECL_DRAW_DOC_SHELL_DEFINED
73 typedef rtl::Reference
<DrawDocShell
> DrawDocShellRef
;
80 class ImpDrawPageListWatcher
;
81 class ImpMasterPageListWatcher
;
83 struct StyleReplaceData
85 SfxStyleFamily nFamily
;
86 SfxStyleFamily nNewFamily
;
91 enum class DocCreationMode
99 struct PresentationSettings
111 bool mbAnimationAllowed
;
112 sal_Int32 mnPauseTimeout
;
113 bool mbShowPauseLogo
;
114 bool mbStartCustomShow
;
117 PresentationSettings();
122 class SD_DLLPUBLIC SdDrawDocument final
: public FmFormModel
125 SAL_DLLPRIVATE
void setDocAccTitle( const OUString
& rTitle
) { msDocAccTitle
= rTitle
; }
126 SAL_DLLPRIVATE
const OUString
& getDocAccTitle() const { return msDocAccTitle
; }
127 SAL_DLLPRIVATE
bool getDocReadOnly() const { return m_bReadOnly
; }
129 OUString msDocAccTitle
;
130 std::unique_ptr
<SdOutliner
>
131 mpOutliner
; ///< local outliner for outline mode
132 std::unique_ptr
<SdOutliner
>
133 mpInternalOutliner
; ///< internal outliner for creation of text objects
134 std::unique_ptr
<Timer
> mpWorkStartupTimer
;
135 std::unique_ptr
<Idle
>
136 mpOnlineSpellingIdle
;
137 std::unique_ptr
<sd::ShapeList
>
138 mpOnlineSpellingList
;
139 std::unique_ptr
<SvxSearchItem
>
141 std::vector
<std::unique_ptr
<sd::FrameView
>>
143 std::unique_ptr
<SdCustomShowList
> mpCustomShowList
;
144 ::sd::DrawDocShell
* mpDocSh
;
145 SdTransferable
* mpCreatingTransferable
;
146 bool mbHasOnlineSpellErrors
;
147 bool mbInitialOnlineSpellingEnabled
;
148 OUString maBookmarkFile
;
149 ::sd::DrawDocShellRef mxBookmarkDocShRef
;
151 sd::PresentationSettings maPresentationSettings
;
153 css::uno::Reference
< css::presentation::XPresentation2
> mxPresentation
;
155 bool mbNewOrLoadCompleted
;
158 bool mbSummationOfParagraphs
;
159 sal_uInt16 mnStartWithPresentation
; ///< 1-based starting slide# when presenting via command line parameter --show
160 bool mbExitAfterPresenting
; ///< true if GetStartWithPresentation AND Presentation was shown fully
161 LanguageType meLanguage
;
162 LanguageType meLanguageCJK
;
163 LanguageType meLanguageCTL
;
164 SvxNumType mePageNumType
;
165 ::sd::DrawDocShellRef mxAllocedDocShRef
; // => AllocModel()
166 bool mbAllocDocSh
; // => AllocModel()
167 DocumentType meDocType
;
168 std::optional
<CharClass
>
171 ::std::unique_ptr
<ImpDrawPageListWatcher
> mpDrawPageListWatcher
;
172 ::std::unique_ptr
<ImpMasterPageListWatcher
> mpMasterPageListWatcher
;
174 SAL_DLLPRIVATE
void UpdatePageObjectsInNotes(sal_uInt16 nStartPos
);
175 SAL_DLLPRIVATE
void UpdatePageRelativeURLs(SdPage
const * pPage
, sal_uInt16 nPos
, sal_Int32 nIncrement
);
176 SAL_DLLPRIVATE
void FillOnlineSpellingList(SdPage
const * pPage
);
177 SAL_DLLPRIVATE
void SpellObject(SdrTextObj
* pObj
);
179 DECL_DLLPRIVATE_LINK(WorkStartupHdl
, Timer
*, void);
180 DECL_DLLPRIVATE_LINK(OnlineSpellingHdl
, Timer
*, void);
181 DECL_DLLPRIVATE_LINK(OnlineSpellEventHdl
, EditStatus
&, void);
183 std::vector
< OUString
> maAnnotationAuthors
;
184 std::vector
<css::uno::Reference
< css::xml::dom::XNode
> > maLayoutInfo
;
186 std::vector
<css::uno::Reference
< css::xml::dom::XNode
> > maPresObjectInfo
;
188 bool mbEmbedFonts
: 1;
189 bool mbEmbedUsedFontsOnly
: 1;
190 bool mbEmbedFontScriptLatin
: 1;
191 bool mbEmbedFontScriptAsian
: 1;
192 bool mbEmbedFontScriptComplex
: 1;
194 sal_Int32 mnImagePreferredDPI
;
196 SAL_DLLPRIVATE
virtual css::uno::Reference
< css::frame::XModel
> createUnoModel() override
;
201 SAL_DLLPRIVATE
SdDrawDocument(DocumentType eType
, SfxObjectShell
* pDocSh
);
202 SAL_DLLPRIVATE
virtual ~SdDrawDocument() override
;
204 // Adapt to given Size and Borders scaling all contained data, maybe
205 // including PresObj's in higher derivations
206 virtual void adaptSizeAndBorderForAllPages(
207 const Size
& rNewSize
,
208 tools::Long nLeft
= 0,
209 tools::Long nRight
= 0,
210 tools::Long nUpper
= 0,
211 tools::Long nLower
= 0) override
;
213 // Adapt PageSize for all Pages of PageKind ePageKind. Also
214 // set Borders to left/right/upper/lower, ScaleAll, Orientation,
215 // PaperBin and BackgroundFullSize. Create Undo-Actions when
216 // a SdUndoGroup is given (then used from the View probably)
217 void AdaptPageSizeForAllPages(
218 const Size
& rNewSize
,
220 SdUndoGroup
* pUndoGroup
= nullptr,
221 tools::Long nLeft
= 0,
222 tools::Long nRight
= 0,
223 tools::Long nUpper
= 0,
224 tools::Long nLower
= 0,
225 bool bScaleAll
= false,
226 Orientation eOrientation
= Orientation::Landscape
,
227 sal_uInt16 nPaperBin
= 0,
228 bool bBackgroundFullSize
= false);
230 SAL_DLLPRIVATE SdDrawDocument
* AllocSdDrawDocument() const;
231 SAL_DLLPRIVATE
virtual SdrModel
* AllocModel() const override
; //forwards to AllocSdDrawDocument
233 SAL_DLLPRIVATE
rtl::Reference
<SdPage
> AllocSdPage(bool bMasterPage
);
234 SAL_DLLPRIVATE
virtual rtl::Reference
<SdrPage
> AllocPage(bool bMasterPage
) override
; //forwards to AllocSdPage
236 // Override SfxBaseModel::getUnoModel and return a more concrete type
237 SdXImpressDocument
* getUnoModel();
239 SAL_DLLPRIVATE
virtual bool IsReadOnly() const override
;
240 SAL_DLLPRIVATE
virtual void SetChanged(bool bFlag
= true) override
;
242 SAL_DLLPRIVATE SfxItemPool
& GetPool() { return( *m_pItemPool
); }
244 SAL_DLLPRIVATE SdOutliner
* GetOutliner(bool bCreateOutliner
=true);
245 SdOutliner
* GetInternalOutliner(bool bCreateOutliner
=true);
247 SAL_DLLPRIVATE ::sd::DrawDocShell
* GetDocSh() const { return mpDocSh
; }
249 SAL_DLLPRIVATE LanguageType
GetLanguage( const sal_uInt16 nId
) const;
250 SAL_DLLPRIVATE
void SetLanguage( const LanguageType eLang
, const sal_uInt16 nId
);
252 SAL_DLLPRIVATE SvxNumType
GetPageNumType() const override
;
253 SAL_DLLPRIVATE
void SetPageNumType(SvxNumType eType
) { mePageNumType
= eType
; }
254 OUString
CreatePageNumValue(sal_uInt16 nNum
) const;
256 SAL_DLLPRIVATE DocumentType
GetDocumentType() const { return meDocType
; }
258 SAL_DLLPRIVATE
void SetAllocDocSh(bool bAlloc
);
260 SAL_DLLPRIVATE
void CreatingDataObj( SdTransferable
* pTransferable
) { mpCreatingTransferable
= pTransferable
; }
261 SAL_DLLPRIVATE
virtual bool IsCreatingDataObj() const override
{ return mpCreatingTransferable
!= nullptr; }
263 /** if the document does not contain at least one handout, one slide and one notes page with
264 at least one master each this methods creates them.
265 If a reference document is given, the sizes and border settings of that document are used
266 for newly created slides.
268 void CreateFirstPages( SdDrawDocument
const * pRefDocument
= nullptr );
269 bool CreateMissingNotesAndHandoutPages();
271 SAL_DLLPRIVATE
void MovePage(sal_uInt16 nPgNum
, sal_uInt16 nNewPos
) override
;
272 SAL_DLLPRIVATE
void InsertPage(SdrPage
* pPage
, sal_uInt16 nPos
=0xFFFF) override
;
273 SAL_DLLPRIVATE
void DeletePage(sal_uInt16 nPgNum
) override
;
274 SAL_DLLPRIVATE
rtl::Reference
<SdrPage
> RemovePage(sal_uInt16 nPgNum
) override
;
276 SAL_DLLPRIVATE
virtual void InsertMasterPage(SdrPage
* pPage
, sal_uInt16 nPos
=0xFFFF) override
;
277 SAL_DLLPRIVATE
virtual rtl::Reference
<SdrPage
> RemoveMasterPage(sal_uInt16 nPgNum
) override
;
279 SAL_DLLPRIVATE
void RemoveUnnecessaryMasterPages( SdPage
* pMaster
=nullptr, bool bOnlyDuplicatePages
=false, bool bUndo
=true );
280 void SetMasterPage(sal_uInt16 nSdPageNum
, std::u16string_view rLayoutName
,
281 SdDrawDocument
* pSourceDoc
, bool bMaster
, bool bCheckMasters
);
283 SdDrawDocument
* OpenBookmarkDoc(const OUString
& rBookmarkFile
);
284 SAL_DLLPRIVATE SdDrawDocument
* OpenBookmarkDoc(SfxMedium
* pMedium
);
286 SAL_DLLPRIVATE
void InsertBookmark(const std::vector
<OUString
> &rBookmarkList
,
287 std::vector
<OUString
> &rExchangeList
, bool bLink
,
289 ::sd::DrawDocShell
* pBookmarkDocSh
,
290 Point
const * pObjPos
);
292 SAL_DLLPRIVATE sal_uInt16
GetStartWithPresentation() const { return mnStartWithPresentation
; }
293 SAL_DLLPRIVATE
void SetStartWithPresentation(sal_uInt16 nStartingSlide
);
295 SAL_DLLPRIVATE
bool IsExitAfterPresenting() const { return mbExitAfterPresenting
;}
296 SAL_DLLPRIVATE
void SetExitAfterPresenting( bool bExitAfterPresenting
);
298 /// load xml-based impress layout definitions into document
299 SAL_DLLPRIVATE
void InitLayoutVector();
300 /// return reference to vector of Impress layout definitions
301 SAL_DLLPRIVATE
const std::vector
<css::uno::Reference
< css::xml::dom::XNode
> >& GetLayoutVector() const
302 { return maLayoutInfo
; }
304 /// load xml-based impress master presentation object definitions into document
305 SAL_DLLPRIVATE
void InitObjectVector();
306 /// return reference to vector of master presentation object definitions
307 SAL_DLLPRIVATE
const std::vector
<css::uno::Reference
<css::xml::dom::XNode
> >& GetObjectVector() const { return maPresObjectInfo
; }
308 /** Insert pages into this document
310 This method inserts whole pages into this document, either
311 selected ones (specified via pBookmarkList/pExchangeList), or
312 all from the source document.
314 @attention Beware! This method in its current state does not
315 handle all combinations of their input parameters
316 correctly. For example, for pBookmarkList=NULL, bReplace=true
317 is ignored (no replace happens).
320 A list of strings, denoting the names of the pages to be copied
323 A list of strings, denoting the names of the pages to be renamed
326 Whether the inserted pages should be linked to the bookmark document
329 Whether the pages should not be inserted, but replace the pages in
330 the destination document
333 Insertion point/start of replacement
336 Whether query dialogs are allowed (e.g. for page scaling)
338 @param pBookmarkDocSh
339 DocShell of the source document (used e.g. to extract the filename
343 Whether the source document should be treated as immutable (i.e.
344 inserted pages are not removed from it, but cloned)
346 @param bMergeMasterPages
347 Whether the source document's master pages should be copied, too.
349 @param bPreservePageNames
350 Whether the replace operation should take the name from the new
351 page, or preserve the old name
354 bool InsertBookmarkAsPage(const std::vector
<OUString
> &rBookmarkList
,
355 std::vector
<OUString
> *pExchangeList
,
356 bool bLink
, bool bReplace
, sal_uInt16 nPgPos
,
357 bool bNoDialogs
, ::sd::DrawDocShell
* pBookmarkDocSh
,
358 bool bCopy
, bool bMergeMasterPages
,
359 bool bPreservePageNames
);
361 SAL_DLLPRIVATE
bool InsertBookmarkAsObject(const std::vector
<OUString
> &rBookmarkList
,
362 const std::vector
<OUString
> &rExchangeList
,
363 ::sd::DrawDocShell
* pBookmarkDocSh
,
364 Point
const * pObjPos
, bool bCalcObjCount
);
366 void CloseBookmarkDoc();
368 SAL_DLLPRIVATE SdrObject
* GetObj(std::u16string_view rObjName
) const;
370 /** Return the first page that has the given name. Regular pages and
371 notes pages are searched first. When not found then the master
374 Name of the page to return.
375 @param rbIsMasterPage
376 Is set by the method to indicate whether the returned index
377 belongs to a master page (<TRUE/>) or a regular or notes page
378 (<FALSE/>). The given value is ignored.
380 Returns the index of the page with the given name or
381 SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist.
383 SAL_DLLPRIVATE sal_uInt16
GetPageByName(std::u16string_view rPgName
, bool& rbIsMasterPage
) const;
384 /** checks, if the given name is a *unique* name for an *existing* slide
386 @param rPageName the name of an existing slide
388 @return true, if the name is unique and the slide exists
390 bool IsPageNameUnique( std::u16string_view rPageName
) const;
391 SdPage
*GetSdPage(sal_uInt16 nPgNum
, PageKind ePgKind
) const;
392 sal_uInt16
GetSdPageCount(PageKind ePgKind
) const;
394 SAL_DLLPRIVATE
void SetSelected(SdPage
* pPage
, bool bSelect
);
395 SAL_DLLPRIVATE
void UnselectAllPages();
396 SAL_DLLPRIVATE
bool MovePages(sal_uInt16 nTargetPage
);
398 SdPage
*GetMasterSdPage(sal_uInt16 nPgNum
, PageKind ePgKind
);
399 sal_uInt16
GetMasterSdPageCount(PageKind ePgKind
) const;
401 sal_uInt16
GetActiveSdPageCount() const;
403 SAL_DLLPRIVATE sal_uInt16
GetMasterPageUserCount(SdrPage
const * pMaster
) const;
405 SAL_DLLPRIVATE
const sd::PresentationSettings
& getPresentationSettings() const { return maPresentationSettings
; }
406 SAL_DLLPRIVATE
sd::PresentationSettings
& getPresentationSettings() { return maPresentationSettings
; }
408 SAL_DLLPRIVATE
const css::uno::Reference
< css::presentation::XPresentation2
>& getPresentation() const;
410 SAL_DLLPRIVATE
void SetSummationOfParagraphs( bool bOn
= true ) { mbSummationOfParagraphs
= bOn
; }
411 SAL_DLLPRIVATE
bool IsSummationOfParagraphs() const { return mbSummationOfParagraphs
; }
413 /** Set the mode that controls whether (and later how) the formatting of the document
414 depends on the current printer metrics.
417 scope="css::document::PrinterIndependentLayout">ENABLED</const>
418 to make formatting printer-independent and <const
419 scope="css::document::PrinterIndependentLayout">DISABLED</const>
420 to make formatting depend on the current printer metrics.
422 SAL_DLLPRIVATE
void SetPrinterIndependentLayout (sal_Int32 nMode
);
424 /** Get the flag that controls whether the formatting of the document
425 depends on the current printer metrics.
428 scope="css::document::PrinterIndependentLayout">ENABLED</const>
429 when formatting is printer-independent and <const
430 scope="css::document::PrinterIndependentLayout">DISABLED</const>
431 when formatting depends on the current printer metrics.
433 SAL_DLLPRIVATE sal_Int32
GetPrinterIndependentLayout() const { return mnPrinterIndependentLayout
;}
435 SAL_DLLPRIVATE
void SetOnlineSpell( bool bIn
);
436 SAL_DLLPRIVATE
bool GetOnlineSpell() const { return mbOnlineSpell
; }
437 SAL_DLLPRIVATE
void StopOnlineSpelling();
438 SAL_DLLPRIVATE
void StartOnlineSpelling(bool bForceSpelling
=true);
440 SAL_DLLPRIVATE
void ImpOnlineSpellCallback(SpellCallbackInfo
const * pInfo
, SdrObject
* pObj
, SdrOutliner
const * pOutl
);
442 SAL_DLLPRIVATE
void InsertObject(SdrObject
* pObj
);
443 SAL_DLLPRIVATE
void RemoveObject(SdrObject
* pObj
);
445 SAL_DLLPRIVATE sal_uLong
GetLinkCount() const;
447 SAL_DLLPRIVATE
std::vector
<std::unique_ptr
<sd::FrameView
>>& GetFrameViewList() { return maFrameViewList
; }
448 SdCustomShowList
* GetCustomShowList(bool bCreate
= false);
450 SAL_DLLPRIVATE
void NbcSetChanged(bool bFlag
);
452 SAL_DLLPRIVATE
void SetTextDefaults() const;
454 SAL_DLLPRIVATE
void CreateLayoutTemplates();
455 SAL_DLLPRIVATE
void RenameLayoutTemplate(const OUString
& rOldLayoutName
, const OUString
& rNewName
);
457 SAL_DLLPRIVATE
void CreateDefaultCellStyles();
459 void StopWorkStartupDelay();
461 SAL_DLLPRIVATE
void NewOrLoadCompleted(DocCreationMode eMode
);
462 SAL_DLLPRIVATE
void NewOrLoadCompleted( SdPage
* pPage
, SdStyleSheetPool
* pSPool
);
463 SAL_DLLPRIVATE
bool IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted
; }
465 SAL_DLLPRIVATE ::sd::FrameView
* GetFrameView(sal_uLong nPos
) {
466 return nPos
< maFrameViewList
.size() ? maFrameViewList
[nPos
].get() : nullptr; }
469 SAL_DLLPRIVATE
static SdAnimationInfo
* GetAnimationInfo(SdrObject
* pObject
);
471 static SdAnimationInfo
* GetShapeUserData(SdrObject
& rObject
, bool bCreate
= false );
473 SAL_DLLPRIVATE
const std::optional
<CharClass
>& GetCharClass() const { return moCharClass
; }
475 SAL_DLLPRIVATE
void UpdateAllLinks();
477 SAL_DLLPRIVATE
void CheckMasterPages();
479 SAL_DLLPRIVATE
void Merge(SdrModel
& rSourceModel
,
480 sal_uInt16 nFirstPageNum
, sal_uInt16 nLastPageNum
,
482 bool bMergeMasterPages
, bool bAllMasterPages
,
483 bool bUndo
= true, bool bTreadSourceAsConst
= false) override
;
485 css::text::WritingMode
GetDefaultWritingMode() const;
486 SAL_DLLPRIVATE
void SetDefaultWritingMode( css::text::WritingMode eMode
);
488 /** replacespOldPage from all custom shows with pNewPage or removes pOldPage from
489 all custom shows if pNewPage is 0.
491 SAL_DLLPRIVATE
void ReplacePageInCustomShows( const SdPage
* pOldPage
, const SdPage
* pNewPage
);
495 /// static to prevent recursions while resolving links
496 SAL_DLLPRIVATE
static SdDrawDocument
* s_pDocLockedInsertingLinks
;
498 /** Create and insert a set of two new pages: a standard (draw) page and
499 the associated notes page. The new pages are inserted directly
500 after the specified page set.
502 This page is used to retrieve the layout for the page to
505 This specifies whether <argument>pCurrentPage</argument> is a
506 standard (draw) page or a notes page.
507 @param sStandardPageName
508 Name of the standard page. An empty string leads to using an
509 automatically created name.
510 @param sNotesPageName
511 Name of the standard page. An empty string leads to using an
512 automatically created name.
513 @param eStandardLayout
514 Layout to use for the new standard page. Note that this layout
515 is not used when the given <argument>pCurrentPage</argument> is
516 not a standard page. In this case the layout is taken from the
517 standard page associated with <argument>pCurrentPage</argument>.
519 Layout to use for the new notes page. Note that this layout
520 is not used when the given <argument>pCurrentPage</argument> is
521 not a notes page. In this case the layout is taken from the
522 notes page associated with <argument>pCurrentPage</argument>.
524 This flag indicates whether to show the background shape.
526 This flag indicates whether to show the shapes on the master page.
527 @param nInsertPosition
528 Position where to insert the standard page. When -1 then the
529 new page set is inserted after the current page.
532 Returns an index of the inserted pages that can be used with the
533 <member>GetSdPage()</member> method.
535 SAL_DLLPRIVATE sal_uInt16
CreatePage (
536 SdPage
* pCurrentPage
,
538 const OUString
& sStandardPageName
,
539 const OUString
& sNotesPageName
,
540 AutoLayout eStandardLayout
,
541 AutoLayout eNotesLayout
,
544 const sal_Int32 nInsertPosition
);
546 /** This method acts as a simplified front end for the more complex
547 <member>DuplicatePage()</member> method.
549 The page number as passed to the <member>GetSdPage()</member>
550 method for which the standard page and the notes page are to be
553 Returns an index of the inserted pages that can be used with the
554 <member>GetSdPage()</member> method.
556 SAL_DLLPRIVATE sal_uInt16
DuplicatePage (sal_uInt16 nPageNum
);
558 /** Create and insert a set of two new pages that are copies of the
559 given <argument>pCurrentPage</argument> and its associated notes
560 resp. standard page. The copies are inserted directly after the
563 This page and its associated notes/standard page is copied.
565 This specifies whether <argument>pCurrentPage</argument> is a
566 standard (draw) page or a notes page.
567 @param sStandardPageName
568 Name of the standard page. An empty string leads to using an
569 automatically created name.
570 @param sNotesPageName
571 Name of the standard page. An empty string leads to using an
572 automatically created name.
574 This flag indicates whether to show the background shape.
576 This flag indicates whether to show the shapes on the master page.
577 @param nInsertPosition
578 Position where to insert the standard page. When -1 then the
579 new page set is inserted after the current page.
582 Returns an index of the inserted pages that can be used with the
583 <member>GetSdPage()</member> method.
585 SAL_DLLPRIVATE sal_uInt16
DuplicatePage (
586 SdPage
* pCurrentPage
,
588 const OUString
& sStandardPageName
,
589 const OUString
& sNotesPageName
,
592 const sal_Int32 nInsertPosition
);
594 /** return the document fonts for latin, cjk and ctl according to the current
595 languages set at this document */
596 SAL_DLLPRIVATE
void getDefaultFonts( vcl::Font
& rLatinFont
, vcl::Font
& rCJKFont
, vcl::Font
& rCTLFont
);
598 sd::UndoManager
* GetUndoManager() const;
600 /** converts the given western font height to a corresponding ctl font height, depending on the system language */
601 SAL_DLLPRIVATE
static sal_uInt32
convertFontHeightToCTL( sal_uInt32 nWesternFontHeight
);
603 /** Get the style sheet pool if it was a SdStyleSheetPool.
605 SdStyleSheetPool
* GetSdStyleSheetPool() const;
607 SAL_DLLPRIVATE
void UpdatePageRelativeURLs(
608 std::u16string_view aOldName
, std::u16string_view aNewName
);
610 SAL_DLLPRIVATE
static void SetCalcFieldValueHdl( ::Outliner
* pOutliner
);
612 SAL_DLLPRIVATE sal_uInt16
GetAnnotationAuthorIndex( const OUString
& rAuthor
);
614 SAL_DLLPRIVATE
bool IsEmbedFonts() const { return mbEmbedFonts
; }
615 SAL_DLLPRIVATE
bool IsEmbedUsedFontsOnly() const { return mbEmbedUsedFontsOnly
; }
616 SAL_DLLPRIVATE
bool IsEmbedFontScriptLatin() const { return mbEmbedFontScriptLatin
; }
617 SAL_DLLPRIVATE
bool IsEmbedFontScriptAsian() const { return mbEmbedFontScriptAsian
; }
618 SAL_DLLPRIVATE
bool IsEmbedFontScriptComplex() const { return mbEmbedFontScriptComplex
; }
620 SAL_DLLPRIVATE
void SetEmbedFonts(bool bUse
) { mbEmbedFonts
= bUse
; }
621 SAL_DLLPRIVATE
void SetEmbedUsedFontsOnly(bool bUse
) { mbEmbedUsedFontsOnly
= bUse
; }
622 SAL_DLLPRIVATE
void SetEmbedFontScriptLatin(bool bUse
) { mbEmbedFontScriptLatin
= bUse
; }
623 SAL_DLLPRIVATE
void SetEmbedFontScriptAsian(bool bUse
) { mbEmbedFontScriptAsian
= bUse
; }
624 SAL_DLLPRIVATE
void SetEmbedFontScriptComplex(bool bUse
) { mbEmbedFontScriptComplex
= bUse
; }
626 sal_Int32
getImagePreferredDPI() const override
{ return mnImagePreferredDPI
; }
627 void setImagePreferredDPI(sal_Int32 nValue
) { mnImagePreferredDPI
= nValue
; }
629 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
633 void UpdatePageRelativeURLsImpl(const std::function
<void(const SvxFieldItem
& rFieldItem
, editeng::SvxFieldItemUpdater
& rFieldItemUpdater
)>& rItemCallback
);
635 /** This member stores the printer independent layout mode. Please
636 refer to <member>SetPrinterIndependentLayout()</member> for its
639 sal_Int32 mnPrinterIndependentLayout
;
641 /** Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>.
643 This page and its associated notes/standard page is copied.
645 This specifies whether <argument>pCurrentPage</argument> is a
646 standard (draw) page or a notes page.
647 @param sStandardPageName
648 Name of the standard page. An empty string leads to using an
649 automatically created name.
650 @param sNotesPageName
651 Name of the standard page. An empty string leads to using an
652 automatically created name.
654 This flag indicates whether to show the background shape.
656 This flag indicates whether to show the shapes on the master page.
658 The standard page to insert.
660 The notes page to insert.
661 @param nInsertPosition
662 Position where to insert the standard page. When -1 then the
663 new page set is inserted after the current page.
666 Returns an index of the inserted pages that can be used with the
667 <member>GetSdPage()</member> method.
669 SAL_DLLPRIVATE sal_uInt16
InsertPageSet (
670 SdPage
* pCurrentPage
,
672 const OUString
& sStandardPageName
,
673 const OUString
& sNotesPageName
,
676 SdPage
* pStandardPage
,
678 sal_Int32 nInsertPosition
);
680 /** Set up a newly created page and insert it into the list of pages.
682 A page to take the size and border geometry from.
684 This is the page to set up and insert.
686 The name of the new page.
687 @param nInsertionPoint
688 Index of the page before which the new page will be inserted.
690 This flag indicates whether to show the background shape.
692 This flag indicates whether to show the shapes on the master
695 SAL_DLLPRIVATE
void SetupNewPage (
696 SdPage
const * pPreviousPage
,
698 const OUString
& sPageName
,
699 sal_uInt16 nInsertionPoint
,
703 SAL_DLLPRIVATE
virtual void PageListChanged() override
;
704 SAL_DLLPRIVATE
virtual void MasterPageListChanged() override
;
710 /**an instance of this guard disables modification of a document
711 during its lifetime*/
715 ModifyGuard( SdDrawDocument
* pDoc
);
721 DrawDocShell
* mpDocShell
;
722 SdDrawDocument
* mpDoc
;
723 bool mbIsEnableSetModified
;
724 bool mbIsDocumentChanged
;
729 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */