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 vcl
{ class Font
; }
40 namespace com::sun::star::presentation
{ class XPresentation2
; }
45 class SdAnimationInfo
;
46 class SdStyleSheetPool
;
52 struct SpellCallbackInfo
;
53 class SdCustomShowList
;
69 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
70 #define SV_DECL_DRAW_DOC_SHELL_DEFINED
71 typedef ::tools::SvRef
<DrawDocShell
> DrawDocShellRef
;
78 class ImpDrawPageListWatcher
;
79 class ImpMasterPageListWatcher
;
81 struct StyleReplaceData
83 SfxStyleFamily nFamily
;
84 SfxStyleFamily nNewFamily
;
89 enum class DocCreationMode
97 struct PresentationSettings
108 bool mbUseNavigation
;
110 bool mbAnimationAllowed
;
111 sal_Int32 mnPauseTimeout
;
112 bool mbShowPauseLogo
;
113 bool mbStartCustomShow
;
115 PresentationSettings();
120 class SD_DLLPUBLIC SdDrawDocument final
: public FmFormModel
123 SAL_DLLPRIVATE
void setDocAccTitle( const OUString
& rTitle
) { msDocAccTitle
= rTitle
; }
124 SAL_DLLPRIVATE
const OUString
& getDocAccTitle() const { return msDocAccTitle
; }
125 SAL_DLLPRIVATE
bool getDocReadOnly() const { return m_bReadOnly
; }
127 OUString msDocAccTitle
;
128 std::unique_ptr
<SdOutliner
>
129 mpOutliner
; ///< local outliner for outline mode
130 std::unique_ptr
<SdOutliner
>
131 mpInternalOutliner
; ///< internal outliner for creation of text objects
132 std::unique_ptr
<Timer
> mpWorkStartupTimer
;
133 std::unique_ptr
<Idle
>
134 mpOnlineSpellingIdle
;
135 std::unique_ptr
<sd::ShapeList
>
136 mpOnlineSpellingList
;
137 std::unique_ptr
<SvxSearchItem
>
139 std::vector
<std::unique_ptr
<sd::FrameView
>>
141 std::unique_ptr
<SdCustomShowList
> mpCustomShowList
;
142 ::sd::DrawDocShell
* mpDocSh
;
143 SdTransferable
* mpCreatingTransferable
;
144 bool mbHasOnlineSpellErrors
;
145 bool mbInitialOnlineSpellingEnabled
;
146 OUString maBookmarkFile
;
147 ::sd::DrawDocShellRef mxBookmarkDocShRef
;
149 sd::PresentationSettings maPresentationSettings
;
151 css::uno::Reference
< css::presentation::XPresentation2
> mxPresentation
;
153 bool mbNewOrLoadCompleted
;
156 bool mbSummationOfParagraphs
;
157 bool mbStartWithPresentation
; ///< is set to true when starting with command line parameter -start
158 bool mbExitAfterPresenting
; ///< true if mbStartWithPresentation AND Presentation was shown fully
159 LanguageType meLanguage
;
160 LanguageType meLanguageCJK
;
161 LanguageType meLanguageCTL
;
162 SvxNumType mePageNumType
;
163 ::sd::DrawDocShellRef mxAllocedDocShRef
; // => AllocModel()
164 bool mbAllocDocSh
; // => AllocModel()
165 DocumentType meDocType
;
166 std::optional
<CharClass
>
169 ::std::unique_ptr
<ImpDrawPageListWatcher
> mpDrawPageListWatcher
;
170 ::std::unique_ptr
<ImpMasterPageListWatcher
> mpMasterPageListWatcher
;
172 SAL_DLLPRIVATE
void UpdatePageObjectsInNotes(sal_uInt16 nStartPos
);
173 SAL_DLLPRIVATE
void UpdatePageRelativeURLs(SdPage
const * pPage
, sal_uInt16 nPos
, sal_Int32 nIncrement
);
174 SAL_DLLPRIVATE
void FillOnlineSpellingList(SdPage
const * pPage
);
175 SAL_DLLPRIVATE
void SpellObject(SdrTextObj
* pObj
);
177 DECL_DLLPRIVATE_LINK(WorkStartupHdl
, Timer
*, void);
178 DECL_DLLPRIVATE_LINK(OnlineSpellingHdl
, Timer
*, void);
179 DECL_DLLPRIVATE_LINK(OnlineSpellEventHdl
, EditStatus
&, void);
181 std::vector
< OUString
> maAnnotationAuthors
;
182 std::vector
<css::uno::Reference
< css::xml::dom::XNode
> > maLayoutInfo
;
184 std::vector
<css::uno::Reference
< css::xml::dom::XNode
> > maPresObjectInfo
;
186 bool mbEmbedFonts
: 1;
187 bool mbEmbedUsedFontsOnly
: 1;
188 bool mbEmbedFontScriptLatin
: 1;
189 bool mbEmbedFontScriptAsian
: 1;
190 bool mbEmbedFontScriptComplex
: 1;
192 sal_Int32 mnImagePreferredDPI
;
194 SAL_DLLPRIVATE
virtual css::uno::Reference
< css::uno::XInterface
> createUnoModel() override
;
199 SAL_DLLPRIVATE
SdDrawDocument(DocumentType eType
, SfxObjectShell
* pDocSh
);
200 SAL_DLLPRIVATE
virtual ~SdDrawDocument() override
;
202 // Adapt to given Size and Borders scaling all contained data, maybe
203 // including PresObj's in higher derivations
204 virtual void adaptSizeAndBorderForAllPages(
205 const Size
& rNewSize
,
206 tools::Long nLeft
= 0,
207 tools::Long nRight
= 0,
208 tools::Long nUpper
= 0,
209 tools::Long nLower
= 0) override
;
211 // Adapt PageSize for all Pages of PageKind ePageKind. Also
212 // set Borders to left/right/upper/lower, ScaleAll, Orientation,
213 // PaperBin and BackgroundFullSize. Create Undo-Actions when
214 // a SdUndoGroup is given (then used from the View probably)
215 void AdaptPageSizeForAllPages(
216 const Size
& rNewSize
,
218 SdUndoGroup
* pUndoGroup
= nullptr,
219 tools::Long nLeft
= 0,
220 tools::Long nRight
= 0,
221 tools::Long nUpper
= 0,
222 tools::Long nLower
= 0,
223 bool bScaleAll
= false,
224 Orientation eOrientation
= Orientation::Landscape
,
225 sal_uInt16 nPaperBin
= 0,
226 bool bBackgroundFullSize
= false);
228 SAL_DLLPRIVATE SdDrawDocument
* AllocSdDrawDocument() const;
229 SAL_DLLPRIVATE
virtual SdrModel
* AllocModel() const override
; //forwards to AllocSdDrawDocument
231 SAL_DLLPRIVATE
rtl::Reference
<SdPage
> AllocSdPage(bool bMasterPage
);
232 SAL_DLLPRIVATE
virtual rtl::Reference
<SdrPage
> AllocPage(bool bMasterPage
) override
; //forwards to AllocSdPage
234 SAL_DLLPRIVATE
virtual bool IsReadOnly() const override
;
235 SAL_DLLPRIVATE
virtual void SetChanged(bool bFlag
= true) override
;
237 SAL_DLLPRIVATE SfxItemPool
& GetPool() { return( *m_pItemPool
); }
239 SAL_DLLPRIVATE SdOutliner
* GetOutliner(bool bCreateOutliner
=true);
240 SdOutliner
* GetInternalOutliner(bool bCreateOutliner
=true);
242 SAL_DLLPRIVATE ::sd::DrawDocShell
* GetDocSh() const { return mpDocSh
; }
244 SAL_DLLPRIVATE LanguageType
GetLanguage( const sal_uInt16 nId
) const;
245 SAL_DLLPRIVATE
void SetLanguage( const LanguageType eLang
, const sal_uInt16 nId
);
247 SAL_DLLPRIVATE SvxNumType
GetPageNumType() const override
;
248 SAL_DLLPRIVATE
void SetPageNumType(SvxNumType eType
) { mePageNumType
= eType
; }
249 OUString
CreatePageNumValue(sal_uInt16 nNum
) const;
251 SAL_DLLPRIVATE DocumentType
GetDocumentType() const { return meDocType
; }
253 SAL_DLLPRIVATE
void SetAllocDocSh(bool bAlloc
);
255 SAL_DLLPRIVATE
void CreatingDataObj( SdTransferable
* pTransferable
) { mpCreatingTransferable
= pTransferable
; }
256 SAL_DLLPRIVATE
virtual bool IsCreatingDataObj() const override
{ return mpCreatingTransferable
!= nullptr; }
258 /** if the document does not contain at least one handout, one slide and one notes page with
259 at least one master each this methods creates them.
260 If a reference document is given, the sizes and border settings of that document are used
261 for newly created slides.
263 void CreateFirstPages( SdDrawDocument
const * pRefDocument
= nullptr );
264 bool CreateMissingNotesAndHandoutPages();
266 SAL_DLLPRIVATE
void MovePage(sal_uInt16 nPgNum
, sal_uInt16 nNewPos
) override
;
267 SAL_DLLPRIVATE
void InsertPage(SdrPage
* pPage
, sal_uInt16 nPos
=0xFFFF) override
;
268 SAL_DLLPRIVATE
void DeletePage(sal_uInt16 nPgNum
) override
;
269 SAL_DLLPRIVATE
rtl::Reference
<SdrPage
> RemovePage(sal_uInt16 nPgNum
) override
;
271 SAL_DLLPRIVATE
virtual void InsertMasterPage(SdrPage
* pPage
, sal_uInt16 nPos
=0xFFFF) override
;
272 SAL_DLLPRIVATE
virtual rtl::Reference
<SdrPage
> RemoveMasterPage(sal_uInt16 nPgNum
) override
;
274 SAL_DLLPRIVATE
void RemoveUnnecessaryMasterPages( SdPage
* pMaster
=nullptr, bool bOnlyDuplicatePages
=false, bool bUndo
=true );
275 void SetMasterPage(sal_uInt16 nSdPageNum
, std::u16string_view rLayoutName
,
276 SdDrawDocument
* pSourceDoc
, bool bMaster
, bool bCheckMasters
);
278 SdDrawDocument
* OpenBookmarkDoc(const OUString
& rBookmarkFile
);
279 SAL_DLLPRIVATE SdDrawDocument
* OpenBookmarkDoc(SfxMedium
* pMedium
);
281 SAL_DLLPRIVATE
void InsertBookmark(const std::vector
<OUString
> &rBookmarkList
,
282 std::vector
<OUString
> &rExchangeList
, bool bLink
,
284 ::sd::DrawDocShell
* pBookmarkDocSh
,
285 Point
const * pObjPos
);
287 SAL_DLLPRIVATE
bool IsStartWithPresentation() const { return mbStartWithPresentation
;}
288 SAL_DLLPRIVATE
void SetStartWithPresentation( bool bStartWithPresentation
);
290 SAL_DLLPRIVATE
bool IsExitAfterPresenting() const { return mbExitAfterPresenting
;}
291 SAL_DLLPRIVATE
void SetExitAfterPresenting( bool bExitAfterPresenting
);
293 /// load xml-based impress layout definitions into document
294 SAL_DLLPRIVATE
void InitLayoutVector();
295 /// return reference to vector of Impress layout definitions
296 SAL_DLLPRIVATE
const std::vector
<css::uno::Reference
< css::xml::dom::XNode
> >& GetLayoutVector() const
297 { return maLayoutInfo
; }
299 /// load xml-based impress master presentation object definitions into document
300 SAL_DLLPRIVATE
void InitObjectVector();
301 /// return reference to vector of master presentation object definitions
302 SAL_DLLPRIVATE
const std::vector
<css::uno::Reference
<css::xml::dom::XNode
> >& GetObjectVector() const { return maPresObjectInfo
; }
303 /** Insert pages into this document
305 This method inserts whole pages into this document, either
306 selected ones (specified via pBookmarkList/pExchangeList), or
307 all from the source document.
309 @attention Beware! This method in its current state does not
310 handle all combinations of their input parameters
311 correctly. For example, for pBookmarkList=NULL, bReplace=true
312 is ignored (no replace happens).
315 A list of strings, denoting the names of the pages to be copied
318 A list of strings, denoting the names of the pages to be renamed
321 Whether the inserted pages should be linked to the bookmark document
324 Whether the pages should not be inserted, but replace the pages in
325 the destination document
328 Insertion point/start of replacement
331 Whether query dialogs are allowed (e.g. for page scaling)
333 @param pBookmarkDocSh
334 DocShell of the source document (used e.g. to extract the filename
338 Whether the source document should be treated as immutable (i.e.
339 inserted pages are not removed from it, but cloned)
341 @param bMergeMasterPages
342 Whether the source document's master pages should be copied, too.
344 @param bPreservePageNames
345 Whether the replace operation should take the name from the new
346 page, or preserve the old name
349 SAL_DLLPRIVATE
bool InsertBookmarkAsPage(const std::vector
<OUString
> &rBookmarkList
,
350 std::vector
<OUString
> *pExchangeList
,
351 bool bLink
, bool bReplace
, sal_uInt16 nPgPos
,
352 bool bNoDialogs
, ::sd::DrawDocShell
* pBookmarkDocSh
,
353 bool bCopy
, bool bMergeMasterPages
,
354 bool bPreservePageNames
);
356 SAL_DLLPRIVATE
bool InsertBookmarkAsObject(const std::vector
<OUString
> &rBookmarkList
,
357 const std::vector
<OUString
> &rExchangeList
,
358 ::sd::DrawDocShell
* pBookmarkDocSh
,
359 Point
const * pObjPos
, bool bCalcObjCount
);
361 void CloseBookmarkDoc();
363 SAL_DLLPRIVATE SdrObject
* GetObj(std::u16string_view rObjName
) const;
365 /** Return the first page that has the given name. Regular pages and
366 notes pages are searched first. When not found then the master
369 Name of the page to return.
370 @param rbIsMasterPage
371 Is set by the method to indicate whether the returned index
372 belongs to a master page (<TRUE/>) or a regular or notes page
373 (<FALSE/>). The given value is ignored.
375 Returns the index of the page with the given name or
376 SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist.
378 SAL_DLLPRIVATE sal_uInt16
GetPageByName(std::u16string_view rPgName
, bool& rbIsMasterPage
) const;
379 /** checks, if the given name is a *unique* name for an *existing* slide
381 @param rPageName the name of an existing slide
383 @return true, if the name is unique and the slide exists
385 bool IsPageNameUnique( std::u16string_view rPageName
) const;
386 SdPage
*GetSdPage(sal_uInt16 nPgNum
, PageKind ePgKind
) const;
387 sal_uInt16
GetSdPageCount(PageKind ePgKind
) const;
389 SAL_DLLPRIVATE
void SetSelected(SdPage
* pPage
, bool bSelect
);
390 SAL_DLLPRIVATE
void UnselectAllPages();
391 SAL_DLLPRIVATE
bool MovePages(sal_uInt16 nTargetPage
);
393 SdPage
*GetMasterSdPage(sal_uInt16 nPgNum
, PageKind ePgKind
);
394 sal_uInt16
GetMasterSdPageCount(PageKind ePgKind
) const;
396 sal_uInt16
GetActiveSdPageCount() const;
398 SAL_DLLPRIVATE sal_uInt16
GetMasterPageUserCount(SdrPage
const * pMaster
) const;
400 SAL_DLLPRIVATE
const sd::PresentationSettings
& getPresentationSettings() const { return maPresentationSettings
; }
401 SAL_DLLPRIVATE
sd::PresentationSettings
& getPresentationSettings() { return maPresentationSettings
; }
403 SAL_DLLPRIVATE
const css::uno::Reference
< css::presentation::XPresentation2
>& getPresentation() const;
405 SAL_DLLPRIVATE
void SetSummationOfParagraphs( bool bOn
= true ) { mbSummationOfParagraphs
= bOn
; }
406 SAL_DLLPRIVATE
bool IsSummationOfParagraphs() const { return mbSummationOfParagraphs
; }
408 /** Set the mode that controls whether (and later how) the formatting of the document
409 depends on the current printer metrics.
412 scope="css::document::PrinterIndependentLayout">ENABLED</const>
413 to make formatting printer-independent and <const
414 scope="css::document::PrinterIndependentLayout">DISABLED</const>
415 to make formatting depend on the current printer metrics.
417 SAL_DLLPRIVATE
void SetPrinterIndependentLayout (sal_Int32 nMode
);
419 /** Get the flag that controls whether the formatting of the document
420 depends on the current printer metrics.
423 scope="css::document::PrinterIndependentLayout">ENABLED</const>
424 when formatting is printer-independent and <const
425 scope="css::document::PrinterIndependentLayout">DISABLED</const>
426 when formatting depends on the current printer metrics.
428 SAL_DLLPRIVATE sal_Int32
GetPrinterIndependentLayout() const { return mnPrinterIndependentLayout
;}
430 SAL_DLLPRIVATE
void SetOnlineSpell( bool bIn
);
431 SAL_DLLPRIVATE
bool GetOnlineSpell() const { return mbOnlineSpell
; }
432 SAL_DLLPRIVATE
void StopOnlineSpelling();
433 SAL_DLLPRIVATE
void StartOnlineSpelling(bool bForceSpelling
=true);
435 SAL_DLLPRIVATE
void ImpOnlineSpellCallback(SpellCallbackInfo
const * pInfo
, SdrObject
* pObj
, SdrOutliner
const * pOutl
);
437 SAL_DLLPRIVATE
void InsertObject(SdrObject
* pObj
);
438 SAL_DLLPRIVATE
void RemoveObject(SdrObject
* pObj
);
440 SAL_DLLPRIVATE sal_uLong
GetLinkCount() const;
442 SAL_DLLPRIVATE
std::vector
<std::unique_ptr
<sd::FrameView
>>& GetFrameViewList() { return maFrameViewList
; }
443 SdCustomShowList
* GetCustomShowList(bool bCreate
= false);
445 SAL_DLLPRIVATE
void NbcSetChanged(bool bFlag
);
447 SAL_DLLPRIVATE
void SetTextDefaults() const;
449 SAL_DLLPRIVATE
void CreateLayoutTemplates();
450 SAL_DLLPRIVATE
void RenameLayoutTemplate(const OUString
& rOldLayoutName
, const OUString
& rNewName
);
452 SAL_DLLPRIVATE
void CreateDefaultCellStyles();
454 void StopWorkStartupDelay();
456 SAL_DLLPRIVATE
void NewOrLoadCompleted(DocCreationMode eMode
);
457 SAL_DLLPRIVATE
void NewOrLoadCompleted( SdPage
* pPage
, SdStyleSheetPool
* pSPool
);
458 SAL_DLLPRIVATE
bool IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted
; }
460 SAL_DLLPRIVATE ::sd::FrameView
* GetFrameView(sal_uLong nPos
) {
461 return nPos
< maFrameViewList
.size() ? maFrameViewList
[nPos
].get() : nullptr; }
464 SAL_DLLPRIVATE
static SdAnimationInfo
* GetAnimationInfo(SdrObject
* pObject
);
466 static SdAnimationInfo
* GetShapeUserData(SdrObject
& rObject
, bool bCreate
= false );
468 SAL_DLLPRIVATE
const std::optional
<CharClass
>& GetCharClass() const { return moCharClass
; }
470 SAL_DLLPRIVATE
void UpdateAllLinks();
472 SAL_DLLPRIVATE
void CheckMasterPages();
474 SAL_DLLPRIVATE
void Merge(SdrModel
& rSourceModel
,
475 sal_uInt16 nFirstPageNum
, sal_uInt16 nLastPageNum
,
477 bool bMergeMasterPages
, bool bAllMasterPages
,
478 bool bUndo
= true, bool bTreadSourceAsConst
= false) override
;
480 css::text::WritingMode
GetDefaultWritingMode() const;
481 SAL_DLLPRIVATE
void SetDefaultWritingMode( css::text::WritingMode eMode
);
483 /** replacespOldPage from all custom shows with pNewPage or removes pOldPage from
484 all custom shows if pNewPage is 0.
486 SAL_DLLPRIVATE
void ReplacePageInCustomShows( const SdPage
* pOldPage
, const SdPage
* pNewPage
);
490 /// static to prevent recursions while resolving links
491 SAL_DLLPRIVATE
static SdDrawDocument
* s_pDocLockedInsertingLinks
;
493 /** Create and insert a set of two new pages: a standard (draw) page and
494 the associated notes page. The new pages are inserted directly
495 after the specified page set.
497 This page is used to retrieve the layout for the page to
500 This specifies whether <argument>pCurrentPage</argument> is a
501 standard (draw) page or a notes page.
502 @param sStandardPageName
503 Name of the standard page. An empty string leads to using an
504 automatically created name.
505 @param sNotesPageName
506 Name of the standard page. An empty string leads to using an
507 automatically created name.
508 @param eStandardLayout
509 Layout to use for the new standard page. Note that this layout
510 is not used when the given <argument>pCurrentPage</argument> is
511 not a standard page. In this case the layout is taken from the
512 standard page associated with <argument>pCurrentPage</argument>.
514 Layout to use for the new notes page. Note that this layout
515 is not used when the given <argument>pCurrentPage</argument> is
516 not a notes page. In this case the layout is taken from the
517 notes page associated with <argument>pCurrentPage</argument>.
519 This flag indicates whether to show the background shape.
521 This flag indicates whether to show the shapes on the master page.
522 @param nInsertPosition
523 Position where to insert the standard page. When -1 then the
524 new page set is inserted after the current page.
527 Returns an index of the inserted pages that can be used with the
528 <member>GetSdPage()</member> method.
530 SAL_DLLPRIVATE sal_uInt16
CreatePage (
531 SdPage
* pCurrentPage
,
533 const OUString
& sStandardPageName
,
534 const OUString
& sNotesPageName
,
535 AutoLayout eStandardLayout
,
536 AutoLayout eNotesLayout
,
539 const sal_Int32 nInsertPosition
);
541 /** This method acts as a simplified front end for the more complex
542 <member>DuplicatePage()</member> method.
544 The page number as passed to the <member>GetSdPage()</member>
545 method for which the standard page and the notes page are to be
548 Returns an index of the inserted pages that can be used with the
549 <member>GetSdPage()</member> method.
551 SAL_DLLPRIVATE sal_uInt16
DuplicatePage (sal_uInt16 nPageNum
);
553 /** Create and insert a set of two new pages that are copies of the
554 given <argument>pCurrentPage</argument> and its associated notes
555 resp. standard page. The copies are inserted directly after the
558 This page and its associated notes/standard page is copied.
560 This specifies whether <argument>pCurrentPage</argument> is a
561 standard (draw) page or a notes page.
562 @param sStandardPageName
563 Name of the standard page. An empty string leads to using an
564 automatically created name.
565 @param sNotesPageName
566 Name of the standard page. An empty string leads to using an
567 automatically created name.
569 This flag indicates whether to show the background shape.
571 This flag indicates whether to show the shapes on the master page.
572 @param nInsertPosition
573 Position where to insert the standard page. When -1 then the
574 new page set is inserted after the current page.
577 Returns an index of the inserted pages that can be used with the
578 <member>GetSdPage()</member> method.
580 SAL_DLLPRIVATE sal_uInt16
DuplicatePage (
581 SdPage
* pCurrentPage
,
583 const OUString
& sStandardPageName
,
584 const OUString
& sNotesPageName
,
587 const sal_Int32 nInsertPosition
);
589 /** return the document fonts for latin, cjk and ctl according to the current
590 languages set at this document */
591 SAL_DLLPRIVATE
void getDefaultFonts( vcl::Font
& rLatinFont
, vcl::Font
& rCJKFont
, vcl::Font
& rCTLFont
);
593 sd::UndoManager
* GetUndoManager() const;
595 /** converts the given western font height to a corresponding ctl font height, depending on the system language */
596 SAL_DLLPRIVATE
static sal_uInt32
convertFontHeightToCTL( sal_uInt32 nWesternFontHeight
);
598 /** Get the style sheet pool if it was a SdStyleSheetPool.
600 SdStyleSheetPool
* GetSdStyleSheetPool() const;
602 SAL_DLLPRIVATE
void UpdatePageRelativeURLs(
603 std::u16string_view aOldName
, std::u16string_view aNewName
);
605 SAL_DLLPRIVATE
static void SetCalcFieldValueHdl( ::Outliner
* pOutliner
);
607 SAL_DLLPRIVATE sal_uInt16
GetAnnotationAuthorIndex( const OUString
& rAuthor
);
609 SAL_DLLPRIVATE
bool IsEmbedFonts() const { return mbEmbedFonts
; }
610 SAL_DLLPRIVATE
bool IsEmbedUsedFontsOnly() const { return mbEmbedUsedFontsOnly
; }
611 SAL_DLLPRIVATE
bool IsEmbedFontScriptLatin() const { return mbEmbedFontScriptLatin
; }
612 SAL_DLLPRIVATE
bool IsEmbedFontScriptAsian() const { return mbEmbedFontScriptAsian
; }
613 SAL_DLLPRIVATE
bool IsEmbedFontScriptComplex() const { return mbEmbedFontScriptComplex
; }
615 SAL_DLLPRIVATE
void SetEmbedFonts(bool bUse
) { mbEmbedFonts
= bUse
; }
616 SAL_DLLPRIVATE
void SetEmbedUsedFontsOnly(bool bUse
) { mbEmbedUsedFontsOnly
= bUse
; }
617 SAL_DLLPRIVATE
void SetEmbedFontScriptLatin(bool bUse
) { mbEmbedFontScriptLatin
= bUse
; }
618 SAL_DLLPRIVATE
void SetEmbedFontScriptAsian(bool bUse
) { mbEmbedFontScriptAsian
= bUse
; }
619 SAL_DLLPRIVATE
void SetEmbedFontScriptComplex(bool bUse
) { mbEmbedFontScriptComplex
= bUse
; }
621 sal_Int32
getImagePreferredDPI() const override
{ return mnImagePreferredDPI
; }
622 void setImagePreferredDPI(sal_Int32 nValue
) { mnImagePreferredDPI
= nValue
; }
624 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
627 /** This member stores the printer independent layout mode. Please
628 refer to <member>SetPrinterIndependentLayout()</member> for its
631 sal_Int32 mnPrinterIndependentLayout
;
633 /** Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>.
635 This page and its associated notes/standard page is copied.
637 This specifies whether <argument>pCurrentPage</argument> is a
638 standard (draw) page or a notes page.
639 @param sStandardPageName
640 Name of the standard page. An empty string leads to using an
641 automatically created name.
642 @param sNotesPageName
643 Name of the standard page. An empty string leads to using an
644 automatically created name.
646 This flag indicates whether to show the background shape.
648 This flag indicates whether to show the shapes on the master page.
650 The standard page to insert.
652 The notes page to insert.
653 @param nInsertPosition
654 Position where to insert the standard page. When -1 then the
655 new page set is inserted after the current page.
658 Returns an index of the inserted pages that can be used with the
659 <member>GetSdPage()</member> method.
661 SAL_DLLPRIVATE sal_uInt16
InsertPageSet (
662 SdPage
* pCurrentPage
,
664 const OUString
& sStandardPageName
,
665 const OUString
& sNotesPageName
,
668 SdPage
* pStandardPage
,
670 sal_Int32 nInsertPosition
);
672 /** Set up a newly created page and insert it into the list of pages.
674 A page to take the size and border geometry from.
676 This is the page to set up and insert.
678 The name of the new page.
679 @param nInsertionPoint
680 Index of the page before which the new page will be inserted.
682 This flag indicates whether to show the background shape.
684 This flag indicates whether to show the shapes on the master
687 SAL_DLLPRIVATE
void SetupNewPage (
688 SdPage
const * pPreviousPage
,
690 const OUString
& sPageName
,
691 sal_uInt16 nInsertionPoint
,
695 SAL_DLLPRIVATE
virtual void PageListChanged() override
;
696 SAL_DLLPRIVATE
virtual void MasterPageListChanged() override
;
702 /**an instance of this guard disables modification of a document
703 during its lifetime*/
707 ModifyGuard( SdDrawDocument
* pDoc
);
713 DrawDocShell
* mpDocShell
;
714 SdDrawDocument
* mpDoc
;
715 bool mbIsEnableSetModified
;
716 bool mbIsDocumentChanged
;
721 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */