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