merge the formfield patch from ooo-build
[ooovba.git] / sw / inc / ndtxt.hxx
blobe124aeb3bd1d4d26261338cec9092352f9aa5992
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: ndtxt.hxx,v $
10 * $Revision: 1.61 $
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 _NDTXT_HXX
31 #define _NDTXT_HXX
33 #include "swdllapi.h"
34 #include <error.h>
35 #include <node.hxx>
36 #include <hintids.hxx>
37 #include <ndhints.hxx>
38 #include <errhdl.hxx>
39 #include <modeltoviewhelper.hxx>
40 #include <SwNumberTreeTypes.hxx>
41 #include <IDocumentContentOperations.hxx>
43 #include <sfx2/Metadatable.hxx>
45 #include <vector>
46 #include <set>
49 class SwNumRule;
50 class SwNodeNum;
51 // --> OD 2008-05-06 #refactorlists#
52 class SwList;
53 // <--
54 // --> OD 2008-12-02 #i96772#
55 class SvxLRSpaceItem;
56 // <--
58 namespace utl {
59 class TransliterationWrapper;
62 class SwTxtFmtColl;
63 class SwCntntFrm;
64 class SwTxtFld; // Fuer GetTxtFld()
65 class SfxItemSet;
66 class SwUndoTransliterate;
69 struct SwSpellArgs; // for Spell(), splargs.hxx
70 struct SwConversionArgs; // for Convert(), splargs.hxx
71 class SwInterHyphInfo; // for Hyphenate(), splargs.hxx
72 class SwWrongList; // fuer OnlineSpelling
73 class SwGrammarMarkUp;
74 class OutputDevice;
75 class SwScriptInfo;
76 struct SwDocStat;
77 struct SwParaIdleData_Impl;
79 namespace com { namespace sun { namespace star { namespace uno {
80 template < class > class Sequence;
81 }}}}
83 typedef std::set< xub_StrLen > SwSoftPageBreakList;
85 // --------------------
86 // SwTxtNode
87 // --------------------
88 class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
91 // fuer das Erzeugen des ersten TextNode
92 friend class SwDoc; // CTOR und AppendTxtNode()
93 friend class SwNodes;
94 friend class SwTxtFrm;
95 friend class SwScriptInfo;
97 //Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen.
98 //Also niemals direkt zugreifen!
99 SwpHints *m_pSwpHints;
101 // --> OD 2005-11-02 #i51089 - TUNING#
102 mutable SwNodeNum* mpNodeNum; // Numerierung fuer diesen Absatz
103 // <--
104 XubString m_Text;
106 SwParaIdleData_Impl* m_pParaIdleData_Impl;
108 // Some of the chars this para are hidden. Paragraph has to be reformatted
109 // on changing the view to print preview.
110 mutable bool m_bContainsHiddenChars : 1;
111 // The whole paragraph is hidden because of the hidden text attribute
112 mutable bool m_bHiddenCharsHidePara : 1;
113 // The last two flags have to be recalculated if this flag is set:
114 mutable bool m_bRecalcHiddenCharFlags : 1;
116 mutable bool m_bLastOutlineState : 1;
117 bool m_bNotifiable;
119 // BYTE nOutlineLevel; //#outline level, removed by zhaojianwei.
120 // --> OD 2008-11-19 #i70748#
121 bool mbEmptyListStyleSetDueToSetOutlineLevelAttr;
122 // <--
124 // --> OD 2008-03-27 #refactorlists#
125 // boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or
126 // <ResetAllAttr(..)> method is running.
127 // Needed to avoid duplicate handling of attribute change actions.
128 bool mbInSetOrResetAttr;
129 // <--
130 // --> OD 2008-05-06 #refactorlists#
131 // pointer to the list, to whose the text node is added to
132 SwList* mpList;
133 // <--
136 SW_DLLPRIVATE SwTxtNode( const SwNodeIndex &rWhere, SwTxtFmtColl *pTxtColl,
137 const SfxItemSet* pAutoAttr = 0 );
139 // Kopiert die Attribute an nStart nach pDest.
140 SW_DLLPRIVATE void CopyAttr( SwTxtNode *pDest, const xub_StrLen nStart, const xub_StrLen nOldPos);
142 SW_DLLPRIVATE SwTxtNode* _MakeNewTxtNode( const SwNodeIndex&, BOOL bNext = TRUE,
143 BOOL bChgFollow = TRUE );
145 SW_DLLPRIVATE void CutImpl(
146 SwTxtNode * const pDest, const SwIndex & rDestStart,
147 const SwIndex & rStart, /*const*/ xub_StrLen nLen,
148 const bool bUpdate = true );
150 // Verlagere alles umfassende harte Attribute in den AttrSet des Absatzes
151 SW_DLLPRIVATE void MoveTxtAttr_To_AttrSet(); // wird von SplitNode gerufen.
153 // lege den spz. AttrSet an
154 SW_DLLPRIVATE virtual void NewAttrSet( SwAttrPool& );
156 SW_DLLPRIVATE void Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
157 xub_StrLen nEndPos, BOOL bExpandFlds ) const;
159 // Optimization: Asking for information about hidden characters at SwScriptInfo
160 // updates these flags.
161 inline bool IsCalcHiddenCharFlags() const
162 { return m_bRecalcHiddenCharFlags; }
163 inline void SetHiddenCharAttribute( bool bNewHiddenCharsHidePara, bool bNewContainsHiddenChars ) const
165 m_bHiddenCharsHidePara = bNewHiddenCharsHidePara;
166 m_bContainsHiddenChars = bNewContainsHiddenChars;
167 m_bRecalcHiddenCharFlags = false;
170 SW_DLLPRIVATE void CalcHiddenCharFlags() const;
172 SW_DLLPRIVATE SwNumRule * _GetNumRule(BOOL bInParent = TRUE) const;
174 SW_DLLPRIVATE void SetLanguageAndFont( const SwPaM &rPaM,
175 LanguageType nLang, USHORT nLangWhichId,
176 const Font *pFont, USHORT nFontWhichId );
179 // Start: Data collected during idle time
181 SW_DLLPRIVATE void SetParaNumberOfWords( ULONG nTmpWords ) const;
182 SW_DLLPRIVATE ULONG GetParaNumberOfWords() const;
183 SW_DLLPRIVATE void SetParaNumberOfChars( ULONG nTmpChars ) const;
184 SW_DLLPRIVATE ULONG GetParaNumberOfChars() const;
185 SW_DLLPRIVATE void InitSwParaStatistics( bool bNew );
187 /** create number for this text node, if not already existing
189 OD 2005-11-02 #i51089 - TUNING#
190 OD 2007-10-26 #i83479# - made private
192 @return number of this node
194 SwNodeNum* CreateNum() const;
196 inline void TryDeleteSwpHints();
198 public:
199 bool IsWordCountDirty() const;
200 bool IsWrongDirty() const;
201 bool IsGrammarCheckDirty() const;
202 bool IsSmartTagDirty() const; // SMARTTAGS
203 bool IsAutoCompleteWordDirty() const;
204 void SetWordCountDirty( bool bNew ) const;
205 void SetWrongDirty( bool bNew ) const;
206 void SetGrammarCheckDirty( bool bNew ) const;
207 void SetSmartTagDirty( bool bNew ) const; // SMARTTAGS
208 void SetAutoCompleteWordDirty( bool bNew ) const;
209 void SetWrong( SwWrongList* pNew, bool bDelete = true );
210 SwWrongList* GetWrong();
211 // --> OD 2008-05-23 #i71360#
212 const SwWrongList* GetWrong() const;
213 // <--
214 void SetGrammarCheck( SwGrammarMarkUp* pNew, bool bDelete = true );
215 SwGrammarMarkUp* GetGrammarCheck();
216 // SMARTTAGS
217 void SetSmartTags( SwWrongList* pNew, bool bDelete = true );
218 SwWrongList* GetSmartTags();
221 // End: Data collected during idle time
224 public:
225 using SwCntntNode::GetAttr;
227 const String& GetTxt() const { return m_Text; }
229 // getters for SwpHints
230 inline SwpHints &GetSwpHints();
231 inline const SwpHints &GetSwpHints() const;
232 inline SwpHints *GetpSwpHints() { return m_pSwpHints; }
233 inline const SwpHints *GetpSwpHints() const { return m_pSwpHints; }
234 inline bool HasHints() const { return m_pSwpHints ? true : false; }
235 inline SwpHints &GetOrCreateSwpHints();
237 virtual ~SwTxtNode();
239 virtual xub_StrLen Len() const;
241 // steht in itratr
242 void GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax, ULONG &rAbs,
243 OutputDevice* pOut = 0 ) const;
245 // --> OD 2008-03-13 #refactorlists#
246 // overriding to handle change of certain paragraph attributes
247 virtual BOOL SetAttr( const SfxPoolItem& );
248 virtual BOOL SetAttr( const SfxItemSet& rSet );
249 virtual BOOL ResetAttr( USHORT nWhich1, USHORT nWhich2 = 0 );
250 virtual BOOL ResetAttr( const SvUShorts& rWhichArr );
251 virtual USHORT ResetAllAttr();
252 // <--
254 /// insert text content
255 void InsertText( const XubString & rStr, const SwIndex & rIdx,
256 const enum IDocumentContentOperations::InsertFlags nMode
257 = IDocumentContentOperations::INS_DEFAULT );
259 /** delete text content
260 ATTENTION: must not be called with a range that overlaps the start of
261 an attribute with both extent and dummy char
263 void EraseText ( const SwIndex &rIdx, const xub_StrLen nCount = STRING_LEN,
264 const enum IDocumentContentOperations::InsertFlags nMode
265 = IDocumentContentOperations::INS_DEFAULT );
267 /** delete all attributes.
268 If neither pSet nor nWhich is given, delete all attributes (except
269 refmarks, toxmarks, meta) in range.
270 @param rIdx start position
271 @param nLen range in which attributes will be deleted
272 @param pSet if not 0, delete only attributes contained in pSet
273 @param nWhich if not 0, delete only attributes with matching which
274 @param bInclRefToxMark
275 refmarks, toxmarks, and metas will be ignored unless this is true
276 ATTENTION: setting bInclRefToxMark is only allowed from UNDO!
278 void RstAttr( const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich = 0,
279 const SfxItemSet* pSet = 0, BOOL bInclRefToxMark = FALSE );
280 void GCAttr();
282 // loesche das Text-Attribut (muss beim Pool abgemeldet werden!)
283 void DestroyAttr( SwTxtAttr* pAttr );
285 // loesche alle Attribute aus dem SwpHintsArray.
286 void ClearSwpHintsArr( bool bDelFields );
288 /// Insert pAttr into hints array. @return true iff inserted successfully
289 bool InsertHint( SwTxtAttr * const pAttr,
290 const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
291 /// create new text attribute from rAttr and insert it
292 /// @return inserted hint; 0 if not sure the hint is inserted
293 SwTxtAttr* InsertItem( SfxPoolItem& rAttr,
294 const xub_StrLen nStart, const xub_StrLen nEnd,
295 const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
297 // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
298 // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
299 BOOL SetAttr( const SfxItemSet& rSet,
300 xub_StrLen nStt, xub_StrLen nEnd,
301 const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
302 // erfrage die Attribute vom TextNode ueber den Bereich
303 // --> OD 2008-01-16 #newlistlevelattrs#
304 // Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
305 // If <bMergeIndentValuesOfNumRule> == TRUE, the indent attributes of
306 // the corresponding list level of an applied list style is merged into
307 // the requested item set as a LR-SPACE item, if <bOnlyTxtAttr> == FALSE,
308 // corresponding node has not its own indent attributes and the
309 // position-and-space mode of the list level is SvxNumberFormat::LABEL_ALIGNMENT.
310 BOOL GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
311 BOOL bOnlyTxtAttr = FALSE,
312 BOOL bGetFromChrFmt = TRUE,
313 const bool bMergeIndentValuesOfNumRule = false ) const;
314 // <--
316 // uebertrage Attribute eines AttrSets ( AutoFmt ) in das SwpHintsArray
317 void FmtToTxtAttr( SwTxtNode* pNd );
319 /// delete all attributes of type nWhich at nStart (opt. end nEnd)
320 void DeleteAttributes( const USHORT nWhich,
321 const xub_StrLen nStart, const xub_StrLen nEnd = 0 );
322 /// delete the attribute pTxtAttr
323 void DeleteAttribute ( SwTxtAttr * const pTxtAttr );
325 // Aktionen auf Text und Attributen
326 // --> OD 2008-11-18 #i96213#
327 // introduce optional parameter to control, if all attributes have to be copied.
328 void CopyText( SwTxtNode * const pDest,
329 const SwIndex &rStart,
330 const xub_StrLen nLen,
331 const bool bForceCopyOfAllAttrs = false );
332 void CopyText( SwTxtNode * const pDest,
333 const SwIndex &rDestStart,
334 const SwIndex &rStart,
335 xub_StrLen nLen,
336 const bool bForceCopyOfAllAttrs = false );
337 // <--
339 void CutText(SwTxtNode * const pDest,
340 const SwIndex & rStart, const xub_StrLen nLen);
341 inline void CutText(SwTxtNode * const pDest, const SwIndex &rDestStart,
342 const SwIndex & rStart, const xub_StrLen nLen);
344 /// replace nDelLen characters at rStart with rText
345 void ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
346 const XubString& rText );
347 void ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen, const XubString& rText,
348 const ::com::sun::star::uno::Sequence<sal_Int32>& rOffsets );
350 // virtuelle Methoden aus dem CntntNode
351 virtual SwCntntFrm *MakeFrm();
352 virtual SwCntntNode *SplitCntntNode( const SwPosition & );
353 virtual SwCntntNode *JoinNext();
354 virtual SwCntntNode *JoinPrev();
356 SwCntntNode *AppendNode( const SwPosition & );
358 // setze ggf. das DontExpand-Flag an INet bzw. Zeichenvorlagen
359 BOOL DontExpandFmt( const SwIndex& rIdx, bool bFlag = true,
360 BOOL bFmtToTxtAttributes = TRUE );
362 // gebe das vorgegebene Attribut, welches an der TextPosition (rIdx)
363 // gesetzt ist zurueck. Gibt es keines, returne 0-Pointer
364 // gesetzt heisst: Start <= rIdx < End
365 // FIXME: this function does not seem to be well-defined for those
366 // hints of which several may cover a single position, like TOXMark,
367 // or CharFmt
368 SwTxtAttr *GetTxtAttr( const SwIndex& rIdx, USHORT nWhichHt,
369 BOOL bExpand = FALSE ) const;
371 /** get the text attribute at position nIndex which owns
372 the dummy character CH_TXTATR_* at that position, if one exists.
373 @param nIndex the position in the text
374 @param nWhich if different from RES_TXTATR_END, return only
375 attribute with given which id
376 @return the text attribute at nIndex of type nWhich, if it exists
378 SwTxtAttr *GetTxtAttrForCharAt( const xub_StrLen nIndex,
379 const RES_TXTATR nWhich = RES_TXTATR_END ) const;
381 // Aktuelles Wort zurueckliefern
382 XubString GetCurWord(xub_StrLen) const;
383 USHORT Spell(SwSpellArgs*);
384 USHORT Convert( SwConversionArgs & );
386 inline SwTxtFmtColl *GetTxtColl() const;
387 virtual SwFmtColl *ChgFmtColl( SwFmtColl* );
388 void _ChgTxtCollUpdateNum( const SwTxtFmtColl* pOld,
389 const SwTxtFmtColl* pNew );
391 // kopiere die Collection mit allen Autoformaten zum Dest-Node
392 // dieser kann auch in einem anderen Dokument stehen!
393 // (Methode steht im ndcopy.cxx!!)
394 void CopyCollFmt( SwTxtNode& rDestNd );
396 //const SwNodeNum* _GetNodeNum() const { return pNdNum; }
399 // BEGIN OF BULLET/NUMBERING/OUTLINE STUFF:
403 Returns numbering rule of this text node.
405 @param bInParent serach in parent attributes, too
407 @return numbering rule of this text node or NULL if none is set
409 SwNumRule *GetNumRule(BOOL bInParent = TRUE) const;
411 inline const SwNodeNum* GetNum() const
413 return mpNodeNum;
416 SwNumberTree::tNumberVector GetNumberVector() const;
419 Returns if this text node is an outline.
421 @retval true this text node is an outline
422 @retval false else
424 bool IsOutline() const;
426 bool IsOutlineStateChanged() const;
428 void UpdateOutlineState();
430 /** -> #i23730#
432 Returns if this text node may be numbered.
434 A text node may be numbered if
435 - it has no SwNodeNum
436 - it has a SwNodeNum and it has a numbering rule and the according
437 SwNumFmt defines a numbering type that is an enumeration.
439 @retval TRUE this text node may be numbered
440 @retval FALSE else
442 //BOOL MayBeNumbered() const;
445 Notify this textnode that its numbering rule has changed.
447 void NumRuleChgd();
449 /** Returns outline of numbering string
451 OD 2005-11-17 #128041#
452 Introduce parameter <_bInclPrefixAndSuffixStrings> in order to control,
453 if the prefix and the suffix strings have to been included or not.
455 @param _bInclPrefixAndSuffixStrings
456 optional input parameter - boolean indicating, if the prefix and the
457 suffix strings have to been included or not. default value = <true>
459 @param _nRestrictToThisLevel
460 optional input parameter - unsigned integer indicating the maximum outline
461 level to which the output string must be restricted to. Default value is
462 MAXLEVEL
464 XubString GetNumString( const bool _bInclPrefixAndSuffixStrings = true, const unsigned int _nRestrictToThisLevel = MAXLEVEL ) const;
467 Returns the additional indents of this text node and its numbering.
469 @param bTxtLeft ???
471 @return additional indents
473 long GetLeftMarginWithNum( BOOL bTxtLeft = FALSE ) const;
476 Returns the combined first line indent of this text node and
477 its numbering.
479 @param the first line indent of this text node taking the
480 numbering into account (return parameter)
482 @retval TRUE this node has SwNodeNum and has numbering rule
483 @retval FALSE else
485 BOOL GetFirstLineOfsWithNum( short& rFirstOffset ) const;
487 // --> OD 2008-12-02 #i96772#
488 void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const;
489 // <--
491 /** return left margin for tab stop position calculation
493 OD 2008-06-30 #i91133#
494 Needed for text formatting
495 Method considers new list level attributes, which also can provide a left margin value
497 @author OD
499 long GetLeftMarginForTabCalculation() const;
501 /** -> #i29560
502 Returns if this text node has a number.
504 This text node has a number if it has a SwNodeNum and a
505 numbering rule and the numbering format specified for the
506 level of the SwNodeNum is of an enumeration type.
508 @retval TRUE This text node has a number.
509 @retval FALSE else
511 BOOL HasNumber() const;
513 /** -> #i29560
514 Returns if this text node has a bullet.
516 This text node has a bullet if it has a SwNodeNum and a
517 numbering rule and the numbering format specified for the
518 level of the SwNodeNum is of a bullet type.
520 @retval TRUE This text node has a bullet.
521 @retval FALSE else
523 BOOL HasBullet() const;
525 /** -> #i27615#
526 Returns is this text node is numbered.
528 This node is numbered if it has a SwNodeNum and it has a
529 numbering rule and has not a hidden SwNodeNum.
531 ATTENTION: Returns TRUE even if the SwNumFmt has type
532 SVX_NUM_NUMBER_NONE.
534 @retval TRUE This node is numbered.
535 @retval FALSE else
537 BOOL IsNumbered() const;
539 /** -> #i27615#
540 Returns if this text node has a marked label.
542 @retval true This text node has a marked label.
543 @retval false else
545 bool HasMarkedLabel() const;
547 /** Sets the list level of this text node.
549 Side effect, when the text node is a list item:
550 The text node's representation in the list tree (<SwNodeNum> instance)
551 is updated.
553 @param nLevel level to set
555 void SetAttrListLevel(int nLevel);
557 bool HasAttrListLevel() const;
559 int GetAttrListLevel() const;
561 /** Returns the actual list level of this text node, when it is a list item
563 @return the actual list level of this text node, if it is a list item,
564 -1 otherwise
566 int GetActualListLevel() const;
569 Returns outline level of this text node.
571 If a text node has an outline number (i.e. it has an SwNodeNum
572 and a outline numbering rule) the outline level is the level of
573 this SwNodeNum.
575 If a text node has no outline number and has a paragraph style
576 attached the outline level is the outline level of the
577 paragraph style.
579 Otherwise the text node has no outline level (NO_NUMBERING).
581 NOTE: The outline level of text nodes is subject to change. The
582 plan is to have an SwTxtNode::nOutlineLevel member that is
583 updated from a paragraph style upon appliance of that paragraph
584 style.
586 @return outline level or NO_NUMBERING if there is no outline level
588 int GetAttrOutlineLevel() const;//#OutlineLevel,added by zhaojianwei
591 Sets the out line level *at* a text node.
593 @param nLevel the level to be set
595 If the text node has an outline number the level is set at the
596 outline number.
598 If the text node has no outline number but has a paragraph
599 style applied the outline level is set at the paragraph style.
601 NOTE: This is subject to change, see GetOutlineLevel.
603 //void SetOutlineLevel(int nLevel);
604 void SetAttrOutlineLevel(int nLevel);//#OutlineLevel,added by zhaojianwei
606 // --> OD 2008-11-19 #i70748#
607 bool IsEmptyListStyleDueToSetOutlineLevelAttr();
608 void SetEmptyListStyleDueToSetOutlineLevelAttr();
609 void ResetEmptyListStyleDueToResetOutlineLevelAttr();
610 // <--
613 Returns the width of leading tabs/blanks in this paragraph.
614 This space will be converted into numbering indent if the paragraph
615 is set to be numbered.
617 @return the width of the leading whitespace
619 USHORT GetWidthOfLeadingTabs() const;
623 Returns if the paragraph has a visible numbering or bullet.
624 This includes all kinds of numbering/bullet/outlines.
625 Note: This function returns false, if the numbering format is
626 SVX_NUM_NUMBER_NONE or if the numbering/bullet has been deleted.
628 @return TRUE if the paragraph has a visible numbering/bullet/outline
630 bool HasVisibleNumberingOrBullet() const;
632 // --> OD 2008-02-19 #refactorlists#
633 void SetListId( const String sListId );
634 String GetListId() const;
635 // <--
637 /** Determines, if the list level indent attributes can be applied to the
638 paragraph.
640 OD 2008-01-17 #newlistlevelattrs#
641 The list level indents can be applied to the paragraph under the one
642 of following conditions:
643 - the list style is directly applied to the paragraph and the paragraph
644 has no own indent attributes.
645 - the list style is applied to the paragraph through one of its paragraph
646 styles, the paragraph has no own indent attributes and on the paragraph
647 style hierarchy from the paragraph to the paragraph style with the
648 list style no indent attributes are found.
650 @author OD
652 @return boolean
654 bool AreListLevelIndentsApplicable() const;
656 /** Retrieves the list tab stop position, if the paragraph's list level defines
657 one and this list tab stop has to merged into the tap stops of the paragraph
659 OD 2008-01-17 #newlistlevelattrs#
661 @author OD
663 @param nListTabStopPosition
664 output parameter - containing the list tab stop position
666 @return boolean - indicating, if a list tab stop position is provided
668 bool GetListTabStopPosition( long& nListTabStopPosition ) const;
670 /** Retrieves the character following the list label, if the paragraph's
671 list level defines one.
673 OD 2008-01-17 #newlistlevelattrs#
675 @author OD
677 @return XubString - the list tab stop position
679 XubString GetLabelFollowedBy() const;
682 // END OF BULLET/NUMBERING/OUTLINE STUFF:
685 void fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const;
687 USHORT GetLang( const xub_StrLen nBegin, const xub_StrLen nLen = 0,
688 USHORT nScript = 0 ) const;
690 // steht in ndcopy.cxx
691 BOOL IsSymbol( const xub_StrLen nBegin ) const; // steht in itratr.cxx
692 virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
694 // interaktive Trennung: wir finden den TxtFrm und rufen sein CalcHyph
695 BOOL Hyphenate( SwInterHyphInfo &rHyphInf );
696 void DelSoftHyph( const xub_StrLen nStart, const xub_StrLen nEnd );
698 // --> OD 2007-11-15 #i83479#
699 // add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating,
700 // when <bWithNum = true> that a space is inserted after the string for
701 // the list label.
702 // add 5th optional parameter <bWithSpacesForLevel> indicating, if additional
703 // spaces are inserted in front of the expanded text string depending on
704 // the list level.
705 XubString GetExpandTxt( const xub_StrLen nIdx = 0,
706 const xub_StrLen nLen = STRING_LEN,
707 const bool bWithNum = false,
708 const bool bAddSpaceAfterListLabelStr = false,
709 const bool bWithSpacesForLevel = false ) const;
710 // <--
711 BOOL GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx = 0,
712 xub_StrLen nIdx = 0, xub_StrLen nLen = STRING_LEN,
713 BOOL bWithNum = FALSE, BOOL bWithFtn = TRUE,
714 BOOL bReplaceTabsWithSpaces = FALSE ) const;
719 const ModelToViewHelper::ConversionMap*
720 BuildConversionMap( rtl::OUString& rExpandText ) const;
722 XubString GetRedlineTxt( xub_StrLen nIdx = 0,
723 xub_StrLen nLen = STRING_LEN,
724 BOOL bExpandFlds = FALSE,
725 BOOL bWithNum = FALSE ) const;
726 //Liefert fuer die Initalfunktion tatsaechliche Anzahl der Initialzeichen
727 //bei nWishLen == 0 die des ersten Wortes
728 USHORT GetDropLen( USHORT nWishLen) const;
730 // Passes back info needed on the dropcap dimensions
731 bool GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescent) const;
733 // Hidden Paragraph Field:
734 inline bool CalcHiddenParaField()
735 { return m_pSwpHints ? m_pSwpHints->CalcHiddenParaField() : false; }
736 // set CalcVisible flags
737 inline void SetCalcHiddenParaField()
738 { if (m_pSwpHints) m_pSwpHints->SetCalcHiddenParaField(); }
740 // is the paragraph visible?
741 inline bool HasHiddenParaField() const
742 { return m_pSwpHints ? m_pSwpHints->HasHiddenParaField() : false; }
745 // Hidden Paragraph Field:
747 inline bool HasHiddenCharAttribute( bool bWholePara ) const
749 if ( m_bRecalcHiddenCharFlags )
750 CalcHiddenCharFlags();
751 return bWholePara ? m_bHiddenCharsHidePara : m_bContainsHiddenChars;
754 inline void SetCalcHiddenCharFlags() const
755 { m_bRecalcHiddenCharFlags = true; }
757 // --> FME 2004-06-08 #i12836# enhanced pdf
759 // Returns if the node is hidden due to
760 // 1. HiddenParaField
761 // 2. HiddenCharAttribute
762 // 3. HiddenSection
764 bool IsHidden() const;
765 // <--
767 TYPEINFO(); // fuer rtti
769 // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
770 virtual void Modify( SfxPoolItem*, SfxPoolItem* );
772 // override SwIndexReg
773 virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
774 const bool bNegative = false, const bool bDelete = false );
776 // change text to Upper/Lower/Hiragana/Katagana/...
777 void TransliterateText( utl::TransliterationWrapper& rTrans,
778 xub_StrLen nStart, xub_StrLen nEnd,
779 SwUndoTransliterate* pUndo = 0 );
781 // count words in given range
782 void CountWords( SwDocStat& rStat, xub_StrLen nStart, xub_StrLen nEnd ) const;
784 // Checks some global conditions like loading or destruction of document
785 // to economize notifications
786 bool IsNotificationEnabled() const;
788 // Checks a temporary notification blocker and the global conditons of IsNotificationEnabled()
789 bool IsNotifiable() const;
791 void SetListRestart( bool bRestart );
792 // --> OD 2005-11-02 #i51089 - TUNING#
793 bool IsListRestart() const;
794 // <--
796 void SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNum );
797 bool HasAttrListRestartValue() const;
798 SwNumberTree::tSwNumTreeNumber GetAttrListRestartValue() const;
799 SwNumberTree::tSwNumTreeNumber GetActualListStartValue() const;
801 void SetCountedInList( bool bCounted );
802 bool IsCountedInList() const;
804 // --> OD 2008-03-13 #refactorlists#
805 // void SyncNumberAndNumRule();
806 // void UnregisterNumber();
807 void AddToList();
808 void RemoveFromList();
809 bool IsInList() const;
810 // <--
812 bool IsFirstOfNumRule() const;
814 USHORT GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) const;
816 // sfx2::Metadatable
817 virtual ::sfx2::IXmlIdRegistry& GetRegistry();
818 virtual bool IsInClipboard() const;
819 virtual bool IsInUndo() const;
820 virtual bool IsInContent() const;
821 virtual ::com::sun::star::uno::Reference<
822 ::com::sun::star::rdf::XMetadatable > MakeUnoObject();
824 bool IsCollapse() const;
826 DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode)
829 //-----------------------------------------------------------------------------
831 inline SwpHints & SwTxtNode::GetSwpHints()
833 ASSERT_ID( m_pSwpHints, ERR_NOHINTS);
834 return *m_pSwpHints;
836 inline const SwpHints &SwTxtNode::GetSwpHints() const
838 ASSERT_ID( m_pSwpHints, ERR_NOHINTS);
839 return *m_pSwpHints;
842 inline SwpHints& SwTxtNode::GetOrCreateSwpHints()
844 if ( !m_pSwpHints )
846 m_pSwpHints = new SwpHints;
848 return *m_pSwpHints;
851 inline void SwTxtNode::TryDeleteSwpHints()
853 if ( m_pSwpHints && m_pSwpHints->CanBeDeleted() )
855 DELETEZ( m_pSwpHints );
859 inline SwTxtFmtColl* SwTxtNode::GetTxtColl() const
861 return static_cast<SwTxtFmtColl*>(const_cast<SwModify*>(GetRegisteredIn()));
864 // fuer den IBM-Compiler nicht inlinen wg. 42876
865 #ifndef ICC
866 // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
867 inline SwTxtNode *SwNode::GetTxtNode()
869 return ND_TEXTNODE == nNodeType ? static_cast<SwTxtNode*>(this) : 0;
871 inline const SwTxtNode *SwNode::GetTxtNode() const
873 return ND_TEXTNODE == nNodeType ? static_cast<const SwTxtNode*>(this) : 0;
875 #endif
877 inline void
878 SwTxtNode::CutText(SwTxtNode * const pDest, const SwIndex & rDestStart,
879 const SwIndex & rStart, const xub_StrLen nLen)
881 CutImpl( pDest, rDestStart, rStart, nLen, true );
884 #endif