update dev300-m58
[ooovba.git] / sw / inc / doc.hxx
blob43b1979c342deab76749c9b1566190d28a05e1a8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: doc.hxx,v $
10 * $Revision: 1.157 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _DOC_HXX
31 #define _DOC_HXX
33 /** SwDoc interfaces */
35 #include <IInterface.hxx>
36 #include <IDocumentSettingAccess.hxx>
37 #include <IDocumentDeviceAccess.hxx>
38 #include <IDocumentMarkAccess.hxx>
39 #include <IDocumentRedlineAccess.hxx>
40 #include <IDocumentUndoRedo.hxx>
41 #include <IDocumentLinksAdministration.hxx>
42 #include <IDocumentFieldsAccess.hxx>
43 #include <IDocumentContentOperations.hxx>
44 #include <IDocumentStylePoolAccess.hxx>
45 #include <IDocumentLineNumberAccess.hxx>
46 #include <IDocumentStatistics.hxx>
47 #include <IDocumentState.hxx>
48 #include <IDocumentDrawModelAccess.hxx>
49 #include <IDocumentLayoutAccess.hxx>
50 #include <IDocumentTimerAccess.hxx>
51 #include <IDocumentChartDataProviderAccess.hxx>
52 // --> OD 2007-10-26 #i83479#
53 #include <IDocumentOutlineNodes.hxx>
54 #include <IDocumentListItems.hxx>
55 #include <set>
56 // <--
57 // --> OD 2008-03-12 #refactorlists#
58 #include <IDocumentListsAccess.hxx>
59 class SwList;
60 // <--
61 #define _SVSTDARR_STRINGSDTOR
62 #include <svtools/svstdarr.hxx>
63 #include <com/sun/star/embed/XEmbeddedObject.hpp>
64 #include <com/sun/star/embed/XStorage.hpp>
65 #include <vcl/timer.hxx>
66 #include "swdllapi.h"
67 #include <swtypes.hxx>
68 #include <ndarr.hxx>
69 #include <swatrset.hxx>
70 #include <toxe.hxx> // enums
71 #include <flyenum.hxx>
72 #include <itabenum.hxx>
73 #include <swdbdata.hxx>
74 #include <chcmprse.hxx>
75 #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
76 #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
77 #include <vos/ref.hxx>
78 #include <svx/svdtypes.hxx>
79 #include <svtools/style.hxx>
80 #include <svx/numitem.hxx>
81 #include "comphelper/implementationreference.hxx"
82 #include <com/sun/star/chart2/data/XDataProvider.hpp>
83 #include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
85 #include <hash_map>
86 #include <stringhash.hxx>
88 #include <svtools/embedhlp.hxx>
89 #include <vector>
90 #include <memory>
92 #include <boost/scoped_ptr.hpp>
94 class SfxObjectShell;
95 class SfxObjectShellRef;
96 class SvxForbiddenCharactersTable;
97 class SwExtTextInput;
98 class DateTime;
99 class EditFieldInfo;
100 class JobSetup;
101 class Color;
102 class KeyCode;
103 class Outliner;
104 class OutputDevice;
105 class Point;
106 class SbxArray;
107 class SdrModel;
108 class SdrObject;
109 class SdrUndoAction;
110 class VirtualDevice;
111 class SfxPrinter;
112 class SvNumberFormatter;
113 class SvStringsSort;
114 class SvUShorts;
115 class SvUShortsSort;
116 class SvxLinkManager;
117 class SvxMacro;
118 class SvxMacroTableDtor;
119 class SvxBorderLine;
120 class SwAutoCompleteWord;
121 class SwAutoCorrExceptWord;
122 class SwCalc;
123 class SwCellFrm;
124 class SwCharFmt;
125 class SwCharFmts;
126 class SwConditionTxtFmtColl;
127 class SwCrsrShell;
128 class SwCursor;
129 class SwDBNameInfField;
130 class SwDocShell;
131 class SwDocUpdtFld;
132 class SwDrawFrmFmt;
133 class SwDrawView;
134 class SwEditShell;
135 class SwFieldType;
136 class SwField;
137 class SwTxtFld;
138 class SwFldTypes;
139 class SwFlyFrmFmt;
140 class SwFmt;
141 class SwFmtINetFmt;
142 class SwFmtRefMark;
143 class SwFrmFmt;
144 class SwFrmFmts;
145 class SwFtnIdxs;
146 class SwFtnInfo;
147 class SwEndNoteInfo;
148 class GraphicObject;
149 class SwGrfFmtColl;
150 class SwGrfFmtColls;
151 class SwLineNumberInfo;
152 class SwNewDBMgr;
153 class SwNoTxtNode;
154 class SwNodeIndex;
155 class SwNodeRange;
156 class SwNumRule;
157 class SwNumRuleTbl;
158 class SwPageDesc;
159 class SwPosFlyFrms;
160 class SwPagePreViewPrtData;
161 class SwRedline;
162 class SwRedlineTbl;
163 class SwRootFrm;
164 class SwRubyList;
165 class SwRubyListEntry;
166 class SwSectionFmt;
167 class SwSectionFmts;
168 class SwSelBoxes;
169 class SwSpzFrmFmts;
170 class SwTOXBase;
171 class SwTOXBaseSection;
172 class SwTOXMark;
173 class SwTOXMarks;
174 class SwTOXType;
175 class SwTOXTypes;
176 class SwTabCols;
177 class SwTable;
178 class SwTableAutoFmt;
179 class SwTableBox;
180 class SwTableBoxFmt;
181 class SwTableFmt;
182 class SwTableLineFmt;
183 class SwTableNode;
184 class SwTextBlocks;
185 class SwTxtFmtColl;
186 class SwTxtFmtColls;
187 class SwURLStateChanged;
188 class SwUndo;
189 class SwUndoIds;
190 class SwUndoIter;
191 class SwUndos;
192 class SwUnoCrsr;
193 class SwUnoCrsrTbl;
194 class ViewShell;
195 class _SetGetExpFld;
196 class SwDrawContact;
197 class SwLayouter;
198 class SdrView;
199 class SdrMarkList;
200 class SwAuthEntry;
201 class SwUnoCallBack;
202 class SwLayoutCache;
203 class IStyleAccess;
204 struct SwCallMouseEvent;
205 struct SwDocStat;
206 struct SwHash;
207 struct SwSortOptions;
208 struct SwDefTOXBase_Impl;
209 struct SwPrintData;
210 class SdrPageView;
211 struct SwConversionArgs;
212 class SwRewriter;
213 class SwMsgPoolItem;
214 class SwChartDataProvider;
215 class SwChartLockController_Helper;
216 class IGrammarContact;
218 namespace sw { namespace mark {
219 class MarkManager;
222 namespace com { namespace sun { namespace star {
223 namespace i18n {
224 struct ForbiddenCharacters; // comes from the I18N UNO interface
226 namespace uno {
227 template < class > class Sequence;
229 namespace container {
230 class XNameContainer; // for getXForms()/isXForms()/initXForms() methods
234 namespace sfx2 {
235 class SvLinkSource;
236 class IXmlIdRegistry;
239 //PageDescriptor-Schnittstelle, Array hier wegen inlines.
240 typedef SwPageDesc* SwPageDescPtr;
241 SV_DECL_PTRARR_DEL( SwPageDescs, SwPageDescPtr, 4, 4 )
243 // forward declartion
244 void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem );
246 // global function to start grammar checking in the document
247 void StartGrammarChecking( SwDoc &rDoc );
249 class SW_DLLPUBLIC SwDoc :
250 public IInterface,
251 public IDocumentSettingAccess,
252 public IDocumentDeviceAccess,
253 public IDocumentRedlineAccess,
254 public IDocumentUndoRedo,
255 public IDocumentLinksAdministration,
256 public IDocumentFieldsAccess,
257 public IDocumentContentOperations,
258 public IDocumentStylePoolAccess,
259 public IDocumentLineNumberAccess,
260 public IDocumentStatistics,
261 public IDocumentState,
262 public IDocumentDrawModelAccess,
263 public IDocumentLayoutAccess,
264 public IDocumentTimerAccess,
265 public IDocumentChartDataProviderAccess,
266 // --> OD 2007-10-26 #i83479#
267 public IDocumentListItems,
268 public IDocumentOutlineNodes,
269 // <--
270 // --> OD 2008-03-12 #refactorlists#
271 public IDocumentListsAccess
272 // <--
275 friend void _InitCore();
276 friend void _FinitCore();
278 //---------------- private Member --------------------------------
280 // -------------------------------------------------------------------
281 // die Objecte
282 SwNodes aNodes; // Inhalt des Dokumentes
283 SwNodes aUndoNodes; // Inhalt fuer das Undo
284 SwAttrPool* mpAttrPool; // der Attribut Pool
285 SwPageDescs aPageDescs; // PageDescriptoren
286 Link aOle2Link; // OLE 2.0-Benachrichtigung
287 /* @@@MAINTAINABILITY-HORROR@@@
288 Timer should not be members of the model
290 Timer aIdleTimer; // der eigene IdleTimer
291 Timer aOLEModifiedTimer; // Timer for update modified OLE-Objecs
292 SwDBData aDBData; // database descriptor
293 ::com::sun::star::uno::Sequence <sal_Int8 > aRedlinePasswd;
294 String sTOIAutoMarkURL; // ::com::sun::star::util::URL of table of index AutoMark file
295 SvStringsDtor aPatternNms; // Array fuer die Namen der Dokument-Vorlagen
296 com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>
297 xXForms; // container with XForms models
298 mutable com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > m_xGCIterator;
300 const ::boost::scoped_ptr< ::sw::mark::MarkManager> pMarkManager;
302 // -------------------------------------------------------------------
303 // die Pointer
304 //Defaultformate
305 SwFrmFmt *pDfltFrmFmt;
306 SwFrmFmt *pEmptyPageFmt; // Format fuer die Default-Leerseite.
307 SwFrmFmt *pColumnContFmt; // Format fuer Spaltencontainer
308 SwCharFmt *pDfltCharFmt;
309 SwTxtFmtColl *pDfltTxtFmtColl; // Defaultformatcollections
310 SwGrfFmtColl *pDfltGrfFmtColl;
312 SwFrmFmts *pFrmFmtTbl; // Formattabellen
313 SwCharFmts *pCharFmtTbl;
314 SwSpzFrmFmts *pSpzFrmFmtTbl;
315 SwSectionFmts *pSectionFmtTbl;
316 SwFrmFmts *pTblFrmFmtTbl; // spz. fuer Tabellen
317 SwTxtFmtColls *pTxtFmtCollTbl; // FormatCollections
318 SwGrfFmtColls *pGrfFmtCollTbl;
320 SwTOXTypes *pTOXTypes; // Verzeichnisse
321 SwDefTOXBase_Impl * pDefTOXBases; // defaults of SwTOXBase's
323 SwRootFrm *pLayout; // Rootframe des spezifischen Layouts.
324 SdrModel *pDrawModel; // StarView Drawing
326 SwUndos *pUndos; // Undo/Redo History
328 SwDocUpdtFld *pUpdtFlds; // Struktur zum Field-Update
329 SwFldTypes *pFldTypes; // Feldtypen
330 SwNewDBMgr *pNewDBMgr; // Pointer auf den neuen DBMgr fuer
331 // Evaluierung der DB-Fields
333 VirtualDevice *pVirDev; // can be used for formatting
334 SfxPrinter *pPrt; // can be used for formatting
335 SwPrintData *pPrtData; // Print configuration
337 SwDoc *pGlossaryDoc; // Pointer auf das Glossary-Dokument. Dieses
339 SwNumRule *pOutlineRule;
340 SwFtnInfo *pFtnInfo;
341 SwEndNoteInfo *pEndNoteInfo;
342 SwLineNumberInfo*pLineNumberInfo;
343 SwFtnIdxs *pFtnIdxs;
344 SwDocStat *pDocStat; // Statistic Informationen
345 SvxMacroTableDtor *pMacroTable; // Tabelle der dokumentglobalen Macros
347 SwDocShell *pDocShell; // Ptr auf die SfxDocShell vom Doc
348 SfxObjectShellRef* pDocShRef; // fuers Kopieren von OLE-Nodes (wenn keine
349 // DocShell gesetzt ist, muss dieser
350 // Ref-Pointer gesetzt sein!!!!)
351 SvxLinkManager *pLinkMgr; // Liste von Verknuepften (Grafiken/DDE/OLE)
353 SwAutoCorrExceptWord *pACEWord; // fuer die automatische Uebernahme von
354 // autokorrigierten Woertern, die "zurueck"
355 // verbessert werden
356 SwURLStateChanged *pURLStateChgd; // SfxClient fuer Aenderungen in der
357 // INetHistory
358 SvNumberFormatter *pNumberFormatter; // NumFormatter fuer die Tabellen/Felder
360 mutable SwNumRuleTbl *pNumRuleTbl; // Liste aller benannten NumRules
362 // Hash map to find numrules by name
363 mutable std::hash_map<String, SwNumRule *, StringHash> maNumRuleMap;
365 // --> OD 2008-03-12 #refactorlists#
366 typedef std::hash_map< String, SwList*, StringHash > tHashMapForLists;
367 // container to hold the lists of the text document
368 tHashMapForLists maLists;
369 // relation between list style and its default list
370 tHashMapForLists maListStyleLists;
371 // <--
373 SwRedlineTbl *pRedlineTbl; // Liste aller Redlines
374 String *pAutoFmtRedlnComment; // Kommentar fuer Redlines, die
375 // uebers Autoformat eingefuegt werden
376 SwUnoCrsrTbl *pUnoCrsrTbl;
378 SwPagePreViewPrtData *pPgPViewPrtData; // Einzuege/Abstaende fuers
379 // Drucken der Seitenansicht
380 SwPaM *pExtInputRing;
382 SwLayouter *pLayouter; // ::com::sun::star::frame::Controller for complex layout formatting
383 // like footnote/endnote in sections
384 IStyleAccess *pStyleAccess; // handling of automatic styles
385 SwLayoutCache *pLayoutCache; // Layout cache to read and save with the
386 // document for a faster formatting
388 SwUnoCallBack *pUnoCallBack;
389 IGrammarContact *mpGrammarContact; // for grammar checking in paragraphs during editing
391 mutable comphelper::ImplementationReference< SwChartDataProvider
392 , ::com::sun::star::chart2::data::XDataProvider >
393 aChartDataProviderImplRef;
394 SwChartLockController_Helper *pChartControllerHelper;
396 // table of forbidden characters of this document
397 vos::ORef<SvxForbiddenCharactersTable> xForbiddenCharsTable;
398 com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> m_xTemplateToProjectCache;
400 // --> OD 2007-10-26 #i83479#
401 public:
402 struct lessThanNodeNum
404 bool operator()( const SwNodeNum* pNodeNumOne,
405 const SwNodeNum* pNodeNumTwo ) const;
408 typedef ::std::set< const SwNodeNum*, lessThanNodeNum > tImplSortedNodeNumList;
409 private:
410 tImplSortedNodeNumList* mpListItemsList;
411 // <--
413 ::std::auto_ptr< ::sfx2::IXmlIdRegistry > m_pXmlIdRegistry;
415 // -------------------------------------------------------------------
416 // sonstige
417 sal_uInt16 nUndoPos; // akt. Undo-InsertPosition (fuers Redo!)
418 sal_uInt16 nUndoSavePos; // Position im Undo-Array, ab der das Doc
419 // nicht als modifiziert gilt
420 sal_uInt16 nUndoCnt; // Anzahl von Undo Aktionen
421 sal_uInt16 nUndoSttEnd; // != 0 -> innerhalb einer Klammerung
423 sal_uInt16 nAutoFmtRedlnCommentNo; // SeqNo fuers UI-seitige zusammenfassen
424 // von AutoFmt-Redlines. Wird vom SwAutoFmt
425 // verwaltet!
426 sal_uInt16 nLinkUpdMode; // UpdateMode fuer Links
427 SwFldUpdateFlags eFldUpdMode; // Mode fuer Felder/Charts automatisch aktualisieren
428 RedlineMode_t eRedlineMode; // aktueller Redline Modus
429 SwCharCompressType eChrCmprType; // for ASIAN: compress punctuation/kana
431 sal_Int32 mReferenceCount;
432 sal_Int32 mIdleBlockCount;
433 sal_Int8 nLockExpFld; // Wenn != 0 hat UpdateExpFlds() keine Wirkung
435 /* Draw Model Layer IDs
436 * LayerIds, Heaven == ueber dem Dokument
437 * Hell == unter dem Dokument
438 * Controls == ganz oben
440 SdrLayerID nHeaven;
441 SdrLayerID nHell;
442 SdrLayerID nControls;
443 SdrLayerID nInvisibleHeaven;
444 SdrLayerID nInvisibleHell;
445 SdrLayerID nInvisibleControls;
447 bool mbGlossDoc : 1; //TRUE: ist ein Textbaustein Dokument
448 bool mbModified : 1; //TRUE: Dokument ist veraendert
449 bool mbDtor : 1; //TRUE: ist im SwDoc DTOR
450 // leider auch temporaer von
451 // SwSwgReader::InLayout(), wenn fehlerhafte
452 // Frames geloescht werden muessen
453 bool mbUndo : 1; // TRUE: Undo eingeschaltet
454 bool mbGroupUndo : 1; // TRUE: Undos werden gruppiert
455 bool mbPageNums : 1; // TRUE: es gibt virtuelle Seitennummern
456 bool mbLoaded : 1; // TRUE: ein geladenes Doc
457 bool mbUpdateExpFld : 1; // TRUE: Expression-Felder updaten
458 bool mbNewDoc : 1; // TRUE: neues Doc
459 bool mbNewFldLst : 1; // TRUE: Felder-Liste neu aufbauen
460 bool mbCopyIsMove : 1; // TRUE: Copy ist ein verstecktes Move
461 bool mbNoDrawUndoObj : 1; // TRUE: keine DrawUndoObjecte speichern
462 bool mbVisibleLinks : 1; // TRUE: Links werden sichtbar eingefuegt
463 bool mbBrowseMode : 1; // TRUE: Dokument im BrowseModus anzeigen
464 bool mbInReading : 1; // TRUE: Dokument wird gerade gelesen
465 bool mbInXMLImport : 1; // TRUE: During xml import, attribute portion building is not necessary
466 bool mbUpdateTOX : 1; // TRUE: nach Dokument laden die TOX Updaten
467 bool mbInLoadAsynchron : 1; // TRUE: Dokument wird gerade asynchron geladen
468 bool mbHTMLMode : 1; // TRUE: Dokument ist im HTMLMode
469 bool mbInCallModified : 1; // TRUE: im Set/Reset-Modified Link
470 bool mbIsGlobalDoc : 1; // TRUE: es ist ein GlobalDokument
471 bool mbGlblDocSaveLinks : 1; // TRUE: im GlobalDoc. gelinkte Sect. mit speichern
472 bool mbIsLabelDoc : 1; // TRUE: es ist ein Etiketten-Dokument
473 bool mbIsAutoFmtRedline : 1; // TRUE: die Redlines werden vom Autoformat aufgezeichnet
474 bool mbOLEPrtNotifyPending : 1; // TRUE: Printer ist geaendert und beim
475 // Erzeugen der ::com::sun::star::sdbcx::View ist eine Benachrichtigung
476 // der OLE-Objekte PrtOLENotify() notwendig.
477 bool mbAllOLENotify : 1; // True: Benachrichtigung aller Objekte ist notwendig
478 bool mbIsRedlineMove : 1; // True: die Redlines werden in/aus der Section verschoben
479 bool mbInsOnlyTxtGlssry : 1; // True: insert 'only text' glossary into doc
480 bool mbContains_MSVBasic : 1; // True: MS-VBasic exist is in our storage
481 bool mbPurgeOLE : 1; // TRUE: Purge OLE-Objects
482 bool mbKernAsianPunctuation : 1; // TRUE: kerning also for ASIAN punctuation
483 bool mbReadlineChecked : 1; // TRUE: if the query was already shown
484 bool mbLinksUpdated : 1; // OD 2005-02-11 #i38810#
485 // flag indicating, that the links have been updated.
486 bool mbClipBoard : 1; // true: this document represents the clipboard
487 bool mbColumnSelection : 1; // true: this content has bee created by a column selection
488 // (clipboard docs only)
490 #ifndef PRODUCT
491 bool mbXMLExport : 1; // TRUE: during XML export
492 #endif
494 // --> OD 2006-03-21 #b6375613#
495 // Document flag to trigger conversion, which applys the workaround for documents,
496 // which uses a certain layout defect in OOo 1.x to layout the documents.
497 // This conversion is performed, when the frames for the layout are created.
498 // Thus, this document flag has to be set after load a document and before
499 // creating the document view.
500 bool mbApplyWorkaroundForB6375613 : 1;
501 // <--
504 // COMPATIBILITY FLAGS START
507 // HISTORY OF THE COMPATIBILITY FLAGS:
509 // SO5:
510 // mbParaSpaceMax def = FALSE, TRUE since SO8
511 // mbParaSpaceMaxAtPages def = FALSE, TRUE since SO8
513 // SO6:
514 // mbTabCompat def = FALSE, TRUE since SO8
516 // SO7:
517 // mbUseVirtualDevice def = TRUE
518 // mbAddFlyOffsets def = FALSE, hidden
520 // SO7pp1:
521 // bOldNumbering def = FALSE, hidden
523 // SO8:
524 // mbAddExternalLeading def = TRUE
525 // mbUseHiResolutionVirtualDevice def = TRUE, hidden
526 // mbOldLineSpacing def = FALSE
527 // mbAddParaSpacingToTableCells def = TRUE
528 // mbUseFormerObjectPos def = FALSE
529 // mbUseFormerTextWrapping def = FALSE
530 // mbConsiderWrapOnObjPos def = FALSE
532 // SO8pp1:
533 // mbIgnoreFirstLineIndentInNumbering def = FALSE, hidden
534 // mbDoNotJustifyLinesWithManualBreak def = FALSE, hidden
535 // mbDoNotResetParaAttrsForNumFont def = FALSE, hidden
537 // SO8pp3
538 // mbDoNotCaptureDrawObjsOnPage def = FALSE, hidden
539 // - Relevant for drawing objects, which don't follow the text flow, but
540 // whose position is outside the page area:
541 // FALSE: Such drawing objects are captured on the page area of its anchor.
542 // TRUE: Such drawing objects can leave the page area, they aren't captured.
543 // mbTableRowKeep def = FALSE, hidden
544 // mbIgnoreTabsAndBlanksForLineCalculation def = FALSE, hidden
545 // mbClipAsCharacterAnchoredWriterFlyFrame def = FALSE, hidden
546 // - Introduced in order to re-activate clipping of as-character anchored
547 // Writer fly frames in method <SwFlyInCntFrm::MakeAll()> for documents,
548 // which are created with version prior SO8/OOo 2.0
550 // SO8pp4
551 // mbUnixForceZeroExtLeading def = FALSE, hidden
553 // SO8pu8
554 // mbOldPrinterMetrics def = FALSE, hidden
556 // SO9
557 // #i24363# tab stops relative to indent
558 // mbTabRelativeToIndent def = TRUE, hidden
559 // #i89181# suppress tab stop at left indent for paragraphs in lists, whose
560 // list level position and space mode equals LABEL_ALIGNMENT and whose list
561 // label is followed by a tab character.
562 // mbTabAtLeftIndentForParagraphsInList def = FALSE, hidden
564 bool mbParaSpaceMax : 1;
565 bool mbParaSpaceMaxAtPages : 1;
566 bool mbTabCompat : 1;
567 bool mbUseVirtualDevice : 1;
568 bool mbAddFlyOffsets : 1;
569 bool mbAddExternalLeading : 1;
570 bool mbUseHiResolutionVirtualDevice : 1;
571 bool mbOldLineSpacing : 1; // OD 2004-01-06 #i11859#
572 bool mbAddParaSpacingToTableCells : 1; // OD 2004-02-16 #106629#
573 bool mbUseFormerObjectPos : 1; // OD 2004-03-12 #i11860#
574 bool mbUseFormerTextWrapping : 1; // FME 2005-05-11 #108724#
575 bool mbConsiderWrapOnObjPos : 1; // OD 2004-05-05 #i28701#
576 // TRUE: object positioning algorithm has consider the wrapping style of // the floating screen objects as given by its attribute 'WrapInfluenceOnObjPos'
578 // non-ui-compatibility flags:
579 bool mbOldNumbering : 1; // HBRINKM #111955#
580 bool mbIgnoreFirstLineIndentInNumbering : 1; // FME 2005-05-30# i47448#
581 bool mbDoNotJustifyLinesWithManualBreak : 1; // FME 2005-06-08 #i49277#
582 bool mbDoNotResetParaAttrsForNumFont : 1; // FME 2005-08-11 #i53199#
583 bool mbTableRowKeep : 1; // FME 2006-02-10 #131283#
584 bool mbIgnoreTabsAndBlanksForLineCalculation : 1; // FME 2006-03-01 #i3952#
585 bool mbDoNotCaptureDrawObjsOnPage : 1; // OD 2006-03-14 #i62875#
586 bool mbOutlineLevelYieldsOutlineRule : 1;
587 bool mbClipAsCharacterAnchoredWriterFlyFrames : 1; // OD 2006-04-13 #b6402800#
588 bool mbUnixForceZeroExtLeading : 1; // FME 2006-10-09 #i60945#
589 bool mbOldPrinterMetrics : 1; // FME 2007-05-14 #147385#
590 bool mbTabRelativeToIndent : 1; // #i24363# tab stops relative to indent
591 bool mbProtectForm : 1;
592 bool mbInvertBorderSpacing : 1;
593 bool mbCollapseEmptyCellPara : 1;
594 bool mbTabAtLeftIndentForParagraphsInList; // OD 2008-06-05 #i89181# - see above
596 // #i78591#
597 sal_uInt32 n32DummyCompatabilityOptions1;
598 sal_uInt32 n32DummyCompatabilityOptions2;
600 // COMPATIBILITY FLAGS END
603 sal_Bool mbStartIdleTimer ; // idle timer mode start/stop
605 static SwAutoCompleteWord *pACmpltWords; // Liste aller Worte fuers AutoComplete
606 static sal_uInt16 nUndoActions; // anzahl von Undo ::com::sun::star::chaos::Action
608 //---------------- private Methoden ------------------------------
609 void checkRedlining(RedlineMode_t& _rReadlineMode);
611 sal_Bool DelUndoObj( sal_uInt16 nEnde ); // loescht alle UndoObjecte vom Anfang
612 // bis zum angegebenen Ende
613 DECL_LINK( AddDrawUndo, SdrUndoAction * );
614 // DrawModel
615 void DrawNotifyUndoHdl(); // wegen CLOOKs
617 // nur fuer den internen Gebrauch deshalb privat.
618 // Kopieren eines Bereiches im oder in ein anderes Dokument !
619 // Die Position darf nicht im Bereich liegen !!
620 sal_Bool _Copy( SwPaM&, SwPosition&,
621 sal_Bool MakeNewFrms /*= sal_True*/, bool bCopyAll, SwPaM* pCpyRng /*= 0*/ ) const; // in ndcopy.cxx
623 SwFlyFrmFmt* _MakeFlySection( const SwPosition& rAnchPos,
624 const SwCntntNode& rNode, RndStdIds eRequestId,
625 const SfxItemSet* pFlyAttrSet,
626 SwFrmFmt* = 0 );
628 SwFlyFrmFmt* _InsNoTxtNode( const SwPosition&rPos, SwNoTxtNode*,
629 const SfxItemSet* pFlyAttrSet,
630 const SfxItemSet* pGrfAttrSet,
631 SwFrmFmt* = 0 );
633 void _CopyFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex,
634 const SwNodeIndex& rSttIdx,
635 sal_Bool bCopyFlyAtFly = sal_False ) const; // steht im ndcopy.cxx
636 sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, sal_Bool bNewFrms );
638 // --> OD 2005-01-13 #i40550#
639 typedef SwFmt* (SwDoc:: *FNCopyFmt)( const String&, SwFmt*, BOOL, BOOL );
640 // <--
641 SwFmt* CopyFmt( const SwFmt& rFmt, const SvPtrarr& rFmtArr,
642 FNCopyFmt fnCopyFmt, const SwFmt& rDfltFmt );
643 void CopyFmtArr( const SvPtrarr& rSourceArr, SvPtrarr& rDestArr,
644 FNCopyFmt fnCopyFmt, SwFmt& rDfltFmt );
645 void _CopyPageDescHeaderFooter( sal_Bool bCpyHeader,
646 const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt );
647 SwFmt* FindFmtByName( const SvPtrarr& rFmtArr,
648 const String& rName ) const;
650 VirtualDevice& CreateVirtualDevice_() const;
651 SfxPrinter& CreatePrinter_() const;
652 void PrtDataChanged(); //Printer oder JobSetup geandert, es muss
653 //fuer entsprechende Invalidierungen und
654 //Benachrichtigungen gesorgt werden.
656 // gcc: aFtnInfo::CopyCtor ist private, also muessen wir uns auch schuetzen
657 SwDoc( const SwDoc &);
659 // fuer Felder:
660 void _InitFieldTypes(); // wird vom CTOR gerufen!!
661 void _MakeFldList( int eMode );
663 // Datenbankfelder:
664 void UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc );
665 void AddUsedDBToList( SvStringsDtor& rDBNameList,
666 const SvStringsDtor& rUsedDBNames );
667 void AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName );
668 sal_Bool IsNameInArray( const SvStringsDtor& rOldNames, const String& rName );
669 void GetAllDBNames( SvStringsDtor& rAllDBNames );
670 void ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
671 const String& rNewName, String& rFormel );
672 SvStringsDtor& FindUsedDBs( const SvStringsDtor& rAllDBNames,
673 const String& rFormel,
674 SvStringsDtor& rUsedDBNames );
676 void InitDrawModel();
677 void ReleaseDrawModel();
679 void _CreateNumberFormatter();
681 sal_Bool _UnProtectTblCells( SwTable& rTbl );
683 // erzeuge Anhand der vorgebenen Collection Teildokumente
684 // falls keine angegeben ist, nehme die Kapitelvorlage der 1. Ebene
685 sal_Bool SplitDoc( sal_uInt16 eDocType, const String& rPath,
686 const SwTxtFmtColl* pSplitColl );
687 sal_Bool SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutlineLevel = 0 ); //#outline level,add by zhaijianwei.
690 // Charts der angegebenen Tabelle updaten
691 void _UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const;
693 BOOL _SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rRubyEntry,
694 USHORT nMode );
696 // unser eigener 'IdlTimer' ruft folgende Methode
697 DECL_LINK( DoIdleJobs, Timer * );
698 // der CharTimer ruft diese Methode
699 DECL_LINK( DoUpdateAllCharts, Timer * );
700 DECL_LINK( DoUpdateModifiedOLE, Timer * );
702 SwFmt *_MakeCharFmt(const String &, SwFmt *, BOOL, BOOL );
703 SwFmt *_MakeFrmFmt(const String &, SwFmt *, BOOL, BOOL );
704 SwFmt *_MakeTxtFmtColl(const String &, SwFmt *, BOOL, BOOL );
706 void InitTOXTypes();
707 void Paste( const SwDoc& );
708 public:
710 /** Life cycle
712 SwDoc();
713 ~SwDoc();
715 inline bool IsInDtor() const { return mbDtor; }
717 /* @@@MAINTAINABILITY-HORROR@@@
718 Implementation details made public.
720 SwNodes& GetNodes() { return aNodes; }
721 const SwNodes& GetNodes() const { return aNodes; }
723 /** IInterface
725 virtual sal_Int32 acquire();
726 virtual sal_Int32 release();
727 virtual sal_Int32 getReferenceCount() const;
729 /** IDocumentSettingAccess
731 virtual bool get(/*[in]*/ DocumentSettingId id) const;
732 virtual void set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value);
733 virtual const com::sun::star::i18n::ForbiddenCharacters* getForbiddenCharacters(/*[in]*/ USHORT nLang, /*[in]*/ bool bLocaleData ) const;
734 virtual void setForbiddenCharacters(/*[in]*/ USHORT nLang, /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rForbiddenCharacters );
735 virtual vos::ORef<SvxForbiddenCharactersTable>& getForbiddenCharacterTable();
736 virtual const vos::ORef<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() const;
737 virtual sal_uInt16 getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const;
738 virtual void setLinkUpdateMode( /*[in]*/ sal_uInt16 nMode );
739 virtual SwFldUpdateFlags getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const;
740 virtual void setFieldUpdateFlags( /*[in]*/ SwFldUpdateFlags eMode );
741 virtual SwCharCompressType getCharacterCompressionType() const;
742 virtual void setCharacterCompressionType( /*[in]*/SwCharCompressType nType );
744 /** IDocumentDeviceAccess
746 virtual SfxPrinter* getPrinter(/*[in]*/ bool bCreate ) const;
747 virtual void setPrinter(/*[in]*/ SfxPrinter* pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged );
748 virtual VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate ) const;
749 virtual void setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOld, /*[in]*/ bool bCallVirDevDataChanged );
750 virtual OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate ) const;
751 virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewHiRes );
752 virtual const JobSetup* getJobsetup() const;
753 virtual void setJobsetup(/*[in]*/ const JobSetup& rJobSetup );
754 virtual SwPrintData* getPrintData() const;
755 virtual void setPrintData(/*[in]*/ const SwPrintData& rPrtData);
757 /** IDocumentMarkAccess
759 IDocumentMarkAccess* getIDocumentMarkAccess();
760 const IDocumentMarkAccess* getIDocumentMarkAccess() const;
762 /** IDocumentRedlineAccess
764 virtual RedlineMode_t GetRedlineMode() const;
765 virtual void SetRedlineMode_intern(/*[in]*/RedlineMode_t eMode);
766 virtual void SetRedlineMode(/*[in]*/RedlineMode_t eMode);
767 virtual bool IsRedlineOn() const;
768 virtual bool IsIgnoreRedline() const;
769 virtual bool IsInRedlines(const SwNode& rNode) const;
770 virtual const SwRedlineTbl& GetRedlineTbl() const;
771 virtual bool AppendRedline(/*[in]*/SwRedline* pPtr, /*[in]*/bool bCallDelete);
772 virtual bool SplitRedline(const SwPaM& rPam);
773 virtual bool DeleteRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bSaveInUndo, /*[in]*/sal_uInt16 nDelType);
774 virtual bool DeleteRedline(/*[in]*/const SwStartNode& rSection, /*[in]*/bool bSaveInUndo, /*[in]*/sal_uInt16 nDelType);
775 virtual sal_uInt16 GetRedlinePos(/*[in]*/const SwNode& rNode, /*[in]*/sal_uInt16 nType) const;
776 virtual void CompressRedlines();
777 virtual const SwRedline* GetRedline(/*[in]*/const SwPosition& rPos, /*[in]*/sal_uInt16* pFndPos) const;
778 virtual bool IsRedlineMove() const;
779 virtual void SetRedlineMove(/*[in]*/bool bFlag);
780 virtual bool AcceptRedline(/*[in]*/sal_uInt16 nPos, /*[in]*/bool bCallDelete);
781 virtual bool AcceptRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete);
782 virtual bool RejectRedline(/*[in]*/sal_uInt16 nPos, /*[in]*/bool bCallDelete);
783 virtual bool RejectRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete);
784 virtual const SwRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const;
785 virtual const SwRedline* SelPrevRedline(/*[in]*/SwPaM& rPam) const;
786 virtual void UpdateRedlineAttr();
787 virtual sal_uInt16 GetRedlineAuthor();
788 virtual sal_uInt16 InsertRedlineAuthor(const String& rAuthor);
789 virtual bool SetRedlineComment(/*[in]*/const SwPaM& rPam, /*[in]*/const String& rComment);
790 virtual const ::com::sun::star::uno::Sequence <sal_Int8>& GetRedlinePassword() const;
791 virtual void SetRedlinePassword(/*[in]*/const ::com::sun::star::uno::Sequence <sal_Int8>& rNewPassword);
793 /** IDocumentUndoRedo
795 virtual void SetUndoNoResetModified();
796 virtual bool IsUndoNoResetModified() const;
797 virtual void DoUndo(bool bUn);
798 virtual bool DoesUndo() const;
799 virtual void DoGroupUndo(bool bUn);
800 virtual bool DoesGroupUndo() const;
801 virtual bool Undo(SwUndoIter& );
802 virtual SwUndoId StartUndo(SwUndoId eUndoId, const SwRewriter * pRewriter);
803 virtual SwUndoId EndUndo(SwUndoId eUndoId, const SwRewriter * pRewriter);
804 virtual void DelAllUndoObj();
805 virtual SwUndoId GetUndoIds(String* pStr, SwUndoIds *pUndoIds) const;
806 virtual String GetUndoIdsStr(String* pStr, SwUndoIds *pUndoIds) const;
807 virtual bool HasUndoId(SwUndoId eId) const;
808 virtual const SwNodes* GetUndoNds() const;
809 virtual SwUndo* RemoveLastUndo(SwUndoId eUndoId);
810 virtual bool HasTooManyUndos() const;
811 virtual bool Redo(SwUndoIter&);
812 virtual SwUndoId GetRedoIds(String* pStr, SwUndoIds *pRedoIds) const;
813 virtual String GetRedoIdsStr(String* pStr, SwUndoIds *pRedoIds) const;
814 virtual bool Repeat(SwUndoIter&, sal_uInt16 nRepeatCnt);
815 virtual SwUndoId GetRepeatIds(String* pStr, SwUndoIds *pRedoIds) const;
816 virtual String GetRepeatIdsStr(String* pStr, SwUndoIds *pRedoIds) const;
817 virtual void AppendUndo(SwUndo*);
818 virtual void ClearRedo();
819 virtual void setUndoNoModifiedPosition( SwUndoNoModifiedPosition );
820 virtual SwUndoNoModifiedPosition getUndoNoModifiedPosition() const;
823 /** abfragen/setzen der Anzahl von wiederherstellbaren Undo-Actions */
824 static sal_uInt16 GetUndoActionCount();
825 static void SetUndoActionCount(sal_uInt16 nNew);
827 /** IDocumentLinksAdministration
829 virtual bool IsVisibleLinks() const;
830 virtual void SetVisibleLinks(bool bFlag);
831 virtual SvxLinkManager& GetLinkManager();
832 virtual const SvxLinkManager& GetLinkManager() const;
833 virtual void UpdateLinks(BOOL bUI);
834 virtual bool GetData(const String& rItem, const String& rMimeType, ::com::sun::star::uno::Any& rValue) const;
835 virtual bool SetData(const String& rItem, const String& rMimeType, const ::com::sun::star::uno::Any& rValue);
836 virtual ::sfx2::SvLinkSource* CreateLinkSource(const String& rItem);
837 virtual bool EmbedAllLinks();
838 virtual void SetLinksUpdated(const bool bNewLinksUpdated);
839 virtual bool LinksUpdated() const;
841 /** IDocumentFieldsAccess
843 virtual const SwFldTypes *GetFldTypes() const;
844 virtual SwFieldType *InsertFldType(const SwFieldType &);
845 virtual SwFieldType *GetSysFldType( const sal_uInt16 eWhich ) const;
846 virtual SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName, bool bDbFieldMatching) const;
847 virtual void RemoveFldType(sal_uInt16 nFld);
848 virtual void UpdateFlds( SfxPoolItem* pNewHt, bool bCloseDB);
849 virtual void InsDeletedFldType(SwFieldType &);
850 virtual bool PutValueToField(const SwPosition & rPos, const com::sun::star::uno::Any& rVal, USHORT nWhich);
851 virtual bool UpdateFld(SwTxtFld * rDstFmtFld, SwField & rSrcFld, SwMsgPoolItem * pMsgHnt, bool bUpdateTblFlds);
852 virtual void UpdateRefFlds(SfxPoolItem* pHt);
853 virtual void UpdateTblFlds(SfxPoolItem* pHt);
854 virtual void UpdateExpFlds(SwTxtFld* pFld, bool bUpdateRefFlds);
855 virtual void UpdateUsrFlds();
856 virtual void UpdatePageFlds(SfxPoolItem*);
857 virtual void LockExpFlds();
858 virtual void UnlockExpFlds();
859 virtual bool IsExpFldsLocked() const;
860 virtual SwDocUpdtFld& GetUpdtFlds() const;
861 virtual bool SetFieldsDirty(bool b, const SwNode* pChk, ULONG nLen);
862 virtual void SetFixFields(bool bOnlyTimeDate, const DateTime* pNewDateTime);
863 virtual void FldsToCalc(SwCalc& rCalc, ULONG nLastNd, sal_uInt16 nLastCnt);
864 virtual void FldsToCalc(SwCalc& rCalc, const _SetGetExpFld& rToThisFld);
865 virtual void FldsToExpand(SwHash**& ppTbl, sal_uInt16& rTblSize, const _SetGetExpFld& rToThisFld);
866 virtual bool IsNewFldLst() const;
867 virtual void SetNewFldLst( bool bFlag);
868 virtual void InsDelFldInFldLst(bool bIns, const SwTxtFld& rFld);
870 /** Returns the field at a certain position.
871 @param rPos position to search at
872 @return pointer to field at the given position or NULL in case no field is found
874 static SwField* GetField(const SwPosition& rPos);
876 /** Returns the field at a certain position.
877 @param rPos position to search at
878 @return pointer to field at the given position or NULL in case no field is found
880 static SwTxtFld* GetTxtFld(const SwPosition& rPos);
882 /** IDocumentContentOperations
884 virtual bool Copy(SwPaM&, SwPosition&, bool bCopyAll) const;
885 virtual void DeleteSection(SwNode* pNode);
886 virtual bool Delete(SwPaM&);
887 virtual bool DelFullPara(SwPaM&);
888 // --> OD 2009-08-20 #i100466#
889 // Add optional parameter <bForceJoinNext>, default value <false>
890 // Needed for hiding of deletion redlines
891 virtual bool DeleteAndJoin( SwPaM&,
892 const bool bForceJoinNext = false );
893 // <--
894 virtual bool Move(SwPaM&, SwPosition&, SwMoveFlags);
895 virtual bool Move(SwNodeRange&, SwNodeIndex&, SwMoveFlags);
896 virtual bool MoveAndJoin(SwPaM&, SwPosition&, SwMoveFlags);
897 virtual bool Overwrite(const SwPaM &rRg, sal_Unicode c);
898 virtual bool Overwrite(const SwPaM &rRg, const String& rStr);
899 virtual bool Insert(const SwPaM &rRg, sal_Unicode c);
900 virtual bool Insert(const SwPaM &rRg, const String&, bool bHintExpand);
901 virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const String& rGrfName, const String& rFltName, const Graphic* pGraphic,
902 const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
903 virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet,
904 const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
905 virtual SwDrawFrmFmt* Insert(const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet, SwFrmFmt*);
906 virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet,
907 const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
908 virtual bool Insert(const SwPaM &rRg, const SfxPoolItem&, sal_uInt16 nFlags);
909 virtual bool Insert(const SwPaM &rRg, const SfxItemSet&, sal_uInt16 nFlags);
910 virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj);
911 virtual void TransliterateText(const SwPaM& rPaM, utl::TransliterationWrapper&);
912 virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const String& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
913 const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
914 virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart);
915 virtual bool AppendTxtNode(SwPosition& rPos);
916 virtual void SetModified(SwPaM &rPaM);
917 virtual bool Replace(SwPaM& rPam, const String& rNewStr, bool bRegExpRplc);
918 virtual void RemoveLeadingWhiteSpace(const SwPosition & rPos );
920 /** IDocumentStylePoolAccess
922 virtual SwTxtFmtColl* GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage = true );
923 virtual SwFmt* GetFmtFromPool( sal_uInt16 nId );
924 virtual SwFrmFmt* GetFrmFmtFromPool( sal_uInt16 nId );
925 virtual SwCharFmt* GetCharFmtFromPool( sal_uInt16 nId );
926 virtual SwPageDesc* GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage = true );
927 virtual SwNumRule* GetNumRuleFromPool( sal_uInt16 nId );
928 virtual bool IsPoolTxtCollUsed( sal_uInt16 nId ) const;
929 virtual bool IsPoolFmtUsed( sal_uInt16 nId ) const;
930 virtual bool IsPoolPageDescUsed( sal_uInt16 nId ) const;
932 /** IDocumentLineNumberAccess
934 virtual const SwLineNumberInfo& GetLineNumberInfo() const;
935 virtual void SetLineNumberInfo(const SwLineNumberInfo& rInfo);
937 /** IDocumentStatistics
939 virtual void DocInfoChgd();
940 virtual const SwDocStat &GetDocStat() const;
941 virtual void SetDocStat(const SwDocStat& rStat);
942 virtual void UpdateDocStat(SwDocStat& rStat);
944 /** IDocumentState
946 virtual void SetModified();
947 virtual void ResetModified();
948 virtual bool IsModified() const;
949 virtual bool IsLoaded() const;
950 virtual bool IsUpdateExpFld() const;
951 virtual bool IsNewDoc() const;
952 virtual bool IsPageNums() const;
953 virtual void SetPageNums(bool b);
954 virtual void SetNewDoc(bool b);
955 virtual void SetUpdateExpFldStat(bool b);
956 virtual void SetLoaded(bool b);
958 /** IDocumentDrawModelAccess
960 virtual const SdrModel* GetDrawModel() const;
961 virtual SdrModel* GetDrawModel();
962 virtual SdrLayerID GetHeavenId() const;
963 virtual SdrLayerID GetHellId() const;
964 virtual SdrLayerID GetControlsId() const;
965 virtual SdrLayerID GetInvisibleHeavenId() const;
966 virtual SdrLayerID GetInvisibleHellId() const;
967 virtual SdrLayerID GetInvisibleControlsId() const;
968 virtual void NotifyInvisibleLayers( SdrPageView& _rSdrPageView );
969 virtual bool IsVisibleLayerId( const SdrLayerID& _nLayerId ) const;
970 virtual SdrLayerID GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisibleLayerId );
971 virtual SdrLayerID GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLayerId );
972 virtual SdrModel* _MakeDrawModel();
973 virtual SdrModel* GetOrCreateDrawModel();
975 /** IDocumentLayoutAccess
977 virtual const SwRootFrm* GetRootFrm() const ;
978 virtual SwRootFrm* GetRootFrm();
979 virtual void SetRootFrm( SwRootFrm* pNew );
980 virtual SwLayouter* GetLayouter();
981 virtual const SwLayouter* GetLayouter() const;
982 virtual void SetLayouter( SwLayouter* pNew );
983 virtual SwFrmFmt* MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet );
984 virtual void DelLayoutFmt( SwFrmFmt *pFmt );
985 virtual SwFrmFmt* CopyLayoutFmt( const SwFrmFmt& rSrc, const SwFmtAnchor& rNewAnchor, bool bSetTxtFlyAtt, bool bMakeFrms );
987 /** IDocumentTimerAccess
989 virtual void StartIdling();
990 virtual void StopIdling();
991 virtual void BlockIdling();
992 virtual void UnblockIdling();
994 /** IDocumentChartDataProviderAccess
996 virtual SwChartDataProvider * GetChartDataProvider( bool bCreate = false ) const;
997 virtual void CreateChartInternalDataProviders( const SwTable *pTable );
998 virtual SwChartLockController_Helper & GetChartControllerHelper();
1000 /** IDocumentListItems
1002 OD 2007-10-26 #i83479#
1004 virtual void addListItem( const SwNodeNum& rNodeNum );
1005 virtual void removeListItem( const SwNodeNum& rNodeNum );
1006 virtual String getListItemText( const SwNodeNum& rNodeNum,
1007 const bool bWithNumber = true,
1008 const bool bWithSpacesForLevel = false ) const;
1009 virtual void getListItems( IDocumentListItems::tSortedNodeNumList& orNodeNumList ) const;
1010 virtual void getNumItems( IDocumentListItems::tSortedNodeNumList& orNodeNumList ) const;
1012 /** IDocumentOutlineNodes
1014 OD 2007-11-15 #i83479#
1016 virtual sal_Int32 getOutlineNodesCount() const;
1017 virtual int getOutlineLevel( const sal_Int32 nIdx ) const;
1018 virtual String getOutlineText( const sal_Int32 nIdx,
1019 const bool bWithNumber,
1020 const bool bWithSpacesForLevel ) const;
1021 virtual SwTxtNode* getOutlineNode( const sal_Int32 nIdx ) const;
1022 virtual void getOutlineNodes( IDocumentOutlineNodes::tSortedOutlineNodeList& orOutlineNodeList ) const;
1024 /** IDocumentListsAccess
1026 OD 2008-03-26 #refactorlists#
1028 virtual SwList* createList( String sListId,
1029 const String sDefaultListStyleName );
1030 virtual void deleteList( const String sListId );
1031 virtual SwList* getListByName( const String sListId ) const;
1032 virtual SwList* createListForListStyle( const String sListStyleName );
1033 virtual SwList* getListForListStyle( const String sListStyleName ) const;
1034 virtual void deleteListForListStyle( const String sListStyleName );
1035 // --> OD 2008-07-08 #i91400#
1036 virtual void trackChangeOfListStyleName( const String sListStyleName,
1037 const String sNewListStyleName );
1038 // <--
1040 /** INextInterface here
1043 DECL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem *);
1044 DECL_LINK(CalcFieldValueHdl, EditFieldInfo*);
1046 /** OLE ???
1048 bool IsOLEPrtNotifyPending() const { return mbOLEPrtNotifyPending; }
1049 inline void SetOLEPrtNotifyPending( bool bSet = true );
1050 void PrtOLENotify( sal_Bool bAll ); //Alle oder nur Markierte
1052 #ifndef PRODUCT
1053 bool InXMLExport() const { return mbXMLExport; }
1054 void SetXMLExport( bool bFlag ) { mbXMLExport = bFlag; }
1055 #endif
1057 // liefert zu allen fliegenden Rahmen die Position im Dokument.
1058 // Wird ein Pam-Pointer uebergeben, muessen die absatzgebundenen
1059 // FlyFrames von der ::com::sun::star::awt::Selection vollstaendig umschlossen sein
1060 // ( Start < Pos < End ) !!!
1061 // (wird fuer die Writer benoetigt)
1062 void GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, const SwPaM* = 0,
1063 sal_Bool bDrawAlso = sal_False ) const;
1065 // wegen swrtf.cxx und define private public, jetzt hier
1066 SwFlyFrmFmt *MakeFlyFrmFmt (const String &rFmtName, SwFrmFmt *pDerivedFrom);
1067 SwDrawFrmFmt *MakeDrawFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom);
1069 // JP 08.05.98: fuer Flys muss jetzt diese Schnittstelle benutzt
1070 // werden. pAnchorPos muss gesetzt sein, wenn keine
1071 // Seitenbindung vorliegt UND der ::com::sun::star::chaos::Anchor nicht schon
1072 // im FlySet/FrmFmt mit gueltiger CntntPos gesetzt ist
1073 /* #109161# new parameter bCalledFromShell
1075 TRUE: An existing adjust item at pAnchorPos is propagated to
1076 the content node of the new fly section. That propagation only
1077 takes place if there is no adjust item in the paragraph style
1078 for the new fly section.
1080 FALSE: no propagation
1082 SwFlyFrmFmt* MakeFlySection( RndStdIds eAnchorType,
1083 const SwPosition* pAnchorPos,
1084 const SfxItemSet* pSet = 0,
1085 SwFrmFmt *pParent = 0,
1086 BOOL bCalledFromShell = FALSE );
1087 SwFlyFrmFmt* MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
1088 const SwSelBoxes* pSelBoxes = 0,
1089 SwFrmFmt *pParent = 0 );
1091 void CopyWithFlyInFly( const SwNodeRange& rRg,
1092 const xub_StrLen nEndContentIndex,
1093 const SwNodeIndex& rInsPos,
1094 sal_Bool bMakeNewFrms = sal_True,
1095 sal_Bool bDelRedlines = sal_True,
1096 sal_Bool bCopyFlyAtFly = sal_False ) const;
1098 sal_Bool SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet );
1100 sal_Bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt,
1101 SfxItemSet* pSet = 0, sal_Bool bKeepOrient = sal_False );
1102 // --> OD 2009-07-20 #i73249#
1103 void SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
1104 const String& sNewTitle );
1105 void SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
1106 const String& sNewDescription );
1107 // <--
1109 /** Footnotes
1111 // Fussnoten Informationen
1112 const SwFtnInfo& GetFtnInfo() const { return *pFtnInfo; }
1113 void SetFtnInfo(const SwFtnInfo& rInfo);
1114 const SwEndNoteInfo& GetEndNoteInfo() const { return *pEndNoteInfo; }
1115 void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
1116 SwFtnIdxs& GetFtnIdxs() { return *pFtnIdxs; }
1117 const SwFtnIdxs& GetFtnIdxs() const { return *pFtnIdxs; }
1118 // change footnotes in area
1119 bool SetCurFtn( const SwPaM& rPam, const String& rNumStr,
1120 sal_uInt16 nNumber, bool bIsEndNote );
1122 /** Operations on the content of the document e.g.
1123 spell-checking/hyphenating/word-counting
1125 ::com::sun::star::uno::Any
1126 Spell( SwPaM&, ::com::sun::star::uno::Reference<
1127 ::com::sun::star::linguistic2::XSpellChecker1 > &,
1128 sal_uInt16* pPageCnt, sal_uInt16* pPageSt, bool bGrammarCheck,
1129 SwConversionArgs *pConvArgs = 0 ) const;
1131 ::com::sun::star::uno::Reference<
1132 ::com::sun::star::linguistic2::XHyphenatedWord >
1133 Hyphenate( SwPaM *pPam, const Point &rCrsrPos,
1134 sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
1136 // count words in pam
1137 void CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const;
1140 /** ???
1142 // Textbaustein Dokument?
1143 void SetGlossDoc( bool bGlssDc = true ) { mbGlossDoc = bGlssDc; }
1144 bool IsInsOnlyTextGlossary() const { return mbInsOnlyTxtGlssry; }
1146 // Abstakt fuellen
1147 void Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool bImpress );
1149 void ChangeAuthorityData(const SwAuthEntry* pNewData);
1151 bool IsInCallModified() const { return mbInCallModified; }
1152 sal_Bool IsInHeaderFooter( const SwNodeIndex& rIdx ) const;
1153 short GetTextDirection( const SwPosition& rPos,
1154 const Point* pPt = 0 ) const;
1155 sal_Bool IsInVerticalText( const SwPosition& rPos,
1156 const Point* pPt = 0 ) const;
1157 /** Database ???
1160 /* Datenbank && DB-Manager */
1161 void SetNewDBMgr( SwNewDBMgr* pNewMgr ) { pNewDBMgr = pNewMgr; }
1162 SwNewDBMgr* GetNewDBMgr() const { return pNewDBMgr; }
1163 void ChangeDBFields( const SvStringsDtor& rOldNames,
1164 const String& rNewName );
1165 void SetInitDBFields(sal_Bool b);
1166 // Von Feldern verwendete Datenbanken herausfinden
1167 void GetAllUsedDB( SvStringsDtor& rDBNameList,
1168 const SvStringsDtor* pAllDBNames = 0 );
1170 void ChgDBData( const SwDBData& rNewData );
1171 SwDBData GetDBData();
1172 const SwDBData& GetDBDesc();
1173 const SwDBData& _GetDBDesc() const { return aDBData; }
1175 /** Some helper functions
1177 String GetUniqueGrfName() const;
1178 String GetUniqueOLEName() const;
1179 String GetUniqueFrameName() const;
1181 void SetFlyName( SwFlyFrmFmt& rFmt, const String& rName );
1182 const SwFlyFrmFmt* FindFlyByName( const String& rName, sal_Int8 nNdTyp = 0 ) const;
1184 void GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
1185 String* pFltName ) const;
1187 // setze bei allen Flys ohne Namen einen gueltigen (Wird von den Readern
1188 // nach dem Einlesen gerufen )
1189 void SetAllUniqueFlyNames();
1191 //Zuruecksetzen der Attribute; es werden alle TxtHints und bei
1192 //vollstaendiger Selektion harte Formatierung (AUTO-Formate) entfernt
1193 // --> OD 2008-11-28 #i96644#
1194 // introduce new optional parameter <bSendDataChangedEvents> in order to
1195 // control, if the side effect "send data changed events" is triggered or not.
1196 void ResetAttrs( const SwPaM &rRg,
1197 sal_Bool bTxtAttr = sal_True,
1198 const SvUShortsSort* = 0,
1199 const bool bSendDataChangedEvents = true );
1200 // <--
1201 void RstTxtAttrs(const SwPaM &rRg, BOOL bInclRefToxMark = FALSE );
1203 // Setze das Attribut im angegebenen Format. Ist Undo aktiv, wird
1204 // das alte in die Undo-History aufgenommen
1205 void SetAttr( const SfxPoolItem&, SwFmt& );
1206 void SetAttr( const SfxItemSet&, SwFmt& );
1208 // --> OD 2008-02-12 #newlistlevelattrs#
1209 // method to reset a certain attribute at the given format
1210 void ResetAttrAtFormat( const USHORT nWhichId,
1211 SwFmt& rChangedFormat );
1212 // <--
1214 // Setze das Attribut als neues default Attribut in diesem Dokument.
1215 // Ist Undo aktiv, wird das alte in die Undo-History aufgenommen
1216 void SetDefault( const SfxPoolItem& );
1217 void SetDefault( const SfxItemSet& );
1219 // Erfrage das Default Attribut in diesem Dokument.
1220 const SfxPoolItem& GetDefault( sal_uInt16 nFmtHint ) const;
1221 // TextAttribute nicht mehr aufspannen lassen
1222 sal_Bool DontExpandFmt( const SwPosition& rPos, sal_Bool bFlag = sal_True );
1224 /* Formate */
1225 const SwFrmFmts* GetFrmFmts() const { return pFrmFmtTbl; }
1226 SwFrmFmts* GetFrmFmts() { return pFrmFmtTbl; }
1227 const SwCharFmts* GetCharFmts() const { return pCharFmtTbl;}
1229 /* LayoutFormate (Rahmen, DrawObjecte), mal const mal nicht */
1230 const SwSpzFrmFmts* GetSpzFrmFmts() const { return pSpzFrmFmtTbl; }
1231 SwSpzFrmFmts* GetSpzFrmFmts() { return pSpzFrmFmtTbl; }
1233 const SwFrmFmt *GetDfltFrmFmt() const { return pDfltFrmFmt; }
1234 SwFrmFmt *GetDfltFrmFmt() { return pDfltFrmFmt; }
1235 const SwFrmFmt *GetEmptyPageFmt() const { return pEmptyPageFmt; }
1236 SwFrmFmt *GetEmptyPageFmt() { return pEmptyPageFmt; }
1237 const SwFrmFmt *GetColumnContFmt() const{ return pColumnContFmt; }
1238 SwFrmFmt *GetColumnContFmt() { return pColumnContFmt; }
1239 const SwCharFmt *GetDfltCharFmt() const { return pDfltCharFmt;}
1240 SwCharFmt *GetDfltCharFmt() { return pDfltCharFmt;}
1242 // Returns the interface of the management of (auto)styles
1243 IStyleAccess& GetIStyleAccess() { return *pStyleAccess; }
1245 // Remove all language dependencies from all existing formats
1246 void RemoveAllFmtLanguageDependencies();
1248 SwFrmFmt *MakeFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom,
1249 BOOL bBroadcast = FALSE, BOOL bAuto = TRUE);
1250 void DelFrmFmt( SwFrmFmt *pFmt, BOOL bBroadcast = FALSE );
1251 SwFrmFmt* FindFrmFmtByName( const String& rName ) const
1252 { return (SwFrmFmt*)FindFmtByName( (SvPtrarr&)*pFrmFmtTbl, rName ); }
1254 // --> OD 2005-01-13 #i40550#
1255 SwCharFmt *MakeCharFmt(const String &rFmtName, SwCharFmt *pDerivedFrom,
1256 BOOL bBroadcast = FALSE,
1257 BOOL bAuto = TRUE );
1258 // <--
1259 void DelCharFmt(sal_uInt16 nFmt, BOOL bBroadcast = FALSE);
1260 void DelCharFmt(SwCharFmt* pFmt, BOOL bBroadcast = FALSE);
1261 SwCharFmt* FindCharFmtByName( const String& rName ) const
1262 { return (SwCharFmt*)FindFmtByName( (SvPtrarr&)*pCharFmtTbl, rName ); }
1264 /* Formatcollections (Vorlagen) */
1265 // TXT
1266 const SwTxtFmtColl* GetDfltTxtFmtColl() const { return pDfltTxtFmtColl; }
1267 const SwTxtFmtColls *GetTxtFmtColls() const { return pTxtFmtCollTbl; }
1268 // --> OD 2005-01-13 #i40550#
1269 SwTxtFmtColl *MakeTxtFmtColl( const String &rFmtName,
1270 SwTxtFmtColl *pDerivedFrom,
1271 BOOL bBroadcast = FALSE,
1272 BOOL bAuto = TRUE );
1273 // <--
1274 SwConditionTxtFmtColl* MakeCondTxtFmtColl( const String &rFmtName,
1275 SwTxtFmtColl *pDerivedFrom,
1276 BOOL bBroadcast = FALSE);
1277 void DelTxtFmtColl(sal_uInt16 nFmt, BOOL bBroadcast = FALSE);
1278 void DelTxtFmtColl( SwTxtFmtColl* pColl, BOOL bBroadcast = FALSE );
1279 // --> OD 2007-11-06 #i62675#
1280 // Add 4th optional parameter <bResetListAttrs>.
1281 // 'side effect' of <SetTxtFmtColl> with <bReset = true> is that the hard
1282 // attributes of the affected text nodes are cleared, except the break
1283 // attribute, the page description attribute and the list style attribute.
1284 // The new parameter <bResetListAttrs> indicates, if the list attributes
1285 // (list style, restart at and restart with) are cleared as well in case
1286 // that <bReset = true> and the paragraph style has a list style attribute set.
1287 sal_Bool SetTxtFmtColl( const SwPaM &rRg, SwTxtFmtColl *pFmt,
1288 bool bReset = true,
1289 bool bResetListAttrs = false );
1290 // <--
1291 SwTxtFmtColl* FindTxtFmtCollByName( const String& rName ) const
1292 { return (SwTxtFmtColl*)FindFmtByName( (SvPtrarr&)*pTxtFmtCollTbl, rName ); }
1294 void ChkCondColls();
1296 // GRF
1297 const SwGrfFmtColl* GetDfltGrfFmtColl() const { return pDfltGrfFmtColl; }
1298 const SwGrfFmtColls *GetGrfFmtColls() const { return pGrfFmtCollTbl; }
1299 SwGrfFmtColl *MakeGrfFmtColl(const String &rFmtName,
1300 SwGrfFmtColl *pDerivedFrom);
1301 SwGrfFmtColl* FindGrfFmtCollByName( const String& rName ) const
1302 { return (SwGrfFmtColl*)FindFmtByName( (SvPtrarr&)*pGrfFmtCollTbl, rName ); }
1304 // Tabellen-Formate
1305 const SwFrmFmts* GetTblFrmFmts() const { return pTblFrmFmtTbl; }
1306 SwFrmFmts* GetTblFrmFmts() { return pTblFrmFmtTbl; }
1307 sal_uInt16 GetTblFrmFmtCount( sal_Bool bUsed ) const;
1308 SwFrmFmt& GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed ) const;
1309 SwTableFmt* MakeTblFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom);
1310 void DelTblFrmFmt( SwTableFmt* pFmt );
1311 SwTableFmt* FindTblFmtByName( const String& rName, sal_Bool bAll = sal_False ) const;
1313 //Rahmenzugriff
1314 //iterieren ueber Flys - fuer Basic-Collections
1315 sal_uInt16 GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL) const;
1316 SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL);
1319 // kopiere die Formate in die eigenen Arrays und returne diese
1320 SwFrmFmt *CopyFrmFmt ( const SwFrmFmt& );
1321 SwCharFmt *CopyCharFmt( const SwCharFmt& );
1322 SwTxtFmtColl* CopyTxtColl( const SwTxtFmtColl& rColl );
1323 SwGrfFmtColl* CopyGrfColl( const SwGrfFmtColl& rColl );
1325 // ersetze alle Formate mit denen aus rSource
1326 void ReplaceStyles( SwDoc& rSource );
1328 // erfrage ob die Absatz-/Zeichen-/Rahmen-/Seiten - Vorlage benutzt wird
1329 sal_Bool IsUsed( const SwModify& ) const;
1330 sal_Bool IsUsed( const SwNumRule& ) const;
1332 // setze den Namen der neu geladenen Dokument-Vorlage
1333 sal_uInt16 SetDocPattern( const String& rPatternName );
1334 // gebe den Dok-VorlagenNamen zurueck. !!! Kann auch 0 sein !!!
1335 String* GetDocPattern( sal_uInt16 nPos ) const { return aPatternNms[nPos]; }
1337 // Loesche alle nicht referenzierten FeldTypen
1338 void GCFieldTypes(); // impl. in docfld.cxx
1340 // akt. Dokument mit Textbausteindokument verbinden/erfragen
1341 void SetGlossaryDoc( SwDoc* pDoc ) { pGlossaryDoc = pDoc; }
1343 // travel over PaM Ring
1344 sal_Bool InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
1345 SwPaM& rPaM, SwCrsrShell* pShell = 0);
1347 sal_uInt16 GetPageCount() const;
1348 const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
1350 //PageDescriptor-Schnittstelle
1351 sal_uInt16 GetPageDescCnt() const { return aPageDescs.Count(); }
1352 const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return *aPageDescs[i]; }
1353 SwPageDesc* FindPageDescByName( const String& rName,
1354 sal_uInt16* pPos = 0 ) const;
1356 // kopiere den gesamten PageDesc - ueber Dokumentgrenzen und "tief"!
1357 // optional kann das kopieren der PoolFmtId, -HlpId verhindert werden
1358 void CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
1359 sal_Bool bCopyPoolIds = sal_True );
1361 // kopiere die Kopzeile (mit dem Inhalt!) aus dem SrcFmt
1362 // ins DestFmt ( auch ueber Doc grenzen hinaus!)
1363 void CopyHeader( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
1364 { _CopyPageDescHeaderFooter( sal_True, rSrcFmt, rDestFmt ); }
1365 // kopiere die Fusszeile (mit dem Inhalt!) aus dem SrcFmt
1366 // ins DestFmt ( auch ueber Doc grenzen hinaus!)
1367 void CopyFooter( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
1368 { _CopyPageDescHeaderFooter( sal_False, rSrcFmt, rDestFmt ); }
1370 //fuer Reader
1372 SwPageDesc * GetPageDesc( const String & rName );
1373 SwPageDesc& _GetPageDesc( sal_uInt16 i ) const { return *aPageDescs[i]; }
1374 void ChgPageDesc( const String & rName, const SwPageDesc& );
1375 void ChgPageDesc( sal_uInt16 i, const SwPageDesc& );
1376 BOOL FindPageDesc( const String & rName, sal_uInt16 * pFound );
1377 // -> #116530#
1378 void DelPageDesc( const String & rName, BOOL bBroadcast = FALSE);
1379 void DelPageDesc( sal_uInt16 i, BOOL bBroadcast = FALSE );
1380 // <- #116530#
1381 void PreDelPageDesc(SwPageDesc * pDel); // #i7983#
1382 // -> #116530#
1383 sal_uInt16 MakePageDesc( const String &rName, const SwPageDesc* pCpy = 0,
1384 BOOL bRegardLanguage = TRUE,
1385 BOOL bBroadcast = FALSE);
1386 void BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
1387 USHORT nOp);
1388 // <- #116530#
1391 // --> FME 2005-03-16 #i44963# The html import sometimes overwrites the
1392 // page sizes set in the page descriptions. This function is used to
1393 // correct this.
1394 void CheckDefaultPageFmt();
1395 // <--
1397 // Methoden fuer die Verzeichnisse:
1398 // - Verzeichnismarke einfuegen loeschen travel
1399 sal_uInt16 GetCurTOXMark( const SwPosition& rPos, SwTOXMarks& ) const;
1400 void Delete( const SwTOXMark* pTOXMark );
1401 const SwTOXMark& GotoTOXMark( const SwTOXMark& rCurTOXMark,
1402 SwTOXSearch eDir, sal_Bool bInReadOnly );
1404 // - Verzeichnis einfuegen, und bei Bedarf erneuern
1405 const SwTOXBaseSection* InsertTableOf( const SwPosition& rPos,
1406 const SwTOXBase& rTOX,
1407 const SfxItemSet* pSet = 0,
1408 sal_Bool bExpand = sal_False );
1409 const SwTOXBaseSection* InsertTableOf( ULONG nSttNd, ULONG nEndNd,
1410 const SwTOXBase& rTOX,
1411 const SfxItemSet* pSet = 0 );
1412 const SwTOXBase* GetCurTOX( const SwPosition& rPos ) const;
1413 const SwAttrSet& GetTOXBaseAttrSet(const SwTOXBase& rTOX) const;
1415 sal_Bool DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes = sal_False );
1416 String GetUniqueTOXBaseName( const SwTOXType& rType,
1417 const String* pChkStr = 0 ) const;
1419 sal_Bool SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName);
1420 void SetTOXBaseProtection(const SwTOXBase& rTOXBase, sal_Bool bProtect);
1422 // nach einlesen einer Datei alle Verzeichnisse updaten
1423 void SetUpdateTOX( bool bFlag = true ) { mbUpdateTOX = bFlag; }
1424 bool IsUpdateTOX() const { return mbUpdateTOX; }
1426 const String& GetTOIAutoMarkURL() const {return sTOIAutoMarkURL;}
1427 void SetTOIAutoMarkURL(const String& rSet) {sTOIAutoMarkURL = rSet;}
1428 void ApplyAutoMark();
1430 bool IsInReading() const { return mbInReading; }
1431 void SetInReading( bool bNew ) { mbInReading = bNew; }
1433 bool IsClipBoard() const { return mbClipBoard; }
1434 // N.B.: must be called right after constructor! (@see GetXmlIdRegistry)
1435 void SetClipBoard( bool bNew ) { mbClipBoard = bNew; }
1437 bool IsColumnSelection() const { return mbColumnSelection; }
1438 void SetColumnSelection( bool bNew ) { mbColumnSelection = bNew; }
1440 bool IsInXMLImport() const { return mbInXMLImport; }
1441 void SetInXMLImport( bool bNew ) { mbInXMLImport = bNew; }
1443 // - Verzeichnis-Typen verwalten
1444 sal_uInt16 GetTOXTypeCount( TOXTypes eTyp ) const;
1445 const SwTOXType* GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const;
1446 sal_Bool DeleteTOXType( TOXTypes eTyp, sal_uInt16 nId );
1447 const SwTOXType* InsertTOXType( const SwTOXType& rTyp );
1448 const SwTOXTypes& GetTOXTypes() const { return *pTOXTypes; }
1450 const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate = sal_False );
1451 void SetDefaultTOXBase(const SwTOXBase& rBase);
1453 // - Schluessel fuer die Indexverwaltung
1454 sal_uInt16 GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const;
1456 // Sortieren Tabellen Text
1457 sal_Bool SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions&);
1458 sal_Bool SortText(const SwPaM&, const SwSortOptions&);
1460 // korrigiere die im Dokument angemeldeten SwPosition-Objecte,
1461 // wie z.B. die ::com::sun::star::text::Bookmarks oder die Verzeichnisse.
1462 // JP 22.06.95: ist bMoveCrsr gesetzt, verschiebe auch die Crsr
1464 // Setzt alles in rOldNode auf rNewPos + Offset
1465 void CorrAbs( const SwNodeIndex& rOldNode, const SwPosition& rNewPos,
1466 const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False );
1467 // Setzt alles im Bereich von [rStartNode, rEndNode] nach rNewPos
1468 void CorrAbs( const SwNodeIndex& rStartNode, const SwNodeIndex& rEndNode,
1469 const SwPosition& rNewPos, sal_Bool bMoveCrsr = sal_False );
1470 // Setzt alles im Bereich von rRange nach rNewPos
1471 void CorrAbs( const SwPaM& rRange, const SwPosition& rNewPos,
1472 sal_Bool bMoveCrsr = sal_False );
1473 // Setzt alles in rOldNode auf relative Pos
1474 void CorrRel( const SwNodeIndex& rOldNode, const SwPosition& rNewPos,
1475 const xub_StrLen nOffset = 0, sal_Bool bMoveCrsr = sal_False );
1477 // GliederungsRegeln erfragen / setzen
1478 // --> OD 2005-11-02 #i51089 - TUNING#
1479 inline SwNumRule* GetOutlineNumRule() const
1481 return pOutlineRule;
1483 // <--
1484 void SetOutlineNumRule( const SwNumRule& rRule );
1485 void PropagateOutlineRule();
1487 // Gliederung - hoch-/runterstufen
1488 sal_Bool OutlineUpDown( const SwPaM& rPam, short nOffset = 1 );
1489 // Gliederung - hoch-/runtermoven
1490 sal_Bool MoveOutlinePara( const SwPaM& rPam, short nOffset = 1);
1491 // zu diesem Gliederungspunkt
1492 sal_Bool GotoOutline( SwPosition& rPos, const String& rName ) const;
1493 // die Aenderungen an den Gliederungsvorlagen in die OutlineRule uebernehmen
1495 // setzt, wenn noch keine Numerierung, sonst wird geaendert
1496 // arbeitet mit alten und neuen Regeln, nur Differenzen aktualisieren
1497 // --> OD 2005-02-18 #i42921# - re-use unused 3rd parameter
1498 // --> OD 2008-02-08 #newlistlevelattrs#
1499 // Add optional parameter <bResetIndentAttrs> - default value FALSE.
1500 // If <bResetIndentAttrs> equals true, the indent attributes "before text"
1501 // and "first line indent" are additionally reset at the provided PaM, if
1502 // the list style makes use of the new list level attributes.
1503 // --> OD 2008-03-17 #refactorlists#
1504 // introduce parameters <bCreateNewList> and <sContinuedListId>
1505 // <bCreateNewList> indicates, if a new list is created by applying the
1506 // given list style.
1507 void SetNumRule( const SwPaM&,
1508 const SwNumRule&,
1509 const bool bCreateNewList,
1510 const String sContinuedListId = String(),
1511 sal_Bool bSetItem = sal_True,
1512 const bool bResetIndentAttrs = false );
1513 // <--
1514 void SetCounted( const SwPaM&, bool bCounted);
1516 // --> OD 2009-08-25 #i86492#
1517 // no longer needed.
1518 // SwDoc::SetNumRule( rPaM, rNumRule, false, <ListId>, sal_True, true ) have to be used instead.
1519 // /**
1520 // Replace numbering rules in a PaM by another numbering rule.
1522 // \param rPaM PaM to replace the numbering rules in
1523 // \param rNumRule numbering rule to replace the present numbering rules
1524 // */
1525 // void ReplaceNumRule(const SwPaM & rPaM, const SwNumRule & rNumRule);
1527 void MakeUniqueNumRules(const SwPaM & rPaM);
1529 void SetNumRuleStart( const SwPosition& rPos, sal_Bool bFlag = sal_True );
1530 void SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt );
1532 SwNumRule* GetCurrNumRule( const SwPosition& rPos ) const;
1534 const SwNumRuleTbl& GetNumRuleTbl() const { return *pNumRuleTbl; }
1536 // #i36749#
1538 Add numbering rule to document.
1540 @param pRule rule to add
1542 void AddNumRule(SwNumRule * pRule);
1544 // --> OD 2008-02-11 #newlistlevelattrs#
1545 // add optional parameter <eDefaultNumberFormatPositionAndSpaceMode>
1546 sal_uInt16 MakeNumRule( const String &rName,
1547 const SwNumRule* pCpy = 0,
1548 BOOL bBroadcast = FALSE,
1549 const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode =
1550 SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
1551 // <--
1552 sal_uInt16 FindNumRule( const String& rName ) const;
1553 SwNumRule* FindNumRulePtr( const String& rName ) const;
1555 // loeschen geht nur, wenn die ::com::sun::star::chaos::Rule niemand benutzt!
1556 // #106897#
1557 sal_Bool RenameNumRule(const String & aOldName, const String & aNewName,
1558 BOOL bBroadcast = FALSE);
1559 sal_Bool DelNumRule( const String& rName, BOOL bBroadCast = FALSE );
1560 String GetUniqueNumRuleName( const String* pChkStr = 0, sal_Bool bAutoNum = sal_True ) const;
1562 void UpdateNumRule(); // alle invaliden Updaten
1563 // #106897#
1564 void ChgNumRuleFmts( const SwNumRule& rRule, const String * pOldName = 0 );
1565 sal_Bool ReplaceNumRule( const SwPosition& rPos, const String& rOldRule,
1566 const String& rNewRule );
1568 // zum naechsten/vorhergehenden Punkt auf gleicher Ebene
1569 sal_Bool GotoNextNum( SwPosition&, sal_Bool bOverUpper = sal_True,
1570 sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 );
1571 sal_Bool GotoPrevNum( SwPosition&, sal_Bool bOverUpper = sal_True,
1572 sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 );
1574 // #i23731#
1575 /** Searches for a text node with a numbering rule.
1577 OD 2005-10-24 #i55391# - add optional parameter <bInvestigateStartNode>
1578 OD 2008-03-18 #refactorlists# - add output parameter <sListId>
1580 \param rPos position to start search
1581 \param bForward - TRUE: search forward
1582 - FALSE: search backward
1583 \param bNum - TRUE: search for enumeration
1584 - FALSE: search for itemize
1585 \param bOutline - TRUE: search for outline numbering rule
1586 - FALSE: search for non-outline numbering rule
1587 \param nNonEmptyAllowed number of non-empty paragraphs allowed between
1588 rPos and found paragraph
1590 @param sListId
1591 output parameter - in case a list style is found, <sListId> holds the
1592 list id, to which the text node belongs, which applies the found list style.
1594 @param bInvestigateStartNode
1595 input parameter - boolean, indicating, if start node, determined by given
1596 start position has to be investigated or not.
1598 const SwNumRule * SearchNumRule(const SwPosition & rPos,
1599 const bool bForward,
1600 const bool bNum,
1601 const bool bOutline,
1602 int nNonEmptyAllowed,
1603 String& sListId,
1604 const bool bInvestigateStartNode = false );
1606 // Absaetze ohne Numerierung, aber mit Einzuegen
1607 sal_Bool NoNum( const SwPaM& );
1608 // Loeschen, Splitten der Aufzaehlungsliste
1609 void DelNumRules( const SwPaM& );
1611 // Invalidates all numrules
1612 void InvalidateNumRules();
1614 // Hoch-/Runterstufen
1615 sal_Bool NumUpDown( const SwPaM&, sal_Bool bDown = sal_True );
1616 // Bewegt selektierte Absaetze (nicht nur Numerierungen)
1617 // entsprechend des Offsets. (negativ: zum Doc-Anf.)
1618 sal_Bool MoveParagraph( const SwPaM&, long nOffset = 1, sal_Bool bIsOutlMv = sal_False );
1619 // No-/Numerierung ueber Delete/Backspace ein/abschalten #115901#
1620 sal_Bool NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel = sal_False);
1621 // Animation der Grafiken stoppen
1622 void StopNumRuleAnimations( OutputDevice* );
1624 // fuege eine neue Tabelle auf der Position rPos ein. (es
1625 // wird vor dem Node eingefuegt !!)
1626 //JP 28.10.96:
1627 // fuer AutoFormat bei der Eingabe: dann muessen die Spalten
1628 // auf die vordefinierten Breite gesetzt werden. Im Array stehen die
1629 // Positionen der Spalten!! (nicht deren Breite!)
1630 /* #109161# new parameter bCalledFromShell:
1632 TRUE: called from shell -> propagate existing adjust item at
1633 rPos to every new cell. A existing adjust item in the table
1634 heading or table contents paragraph style prevent that
1635 propagation.
1637 FALSE: do not propagate
1639 const SwTable* InsertTable( const SwInsertTableOptions& rInsTblOpts, // HEADLINE_NO_BORDER
1640 const SwPosition& rPos, sal_uInt16 nRows,
1641 sal_uInt16 nCols, short eAdjust,
1642 const SwTableAutoFmt* pTAFmt = 0,
1643 const SvUShorts* pColArr = 0,
1644 BOOL bCalledFromShell = FALSE,
1645 BOOL bNewModel = TRUE );
1647 // steht der Index in einer Tabelle, dann returne den TableNode sonst 0
1648 SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx );
1649 inline const SwTableNode* IsIdxInTbl( const SwNodeIndex& rIdx ) const;
1651 // erzeuge aus dem makierten Bereich eine ausgeglichene Tabelle
1652 const SwTable* TextToTable( const SwInsertTableOptions& rInsTblOpts, // HEADLINE_NO_BORDER,
1653 const SwPaM& rRange, sal_Unicode cCh,
1654 short eAdjust,
1655 const SwTableAutoFmt* = 0 );
1656 // text to table conversion - API support
1657 const SwTable* TextToTable( const std::vector< std::vector<SwNodeRange> >& rTableNodes );
1658 // erzeuge aus der Tabelle wieder normalen Text
1659 sal_Bool TableToText( const SwTableNode* pTblNd, sal_Unicode cCh );
1660 // einfuegen von Spalten/Zeilen in der Tabelle
1661 sal_Bool InsertCol( const SwCursor& rCursor,
1662 sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
1663 sal_Bool InsertCol( const SwSelBoxes& rBoxes,
1664 sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
1665 sal_Bool InsertRow( const SwCursor& rCursor,
1666 sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
1667 sal_Bool InsertRow( const SwSelBoxes& rBoxes,
1668 sal_uInt16 nCnt = 1, sal_Bool bBehind = sal_True );
1669 // loeschen von Spalten/Zeilen in der Tabelle
1670 sal_Bool DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn = false );
1671 sal_Bool DeleteRow( const SwCursor& rCursor );
1672 sal_Bool DeleteCol( const SwCursor& rCursor );
1673 // teilen / zusammenfassen von Boxen in der Tabelle
1674 sal_Bool SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert = sal_True,
1675 sal_uInt16 nCnt = 1, sal_Bool bSameHeight = sal_False );
1676 // returnt den enum TableMergeErr
1677 sal_uInt16 MergeTbl( SwPaM& rPam );
1678 String GetUniqueTblName() const;
1679 sal_Bool IsInsTblFormatNum() const;
1680 sal_Bool IsInsTblChangeNumFormat() const;
1681 sal_Bool IsInsTblAlignNum() const;
1683 // aus der FEShell wg.. Undo und bModified
1684 void GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
1685 const SwCellFrm* pBoxFrm = 0 ) const;
1686 void SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
1687 const SwCursor* pCrsr, const SwCellFrm* pBoxFrm = 0 );
1688 void GetTabRows( SwTabCols &rFill, const SwCursor* pCrsr,
1689 const SwCellFrm* pBoxFrm = 0 ) const;
1690 void SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor* pCrsr,
1691 const SwCellFrm* pBoxFrm = 0 );
1694 // Direktzugriff fuer Uno
1695 void SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rOld,
1696 const SwTableBox *pStart, sal_Bool bCurRowOnly);
1698 void SetRowsToRepeat( SwTable &rTable, USHORT nSet );
1700 // AutoFormat fuer die Tabelle/TabellenSelection
1701 sal_Bool SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew );
1702 // Erfrage wie attributiert ist
1703 sal_Bool GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet );
1704 // setze das InsertDB als Tabelle Undo auf:
1705 void AppendUndoForInsertFromDB( const SwPaM& rPam, BOOL bIsTable );
1706 // setze die Spalten/Zeilen/ZTellen Breite/Hoehe
1707 sal_Bool SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType,
1708 SwTwips nAbsDiff, SwTwips nRelDiff );
1709 SwTableBoxFmt* MakeTableBoxFmt();
1710 SwTableLineFmt* MakeTableLineFmt();
1711 // teste ob die Box ein numerischen Wert darstellt und aender dann ggfs.
1712 // das Format der Box
1713 void ChkBoxNumFmt( SwTableBox& rAktBox, sal_Bool bCallUpdate );
1714 void SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet );
1715 void ClearBoxNumAttrs( const SwNodeIndex& rNode );
1716 void ClearLineNumAttrs( SwPosition & rPos );
1718 sal_Bool InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
1719 const SwTable* pCpyTbl = 0, sal_Bool bCpyName = sal_False,
1720 sal_Bool bCorrPos = sal_False );
1722 sal_Bool UnProtectCells( const String& rTblName );
1723 sal_Bool UnProtectCells( const SwSelBoxes& rBoxes );
1724 sal_Bool UnProtectTbls( const SwPaM& rPam );
1725 sal_Bool HasTblAnyProtection( const SwPosition* pPos,
1726 const String* pTblName = 0,
1727 sal_Bool* pFullTblProtection = 0 );
1729 // Tabelle an der Position in der GrundLine aufsplitten, sprich eine
1730 // neue Tabelle erzeugen.
1731 sal_Bool SplitTable( const SwPosition& rPos, sal_uInt16 eMode = 0,
1732 sal_Bool bCalcNewSize = sal_False );
1733 // und die Umkehrung davon. rPos muss in der Tabelle stehen, die bestehen
1734 // bleibt. Das Flag besagt ob die aktuelle mit der davor oder dahinter
1735 // stehenden vereint wird.
1736 sal_Bool MergeTable( const SwPosition& rPos, sal_Bool bWithPrev = sal_True,
1737 sal_uInt16 nMode = 0 );
1739 // Charts der angegebenen Tabelle zum Update bewegen
1740 void UpdateCharts( const String &rName ) const;
1741 // update all charts, for that exists any table
1742 void UpdateAllCharts() { DoUpdateAllCharts( 0 ); }
1743 // Tabelle wird umbenannt und aktualisiert die Charts
1744 void SetTableName( SwFrmFmt& rTblFmt, const String &rNewName );
1746 // returne zum Namen die im Doc gesetzte Referenz
1747 const SwFmtRefMark* GetRefMark( const String& rName ) const;
1748 // returne die RefMark per Index - fuer Uno
1749 const SwFmtRefMark* GetRefMark( sal_uInt16 nIndex ) const;
1750 // returne die Namen aller im Doc gesetzten Referenzen.
1751 // Ist der ArrayPointer 0 dann returne nur, ob im Doc. eine RefMark
1752 // gesetzt ist
1753 sal_uInt16 GetRefMarks( SvStringsDtor* = 0 ) const;
1755 //Einfuegen einer Beschriftung - falls ein FlyFormat erzeugt wird, so
1756 // returne dieses.
1757 SwFlyFrmFmt* InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
1758 const String& rNumberingSeparator,
1759 const sal_Bool bBefore, const sal_uInt16 nId, const ULONG nIdx,
1760 const String& rCharacterStyle,
1761 const sal_Bool bCpyBrd = sal_True );
1762 SwFlyFrmFmt* InsertDrawLabel(
1763 const String &rTxt, const String& rSeparator, const String& rNumberSeparator,
1764 const sal_uInt16 nId, const String& rCharacterStyle, SdrObject& rObj );
1766 // erfrage den Attribut Pool
1767 const SwAttrPool& GetAttrPool() const { return *mpAttrPool; }
1768 SwAttrPool& GetAttrPool() { return *mpAttrPool; }
1770 // suche ueber das Layout eine EditShell und ggfs. eine ViewShell
1771 SwEditShell* GetEditShell( ViewShell** ppSh = 0 ) const;
1773 // OLE 2.0-Benachrichtung
1774 inline void SetOle2Link(const Link& rLink) {aOle2Link = rLink;}
1775 inline const Link& GetOle2Link() const {return aOle2Link;}
1777 // SS fuer Bereiche
1778 SwSection* Insert( const SwPaM& rRange, const SwSection& rNew,
1779 const SfxItemSet* pAttr = 0, sal_Bool bUpdate = sal_True );
1780 sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange,
1781 const SwNode** ppSttNd = 0 ) const;
1782 SwSection* GetCurrSection( const SwPosition& rPos ) const;
1783 SwSectionFmts& GetSections() { return *pSectionFmtTbl; }
1784 const SwSectionFmts& GetSections() const { return *pSectionFmtTbl; }
1785 SwSectionFmt *MakeSectionFmt( SwSectionFmt *pDerivedFrom );
1786 void DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes = sal_False );
1787 void ChgSection( sal_uInt16 nSect, const SwSection&, const SfxItemSet* = 0, sal_Bool bPreventLinkUpdate = FALSE);
1788 String GetUniqueSectionName( const String* pChkStr = 0 ) const;
1790 /* @@@MAINTAINABILITY-HORROR@@@
1791 The model should not have anything to do with a shell.
1792 Unnecessary compile/link time dependency.
1794 // Pointer auf die SfxDocShell vom Doc, kann 0 sein !!!
1795 SwDocShell* GetDocShell() { return pDocShell; }
1796 const SwDocShell* GetDocShell() const { return pDocShell; }
1797 void SetDocShell( SwDocShell* pDSh );
1799 // falls beim Kopieren von OLE-Nodes eine DocShell angelegt werden muss,
1800 // dann MUSS der Ref-Pointer besetzt sein!!!!
1801 SfxObjectShellRef* GetRefForDocShell() { return pDocShRef; }
1802 void SetRefForDocShell( SfxObjectShellRef* p ) { pDocShRef = p; }
1804 // fuer die TextBausteine - diese habe nur ein SvPersist zur
1805 // Verfuegung
1806 SfxObjectShell* GetPersist() const;
1808 // Pointer auf den Storage des SfxDocShells, kann 0 sein !!!
1809 ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetDocStorage();
1811 // abfrage/setze Flag, ob das Dokument im asynchronen Laden ist
1812 bool IsInLoadAsynchron() const { return mbInLoadAsynchron; }
1813 void SetInLoadAsynchron( bool bFlag ) { mbInLoadAsynchron = bFlag; }
1815 // erzeuge um das zu Servende Object eine Selektion
1816 sal_Bool SelectServerObj( const String& rStr, SwPaM*& rpPam,
1817 SwNodeRange*& rpRange ) const;
1819 // fuer Drag&Move: ( z.B. RefMarks "verschieben" erlauben )
1820 bool IsCopyIsMove() const { return mbCopyIsMove; }
1821 void SetCopyIsMove( bool bFlag ) { mbCopyIsMove = bFlag; }
1823 // fuers Draw-Undo: Aktionen auf Flys wollen wir selbst behandeln
1824 bool IsNoDrawUndoObj() const { return mbNoDrawUndoObj; }
1825 void SetNoDrawUndoObj( bool bFlag ) { mbNoDrawUndoObj = bFlag; }
1826 SwDrawContact* GroupSelection( SdrView& );
1827 void UnGroupSelection( SdrView& );
1828 sal_Bool DeleteSelection( SwDrawView& );
1830 // Invalidiert OnlineSpell-WrongListen
1831 void SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags );
1832 void InvalidateAutoCompleteFlag();
1834 // <--
1835 void SetCalcFieldValueHdl(Outliner* pOutliner);
1837 // erfrage ob die ::com::sun::star::util::URL besucht war. Uebers Doc, falls nur ein ::com::sun::star::text::Bookmark
1838 // angegeben ist. Dann muss der Doc. Name davor gesetzt werden!
1839 sal_Bool IsVisitedURL( const String& rURL ) const;
1841 // speicher die akt. Werte fuer die automatische Aufnahme von Ausnahmen
1842 // in die Autokorrektur
1843 void SetAutoCorrExceptWord( SwAutoCorrExceptWord* pNew );
1844 SwAutoCorrExceptWord* GetAutoCorrExceptWord() { return pACEWord; }
1846 const SwFmtINetFmt* FindINetAttr( const String& rName ) const;
1848 // rufe ins dunkle Basic, mit evt. Return String
1849 sal_Bool ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 );
1850 // rufe ins dunkle Basic/JavaScript
1851 sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
1852 sal_Bool bChkPtr = sal_False, SbxArray* pArgs = 0,
1853 const Link* pCallBack = 0 );
1855 // linken Rand ueber Objectleiste einstellen (aenhlich dem Stufen von
1856 // Numerierungen), optional kann man "um" den Offset stufen oder "auf"
1857 // die Position gestuft werden (bModulus = sal_True)
1858 void MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight = sal_True,
1859 sal_Bool bModulus = sal_True );
1861 // Numberformatter erfragen
1862 inline SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True );
1863 inline const SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True ) const;
1865 // loesche den nicht sichtbaren ::com::sun::star::ucb::Content aus dem Document, wie z.B.:
1866 // versteckte Bereiche, versteckte Absaetze
1867 sal_Bool RemoveInvisibleContent();
1868 //restore the invisible content if it's available on the undo stack
1869 sal_Bool RestoreInvisibleContent();
1870 // replace fields by text - mailmerge support
1871 BOOL ConvertFieldsToText();
1873 // erzeuge Anhand der vorgebenen Collection Teildokumente
1874 // falls keine angegeben ist, nehme die Kapitelvorlage der 1. Ebene
1875 sal_Bool GenerateGlobalDoc( const String& rPath,
1876 const SwTxtFmtColl* pSplitColl = 0 );
1877 sal_Bool GenerateGlobalDoc( const String& rPath, int nOutlineLevel = 0 ); //#outline level,add by zhaojianwei
1878 sal_Bool GenerateHTMLDoc( const String& rPath,
1879 const SwTxtFmtColl* pSplitColl = 0 );
1880 sal_Bool GenerateHTMLDoc( const String& rPath, int nOutlineLevel = 0 ); //#outline level,add by zhaojianwei
1882 // vergleiche zwei Dokument miteinander
1883 long CompareDoc( const SwDoc& rDoc );
1884 // merge zweier Dokumente
1885 long MergeDoc( const SwDoc& rDoc );
1886 // setze Kommentar-Text fuers Redline, das dann per AppendRedline
1887 // hereinkommt. Wird vom Autoformat benutzt. 0-Pointer setzt den Modus
1888 // wieder zurueck. Die SequenceNummer ist fuers UI-seitige zusammen-
1889 // fassen von Redlines.
1890 void SetAutoFmtRedlineComment( const String* pTxt, sal_uInt16 nSeqNo = 0 );
1892 bool IsAutoFmtRedline() const { return mbIsAutoFmtRedline; }
1893 void SetAutoFmtRedline( bool bFlag ) { mbIsAutoFmtRedline = bFlag; }
1895 // fuer AutoFormat: mit Undo/Redlining - Behandlung
1896 void SetTxtFmtCollByAutoFmt( const SwPosition& rPos, sal_uInt16 nPoolId,
1897 const SfxItemSet* pSet = 0 );
1898 void SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& );
1900 // !!!NUR fuer die SW-Textblocks!! beachtet kein LAYOUT!!!
1901 void ClearDoc(); // loescht den gesamten Inhalt.
1903 // erfrage / setze die Daten fuer die PagePreView
1904 const SwPagePreViewPrtData* GetPreViewPrtData() const { return pPgPViewPrtData; }
1905 // wenn der Pointer == 0 ist, dann wird im Doc der Pointer zerstoert,
1906 // ansonsten wird das Object kopiert.
1907 // Der Pointer geht NICHT in den Besitz des Doc's!!
1908 void SetPreViewPrtData( const SwPagePreViewPrtData* pData );
1910 // update all modified OLE-Objects. The modification is called over the
1911 // StarOne - Interface --> Bug 67026
1912 void SetOLEObjModified()
1913 { if( GetRootFrm() ) aOLEModifiedTimer.Start(); }
1915 // -------------------- Uno - Schnittstellen ---------------------------
1916 const SwUnoCrsrTbl& GetUnoCrsrTbl() const { return *pUnoCrsrTbl; }
1917 SwUnoCrsr* CreateUnoCrsr( const SwPosition& rPos, sal_Bool bTblCrsr = sal_False );
1918 // -------------------- Uno - Schnittstellen ---------------------------
1920 // -------------------- FeShell - Schnittstellen -----------------------
1921 // !!!!! diese gehen immer davon aus, das ein Layout existiert !!!!
1922 sal_Bool ChgAnchor( const SdrMarkList& _rMrkList,
1923 RndStdIds _eAnchorType,
1924 const sal_Bool _bSameOnly,
1925 const sal_Bool _bPosCorr );
1927 void SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew );
1928 void GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const;
1929 void SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew );
1930 void GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) const;
1931 sal_Bool BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly = sal_True );
1932 void SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew );
1933 sal_Bool GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) const;
1934 void SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet );
1935 void SetTabLineStyle( const SwCursor& rCursor,
1936 const Color* pColor, sal_Bool bSetLine,
1937 const SvxBorderLine* pBorderLine );
1938 void GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const;
1939 void SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew );
1940 sal_Bool GetBoxAttr( const SwCursor& rCursor, SfxPoolItem &rToFill ) const;
1941 void SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign );
1942 sal_uInt16 GetBoxAlign( const SwCursor& rCursor ) const;
1943 void AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance = sal_False );
1945 int Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest );
1946 int Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest );
1947 void Unchain( SwFrmFmt &rFmt );
1949 // fuers Copy/Move aus der FrmShell
1950 SdrObject* CloneSdrObj( const SdrObject&, sal_Bool bMoveWithinDoc = sal_False,
1951 sal_Bool bInsInPage = sal_True );
1954 // -------------------- FeShell - Schnittstellen Ende ------------------
1957 // Schnittstelle fuer die TextInputDaten - ( fuer die Texteingabe
1958 // von japanischen/chinesischen Zeichen)
1959 SwExtTextInput* CreateExtTextInput( const SwPaM& rPam );
1960 void DeleteExtTextInput( SwExtTextInput* pDel );
1961 SwExtTextInput* GetExtTextInput( const SwNode& rNd,
1962 xub_StrLen nCntntPos = STRING_NOTFOUND) const;
1963 SwExtTextInput* GetExtTextInput() const;
1965 // Schnistelle fuer den Zugriff auf die AutoComplete-Liste
1966 static SwAutoCompleteWord& GetAutoCompleteWords() { return *pACmpltWords; }
1968 bool ContainsMSVBasic() const { return mbContains_MSVBasic; }
1969 void SetContainsMSVBasic( bool bFlag ) { mbContains_MSVBasic = bFlag; }
1971 // Interface for the list of Ruby - texts/attributes
1972 USHORT FillRubyList( const SwPaM& rPam, SwRubyList& rList,
1973 USHORT nMode );
1974 USHORT SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
1975 USHORT nMode );
1977 void ReadLayoutCache( SvStream& rStream );
1978 void WriteLayoutCache( SvStream& rStream );
1979 SwLayoutCache* GetLayoutCache() const { return pLayoutCache; }
1981 /** Checks if any of the text node contains hidden characters.
1982 Used for optimization. Changing the view option 'view hidden text'
1983 has to trigger a reformatting only if some of the text is hidden.
1985 bool ContainsHiddenChars() const;
1987 // call back for API wrapper
1988 SwModify* GetUnoCallBack() const;
1990 IGrammarContact* getGrammarContact() const { return mpGrammarContact; }
1992 // -> #i27615#
1993 /** Marks/Unmarks a list level of a certain list
1995 OD 2008-04-02 #refactorlists#
1996 levels of a certain lists are marked now
1998 @param sListId list Id of the list whose level has to be marked/unmarked
1999 @param nListLevel level to mark
2000 @param bValue - TRUE mark the level
2001 - FALSE unmark the level
2003 void MarkListLevel( const String& sListId,
2004 const int nListLevel,
2005 const BOOL bValue );
2007 /** Marks/Unmarks a list level of a certain list
2009 OD 2008-04-02 #refactorlists#
2010 levels of a certain lists are marked now
2012 @param rList list whose level has to be marked/unmarked
2013 @param nListLevel level to mark
2014 @param bValue - TRUE mark the level
2015 - FALSE unmark the level
2017 void MarkListLevel( SwList& rList,
2018 const int nListLevel,
2019 const BOOL bValue );
2020 // <- #i27615#
2022 // Change a format undoable.
2023 void ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet);
2025 void RenameFmt(SwFmt & rFmt, const String & sNewName,
2026 BOOL bBroadcast = FALSE);
2028 // Change a TOX undoable.
2029 void ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew);
2031 // #111827#
2033 Returns a textual description of a PaM.
2035 @param rPaM the PaM to describe
2037 If rPaM only spans one paragraph the result is:
2039 '<text in the PaM>'
2041 <text in the PaM> is shortened to nUndoStringLength characters.
2043 If rPaM spans more than one paragraph the result is:
2045 paragraphs (STR_PARAGRAPHS)
2047 @return the textual description of rPaM
2049 String GetPaMDescr(const SwPaM & rPaM) const;
2051 // -> #i23726#
2052 BOOL IsFirstOfNumRule(SwPosition & rPos);
2053 // <- #i23726#
2055 // --> #i31958# access methods for XForms model(s)
2057 /// access container for XForms model; will be NULL if !isXForms()
2058 com::sun::star::uno::Reference<com::sun::star::container::XNameContainer>
2059 getXForms() const;
2061 com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > GetGCIterator() const;
2063 /// is this an XForms document?
2064 bool isXForms() const;
2066 /// initialize XForms models; turn this into an XForms document
2067 void initXForms( bool bCreateDefaultModel );
2068 // <-- #i31958# access methods for XForms model(s)
2070 // --> OD 2006-03-21 #b6375613#
2071 inline bool ApplyWorkaroundForB6375613() const
2073 return mbApplyWorkaroundForB6375613;
2075 void SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 );
2076 // <--
2078 //Update all the page masters
2079 void SetDefaultPageMode(bool bSquaredPageMode);
2080 sal_Bool IsSquaredPageMode() const;
2082 // i#78591#
2083 void Setn32DummyCompatabilityOptions1( sal_uInt32 CompatabilityOptions1 )
2085 n32DummyCompatabilityOptions1 = CompatabilityOptions1;
2087 sal_uInt32 Getn32DummyCompatabilityOptions1( )
2089 return n32DummyCompatabilityOptions1;
2091 void Setn32DummyCompatabilityOptions2( sal_uInt32 CompatabilityOptions2 )
2093 n32DummyCompatabilityOptions2 = CompatabilityOptions2;
2095 sal_uInt32 Getn32DummyCompatabilityOptions2( )
2097 return n32DummyCompatabilityOptions2;
2099 void SetVBATemplateToProjectCache( com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xCache ) { m_xTemplateToProjectCache = xCache; };
2100 com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > GetVBATemplateToProjectCache() { return m_xTemplateToProjectCache; };
2102 ::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
2103 SwDoc* CreateCopy() const;
2107 // Diese Methode wird im Dtor vom SwDoc gerufen und loescht den Cache
2108 // der Konturobjekte
2109 void ClrContourCache();
2112 //------------------ inline impl. ---------------------------------
2114 inline const SwTableNode* SwDoc::IsIdxInTbl( const SwNodeIndex& rIdx ) const
2116 return ((SwDoc*)this)->IsIdxInTbl( rIdx );
2119 inline SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate )
2121 if( bCreate && !pNumberFormatter )
2122 _CreateNumberFormatter();
2123 return pNumberFormatter;
2126 inline const SvNumberFormatter* SwDoc::GetNumberFormatter( sal_Bool bCreate ) const
2128 return ((SwDoc*)this)->GetNumberFormatter( bCreate );
2131 inline void SwDoc::SetOLEPrtNotifyPending( bool bSet )
2133 mbOLEPrtNotifyPending = bSet;
2134 if( !bSet )
2135 mbAllOLENotify = sal_False;
2138 // --> OD 2006-03-14 #i62875#
2139 // namespace <docfunc> for functions and procedures working on a Writer document.
2140 namespace docfunc
2142 /** method to check, if given Writer document contains at least one drawing object
2144 OD 2006-03-17 #i62875#
2146 @author OD
2148 @param p_rDoc
2149 input parameter - reference to the Writer document, which is investigated.
2151 bool ExistsDrawObjs( SwDoc& p_rDoc );
2153 /** method to check, if given Writer document contains only drawing objects,
2154 which are completely on its page.
2156 OD 2006-03-17 #i62875#
2158 @author OD
2160 @param p_rDoc
2161 input parameter - reference to the Writer document, which is investigated.
2163 bool AllDrawObjsOnPage( SwDoc& p_rDoc );
2165 /** method to check, if the outline style has to written as a normal list style
2167 OD 2006-09-27 #i69627#
2168 The outline style has to written as a normal list style, if a parent
2169 paragraph style of one of the paragraph styles, which are assigned to
2170 the list levels of the outline style, has a list style set or inherits
2171 a list style from its parent paragraphs style.
2172 This information is needed for the OpenDocument file format export.
2174 @author OD
2176 @param rDoc
2177 input parameter - reference to the text document, which is investigated.
2179 @return boolean
2180 indicating, if the outline style has to written as a normal list style
2182 bool HasOutlineStyleToBeWrittenAsNormalListStyle( SwDoc& rDoc );
2184 // <--
2185 #endif //_DOC_HXX