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