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