xref: /aoo42x/main/sd/inc/drawdoc.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _DRAWDOC_HXX
29 #define _DRAWDOC_HXX
30 
31 #include <com/sun/star/lang/Locale.hpp>
32 #include <com/sun/star/text/WritingMode.hpp>
33 #include <com/sun/star/frame/XModel.hdl>
34 #include <vcl/print.hxx>
35 #include <svx/fmmodel.hxx>
36 #include "pres.hxx"
37 #include <svx/pageitem.hxx>
38 #include <unotools/charclass.hxx>
39 #include <sot/storage.hxx>
40 #include <rsc/rscsfx.hxx>
41 #include <com/sun/star/lang/Locale.hpp>
42 #include <com/sun/star/text/WritingMode.hpp>
43 
44 // #107844#
45 #include <svx/svdundo.hxx>
46 
47 #include <vector>
48 
49 #ifndef INCLUDED_MEMORY
50 #include <memory>
51 #define INCLUDED_MEMORY
52 #endif
53 #include "sddllapi.h"
54 #include "sdpage.hxx"
55 
56 namespace com
57 {
58     namespace sun
59     {
60         namespace star
61         {
62             namespace embed
63             {
64                 class XStorage;
65             }
66             namespace io
67             {
68                 class XStream;
69             }
70 			namespace presentation
71 			{
72 				class XPresentation2;
73 			}
74         }
75     }
76 }
77 
78 namespace sd
79 {
80 	class FrameView;
81 	class Outliner;
82 }
83 
84 
85 class Timer;
86 class SfxObjectShell;
87 class SdDrawDocShell;
88 class SdPage;
89 class SdAnimationInfo;
90 class SdIMapInfo;
91 class IMapObject;
92 class SdStyleSheetPool;
93 class SfxMedium;
94 class SvxSearchItem;
95 class SdrOle2Obj;
96 class EditStatus;
97 class Graphic;
98 class Point;
99 class Window;
100 class SdTransferable;
101 struct SpellCallbackInfo;
102 struct StyleRequestData;
103 class SdDrawDocument;
104 
105 namespace sd
106 {
107 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
108 #define SV_DECL_DRAW_DOC_SHELL_DEFINED
109 SV_DECL_REF(DrawDocShell)
110 #endif
111 class DrawDocShell;
112 class UndoManager;
113 class ShapeList;
114 }
115 
116 class ImpDrawPageListWatcher;
117 class ImpMasterPageListWatcher;
118 
119 struct StyleReplaceData
120 {
121 	SfxStyleFamily  nFamily;
122 	SfxStyleFamily  nNewFamily;
123 	String          aName;
124 	String          aNewName;
125 };
126 
127 enum DocCreationMode
128 {
129 	NEW_DOC,
130 	DOC_LOADED
131 };
132 
133 namespace sd
134 {
135 	struct PresentationSettings
136 	{
137 		rtl::OUString maPresPage;
138 		sal_Bool mbAll;
139 		sal_Bool mbEndless;
140 		sal_Bool mbCustomShow;
141 		sal_Bool mbManual;
142 		sal_Bool mbMouseVisible;
143 		sal_Bool mbMouseAsPen;
144 		sal_Bool mbLockedPages;
145 		sal_Bool mbAlwaysOnTop;
146 		sal_Bool mbFullScreen;
147 		sal_Bool mbAnimationAllowed;
148 		sal_Int32 mnPauseTimeout;
149 		sal_Bool mbShowPauseLogo;
150 		sal_Bool mbStartWithNavigator;
151 
152 		PresentationSettings();
153 		PresentationSettings( const PresentationSettings& r );
154 	};
155 }
156 
157 // ------------------
158 // - SdDrawDocument -
159 // ------------------
160 
161 class SdDrawDocument : public FmFormModel
162 {
163 private:
164 	::sd::Outliner*		mpOutliner;		    // local outliner for outline mode
165 	::sd::Outliner*		mpInternalOutliner;  // internal outliner for creation of text objects
166 	Timer*			    mpWorkStartupTimer;
167 	Timer*              mpOnlineSpellingTimer;
168 	sd::ShapeList*		mpOnlineSpellingList;
169 	SvxSearchItem*      mpOnlineSearchItem;
170 	List*               mpFrameViewList;
171 	List*               mpCustomShowList;
172 	::sd::DrawDocShell* mpDocSh;
173     SdTransferable *    mpCreatingTransferable;
174 	sal_Bool                mbHasOnlineSpellErrors;
175 	sal_Bool                mbInitialOnlineSpellingEnabled;
176 	String              maBookmarkFile;
177 	::sd::DrawDocShellRef   mxBookmarkDocShRef;
178 
179 	sd::PresentationSettings maPresentationSettings;
180 
181 	::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 > mxPresentation;
182 
183 	sal_Bool			    mbNewOrLoadCompleted;
184 
185 	sal_Bool			    mbOnlineSpell;
186     sal_Bool                mbSummationOfParagraphs;
187 	bool				mbStartWithPresentation;		// is set to true when starting with command line parameter -start
188 	LanguageType	    meLanguage;
189 	LanguageType	    meLanguageCJK;
190 	LanguageType	    meLanguageCTL;
191 	SvxNumType		    mePageNumType;
192 	::sd::DrawDocShellRef   mxAllocedDocShRef;   // => AllocModel()
193 	sal_Bool			    mbAllocDocSh;		// => AllocModel()
194 	DocumentType        meDocType;
195 	CharClass*		    mpCharClass;
196 	::com::sun::star::lang::Locale* mpLocale;
197 
198 	// #109538#
199 	::std::auto_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher;
200 	::std::auto_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher;
201 
202 	void                UpdatePageObjectsInNotes(sal_uInt16 nStartPos);
203     void                UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_Int32 nIncrement);
204 	void                FillOnlineSpellingList(SdPage* pPage);
205 	void                SpellObject(SdrTextObj* pObj);
206 
207 	                    DECL_LINK(WorkStartupHdl, Timer*);
208 	                    DECL_LINK(OnlineSpellingHdl, Timer*);
209 	                    DECL_LINK(OnlineSpellEventHdl, EditStatus*);
210 
211     std::vector< rtl::OUString > maAnnotationAuthors;
212 
213 protected:
214 
215 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
216 
217 public:
218 
219     class InsertBookmarkAsPage_PageFunctorBase;
220 
221                 	    TYPEINFO();
222 
223 	                    SdDrawDocument(DocumentType eType, SfxObjectShell* pDocSh);
224 	                    ~SdDrawDocument();
225 
226 	virtual SdrModel*   AllocModel() const;
227 	virtual SdrPage*    AllocPage(FASTBOOL bMasterPage);
228 	virtual const SdrModel* LoadModel(const String& rFileName);
229 	virtual void        DisposeLoadedModels();
230 	virtual FASTBOOL    IsReadOnly() const;
231 	virtual void        SetChanged(sal_Bool bFlag = sal_True);
232 	virtual SvStream*   GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const;
233 
234 	SfxItemPool&	    GetPool() { return( *pItemPool ); }
235 
236 	::sd::Outliner* GetOutliner(sal_Bool bCreateOutliner=sal_True);
237 	SD_DLLPUBLIC ::sd::Outliner* GetInternalOutliner(sal_Bool bCreateOutliner=sal_True);
238 
239 	::sd::DrawDocShell*     GetDocSh() const { return mpDocSh; }
240 
241 	LanguageType	    GetLanguage( const sal_uInt16 nId ) const;
242 	void			    SetLanguage( const LanguageType eLang, const sal_uInt16 nId );
243 
244 	SvxNumType          GetPageNumType() const;
245 	void			    SetPageNumType(SvxNumType eType) { mePageNumType = eType; }
246 	SD_DLLPUBLIC String              CreatePageNumValue(sal_uInt16 nNum) const;
247 
248 	DocumentType        GetDocumentType() const { return meDocType; }
249 
250 	void			    SetAllocDocSh(sal_Bool bAlloc);
251 
252 	void	            CreatingDataObj( SdTransferable* pTransferable ) { mpCreatingTransferable = pTransferable; }
253 
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.
258 	*/
259 	SD_DLLPUBLIC void	CreateFirstPages( SdDrawDocument* pRefDocument = 0 );
260 	SD_DLLPUBLIC sal_Bool                CreateMissingNotesAndHandoutPages();
261 
262 	void	            MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
263 	void	            InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
264 	void	            DeletePage(sal_uInt16 nPgNum);
265 	SdrPage*            RemovePage(sal_uInt16 nPgNum);
266 
267     virtual void     InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
268 	virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
269 
270 	void	            RemoveUnnecessaryMasterPages( SdPage* pMaster=NULL, sal_Bool bOnlyDuplicatePages=sal_False, sal_Bool bUndo=sal_True );
271 	SD_DLLPUBLIC void 	SetMasterPage(sal_uInt16 nSdPageNum, const String& rLayoutName,
272 					    	          SdDrawDocument* pSourceDoc, sal_Bool bMaster, sal_Bool bCheckMasters);
273 
274 	SD_DLLPUBLIC SdDrawDocument* OpenBookmarkDoc(const String& rBookmarkFile);
275 	SdDrawDocument*     OpenBookmarkDoc(SfxMedium& rMedium);
276 	sal_Bool                InsertBookmark(List* pBookmarkList, List* pExchangeList, sal_Bool bLink,
277 			            				sal_Bool bReplace, sal_uInt16 nPgPos, sal_Bool bNoDialogs,
278 			            				::sd::DrawDocShell* pBookmarkDocSh, sal_Bool bCopy,
279 			            				Point* pObjPos);
280 
281 	bool IsStartWithPresentation() const;
282 	void SetStartWithPresentation( bool bStartWithPresentation );
283 
284 	/** Insert pages into this document
285 
286     	This method inserts whole pages into this document, either
287     	selected ones (specified via pBookmarkList/pExchangeList), or
288     	all from the source document.
289 
290         @attention Beware! This method in it's current state does not
291         handle all combinations of their input parameters
292         correctly. For example, for pBookmarkList=NULL, bReplace=sal_True
293         is ignored (no replace happens).
294 
295         @param pBookmarkList
296         A list of strings, denoting the names of the pages to be copied
297 
298         @param pExchangeList
299         A list of strings, denoting the names of the pages to be renamed
300 
301         @param bLink
302         Whether the inserted pages should be links to the bookmark document
303 
304         @param bReplace
305         Whether the pages should not be inserted, but replace the pages in
306         the destination document
307 
308         @param nPgPos
309         Insertion point/start of replacement
310 
311         @param bNoDialogs
312         Whether query dialogs are allowed (e.g. for page scaling)
313 
314         @param pBookmarkDocSh
315         DocShell of the source document (used e.g. to extract the filename
316         for linked pages)
317 
318         @param bCopy
319         Whether the source document should be treated as immutable (i.e.
320         inserted pages are not removed from it, but cloned)
321 
322         @param bMergeMasterPages
323         Whether the source document's master pages should be copied, too.
324 
325         @param bPreservePageNames
326         Whether the replace operation should take the name from the new
327         page, or preserve the old name
328      */
329 	sal_Bool                InsertBookmarkAsPage(List* pBookmarkList, List* pExchangeList,
330 			            					  sal_Bool bLink, sal_Bool bReplace, sal_uInt16 nPgPos,
331 			            					  sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
332 			            					  sal_Bool bCopy, sal_Bool bMergeMasterPages,
333                                               sal_Bool bPreservePageNames);
334 	sal_Bool                InsertBookmarkAsObject(List* pBookmarkList, List* pExchangeListL,
335 			            						sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
336 			            						Point* pObjPos);
337     void 				IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* pBookmarkList,
338                                               sal_uInt16 nBMSdPageCount,
339                                               InsertBookmarkAsPage_PageFunctorBase& rPageIterator );
340 	SD_DLLPUBLIC void	CloseBookmarkDoc();
341 
342 	SdrObject*          GetObj(const String& rObjName) const;
343 
344     /** Return the first page that has the given name.  Regular pages and
345         notes pages are searched first.  When not found then the master
346         pages are searched.
347         @param rPgName
348             Name of the page to return.
349         @param rbIsMasterPage
350             Is set by the method to indicate whether the returned index
351             belongs to a master page (<TRUE/>) or a regular or notes page
352             (<FALSE/>). The given value is ignored.
353         @return
354             Returns the index of the page with the given name or
355             SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist.
356     */
357 	sal_uInt16 GetPageByName(const String& rPgName, sal_Bool& rbIsMasterPage ) const;
358 	SD_DLLPUBLIC SdPage*GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const;
359 	SD_DLLPUBLIC sal_uInt16	GetSdPageCount(PageKind ePgKind) const;
360 
361 	void	            SetSelected(SdPage* pPage, sal_Bool bSelect);
362 	sal_Bool	            MovePages(sal_uInt16 nTargetPage);
363 
364 	SD_DLLPUBLIC SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
365 	SD_DLLPUBLIC sal_uInt16	GetMasterSdPageCount(PageKind ePgKind) const;
366 
367 	sal_uInt16	            GetMasterPageUserCount(SdrPage* pMaster) const;
368 
369 	const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; }
370 	sd::PresentationSettings& getPresentationSettings() { return maPresentationSettings; }
371 
372 	const ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 >& getPresentation() const;
373 
374    	void                SetSummationOfParagraphs( sal_Bool bOn = sal_True ) { mbSummationOfParagraphs = bOn; }
375 	sal_Bool	        IsSummationOfParagraphs() const { return mbSummationOfParagraphs; }
376 
377     /** Set the mode that controls whether (and later how) the formatting of the document
378         depends on the current printer metrics.
379         @param nMode
380             Use <const
381             scope="com::sun::star::document::PrinterIndependentLayout">ENABLED</const>
382             to make formatting printer-independent and <const
383             scope="com::sun::star::document::PrinterIndependentLayout">DISABLED</const>
384             to make formatting depend on the current printer metrics.
385     */
386     void SetPrinterIndependentLayout (sal_Int32 nMode);
387 
388     /** Get the flag that controls whether the formatting of the document
389         depends on the current printer metrics.
390         @return
391             Use <const
392             scope="com::sun::star::document::PrinterIndependentLayout">ENABLED</const>
393             when formatting is printer-independent and <const
394             scope="com::sun::star::document::PrinterIndependentLayout">DISABLED</const>
395             when formatting depends on the current printer metrics.
396     */
397     sal_Int32 GetPrinterIndependentLayout (void);
398 
399 	void                SetOnlineSpell( sal_Bool bIn );
400 	sal_Bool                GetOnlineSpell() const { return mbOnlineSpell; }
401 	void                StopOnlineSpelling();
402 	void                StartOnlineSpelling(sal_Bool bForceSpelling=sal_True);
403 
404 	void                ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj, SdrOutliner* pOutl);
405 
406 	void                InsertObject(SdrObject* pObj, SdPage* pPage);
407 	void                RemoveObject(SdrObject* pObj, SdPage* pPage);
408 
409 	sal_uLong               GetLinkCount();
410 
411 	List*               GetFrameViewList() const { return mpFrameViewList; }
412 	SD_DLLPUBLIC List*  GetCustomShowList(sal_Bool bCreate = sal_False);
413 
414 	void                NbcSetChanged(sal_Bool bFlag = sal_True);
415 
416 	void                SetTextDefaults() const;
417 
418 	void                CreateLayoutTemplates();
419 	void                RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName);
420 
421 	void				CreateDefaultCellStyles();
422 
423 	SD_DLLPUBLIC void   StopWorkStartupDelay();
424 
425 	void                NewOrLoadCompleted(DocCreationMode eMode);
426 	void				NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool );
427 	sal_Bool                IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted; }
428 
429 	::sd::FrameView* GetFrameView(sal_uLong nPos) {
430         return static_cast< ::sd::FrameView*>(
431             mpFrameViewList->GetObject(nPos));}
432 
433 	/** deprecated*/
434 	SdAnimationInfo*    GetAnimationInfo(SdrObject* pObject) const;
435 
436 	SD_DLLPUBLIC static 	SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false );
437 
438 	SdIMapInfo*         GetIMapInfo( SdrObject* pObject ) const;
439 	IMapObject*         GetHitIMapObject( SdrObject* pObject, const Point& rWinPoint, const ::Window& rCmpWnd );
440 
441 	CharClass*	        GetCharClass() const { return mpCharClass; }
442 
443 	void                RestoreLayerNames();
444 
445 	void	            UpdateAllLinks();
446 
447 	void                CheckMasterPages();
448 
449 	void                Merge(SdrModel& rSourceModel,
450 			                    sal_uInt16 nFirstPageNum=0, sal_uInt16 nLastPageNum=0xFFFF,
451 			                    sal_uInt16 nDestPos=0xFFFF,
452 			                    FASTBOOL bMergeMasterPages=sal_False, FASTBOOL bAllMasterPages=sal_False,
453 			                    FASTBOOL bUndo=sal_True, FASTBOOL bTreadSourceAsConst=sal_False);
454 
455     SD_DLLPUBLIC ::com::sun::star::text::WritingMode GetDefaultWritingMode() const;
456     void SetDefaultWritingMode( ::com::sun::star::text::WritingMode eMode );
457 
458 	/** replacespOldPage from all custom shows with pNewPage or removes pOldPage from
459 		all custom shows if pNewPage is 0.
460 	*/
461 	void ReplacePageInCustomShows( const SdPage* pOldPage, const SdPage* pNewPage );
462 
463 public:
464 
465     static SdDrawDocument* pDocLockedInsertingLinks;  // static to prevent recursions while resolving links
466 
467     /** Create and insert a set of two new pages: a standard (draw) page and
468         the associated notes page.  The new pages are inserted direclty
469         after the specified page set.
470         @param pCurrentPage
471             This page is used to retrieve the layout for the page to
472             create.
473         @param ePageKind
474             This specifies whether <argument>pCurrentPage</argument> is a
475             standard (draw) page or a notes page.
476         @param sStandardPageName
477             Name of the standard page.  An empty string leads to using an
478             automatically created name.
479         @param sNotesPageName
480             Name of the standard page.  An empty string leads to using an
481             automatically created name.
482         @param eStandardLayout
483             Layout to use for the new standard page.  Note that this layout
484             is not used when the given <argument>pCurrentPage</argument> is
485             not a standard page.  In this case the layout is taken from the
486             standard page associated with <argument>pCurrentPage</argument>.
487         @param eNotesLayout
488             Layout to use for the new notes page.  Note that this layout
489             is not used when the given <argument>pCurrentPage</argument> is
490             not a notes page.  In this case the layout is taken from the
491             notes page associated with <argument>pCurrentPage</argument>.
492         @param bIsPageBack
493             This flag indicates whether to show the background shape.
494         @param bIsPageObj
495             This flag indicates whether to show the shapes on the master page.
496         @param nInsertPosition
497             Position where to insert the standard page.  When -1 then the
498             new page set is inserted after the current page.
499 
500         @return
501             Returns an index of the inserted pages that can be used with the
502             <member>GetSdPage()</member> method.
503     */
504     sal_uInt16 CreatePage (
505         SdPage* pCurrentPage,
506         PageKind ePageKind,
507         const String& sStandardPageName,
508         const String& sNotesPageName,
509         AutoLayout eStandardLayout,
510         AutoLayout eNotesLayout,
511         sal_Bool bIsPageBack,
512         sal_Bool bIsPageObj,
513         const sal_Int32 nInsertPosition = -1);
514 
515     /** This method acts as a simplified front end for the more complex
516         <member>DuplicatePage()</member> method.
517         @param nPageNum
518             The page number as passed to the <member>GetSdPage()</member>
519             method for which the standard page and the notes page are to be
520             copied.
521         @return
522             Returns an index of the inserted pages that can be used with the
523             <member>GetSdPage()</member> method.
524     */
525     sal_uInt16 DuplicatePage (sal_uInt16 nPageNum);
526 
527     /** Create and insert a set of two new pages that are copies of the
528         given <argument>pCurrentPage</argument> and its associated notes
529         resp. standard page.  The copies are inserted directly after the
530         specified page set.
531         @param pCurrentPage
532             This page and its associated notes/standard page is copied.
533         @param ePageKind
534             This specifies whether <argument>pCurrentPage</argument> is a
535             standard (draw) page or a notes page.
536         @param sStandardPageName
537             Name of the standard page.  An empty string leads to using an
538             automatically created name.
539         @param sNotesPageName
540             Name of the standard page.  An empty string leads to using an
541             automatically created name.
542         @param eStandardLayout
543             Layout to use for the new standard page.  Note that this layout
544             is not used when the given <argument>pCurrentPage</argument> is
545             not a standard page.  In this case the layout is taken from the
546             standard page associated with <argument>pCurrentPage</argument>.
547         @param eNotesLayout
548             Layout to use for the new notes page.  Note that this layout
549             is not used when the given <argument>pCurrentPage</argument> is
550             not a notes page.  In this case the layout is taken from the
551             notes page associated with <argument>pCurrentPage</argument>.
552         @param bIsPageBack
553             This flag indicates whether to show the background shape.
554         @param bIsPageObj
555             This flag indicates whether to show the shapes on the master page.
556         @param nInsertPosition
557             Position where to insert the standard page.  When -1 then the
558             new page set is inserted after the current page.
559 
560         @return
561             Returns an index of the inserted pages that can be used with the
562             <member>GetSdPage()</member> method.
563     */
564     sal_uInt16 DuplicatePage (
565         SdPage* pCurrentPage,
566         PageKind ePageKind,
567         const String& sStandardPageName,
568         const String& sNotesPageName,
569         AutoLayout eStandardLayout,
570         AutoLayout eNotesLayout,
571         sal_Bool bIsPageBack,
572         sal_Bool bIsPageObj,
573         const sal_Int32 nInsertPosition = -1);
574 
575 	/** return the document fonts for latin, cjk and ctl according to the current
576 		languages set at this document */
577 	void getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont );
578 
579 	sd::UndoManager* GetUndoManager() const;
580 
581 	/* converts the given western font height to a corresponding ctl font height, deppending on the system language */
582 	static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight );
583 
584 	/** Get the style sheet pool if it was a SdStyleSheetPool.
585 	 */
586 	SD_DLLPUBLIC SdStyleSheetPool* GetSdStyleSheetPool() const;
587 
588    	void UpdatePageRelativeURLs(const String& rOldName, const String& rNewName);
589 
590 	void SetCalcFieldValueHdl( ::Outliner* pOutliner);
591 
592     sal_uInt16 GetAnnotationAuthorIndex( const rtl::OUString& rAuthor );
593 
594 private:
595     /** This member stores the printer independent layout mode.  Please
596         refer to <member>SetPrinterIndependentLayout()</member> for its
597         values.
598     */
599     sal_Int32 mnPrinterIndependentLayout;
600 
601     /** Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>.
602         @param pCurrentPage
603             This page and its associated notes/standard page is copied.
604         @param ePageKind
605             This specifies whether <argument>pCurrentPage</argument> is a
606             standard (draw) page or a notes page.
607         @param sStandardPageName
608             Name of the standard page.  An empty string leads to using an
609             automatically created name.
610         @param sNotesPageName
611             Name of the standard page.  An empty string leads to using an
612             automatically created name.
613         @param eStandardLayout
614             Layout to use for the new standard page.  Note that this layout
615             is not used when the given <argument>pCurrentPage</argument> is
616             not a standard page.  In this case the layout is taken from the
617             standard page associated with <argument>pCurrentPage</argument>.
618         @param eNotesLayout
619             Layout to use for the new notes page.  Note that this layout
620             is not used when the given <argument>pCurrentPage</argument> is
621             not a notes page.  In this case the layout is taken from the
622             notes page associated with <argument>pCurrentPage</argument>.
623         @param bIsPageBack
624             This flag indicates whether to show the background shape.
625         @param bIsPageObj
626             This flag indicates whether to show the shapes on the master page.
627         @param pStandardPage
628             The standard page to insert.
629         @param pNotesPage
630             The notes page to insert.
631         @param nInsertPosition
632             Position where to insert the standard page.  When -1 then the
633             new page set is inserted after the current page.
634 
635         @return
636             Returns an index of the inserted pages that can be used with the
637             <member>GetSdPage()</member> method.
638     */
639     sal_uInt16 InsertPageSet (
640         SdPage* pCurrentPage,
641         PageKind ePageKind,
642         const String& sStandardPageName,
643         const String& sNotesPageName,
644         AutoLayout eStandardLayout,
645         AutoLayout eNotesLayout,
646         sal_Bool bIsPageBack,
647         sal_Bool bIsPageObj,
648         SdPage* pStandardPage,
649         SdPage* pNotesPage,
650         sal_Int32 nInsertPosition = -1);
651 
652     /** Set up a newly created page and insert it into the list of pages.
653         @param pPreviousPage
654             A page to take the size and border geometry from.
655         @param pPage
656             This is the page to set up and insert.
657         @param sPageName
658             The name of the new page.
659         @param nInsertionPoint
660             Index of the page before which the new page will be inserted.
661         @param bIsPageBack
662             This flag indicates whether to show the background shape.
663         @param bIsPageObj
664             This flag indicates whether to show the shapes on the master
665             page.
666     */
667     void SetupNewPage (
668         SdPage* pPreviousPage,
669         SdPage* pPage,
670         const String& sPageName,
671         sal_uInt16 nInsertionPoint,
672         sal_Bool bIsPageBack,
673         sal_Bool bIsPageObj);
674 
675 	// #109538#
676 	virtual void PageListChanged();
677 	virtual void MasterPageListChanged();
678 };
679 
680 namespace sd
681 {
682 
683 // an instance of this guard disables modification of a document
684 // during its lifetime
685 class ModifyGuard
686 {
687 public:
688 	ModifyGuard( SdDrawDocument* pDoc );
689 	~ModifyGuard();
690 
691 private:
692 	void init();
693 
694 	DrawDocShell* mpDocShell;
695 	SdDrawDocument* mpDoc;
696 	sal_Bool mbIsEnableSetModified;
697 	sal_Bool mbIsDocumentChanged;
698 };
699 
700 }
701 
702 #endif // _DRAWDOC_HXX
703