xref: /trunk/main/sd/inc/drawdoc.hxx (revision 0deba7fb)
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 //IAccessibility2 Implementation 2009-----
161 	String msDocAccTitle;
162 public:
163 	virtual void setDocAccTitle( const String& rTitle ) { msDocAccTitle = rTitle; }
164 	virtual const String getDocAccTitle() const { return msDocAccTitle; }
165 private:
166 	sal_Bool bReadOnly;
167 public:
168 	virtual void setDocReadOnly( sal_Bool b){ bReadOnly = b; }
169 	virtual sal_Bool getDocReadOnly() const { return bReadOnly; }
170 private:
171 //IAccessibility2 Implementation 2009-----
172 	::sd::Outliner*		mpOutliner;		    // local outliner for outline mode
173 	::sd::Outliner*		mpInternalOutliner;  // internal outliner for creation of text objects
174 	Timer*			    mpWorkStartupTimer;
175 	Timer*              mpOnlineSpellingTimer;
176 	sd::ShapeList*		mpOnlineSpellingList;
177 	SvxSearchItem*      mpOnlineSearchItem;
178 	List*               mpFrameViewList;
179 	List*               mpCustomShowList;
180 	::sd::DrawDocShell* mpDocSh;
181     SdTransferable *    mpCreatingTransferable;
182 	sal_Bool                mbHasOnlineSpellErrors;
183 	sal_Bool                mbInitialOnlineSpellingEnabled;
184 	String              maBookmarkFile;
185 	::sd::DrawDocShellRef   mxBookmarkDocShRef;
186 
187 	sd::PresentationSettings maPresentationSettings;
188 
189 	::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 > mxPresentation;
190 
191 	sal_Bool			    mbNewOrLoadCompleted;
192 
193 	sal_Bool			    mbOnlineSpell;
194     sal_Bool                mbSummationOfParagraphs;
195 	bool				mbStartWithPresentation;		// is set to true when starting with command line parameter -start
196 	LanguageType	    meLanguage;
197 	LanguageType	    meLanguageCJK;
198 	LanguageType	    meLanguageCTL;
199 	SvxNumType		    mePageNumType;
200 	::sd::DrawDocShellRef   mxAllocedDocShRef;   // => AllocModel()
201 	sal_Bool			    mbAllocDocSh;		// => AllocModel()
202 	DocumentType        meDocType;
203 	CharClass*		    mpCharClass;
204 	::com::sun::star::lang::Locale* mpLocale;
205 
206 	// #109538#
207 	::std::auto_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher;
208 	::std::auto_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher;
209 
210 	void                UpdatePageObjectsInNotes(sal_uInt16 nStartPos);
211     void                UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_Int32 nIncrement);
212 	void                FillOnlineSpellingList(SdPage* pPage);
213 	void                SpellObject(SdrTextObj* pObj);
214 
215 	                    DECL_LINK(WorkStartupHdl, Timer*);
216 	                    DECL_LINK(OnlineSpellingHdl, Timer*);
217 	                    DECL_LINK(OnlineSpellEventHdl, EditStatus*);
218 
219     std::vector< rtl::OUString > maAnnotationAuthors;
220 
221 protected:
222 
223 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
224 
225 public:
226 
227     class InsertBookmarkAsPage_PageFunctorBase;
228 
229                 	    TYPEINFO();
230 
231 	                    SdDrawDocument(DocumentType eType, SfxObjectShell* pDocSh);
232 	                    ~SdDrawDocument();
233 
234 	virtual SdrModel*   AllocModel() const;
235 	virtual SdrPage*    AllocPage(FASTBOOL bMasterPage);
236 	virtual const SdrModel* LoadModel(const String& rFileName);
237 	virtual void        DisposeLoadedModels();
238 	virtual FASTBOOL    IsReadOnly() const;
239 	virtual void        SetChanged(sal_Bool bFlag = sal_True);
240 	virtual SvStream*   GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const;
241 
242 	SfxItemPool&	    GetPool() { return( *pItemPool ); }
243 
244 	::sd::Outliner* GetOutliner(sal_Bool bCreateOutliner=sal_True);
245 	SD_DLLPUBLIC ::sd::Outliner* GetInternalOutliner(sal_Bool bCreateOutliner=sal_True);
246 
247 	::sd::DrawDocShell*     GetDocSh() const { return mpDocSh; }
248 
249 	LanguageType	    GetLanguage( const sal_uInt16 nId ) const;
250 	void			    SetLanguage( const LanguageType eLang, const sal_uInt16 nId );
251 
252 	SvxNumType          GetPageNumType() const;
253 	void			    SetPageNumType(SvxNumType eType) { mePageNumType = eType; }
254 	SD_DLLPUBLIC String              CreatePageNumValue(sal_uInt16 nNum) const;
255 
256 	DocumentType        GetDocumentType() const { return meDocType; }
257 
258 	void			    SetAllocDocSh(sal_Bool bAlloc);
259 
260 	void	            CreatingDataObj( SdTransferable* pTransferable ) { mpCreatingTransferable = pTransferable; }
261 
262 	/** if the document does not contain at least one handout, one slide and one notes page with
263 		at least one master each this methods creates them.
264 		If a reference document is given, the sizes and border settings of that document are used
265 		for newly created slides.
266 	*/
267 	SD_DLLPUBLIC void	CreateFirstPages( SdDrawDocument* pRefDocument = 0 );
268 	SD_DLLPUBLIC sal_Bool                CreateMissingNotesAndHandoutPages();
269 
270 	void	            MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
271 	void	            InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
272 	void	            DeletePage(sal_uInt16 nPgNum);
273 	SdrPage*            RemovePage(sal_uInt16 nPgNum);
274 
275     virtual void     InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
276 	virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
277 
278 	void	            RemoveUnnecessaryMasterPages( SdPage* pMaster=NULL, sal_Bool bOnlyDuplicatePages=sal_False, sal_Bool bUndo=sal_True );
279 	SD_DLLPUBLIC void 	SetMasterPage(sal_uInt16 nSdPageNum, const String& rLayoutName,
280 					    	          SdDrawDocument* pSourceDoc, sal_Bool bMaster, sal_Bool bCheckMasters);
281 
282 	SD_DLLPUBLIC SdDrawDocument* OpenBookmarkDoc(const String& rBookmarkFile);
283 	SdDrawDocument*     OpenBookmarkDoc(SfxMedium& rMedium);
284 	sal_Bool                InsertBookmark(List* pBookmarkList, List* pExchangeList, sal_Bool bLink,
285 			            				sal_Bool bReplace, sal_uInt16 nPgPos, sal_Bool bNoDialogs,
286 			            				::sd::DrawDocShell* pBookmarkDocSh, sal_Bool bCopy,
287 			            				Point* pObjPos);
288 
289 	bool IsStartWithPresentation() const;
290 	void SetStartWithPresentation( bool bStartWithPresentation );
291 
292 	/** Insert pages into this document
293 
294     	This method inserts whole pages into this document, either
295     	selected ones (specified via pBookmarkList/pExchangeList), or
296     	all from the source document.
297 
298         @attention Beware! This method in it's current state does not
299         handle all combinations of their input parameters
300         correctly. For example, for pBookmarkList=NULL, bReplace=sal_True
301         is ignored (no replace happens).
302 
303         @param pBookmarkList
304         A list of strings, denoting the names of the pages to be copied
305 
306         @param pExchangeList
307         A list of strings, denoting the names of the pages to be renamed
308 
309         @param bLink
310         Whether the inserted pages should be links to the bookmark document
311 
312         @param bReplace
313         Whether the pages should not be inserted, but replace the pages in
314         the destination document
315 
316         @param nPgPos
317         Insertion point/start of replacement
318 
319         @param bNoDialogs
320         Whether query dialogs are allowed (e.g. for page scaling)
321 
322         @param pBookmarkDocSh
323         DocShell of the source document (used e.g. to extract the filename
324         for linked pages)
325 
326         @param bCopy
327         Whether the source document should be treated as immutable (i.e.
328         inserted pages are not removed from it, but cloned)
329 
330         @param bMergeMasterPages
331         Whether the source document's master pages should be copied, too.
332 
333         @param bPreservePageNames
334         Whether the replace operation should take the name from the new
335         page, or preserve the old name
336      */
337 	sal_Bool                InsertBookmarkAsPage(List* pBookmarkList, List* pExchangeList,
338 			            					  sal_Bool bLink, sal_Bool bReplace, sal_uInt16 nPgPos,
339 			            					  sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
340 			            					  sal_Bool bCopy, sal_Bool bMergeMasterPages,
341                                               sal_Bool bPreservePageNames);
342 	sal_Bool                InsertBookmarkAsObject(List* pBookmarkList, List* pExchangeListL,
343 			            						sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
344 			            						Point* pObjPos);
345     void 				IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* pBookmarkList,
346                                               sal_uInt16 nBMSdPageCount,
347                                               InsertBookmarkAsPage_PageFunctorBase& rPageIterator );
348 	SD_DLLPUBLIC void	CloseBookmarkDoc();
349 
350 	SdrObject*          GetObj(const String& rObjName) const;
351 
352     /** Return the first page that has the given name.  Regular pages and
353         notes pages are searched first.  When not found then the master
354         pages are searched.
355         @param rPgName
356             Name of the page to return.
357         @param rbIsMasterPage
358             Is set by the method to indicate whether the returned index
359             belongs to a master page (<TRUE/>) or a regular or notes page
360             (<FALSE/>). The given value is ignored.
361         @return
362             Returns the index of the page with the given name or
363             SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist.
364     */
365 	sal_uInt16 GetPageByName(const String& rPgName, sal_Bool& rbIsMasterPage ) const;
366 	SD_DLLPUBLIC SdPage*GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const;
367 	SD_DLLPUBLIC sal_uInt16	GetSdPageCount(PageKind ePgKind) const;
368 
369 	void	            SetSelected(SdPage* pPage, sal_Bool bSelect);
370 	sal_Bool	            MovePages(sal_uInt16 nTargetPage);
371 
372 	SD_DLLPUBLIC SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
373 	SD_DLLPUBLIC sal_uInt16	GetMasterSdPageCount(PageKind ePgKind) const;
374 
375 	sal_uInt16	            GetMasterPageUserCount(SdrPage* pMaster) const;
376 
377 	const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; }
378 	sd::PresentationSettings& getPresentationSettings() { return maPresentationSettings; }
379 
380 	const ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 >& getPresentation() const;
381 
382    	void                SetSummationOfParagraphs( sal_Bool bOn = sal_True ) { mbSummationOfParagraphs = bOn; }
383 	sal_Bool	        IsSummationOfParagraphs() const { return mbSummationOfParagraphs; }
384 
385     /** Set the mode that controls whether (and later how) the formatting of the document
386         depends on the current printer metrics.
387         @param nMode
388             Use <const
389             scope="com::sun::star::document::PrinterIndependentLayout">ENABLED</const>
390             to make formatting printer-independent and <const
391             scope="com::sun::star::document::PrinterIndependentLayout">DISABLED</const>
392             to make formatting depend on the current printer metrics.
393     */
394     void SetPrinterIndependentLayout (sal_Int32 nMode);
395 
396     /** Get the flag that controls whether the formatting of the document
397         depends on the current printer metrics.
398         @return
399             Use <const
400             scope="com::sun::star::document::PrinterIndependentLayout">ENABLED</const>
401             when formatting is printer-independent and <const
402             scope="com::sun::star::document::PrinterIndependentLayout">DISABLED</const>
403             when formatting depends on the current printer metrics.
404     */
405     sal_Int32 GetPrinterIndependentLayout (void);
406 
407 	void                SetOnlineSpell( sal_Bool bIn );
408 	sal_Bool                GetOnlineSpell() const { return mbOnlineSpell; }
409 	void                StopOnlineSpelling();
410 	void                StartOnlineSpelling(sal_Bool bForceSpelling=sal_True);
411 
412 	void                ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj, SdrOutliner* pOutl);
413 
414 	void                InsertObject(SdrObject* pObj, SdPage* pPage);
415 	void                RemoveObject(SdrObject* pObj, SdPage* pPage);
416 
417 	sal_uLong               GetLinkCount();
418 
419 	List*               GetFrameViewList() const { return mpFrameViewList; }
420 	SD_DLLPUBLIC List*  GetCustomShowList(sal_Bool bCreate = sal_False);
421 
422 	void                NbcSetChanged(sal_Bool bFlag = sal_True);
423 
424 	void                SetTextDefaults() const;
425 
426 	void                CreateLayoutTemplates();
427 	void                RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName);
428 
429 	void				CreateDefaultCellStyles();
430 
431 	SD_DLLPUBLIC void   StopWorkStartupDelay();
432 
433 	void                NewOrLoadCompleted(DocCreationMode eMode);
434 	void				NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool );
435 	sal_Bool                IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted; }
436 
437 	::sd::FrameView* GetFrameView(sal_uLong nPos) {
438         return static_cast< ::sd::FrameView*>(
439             mpFrameViewList->GetObject(nPos));}
440 
441 	/** deprecated*/
442 	SdAnimationInfo*    GetAnimationInfo(SdrObject* pObject) const;
443 
444 	SD_DLLPUBLIC static 	SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false );
445 
446 	SdIMapInfo*         GetIMapInfo( SdrObject* pObject ) const;
447 	IMapObject*         GetHitIMapObject( SdrObject* pObject, const Point& rWinPoint, const ::Window& rCmpWnd );
448 
449 	CharClass*	        GetCharClass() const { return mpCharClass; }
450 
451 	void                RestoreLayerNames();
452 
453 	void	            UpdateAllLinks();
454 
455 	void                CheckMasterPages();
456 
457 	void                Merge(SdrModel& rSourceModel,
458 			                    sal_uInt16 nFirstPageNum=0, sal_uInt16 nLastPageNum=0xFFFF,
459 			                    sal_uInt16 nDestPos=0xFFFF,
460 			                    FASTBOOL bMergeMasterPages=sal_False, FASTBOOL bAllMasterPages=sal_False,
461 			                    FASTBOOL bUndo=sal_True, FASTBOOL bTreadSourceAsConst=sal_False);
462 
463     SD_DLLPUBLIC ::com::sun::star::text::WritingMode GetDefaultWritingMode() const;
464     void SetDefaultWritingMode( ::com::sun::star::text::WritingMode eMode );
465 
466 	/** replacespOldPage from all custom shows with pNewPage or removes pOldPage from
467 		all custom shows if pNewPage is 0.
468 	*/
469 	void ReplacePageInCustomShows( const SdPage* pOldPage, const SdPage* pNewPage );
470 
471 public:
472 
473     static SdDrawDocument* pDocLockedInsertingLinks;  // static to prevent recursions while resolving links
474 
475     /** Create and insert a set of two new pages: a standard (draw) page and
476         the associated notes page.  The new pages are inserted direclty
477         after the specified page set.
478         @param pCurrentPage
479             This page is used to retrieve the layout for the page to
480             create.
481         @param ePageKind
482             This specifies whether <argument>pCurrentPage</argument> is a
483             standard (draw) page or a notes page.
484         @param sStandardPageName
485             Name of the standard page.  An empty string leads to using an
486             automatically created name.
487         @param sNotesPageName
488             Name of the standard page.  An empty string leads to using an
489             automatically created name.
490         @param eStandardLayout
491             Layout to use for the new standard page.  Note that this layout
492             is not used when the given <argument>pCurrentPage</argument> is
493             not a standard page.  In this case the layout is taken from the
494             standard page associated with <argument>pCurrentPage</argument>.
495         @param eNotesLayout
496             Layout to use for the new notes page.  Note that this layout
497             is not used when the given <argument>pCurrentPage</argument> is
498             not a notes page.  In this case the layout is taken from the
499             notes page associated with <argument>pCurrentPage</argument>.
500         @param bIsPageBack
501             This flag indicates whether to show the background shape.
502         @param bIsPageObj
503             This flag indicates whether to show the shapes on the master page.
504         @param nInsertPosition
505             Position where to insert the standard page.  When -1 then the
506             new page set is inserted after the current page.
507 
508         @return
509             Returns an index of the inserted pages that can be used with the
510             <member>GetSdPage()</member> method.
511     */
512     sal_uInt16 CreatePage (
513         SdPage* pCurrentPage,
514         PageKind ePageKind,
515         const String& sStandardPageName,
516         const String& sNotesPageName,
517         AutoLayout eStandardLayout,
518         AutoLayout eNotesLayout,
519         sal_Bool bIsPageBack,
520         sal_Bool bIsPageObj,
521         const sal_Int32 nInsertPosition = -1);
522 
523     /** This method acts as a simplified front end for the more complex
524         <member>DuplicatePage()</member> method.
525         @param nPageNum
526             The page number as passed to the <member>GetSdPage()</member>
527             method for which the standard page and the notes page are to be
528             copied.
529         @return
530             Returns an index of the inserted pages that can be used with the
531             <member>GetSdPage()</member> method.
532     */
533     sal_uInt16 DuplicatePage (sal_uInt16 nPageNum);
534 
535     /** Create and insert a set of two new pages that are copies of the
536         given <argument>pCurrentPage</argument> and its associated notes
537         resp. standard page.  The copies are inserted directly after the
538         specified page set.
539         @param pCurrentPage
540             This page and its associated notes/standard page is copied.
541         @param ePageKind
542             This specifies whether <argument>pCurrentPage</argument> is a
543             standard (draw) page or a notes page.
544         @param sStandardPageName
545             Name of the standard page.  An empty string leads to using an
546             automatically created name.
547         @param sNotesPageName
548             Name of the standard page.  An empty string leads to using an
549             automatically created name.
550         @param eStandardLayout
551             Layout to use for the new standard page.  Note that this layout
552             is not used when the given <argument>pCurrentPage</argument> is
553             not a standard page.  In this case the layout is taken from the
554             standard page associated with <argument>pCurrentPage</argument>.
555         @param eNotesLayout
556             Layout to use for the new notes page.  Note that this layout
557             is not used when the given <argument>pCurrentPage</argument> is
558             not a notes page.  In this case the layout is taken from the
559             notes page associated with <argument>pCurrentPage</argument>.
560         @param bIsPageBack
561             This flag indicates whether to show the background shape.
562         @param bIsPageObj
563             This flag indicates whether to show the shapes on the master page.
564         @param nInsertPosition
565             Position where to insert the standard page.  When -1 then the
566             new page set is inserted after the current page.
567 
568         @return
569             Returns an index of the inserted pages that can be used with the
570             <member>GetSdPage()</member> method.
571     */
572     sal_uInt16 DuplicatePage (
573         SdPage* pCurrentPage,
574         PageKind ePageKind,
575         const String& sStandardPageName,
576         const String& sNotesPageName,
577         AutoLayout eStandardLayout,
578         AutoLayout eNotesLayout,
579         sal_Bool bIsPageBack,
580         sal_Bool bIsPageObj,
581         const sal_Int32 nInsertPosition = -1);
582 
583 	/** return the document fonts for latin, cjk and ctl according to the current
584 		languages set at this document */
585 	void getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont );
586 
587 	sd::UndoManager* GetUndoManager() const;
588 
589 	/* converts the given western font height to a corresponding ctl font height, deppending on the system language */
590 	static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight );
591 
592 	/** Get the style sheet pool if it was a SdStyleSheetPool.
593 	 */
594 	SD_DLLPUBLIC SdStyleSheetPool* GetSdStyleSheetPool() const;
595 
596    	void UpdatePageRelativeURLs(const String& rOldName, const String& rNewName);
597 
598 	void SetCalcFieldValueHdl( ::Outliner* pOutliner);
599 
600     sal_uInt16 GetAnnotationAuthorIndex( const rtl::OUString& rAuthor );
601 
602 private:
603     /** This member stores the printer independent layout mode.  Please
604         refer to <member>SetPrinterIndependentLayout()</member> for its
605         values.
606     */
607     sal_Int32 mnPrinterIndependentLayout;
608 
609     /** Insert a given set of standard and notes page after the given <argument>pCurrentPage</argument>.
610         @param pCurrentPage
611             This page and its associated notes/standard page is copied.
612         @param ePageKind
613             This specifies whether <argument>pCurrentPage</argument> is a
614             standard (draw) page or a notes page.
615         @param sStandardPageName
616             Name of the standard page.  An empty string leads to using an
617             automatically created name.
618         @param sNotesPageName
619             Name of the standard page.  An empty string leads to using an
620             automatically created name.
621         @param eStandardLayout
622             Layout to use for the new standard page.  Note that this layout
623             is not used when the given <argument>pCurrentPage</argument> is
624             not a standard page.  In this case the layout is taken from the
625             standard page associated with <argument>pCurrentPage</argument>.
626         @param eNotesLayout
627             Layout to use for the new notes page.  Note that this layout
628             is not used when the given <argument>pCurrentPage</argument> is
629             not a notes page.  In this case the layout is taken from the
630             notes page associated with <argument>pCurrentPage</argument>.
631         @param bIsPageBack
632             This flag indicates whether to show the background shape.
633         @param bIsPageObj
634             This flag indicates whether to show the shapes on the master page.
635         @param pStandardPage
636             The standard page to insert.
637         @param pNotesPage
638             The notes page to insert.
639         @param nInsertPosition
640             Position where to insert the standard page.  When -1 then the
641             new page set is inserted after the current page.
642 
643         @return
644             Returns an index of the inserted pages that can be used with the
645             <member>GetSdPage()</member> method.
646     */
647     sal_uInt16 InsertPageSet (
648         SdPage* pCurrentPage,
649         PageKind ePageKind,
650         const String& sStandardPageName,
651         const String& sNotesPageName,
652         AutoLayout eStandardLayout,
653         AutoLayout eNotesLayout,
654         sal_Bool bIsPageBack,
655         sal_Bool bIsPageObj,
656         SdPage* pStandardPage,
657         SdPage* pNotesPage,
658         sal_Int32 nInsertPosition = -1);
659 
660     /** Set up a newly created page and insert it into the list of pages.
661         @param pPreviousPage
662             A page to take the size and border geometry from.
663         @param pPage
664             This is the page to set up and insert.
665         @param sPageName
666             The name of the new page.
667         @param nInsertionPoint
668             Index of the page before which the new page will be inserted.
669         @param bIsPageBack
670             This flag indicates whether to show the background shape.
671         @param bIsPageObj
672             This flag indicates whether to show the shapes on the master
673             page.
674     */
675     void SetupNewPage (
676         SdPage* pPreviousPage,
677         SdPage* pPage,
678         const String& sPageName,
679         sal_uInt16 nInsertionPoint,
680         sal_Bool bIsPageBack,
681         sal_Bool bIsPageObj);
682 
683 	// #109538#
684 	virtual void PageListChanged();
685 	virtual void MasterPageListChanged();
686 //IAccessibility2 Implementation 2009-----
687 	virtual ImageMap* GetImageMapForObject(SdrObject* pObj);
688 //-----IAccessibility2 Implementation 2009
689 };
690 
691 namespace sd
692 {
693 
694 // an instance of this guard disables modification of a document
695 // during its lifetime
696 class ModifyGuard
697 {
698 public:
699 	ModifyGuard( SdDrawDocument* pDoc );
700 	~ModifyGuard();
701 
702 private:
703 	void init();
704 
705 	DrawDocShell* mpDocShell;
706 	SdDrawDocument* mpDoc;
707 	sal_Bool mbIsEnableSetModified;
708 	sal_Bool mbIsDocumentChanged;
709 };
710 
711 }
712 
713 #endif // _DRAWDOC_HXX
714