xref: /trunk/main/sw/inc/ndtxt.hxx (revision 69a743679e823ad8f875be547552acb607b8ada5)
11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51d2dbeb0SAndrew Rist  * distributed with this work for additional information
61d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
131d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
171d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef SW_NDTXT_HXX
24cdf0e10cSrcweir #define SW_NDTXT_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <cppuhelper/weakref.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "swdllapi.h"
29cdf0e10cSrcweir #include <error.h>
30cdf0e10cSrcweir #include <node.hxx>
31cdf0e10cSrcweir #include <hintids.hxx>
32cdf0e10cSrcweir #include <ndhints.hxx>
33cdf0e10cSrcweir #include <errhdl.hxx>
34cdf0e10cSrcweir #include <modeltoviewhelper.hxx>
35cdf0e10cSrcweir #include <SwNumberTreeTypes.hxx>
36cdf0e10cSrcweir #include <IDocumentContentOperations.hxx>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #include <sfx2/Metadatable.hxx>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <vector>
41cdf0e10cSrcweir #include <set>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class SfxHint;
44cdf0e10cSrcweir class SwNumRule;
45cdf0e10cSrcweir class SwNodeNum;
46cdf0e10cSrcweir class SwList;
47cdf0e10cSrcweir class SvxLRSpaceItem;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir namespace utl {
50cdf0e10cSrcweir     class TransliterationWrapper;
51cdf0e10cSrcweir }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir class SwTxtFmtColl;
54cdf0e10cSrcweir class SwCntntFrm;
55*69a74367SOliver-Rainer Wittmann class SwTxtFld;
56*69a74367SOliver-Rainer Wittmann class SwTxtInputFld;
57cdf0e10cSrcweir class SfxItemSet;
58cdf0e10cSrcweir class SwUndoTransliterate;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 
61cdf0e10cSrcweir struct SwSpellArgs;             // for Spell(), splargs.hxx
62cdf0e10cSrcweir struct SwConversionArgs;        // for Convert(), splargs.hxx
63cdf0e10cSrcweir class SwInterHyphInfo;          // for Hyphenate(), splargs.hxx
64cdf0e10cSrcweir class SwWrongList;      // fuer OnlineSpelling
65cdf0e10cSrcweir class SwGrammarMarkUp;
66cdf0e10cSrcweir class OutputDevice;
67cdf0e10cSrcweir class SwScriptInfo;
68cdf0e10cSrcweir struct SwDocStat;
69cdf0e10cSrcweir struct SwParaIdleData_Impl;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir namespace com { namespace sun { namespace star {
72cdf0e10cSrcweir     namespace uno {
73cdf0e10cSrcweir         template < class > class Sequence;
74cdf0e10cSrcweir     }
75cdf0e10cSrcweir     namespace text { class XTextContent; }
76cdf0e10cSrcweir } } }
77cdf0e10cSrcweir 
78cdf0e10cSrcweir typedef std::set< xub_StrLen > SwSoftPageBreakList;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir // --------------------
81cdf0e10cSrcweir // SwTxtNode
82cdf0e10cSrcweir // --------------------
83cdf0e10cSrcweir class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
84cdf0e10cSrcweir {
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     // fuer das Erzeugen des ersten TextNode
87cdf0e10cSrcweir     friend class SwDoc;         // CTOR und AppendTxtNode()
88cdf0e10cSrcweir     friend class SwNodes;
89cdf0e10cSrcweir     friend class SwTxtFrm;
90cdf0e10cSrcweir     friend class SwScriptInfo;
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     //Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen.
93cdf0e10cSrcweir     //Also niemals direkt zugreifen!
94cdf0e10cSrcweir     SwpHints    *m_pSwpHints;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     mutable SwNodeNum* mpNodeNum;  // Numerierung fuer diesen Absatz
97cdf0e10cSrcweir     XubString   m_Text;
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     SwParaIdleData_Impl* m_pParaIdleData_Impl;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     // Some of the chars this para are hidden. Paragraph has to be reformatted
102cdf0e10cSrcweir     // on changing the view to print preview.
103cdf0e10cSrcweir     mutable bool m_bContainsHiddenChars : 1;
104cdf0e10cSrcweir     // The whole paragraph is hidden because of the hidden text attribute
105cdf0e10cSrcweir     mutable bool m_bHiddenCharsHidePara : 1;
106cdf0e10cSrcweir     // The last two flags have to be recalculated if this flag is set:
107cdf0e10cSrcweir     mutable bool m_bRecalcHiddenCharFlags : 1;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir     mutable bool m_bLastOutlineState : 1;
110cdf0e10cSrcweir     bool m_bNotifiable;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     // sal_uInt8 nOutlineLevel; //#outline level, removed by zhaojianwei.
113cdf0e10cSrcweir 
114*69a74367SOliver-Rainer Wittmann     bool mbEmptyListStyleSetDueToSetOutlineLevelAttr;
115*69a74367SOliver-Rainer Wittmann 
116cdf0e10cSrcweir     // boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or
117cdf0e10cSrcweir     // <ResetAllAttr(..)> method is running.
118cdf0e10cSrcweir     // Needed to avoid duplicate handling of attribute change actions.
119cdf0e10cSrcweir     bool mbInSetOrResetAttr;
120cdf0e10cSrcweir     // pointer to the list, to whose the text node is added to
121cdf0e10cSrcweir     SwList* mpList;
122cdf0e10cSrcweir     /// #i111677# cached expansion (for clipboard)
123cdf0e10cSrcweir     ::std::auto_ptr< ::rtl::OUString > m_pNumStringCache;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     ::com::sun::star::uno::WeakReference<
126cdf0e10cSrcweir         ::com::sun::star::text::XTextContent> m_wXParagraph;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     SW_DLLPRIVATE SwTxtNode( const SwNodeIndex &rWhere, SwTxtFmtColl *pTxtColl,
129cdf0e10cSrcweir                              const SfxItemSet* pAutoAttr = 0 );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     // Kopiert die Attribute an nStart nach pDest.
132cdf0e10cSrcweir     SW_DLLPRIVATE void CopyAttr( SwTxtNode *pDest, const xub_StrLen nStart, const xub_StrLen nOldPos);
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     SW_DLLPRIVATE SwTxtNode* _MakeNewTxtNode( const SwNodeIndex&, sal_Bool bNext = sal_True,
135cdf0e10cSrcweir                                 sal_Bool bChgFollow = sal_True );
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     SW_DLLPRIVATE void CutImpl(
138cdf0e10cSrcweir           SwTxtNode * const pDest, const SwIndex & rDestStart,
139cdf0e10cSrcweir           const SwIndex & rStart, /*const*/ xub_StrLen nLen,
140cdf0e10cSrcweir           const bool bUpdate = true );
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     // Verlagere alles umfassende harte Attribute in den AttrSet des Absatzes
143cdf0e10cSrcweir     SW_DLLPRIVATE void MoveTxtAttr_To_AttrSet();  // wird von SplitNode gerufen.
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     // lege den spz. AttrSet an
146cdf0e10cSrcweir     SW_DLLPRIVATE virtual void NewAttrSet( SwAttrPool& );
147cdf0e10cSrcweir 
148cdf0e10cSrcweir     SW_DLLPRIVATE void Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
149cdf0e10cSrcweir                         xub_StrLen nEndPos, sal_Bool bExpandFlds ) const;
150cdf0e10cSrcweir 
151cdf0e10cSrcweir     // Optimization: Asking for information about hidden characters at SwScriptInfo
152cdf0e10cSrcweir     // updates these flags.
153cdf0e10cSrcweir     inline bool IsCalcHiddenCharFlags() const
154cdf0e10cSrcweir         { return m_bRecalcHiddenCharFlags; }
155cdf0e10cSrcweir     inline void SetHiddenCharAttribute( bool bNewHiddenCharsHidePara, bool bNewContainsHiddenChars ) const
156cdf0e10cSrcweir     {
157cdf0e10cSrcweir         m_bHiddenCharsHidePara = bNewHiddenCharsHidePara;
158cdf0e10cSrcweir         m_bContainsHiddenChars = bNewContainsHiddenChars;
159cdf0e10cSrcweir         m_bRecalcHiddenCharFlags = false;
160cdf0e10cSrcweir     }
161cdf0e10cSrcweir 
162cdf0e10cSrcweir     SW_DLLPRIVATE void CalcHiddenCharFlags() const;
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     SW_DLLPRIVATE SwNumRule * _GetNumRule(sal_Bool bInParent = sal_True) const;
165cdf0e10cSrcweir 
166cdf0e10cSrcweir     SW_DLLPRIVATE void SetLanguageAndFont( const SwPaM &rPaM,
167cdf0e10cSrcweir             LanguageType nLang, sal_uInt16 nLangWhichId,
168cdf0e10cSrcweir             const Font *pFont,  sal_uInt16 nFontWhichId );
169cdf0e10cSrcweir 
170cdf0e10cSrcweir     //
171cdf0e10cSrcweir     // Start: Data collected during idle time
172cdf0e10cSrcweir     //
173cdf0e10cSrcweir     SW_DLLPRIVATE void SetParaNumberOfWords( sal_uLong nTmpWords ) const;
174cdf0e10cSrcweir     SW_DLLPRIVATE sal_uLong GetParaNumberOfWords() const;
175cdf0e10cSrcweir     SW_DLLPRIVATE void SetParaNumberOfChars( sal_uLong nTmpChars ) const;
176cdf0e10cSrcweir     SW_DLLPRIVATE sal_uLong GetParaNumberOfChars() const;
177cdf0e10cSrcweir     SW_DLLPRIVATE void InitSwParaStatistics( bool bNew );
178cdf0e10cSrcweir 
179cdf0e10cSrcweir     /** create number for this text node, if not already existing
180cdf0e10cSrcweir 
181cdf0e10cSrcweir         @return number of this node
182cdf0e10cSrcweir     */
183cdf0e10cSrcweir     SwNodeNum* CreateNum() const;
184cdf0e10cSrcweir 
185cdf0e10cSrcweir     inline void TryDeleteSwpHints();
186cdf0e10cSrcweir 
187cdf0e10cSrcweir     SW_DLLPRIVATE void impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet);
188cdf0e10cSrcweir 
189*69a74367SOliver-Rainer Wittmann     const SwTxtInputFld* GetOverlappingInputFld( const SwTxtAttr& rTxtAttr ) const;
190*69a74367SOliver-Rainer Wittmann 
191cdf0e10cSrcweir public:
19291100364SJian Hong Cheng     //Bug 120881:Modify here for Directly Page Numbering
19391100364SJian Hong Cheng     bool HasPageNumberField();
19491100364SJian Hong Cheng     //Bug 120881(End)
195cdf0e10cSrcweir     bool IsWordCountDirty() const;
196cdf0e10cSrcweir     bool IsWrongDirty() const;
197cdf0e10cSrcweir     bool IsGrammarCheckDirty() const;
198cdf0e10cSrcweir     bool IsSmartTagDirty() const;   // SMARTTAGS
199cdf0e10cSrcweir     bool IsAutoCompleteWordDirty() const;
200cdf0e10cSrcweir     void SetWordCountDirty( bool bNew ) const;
201cdf0e10cSrcweir     void SetWrongDirty( bool bNew ) const;
202cdf0e10cSrcweir     void SetGrammarCheckDirty( bool bNew ) const;
203cdf0e10cSrcweir     void SetSmartTagDirty( bool bNew ) const;  // SMARTTAGS
204cdf0e10cSrcweir     void SetAutoCompleteWordDirty( bool bNew ) const;
205cdf0e10cSrcweir     void SetWrong( SwWrongList* pNew, bool bDelete = true );
206cdf0e10cSrcweir     SwWrongList* GetWrong();
207cdf0e10cSrcweir     const SwWrongList* GetWrong() const;
208cdf0e10cSrcweir     void SetGrammarCheck( SwGrammarMarkUp* pNew, bool bDelete = true );
209cdf0e10cSrcweir     SwGrammarMarkUp* GetGrammarCheck();
210cdf0e10cSrcweir     // SMARTTAGS
211cdf0e10cSrcweir     void SetSmartTags( SwWrongList* pNew, bool bDelete = true );
212cdf0e10cSrcweir     SwWrongList* GetSmartTags();
213abbaf3ecSJian Hong Cheng     //Modify here for #119405, by easyfan, 2012-05-24
214abbaf3ecSJian Hong Cheng     bool TryCharSetExpandToNum(const SfxItemSet& pCharSet);
215abbaf3ecSJian Hong Cheng     //End of modification, by easyfan
216cdf0e10cSrcweir 
217cdf0e10cSrcweir     //
218cdf0e10cSrcweir     // End: Data collected during idle time
219cdf0e10cSrcweir     //
220cdf0e10cSrcweir protected:
221cdf0e10cSrcweir     // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
222cdf0e10cSrcweir     virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
223cdf0e10cSrcweir     virtual void SwClientNotify( const SwModify&, const SfxHint& );
224cdf0e10cSrcweir 
225cdf0e10cSrcweir public:
226cdf0e10cSrcweir     using SwCntntNode::GetAttr;
227cdf0e10cSrcweir 
228cdf0e10cSrcweir     const String& GetTxt() const { return m_Text; }
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     // getters for SwpHints
231cdf0e10cSrcweir     inline       SwpHints &GetSwpHints();
232cdf0e10cSrcweir     inline const SwpHints &GetSwpHints() const;
233cdf0e10cSrcweir     inline       SwpHints *GetpSwpHints()       { return m_pSwpHints; }
234cdf0e10cSrcweir     inline const SwpHints *GetpSwpHints() const { return m_pSwpHints; }
235cdf0e10cSrcweir     inline       bool   HasHints() const { return m_pSwpHints ? true : false; }
236cdf0e10cSrcweir     inline       SwpHints &GetOrCreateSwpHints();
237cdf0e10cSrcweir 
238cdf0e10cSrcweir     virtual ~SwTxtNode();
239cdf0e10cSrcweir 
240cdf0e10cSrcweir     virtual xub_StrLen Len() const;
241cdf0e10cSrcweir 
242cdf0e10cSrcweir     // steht in itratr
243cdf0e10cSrcweir     void GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax, sal_uLong &rAbs,
244cdf0e10cSrcweir                         OutputDevice* pOut = 0 ) const;
245cdf0e10cSrcweir 
246cdf0e10cSrcweir     // overriding to handle change of certain paragraph attributes
247cdf0e10cSrcweir     virtual sal_Bool SetAttr( const SfxPoolItem& );
248cdf0e10cSrcweir     virtual sal_Bool SetAttr( const SfxItemSet& rSet );
249cdf0e10cSrcweir     virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
250cdf0e10cSrcweir     virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
251cdf0e10cSrcweir     virtual sal_uInt16 ResetAllAttr();
252cdf0e10cSrcweir 
253cdf0e10cSrcweir     /// insert text content
254cdf0e10cSrcweir     void InsertText( const XubString & rStr, const SwIndex & rIdx,
255cdf0e10cSrcweir                      const enum IDocumentContentOperations::InsertFlags nMode
256cdf0e10cSrcweir                          = IDocumentContentOperations::INS_DEFAULT );
257cdf0e10cSrcweir 
258cdf0e10cSrcweir     /** delete text content
259cdf0e10cSrcweir         ATTENTION: must not be called with a range that overlaps the start of
260cdf0e10cSrcweir                    an attribute with both extent and dummy char
261cdf0e10cSrcweir      */
262cdf0e10cSrcweir     void EraseText ( const SwIndex &rIdx, const xub_StrLen nCount = STRING_LEN,
263cdf0e10cSrcweir                      const enum IDocumentContentOperations::InsertFlags nMode
264cdf0e10cSrcweir                          = IDocumentContentOperations::INS_DEFAULT );
265cdf0e10cSrcweir 
266cdf0e10cSrcweir     /** delete all attributes.
267cdf0e10cSrcweir         If neither pSet nor nWhich is given, delete all attributes (except
268cdf0e10cSrcweir         refmarks, toxmarks, meta) in range.
269cdf0e10cSrcweir         @param rIdx     start position
270cdf0e10cSrcweir         @param nLen     range in which attributes will be deleted
271cdf0e10cSrcweir         @param pSet     if not 0, delete only attributes contained in pSet
272cdf0e10cSrcweir         @param nWhich   if not 0, delete only attributes with matching which
273cdf0e10cSrcweir         @param bInclRefToxMark
274cdf0e10cSrcweir             refmarks, toxmarks, and metas will be ignored unless this is true
275cdf0e10cSrcweir         ATTENTION: setting bInclRefToxMark is only allowed from UNDO!
276cdf0e10cSrcweir      */
277*69a74367SOliver-Rainer Wittmann     void RstTxtAttr(
2784d322ebcSOliver-Rainer Wittmann         const SwIndex &rIdx,
2794d322ebcSOliver-Rainer Wittmann         const xub_StrLen nLen,
2804d322ebcSOliver-Rainer Wittmann         const sal_uInt16 nWhich = 0,
2814d322ebcSOliver-Rainer Wittmann         const SfxItemSet* pSet = 0,
2824d322ebcSOliver-Rainer Wittmann         const sal_Bool bInclRefToxMark = sal_False );
283cdf0e10cSrcweir     void    GCAttr();
284cdf0e10cSrcweir 
285cdf0e10cSrcweir     // loesche das Text-Attribut (muss beim Pool abgemeldet werden!)
286cdf0e10cSrcweir     void    DestroyAttr( SwTxtAttr* pAttr );
287cdf0e10cSrcweir 
288cdf0e10cSrcweir     // loesche alle Attribute aus dem SwpHintsArray.
289cdf0e10cSrcweir     void    ClearSwpHintsArr( bool bDelFields );
290cdf0e10cSrcweir 
291cdf0e10cSrcweir     /// Insert pAttr into hints array. @return true iff inserted successfully
292cdf0e10cSrcweir     bool    InsertHint( SwTxtAttr * const pAttr,
293cdf0e10cSrcweir                   const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
294cdf0e10cSrcweir     /// create new text attribute from rAttr and insert it
295cdf0e10cSrcweir     /// @return     inserted hint; 0 if not sure the hint is inserted
296cdf0e10cSrcweir     SwTxtAttr* InsertItem( SfxPoolItem& rAttr,
297cdf0e10cSrcweir                   const xub_StrLen nStart, const xub_StrLen nEnd,
298cdf0e10cSrcweir                   const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
299cdf0e10cSrcweir 
300cdf0e10cSrcweir     // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
301cdf0e10cSrcweir     // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
302*69a74367SOliver-Rainer Wittmann     sal_Bool SetAttr(
303*69a74367SOliver-Rainer Wittmann         const SfxItemSet& rSet,
304*69a74367SOliver-Rainer Wittmann         const xub_StrLen nStt,
305*69a74367SOliver-Rainer Wittmann         const xub_StrLen nEnd,
306cdf0e10cSrcweir         const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
307*69a74367SOliver-Rainer Wittmann 
308cdf0e10cSrcweir     // erfrage die Attribute vom TextNode ueber den Bereich
309cdf0e10cSrcweir     // Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
310cdf0e10cSrcweir     // If <bMergeIndentValuesOfNumRule> == sal_True, the indent attributes of
311cdf0e10cSrcweir     // the corresponding list level of an applied list style is merged into
312cdf0e10cSrcweir     // the requested item set as a LR-SPACE item, if <bOnlyTxtAttr> == sal_False,
313cdf0e10cSrcweir     // corresponding node has not its own indent attributes and the
314cdf0e10cSrcweir     // position-and-space mode of the list level is SvxNumberFormat::LABEL_ALIGNMENT.
315cdf0e10cSrcweir     sal_Bool GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
316cdf0e10cSrcweir                   sal_Bool bOnlyTxtAttr  = sal_False,
317cdf0e10cSrcweir                   sal_Bool bGetFromChrFmt = sal_True,
318cdf0e10cSrcweir                   const bool bMergeIndentValuesOfNumRule = false ) const;
319cdf0e10cSrcweir     // <--
320cdf0e10cSrcweir 
321cdf0e10cSrcweir     // uebertrage Attribute eines AttrSets ( AutoFmt ) in das SwpHintsArray
322cdf0e10cSrcweir     void FmtToTxtAttr( SwTxtNode* pNd );
323cdf0e10cSrcweir 
324cdf0e10cSrcweir     /// delete all attributes of type nWhich at nStart (opt. end nEnd)
325cdf0e10cSrcweir     void DeleteAttributes( const sal_uInt16 nWhich,
326cdf0e10cSrcweir                   const xub_StrLen nStart, const xub_StrLen nEnd = 0 );
327cdf0e10cSrcweir     /// delete the attribute pTxtAttr
328cdf0e10cSrcweir     void DeleteAttribute ( SwTxtAttr * const pTxtAttr );
329cdf0e10cSrcweir 
330cdf0e10cSrcweir     // Aktionen auf Text und Attributen
331cdf0e10cSrcweir     // introduce optional parameter to control, if all attributes have to be copied.
332cdf0e10cSrcweir     void CopyText( SwTxtNode * const pDest,
333cdf0e10cSrcweir                const SwIndex &rStart,
334cdf0e10cSrcweir                const xub_StrLen nLen,
335cdf0e10cSrcweir                const bool bForceCopyOfAllAttrs = false );
336cdf0e10cSrcweir     void CopyText( SwTxtNode * const pDest,
337cdf0e10cSrcweir                const SwIndex &rDestStart,
338cdf0e10cSrcweir                const SwIndex &rStart,
339cdf0e10cSrcweir                xub_StrLen nLen,
340cdf0e10cSrcweir                const bool bForceCopyOfAllAttrs = false );
341cdf0e10cSrcweir 
342cdf0e10cSrcweir     void        CutText(SwTxtNode * const pDest,
343cdf0e10cSrcweir                     const SwIndex & rStart, const xub_StrLen nLen);
344cdf0e10cSrcweir     inline void CutText(SwTxtNode * const pDest, const SwIndex &rDestStart,
345cdf0e10cSrcweir                     const SwIndex & rStart, const xub_StrLen nLen);
346cdf0e10cSrcweir 
347cdf0e10cSrcweir     /// replace nDelLen characters at rStart with rText
348cdf0e10cSrcweir     void ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
349cdf0e10cSrcweir             const XubString& rText );
350cdf0e10cSrcweir     void ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen, const XubString& rText,
351cdf0e10cSrcweir                     const ::com::sun::star::uno::Sequence<sal_Int32>& rOffsets );
352cdf0e10cSrcweir 
353cdf0e10cSrcweir     // virtuelle Methoden aus dem CntntNode
354cdf0e10cSrcweir     virtual SwCntntFrm *MakeFrm( SwFrm* );
355cdf0e10cSrcweir     virtual SwCntntNode *SplitCntntNode( const SwPosition & );
356cdf0e10cSrcweir     virtual SwCntntNode *JoinNext();
357cdf0e10cSrcweir     virtual SwCntntNode *JoinPrev();
358cdf0e10cSrcweir 
359cdf0e10cSrcweir     SwCntntNode *AppendNode( const SwPosition & );
360cdf0e10cSrcweir 
361cdf0e10cSrcweir     // setze ggf. das DontExpand-Flag an INet bzw. Zeichenvorlagen
362cdf0e10cSrcweir     sal_Bool DontExpandFmt( const SwIndex& rIdx, bool bFlag = true,
363cdf0e10cSrcweir                         sal_Bool bFmtToTxtAttributes = sal_True );
364cdf0e10cSrcweir 
365cdf0e10cSrcweir     enum GetTxtAttrMode {
366*69a74367SOliver-Rainer Wittmann         DEFAULT,    /// DEFAULT: (Start <= nIndex <  End)
367*69a74367SOliver-Rainer Wittmann         EXPAND,     /// EXPAND : (Start <  nIndex <= End)
368cdf0e10cSrcweir         PARENT,     /// PARENT : (Start <  nIndex <  End)
369cdf0e10cSrcweir     };
370cdf0e10cSrcweir 
371cdf0e10cSrcweir     /** get the innermost text attribute covering position nIndex.
372cdf0e10cSrcweir         @param nWhich   only attribute with this id is returned.
373cdf0e10cSrcweir         @param eMode    the predicate for matching (@see GetTxtAttrMode).
374cdf0e10cSrcweir 
375cdf0e10cSrcweir         ATTENTION: this function is not well-defined for those
376cdf0e10cSrcweir         hints of which several may cover a single position, like
377cdf0e10cSrcweir         RES_TXTATR_CHARFMT, RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK
378cdf0e10cSrcweir      */
379*69a74367SOliver-Rainer Wittmann     SwTxtAttr *GetTxtAttrAt(
380*69a74367SOliver-Rainer Wittmann         xub_StrLen const nIndex,
381*69a74367SOliver-Rainer Wittmann         RES_TXTATR const nWhich,
382cdf0e10cSrcweir         enum GetTxtAttrMode const eMode = DEFAULT ) const;
383cdf0e10cSrcweir 
384cdf0e10cSrcweir     /** get the innermost text attributes covering position nIndex.
385cdf0e10cSrcweir         @param nWhich   only attributes with this id are returned.
386cdf0e10cSrcweir         @param eMode    the predicate for matching (@see GetTxtAttrMode).
387cdf0e10cSrcweir      */
388*69a74367SOliver-Rainer Wittmann     ::std::vector<SwTxtAttr *> GetTxtAttrsAt(
389*69a74367SOliver-Rainer Wittmann         xub_StrLen const nIndex,
390cdf0e10cSrcweir         RES_TXTATR const nWhich,
391cdf0e10cSrcweir         enum GetTxtAttrMode const eMode = DEFAULT ) const;
392cdf0e10cSrcweir 
393cdf0e10cSrcweir     /** get the text attribute at position nIndex which owns
394cdf0e10cSrcweir         the dummy character CH_TXTATR_* at that position, if one exists.
395cdf0e10cSrcweir         @param nIndex   the position in the text
396cdf0e10cSrcweir         @param nWhich   if different from RES_TXTATR_END, return only
397cdf0e10cSrcweir                         attribute with given which id
398cdf0e10cSrcweir         @return the text attribute at nIndex of type nWhich, if it exists
399cdf0e10cSrcweir     */
400*69a74367SOliver-Rainer Wittmann     SwTxtAttr *GetTxtAttrForCharAt(
401*69a74367SOliver-Rainer Wittmann         const xub_StrLen nIndex,
402cdf0e10cSrcweir         const RES_TXTATR nWhich = RES_TXTATR_END ) const;
403cdf0e10cSrcweir 
404*69a74367SOliver-Rainer Wittmann     SwTxtFld* GetFldTxtAttrAt(
405*69a74367SOliver-Rainer Wittmann         const xub_StrLen nIndex,
406*69a74367SOliver-Rainer Wittmann         const bool bIncludeInputFldAtStart = false ) const;
407*69a74367SOliver-Rainer Wittmann 
408cdf0e10cSrcweir     // Aktuelles Wort zurueckliefern
409cdf0e10cSrcweir     XubString GetCurWord(xub_StrLen) const;
410cdf0e10cSrcweir     sal_uInt16 Spell(SwSpellArgs*);
411cdf0e10cSrcweir     sal_uInt16 Convert( SwConversionArgs & );
412cdf0e10cSrcweir 
413cdf0e10cSrcweir     inline SwTxtFmtColl *GetTxtColl() const;
414cdf0e10cSrcweir     virtual SwFmtColl *ChgFmtColl( SwFmtColl* );
415cdf0e10cSrcweir     void _ChgTxtCollUpdateNum( const SwTxtFmtColl* pOld,
416cdf0e10cSrcweir                                 const SwTxtFmtColl* pNew );
417cdf0e10cSrcweir 
418cdf0e10cSrcweir     // kopiere die Collection mit allen Autoformaten zum Dest-Node
419cdf0e10cSrcweir     // dieser kann auch in einem anderen Dokument stehen!
420cdf0e10cSrcweir     // (Methode steht im ndcopy.cxx!!)
421cdf0e10cSrcweir     void CopyCollFmt( SwTxtNode& rDestNd );
422cdf0e10cSrcweir 
423cdf0e10cSrcweir     //
424cdf0e10cSrcweir     // BEGIN OF BULLET/NUMBERING/OUTLINE STUFF:
425cdf0e10cSrcweir     //
426cdf0e10cSrcweir 
427cdf0e10cSrcweir     /**
428cdf0e10cSrcweir        Returns numbering rule of this text node.
429cdf0e10cSrcweir 
430cdf0e10cSrcweir        @param bInParent     serach in parent attributes, too
431cdf0e10cSrcweir 
432cdf0e10cSrcweir        @return numbering rule of this text node or NULL if none is set
433cdf0e10cSrcweir      */
434cdf0e10cSrcweir     SwNumRule *GetNumRule(sal_Bool bInParent = sal_True) const;
435cdf0e10cSrcweir 
436cdf0e10cSrcweir     inline const SwNodeNum* GetNum() const
437cdf0e10cSrcweir     {
438cdf0e10cSrcweir         return mpNodeNum;
439cdf0e10cSrcweir     }
440cdf0e10cSrcweir 
441cdf0e10cSrcweir     SwNumberTree::tNumberVector GetNumberVector() const;
442cdf0e10cSrcweir 
443cdf0e10cSrcweir     /**
444cdf0e10cSrcweir        Returns if this text node is an outline.
445cdf0e10cSrcweir 
446cdf0e10cSrcweir        @retval true      this text node is an outline
447cdf0e10cSrcweir        @retval false     else
448cdf0e10cSrcweir      */
449cdf0e10cSrcweir     bool IsOutline() const;
450cdf0e10cSrcweir 
451cdf0e10cSrcweir     bool IsOutlineStateChanged() const;
452cdf0e10cSrcweir 
453cdf0e10cSrcweir     void UpdateOutlineState();
454cdf0e10cSrcweir 
455cdf0e10cSrcweir     /**
456cdf0e10cSrcweir        Notify this textnode that its numbering rule has changed.
457cdf0e10cSrcweir      */
458cdf0e10cSrcweir     void NumRuleChgd();
459cdf0e10cSrcweir 
460cdf0e10cSrcweir     /** Returns outline of numbering string
461cdf0e10cSrcweir 
462cdf0e10cSrcweir         Introduce parameter <_bInclPrefixAndSuffixStrings> in order to control,
463cdf0e10cSrcweir         if the prefix and the suffix strings have to been included or not.
464cdf0e10cSrcweir 
465cdf0e10cSrcweir         @param _bInclPrefixAndSuffixStrings
466cdf0e10cSrcweir         optional input parameter - boolean indicating, if the prefix and the
467cdf0e10cSrcweir         suffix strings have to been included or not. default value = <true>
468cdf0e10cSrcweir 
469cdf0e10cSrcweir         @param _nRestrictToThisLevel
470cdf0e10cSrcweir         optional input parameter - unsigned integer indicating the maximum outline
471cdf0e10cSrcweir         level to which the output string must be restricted to. Default value is
472cdf0e10cSrcweir         MAXLEVEL
473cdf0e10cSrcweir     */
474cdf0e10cSrcweir     XubString GetNumString( const bool _bInclPrefixAndSuffixStrings = true, const unsigned int _nRestrictToThisLevel = MAXLEVEL ) const;
475cdf0e10cSrcweir 
476cdf0e10cSrcweir     /**
477cdf0e10cSrcweir        Returns the additional indents of this text node and its numbering.
478cdf0e10cSrcweir 
479cdf0e10cSrcweir        @param bTxtLeft  ???
480cdf0e10cSrcweir 
481cdf0e10cSrcweir        @return additional indents
482cdf0e10cSrcweir      */
483cdf0e10cSrcweir      long GetLeftMarginWithNum( sal_Bool bTxtLeft = sal_False ) const;
484cdf0e10cSrcweir 
485cdf0e10cSrcweir     /**
486cdf0e10cSrcweir        Returns the combined first line indent of this text node and
487cdf0e10cSrcweir        its numbering.
488cdf0e10cSrcweir 
489cdf0e10cSrcweir        @param the first line indent of this text node taking the
490cdf0e10cSrcweir                numbering into account (return parameter)
491cdf0e10cSrcweir 
492cdf0e10cSrcweir        @retval sal_True   this node has SwNodeNum and has numbering rule
493cdf0e10cSrcweir        @retval sal_False  else
494cdf0e10cSrcweir      */
495cdf0e10cSrcweir     sal_Bool GetFirstLineOfsWithNum( short& rFirstOffset ) const;
496cdf0e10cSrcweir 
497cdf0e10cSrcweir     SwTwips GetAdditionalIndentForStartingNewList() const;
498cdf0e10cSrcweir 
499cdf0e10cSrcweir     // --> OD 2008-12-02 #i96772#
500cdf0e10cSrcweir     void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const;
501cdf0e10cSrcweir     // <--
502cdf0e10cSrcweir 
503cdf0e10cSrcweir     /** return left margin for tab stop position calculation
504cdf0e10cSrcweir 
505cdf0e10cSrcweir         OD 2008-06-30 #i91133#
506cdf0e10cSrcweir         Needed for text formatting
507cdf0e10cSrcweir         Method considers new list level attributes, which also can provide a left margin value
508cdf0e10cSrcweir 
509cdf0e10cSrcweir         @author OD
510cdf0e10cSrcweir     */
511cdf0e10cSrcweir     long GetLeftMarginForTabCalculation() const;
512cdf0e10cSrcweir 
513cdf0e10cSrcweir     /** -> #i29560
514cdf0e10cSrcweir         Returns if this text node has a number.
515cdf0e10cSrcweir 
516cdf0e10cSrcweir         This text node has a number if it has a SwNodeNum and a
517cdf0e10cSrcweir         numbering rule and the numbering format specified for the
518cdf0e10cSrcweir         level of the SwNodeNum is of an enumeration type.
519cdf0e10cSrcweir 
520cdf0e10cSrcweir         @retval sal_True    This text node has a number.
521cdf0e10cSrcweir         @retval sal_False   else
522cdf0e10cSrcweir      */
523cdf0e10cSrcweir     sal_Bool HasNumber() const;
524cdf0e10cSrcweir 
525cdf0e10cSrcweir     /** -> #i29560
526cdf0e10cSrcweir         Returns if this text node has a bullet.
527cdf0e10cSrcweir 
528cdf0e10cSrcweir         This text node has a bullet if it has a SwNodeNum and a
529cdf0e10cSrcweir         numbering rule and the numbering format specified for the
530cdf0e10cSrcweir         level of the SwNodeNum is of a bullet type.
531cdf0e10cSrcweir 
532cdf0e10cSrcweir         @retval sal_True    This text node has a bullet.
533cdf0e10cSrcweir         @retval sal_False   else
534cdf0e10cSrcweir      */
535cdf0e10cSrcweir     sal_Bool HasBullet() const;
536cdf0e10cSrcweir 
537cdf0e10cSrcweir     /** -> #i27615#
538cdf0e10cSrcweir         Returns is this text node is numbered.
539cdf0e10cSrcweir 
540cdf0e10cSrcweir         This node is numbered if it has a SwNodeNum and it has a
541cdf0e10cSrcweir         numbering rule and has not a hidden SwNodeNum.
542cdf0e10cSrcweir 
543cdf0e10cSrcweir         ATTENTION: Returns sal_True even if the SwNumFmt has type
544cdf0e10cSrcweir         SVX_NUM_NUMBER_NONE.
545cdf0e10cSrcweir 
546cdf0e10cSrcweir         @retval sal_True      This node is numbered.
547cdf0e10cSrcweir         @retval sal_False     else
548cdf0e10cSrcweir      */
549cdf0e10cSrcweir     sal_Bool IsNumbered() const;
550cdf0e10cSrcweir 
551cdf0e10cSrcweir     /** -> #i27615#
552cdf0e10cSrcweir         Returns if this text node has a marked label.
553cdf0e10cSrcweir 
554cdf0e10cSrcweir         @retval true       This text node has a marked label.
555cdf0e10cSrcweir         @retval false      else
556cdf0e10cSrcweir      */
557cdf0e10cSrcweir     bool HasMarkedLabel() const;
558cdf0e10cSrcweir 
559cdf0e10cSrcweir     /** Sets the list level of this text node.
560cdf0e10cSrcweir 
561cdf0e10cSrcweir         Side effect, when the text node is a list item:
562cdf0e10cSrcweir         The text node's representation in the list tree (<SwNodeNum> instance)
563cdf0e10cSrcweir         is updated.
564cdf0e10cSrcweir 
565cdf0e10cSrcweir         @param nLevel level to set
566cdf0e10cSrcweir     */
567cdf0e10cSrcweir     void SetAttrListLevel(int nLevel);
568cdf0e10cSrcweir 
569cdf0e10cSrcweir     bool HasAttrListLevel() const;
570cdf0e10cSrcweir 
571cdf0e10cSrcweir     int GetAttrListLevel() const;
572cdf0e10cSrcweir 
573cdf0e10cSrcweir     /** Returns the actual list level of this text node, when it is a list item
574cdf0e10cSrcweir 
575cdf0e10cSrcweir         @return the actual list level of this text node, if it is a list item,
576cdf0e10cSrcweir                -1 otherwise
577cdf0e10cSrcweir     */
578cdf0e10cSrcweir     int GetActualListLevel() const;
579cdf0e10cSrcweir 
580cdf0e10cSrcweir     /**
581cdf0e10cSrcweir        Returns outline level of this text node.
582cdf0e10cSrcweir 
583cdf0e10cSrcweir        If a text node has an outline number (i.e. it has an SwNodeNum
584cdf0e10cSrcweir        and a outline numbering rule) the outline level is the level of
585cdf0e10cSrcweir        this SwNodeNum.
586cdf0e10cSrcweir 
587cdf0e10cSrcweir        If a text node has no outline number and has a paragraph style
588cdf0e10cSrcweir        attached the outline level is the outline level of the
589cdf0e10cSrcweir        paragraph style.
590cdf0e10cSrcweir 
591cdf0e10cSrcweir        Otherwise the text node has no outline level (NO_NUMBERING).
592cdf0e10cSrcweir 
593cdf0e10cSrcweir        NOTE: The outline level of text nodes is subject to change. The
594cdf0e10cSrcweir        plan is to have an SwTxtNode::nOutlineLevel member that is
595cdf0e10cSrcweir        updated from a paragraph style upon appliance of that paragraph
596cdf0e10cSrcweir        style.
597cdf0e10cSrcweir 
598cdf0e10cSrcweir        @return outline level or NO_NUMBERING if there is no outline level
599cdf0e10cSrcweir      */
600cdf0e10cSrcweir     int GetAttrOutlineLevel() const;//#OutlineLevel,added by zhaojianwei
601cdf0e10cSrcweir 
602cdf0e10cSrcweir     /**
603cdf0e10cSrcweir        Sets the out line level *at* a text node.
604cdf0e10cSrcweir 
605cdf0e10cSrcweir        @param nLevel     the level to be set
606cdf0e10cSrcweir 
607cdf0e10cSrcweir        If the text node has an outline number the level is set at the
608cdf0e10cSrcweir        outline number.
609cdf0e10cSrcweir 
610cdf0e10cSrcweir        If the text node has no outline number but has a paragraph
611cdf0e10cSrcweir        style applied the outline level is set at the paragraph style.
612cdf0e10cSrcweir 
613cdf0e10cSrcweir        NOTE: This is subject to change, see GetOutlineLevel.
614cdf0e10cSrcweir      */
615cdf0e10cSrcweir     //void SetOutlineLevel(int nLevel);
616cdf0e10cSrcweir       void SetAttrOutlineLevel(int nLevel);//#OutlineLevel,added by zhaojianwei
617cdf0e10cSrcweir 
618cdf0e10cSrcweir     // --> OD 2008-11-19 #i70748#
619cdf0e10cSrcweir     bool IsEmptyListStyleDueToSetOutlineLevelAttr();
620cdf0e10cSrcweir     void SetEmptyListStyleDueToSetOutlineLevelAttr();
621cdf0e10cSrcweir     void ResetEmptyListStyleDueToResetOutlineLevelAttr();
622cdf0e10cSrcweir     // <--
623cdf0e10cSrcweir 
624cdf0e10cSrcweir     /**
625cdf0e10cSrcweir        Returns the width of leading tabs/blanks in this paragraph.
626cdf0e10cSrcweir        This space will be converted into numbering indent if the paragraph
627cdf0e10cSrcweir        is set to be numbered.
628cdf0e10cSrcweir 
629cdf0e10cSrcweir        @return     the width of the leading whitespace
630cdf0e10cSrcweir      */
631cdf0e10cSrcweir     sal_uInt16 GetWidthOfLeadingTabs() const;
632cdf0e10cSrcweir 
633cdf0e10cSrcweir 
634cdf0e10cSrcweir     /**
635cdf0e10cSrcweir        Returns if the paragraph has a visible numbering or bullet.
636cdf0e10cSrcweir        This includes all kinds of numbering/bullet/outlines.
637cdf0e10cSrcweir        Note: This function returns false, if the numbering format is
638cdf0e10cSrcweir        SVX_NUM_NUMBER_NONE or if the numbering/bullet has been deleted.
639cdf0e10cSrcweir 
640cdf0e10cSrcweir        @return     sal_True if the paragraph has a visible numbering/bullet/outline
641cdf0e10cSrcweir      */
642cdf0e10cSrcweir     bool HasVisibleNumberingOrBullet() const;
643cdf0e10cSrcweir 
644cdf0e10cSrcweir     void SetListId( const String sListId );
645cdf0e10cSrcweir     String GetListId() const;
646cdf0e10cSrcweir 
647cdf0e10cSrcweir     /** Determines, if the list level indent attributes can be applied to the
648cdf0e10cSrcweir         paragraph.
649cdf0e10cSrcweir 
650cdf0e10cSrcweir         The list level indents can be applied to the paragraph under the one
651cdf0e10cSrcweir         of following conditions:
652cdf0e10cSrcweir         - the list style is directly applied to the paragraph and the paragraph
653cdf0e10cSrcweir           has no own indent attributes.
654cdf0e10cSrcweir         - the list style is applied to the paragraph through one of its paragraph
655cdf0e10cSrcweir           styles, the paragraph has no own indent attributes and on the paragraph
656cdf0e10cSrcweir           style hierarchy from the paragraph to the paragraph style with the
657cdf0e10cSrcweir           list style no indent attributes are found.
658cdf0e10cSrcweir 
659cdf0e10cSrcweir         @author OD
660cdf0e10cSrcweir 
661cdf0e10cSrcweir         @return boolean
662cdf0e10cSrcweir     */
663cdf0e10cSrcweir     bool AreListLevelIndentsApplicable() const;
664cdf0e10cSrcweir 
665cdf0e10cSrcweir     /** Retrieves the list tab stop position, if the paragraph's list level defines
666cdf0e10cSrcweir         one and this list tab stop has to merged into the tap stops of the paragraph
667cdf0e10cSrcweir 
668cdf0e10cSrcweir         @author OD
669cdf0e10cSrcweir 
670cdf0e10cSrcweir         @param nListTabStopPosition
671cdf0e10cSrcweir         output parameter - containing the list tab stop position
672cdf0e10cSrcweir 
673cdf0e10cSrcweir         @return boolean - indicating, if a list tab stop position is provided
674cdf0e10cSrcweir     */
675cdf0e10cSrcweir     bool GetListTabStopPosition( long& nListTabStopPosition ) const;
676cdf0e10cSrcweir 
677cdf0e10cSrcweir     /** Retrieves the character following the list label, if the paragraph's
678cdf0e10cSrcweir         list level defines one.
679cdf0e10cSrcweir 
680cdf0e10cSrcweir         @author OD
681cdf0e10cSrcweir 
682cdf0e10cSrcweir         @return XubString - the list tab stop position
683cdf0e10cSrcweir     */
684cdf0e10cSrcweir     XubString GetLabelFollowedBy() const;
685cdf0e10cSrcweir 
686cdf0e10cSrcweir     //
687cdf0e10cSrcweir     // END OF BULLET/NUMBERING/OUTLINE STUFF:
688cdf0e10cSrcweir     //
689cdf0e10cSrcweir 
690cdf0e10cSrcweir     void fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const;
691cdf0e10cSrcweir 
692cdf0e10cSrcweir     sal_uInt16 GetLang( const xub_StrLen nBegin, const xub_StrLen nLen = 0,
693cdf0e10cSrcweir                     sal_uInt16 nScript = 0 ) const;
694cdf0e10cSrcweir 
695cdf0e10cSrcweir     // steht in ndcopy.cxx
696cdf0e10cSrcweir     sal_Bool IsSymbol( const xub_StrLen nBegin ) const; // steht in itratr.cxx
697cdf0e10cSrcweir     virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
698cdf0e10cSrcweir 
699cdf0e10cSrcweir     // interaktive Trennung: wir finden den TxtFrm und rufen sein CalcHyph
700cdf0e10cSrcweir     sal_Bool Hyphenate( SwInterHyphInfo &rHyphInf );
701cdf0e10cSrcweir     void DelSoftHyph( const xub_StrLen nStart, const xub_StrLen nEnd );
702cdf0e10cSrcweir 
703cdf0e10cSrcweir     // --> OD 2007-11-15 #i83479#
704cdf0e10cSrcweir     // add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating,
705cdf0e10cSrcweir     // when <bWithNum = true> that a space is inserted after the string for
706cdf0e10cSrcweir     // the list label.
707cdf0e10cSrcweir     // add 5th optional parameter <bWithSpacesForLevel> indicating, if additional
708cdf0e10cSrcweir     // spaces are inserted in front of the expanded text string depending on
709cdf0e10cSrcweir     // the list level.
710cdf0e10cSrcweir     XubString GetExpandTxt( const xub_StrLen nIdx = 0,
711cdf0e10cSrcweir                             const xub_StrLen nLen = STRING_LEN,
712cdf0e10cSrcweir                             const bool bWithNum = false,
713cdf0e10cSrcweir                             const bool bAddSpaceAfterListLabelStr = false,
714cdf0e10cSrcweir                             const bool bWithSpacesForLevel = false ) const;
715cdf0e10cSrcweir     // <--
716cdf0e10cSrcweir     sal_Bool GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx = 0,
717cdf0e10cSrcweir                         xub_StrLen nIdx = 0, xub_StrLen nLen = STRING_LEN,
718cdf0e10cSrcweir                        sal_Bool bWithNum = sal_False, sal_Bool bWithFtn = sal_True,
719cdf0e10cSrcweir                        sal_Bool bReplaceTabsWithSpaces = sal_False ) const;
720cdf0e10cSrcweir 
721cdf0e10cSrcweir     /*
722cdf0e10cSrcweir      *
723cdf0e10cSrcweir      */
724cdf0e10cSrcweir     const ModelToViewHelper::ConversionMap*
725cdf0e10cSrcweir             BuildConversionMap( rtl::OUString& rExpandText ) const;
726cdf0e10cSrcweir 
727cdf0e10cSrcweir     XubString GetRedlineTxt( xub_StrLen nIdx = 0,
728cdf0e10cSrcweir                           xub_StrLen nLen = STRING_LEN,
729cdf0e10cSrcweir                           sal_Bool bExpandFlds = sal_False,
730cdf0e10cSrcweir                           sal_Bool bWithNum = sal_False ) const;
731cdf0e10cSrcweir     //Liefert fuer die Initalfunktion tatsaechliche Anzahl der Initialzeichen
732cdf0e10cSrcweir     //bei nWishLen == 0 die des ersten Wortes
733cdf0e10cSrcweir     sal_uInt16 GetDropLen( sal_uInt16 nWishLen) const;
734cdf0e10cSrcweir 
735cdf0e10cSrcweir     // Passes back info needed on the dropcap dimensions
736cdf0e10cSrcweir     bool GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescent) const;
737cdf0e10cSrcweir 
738cdf0e10cSrcweir     // Hidden Paragraph Field:
739cdf0e10cSrcweir     inline bool CalcHiddenParaField()
740cdf0e10cSrcweir         { return m_pSwpHints ? m_pSwpHints->CalcHiddenParaField() : false; }
741cdf0e10cSrcweir     // set CalcVisible flags
742cdf0e10cSrcweir     inline void SetCalcHiddenParaField()
743cdf0e10cSrcweir         { if (m_pSwpHints) m_pSwpHints->SetCalcHiddenParaField(); }
744cdf0e10cSrcweir 
745cdf0e10cSrcweir     // is the paragraph visible?
746cdf0e10cSrcweir     inline bool HasHiddenParaField() const
747cdf0e10cSrcweir         { return m_pSwpHints ? m_pSwpHints->HasHiddenParaField()  : false; }
748cdf0e10cSrcweir 
749cdf0e10cSrcweir     //
750cdf0e10cSrcweir     // Hidden Paragraph Field:
751cdf0e10cSrcweir     //
752cdf0e10cSrcweir     inline bool HasHiddenCharAttribute( bool bWholePara ) const
753cdf0e10cSrcweir     {
754cdf0e10cSrcweir         if ( m_bRecalcHiddenCharFlags )
755cdf0e10cSrcweir             CalcHiddenCharFlags();
756cdf0e10cSrcweir         return bWholePara ? m_bHiddenCharsHidePara : m_bContainsHiddenChars;
757cdf0e10cSrcweir     }
758cdf0e10cSrcweir 
759cdf0e10cSrcweir     inline void SetCalcHiddenCharFlags() const
760cdf0e10cSrcweir         { m_bRecalcHiddenCharFlags = true; }
761cdf0e10cSrcweir 
762cdf0e10cSrcweir // --> FME 2004-06-08 #i12836# enhanced pdf
763cdf0e10cSrcweir     //
764cdf0e10cSrcweir     // Returns if the node is hidden due to
765cdf0e10cSrcweir     // 1. HiddenParaField
766cdf0e10cSrcweir     // 2. HiddenCharAttribute
767cdf0e10cSrcweir     // 3. HiddenSection
768cdf0e10cSrcweir     //
769cdf0e10cSrcweir     bool IsHidden() const;
770cdf0e10cSrcweir // <--
771cdf0e10cSrcweir 
772cdf0e10cSrcweir     TYPEINFO(); // fuer rtti
773cdf0e10cSrcweir 
774cdf0e10cSrcweir     // override SwIndexReg
775*69a74367SOliver-Rainer Wittmann     virtual void Update(
776*69a74367SOliver-Rainer Wittmann         SwIndex const & rPos,
777*69a74367SOliver-Rainer Wittmann         const xub_StrLen nChangeLen,
778*69a74367SOliver-Rainer Wittmann         const bool bNegative = false,
779*69a74367SOliver-Rainer Wittmann         const bool bDelete = false );
780cdf0e10cSrcweir 
781cdf0e10cSrcweir     // change text to Upper/Lower/Hiragana/Katagana/...
782cdf0e10cSrcweir     void TransliterateText( utl::TransliterationWrapper& rTrans,
783cdf0e10cSrcweir                             xub_StrLen nStart, xub_StrLen nEnd,
784cdf0e10cSrcweir                             SwUndoTransliterate* pUndo = 0 );
785cdf0e10cSrcweir 
786cdf0e10cSrcweir     // count words in given range
787cdf0e10cSrcweir     void CountWords( SwDocStat& rStat, xub_StrLen nStart, xub_StrLen nEnd ) const;
788cdf0e10cSrcweir 
789cdf0e10cSrcweir     // Checks some global conditions like loading or destruction of document
790cdf0e10cSrcweir     // to economize notifications
791cdf0e10cSrcweir     bool IsNotificationEnabled() const;
792cdf0e10cSrcweir 
793cdf0e10cSrcweir     // Checks a temporary notification blocker and the global conditons of IsNotificationEnabled()
794cdf0e10cSrcweir     bool IsNotifiable() const;
795cdf0e10cSrcweir 
796cdf0e10cSrcweir     void SetListRestart( bool bRestart );
797cdf0e10cSrcweir     // --> OD 2005-11-02 #i51089 - TUNING#
798cdf0e10cSrcweir     bool IsListRestart() const;
799cdf0e10cSrcweir     // <--
800cdf0e10cSrcweir 
801cdf0e10cSrcweir     void SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNum );
802cdf0e10cSrcweir     bool HasAttrListRestartValue() const;
803cdf0e10cSrcweir     SwNumberTree::tSwNumTreeNumber GetAttrListRestartValue() const;
804cdf0e10cSrcweir     SwNumberTree::tSwNumTreeNumber GetActualListStartValue() const;
805cdf0e10cSrcweir 
806cdf0e10cSrcweir     void SetCountedInList( bool bCounted );
807cdf0e10cSrcweir     bool IsCountedInList() const;
808cdf0e10cSrcweir 
809cdf0e10cSrcweir     void AddToList();
810cdf0e10cSrcweir     void RemoveFromList();
811cdf0e10cSrcweir     bool IsInList() const;
812cdf0e10cSrcweir 
813cdf0e10cSrcweir     bool IsFirstOfNumRule() const;
814cdf0e10cSrcweir 
815cdf0e10cSrcweir     sal_uInt16 GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) const;
816cdf0e10cSrcweir 
817cdf0e10cSrcweir     SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
818cdf0e10cSrcweir         ::com::sun::star::text::XTextContent> const& GetXParagraph() const
819cdf0e10cSrcweir             { return m_wXParagraph; }
820cdf0e10cSrcweir     SW_DLLPRIVATE void SetXParagraph(::com::sun::star::uno::Reference<
821cdf0e10cSrcweir                     ::com::sun::star::text::XTextContent> const& xParagraph)
822cdf0e10cSrcweir             { m_wXParagraph = xParagraph; }
823cdf0e10cSrcweir 
824cdf0e10cSrcweir     // sfx2::Metadatable
825cdf0e10cSrcweir     virtual ::sfx2::IXmlIdRegistry& GetRegistry();
826cdf0e10cSrcweir     virtual bool IsInClipboard() const;
827cdf0e10cSrcweir     virtual bool IsInUndo() const;
828cdf0e10cSrcweir     virtual bool IsInContent() const;
829cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
830cdf0e10cSrcweir         ::com::sun::star::rdf::XMetadatable > MakeUnoObject();
831cdf0e10cSrcweir 
832cdf0e10cSrcweir     DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode)
833cdf0e10cSrcweir };
834cdf0e10cSrcweir 
835cdf0e10cSrcweir //-----------------------------------------------------------------------------
836cdf0e10cSrcweir 
837cdf0e10cSrcweir inline SwpHints & SwTxtNode::GetSwpHints()
838cdf0e10cSrcweir {
839cdf0e10cSrcweir     ASSERT_ID( m_pSwpHints, ERR_NOHINTS);
840cdf0e10cSrcweir     return *m_pSwpHints;
841cdf0e10cSrcweir }
842cdf0e10cSrcweir inline const SwpHints &SwTxtNode::GetSwpHints() const
843cdf0e10cSrcweir {
844cdf0e10cSrcweir     ASSERT_ID( m_pSwpHints, ERR_NOHINTS);
845cdf0e10cSrcweir     return *m_pSwpHints;
846cdf0e10cSrcweir }
847cdf0e10cSrcweir 
848cdf0e10cSrcweir inline SwpHints& SwTxtNode::GetOrCreateSwpHints()
849cdf0e10cSrcweir {
850cdf0e10cSrcweir     if ( !m_pSwpHints )
851cdf0e10cSrcweir     {
852cdf0e10cSrcweir         m_pSwpHints = new SwpHints;
853cdf0e10cSrcweir     }
854cdf0e10cSrcweir     return *m_pSwpHints;
855cdf0e10cSrcweir }
856cdf0e10cSrcweir 
857cdf0e10cSrcweir inline void SwTxtNode::TryDeleteSwpHints()
858cdf0e10cSrcweir {
859cdf0e10cSrcweir     if ( m_pSwpHints && m_pSwpHints->CanBeDeleted() )
860cdf0e10cSrcweir     {
861cdf0e10cSrcweir         DELETEZ( m_pSwpHints );
862cdf0e10cSrcweir     }
863cdf0e10cSrcweir }
864cdf0e10cSrcweir 
865cdf0e10cSrcweir inline SwTxtFmtColl* SwTxtNode::GetTxtColl() const
866cdf0e10cSrcweir {
867cdf0e10cSrcweir     return static_cast<SwTxtFmtColl*>(const_cast<SwModify*>(GetRegisteredIn()));
868cdf0e10cSrcweir }
869cdf0e10cSrcweir 
870cdf0e10cSrcweir // fuer den IBM-Compiler nicht inlinen wg. 42876
871cdf0e10cSrcweir #ifndef ICC
872cdf0e10cSrcweir // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
873cdf0e10cSrcweir inline       SwTxtNode   *SwNode::GetTxtNode()
874cdf0e10cSrcweir {
875cdf0e10cSrcweir      return ND_TEXTNODE == nNodeType ? static_cast<SwTxtNode*>(this) : 0;
876cdf0e10cSrcweir }
877cdf0e10cSrcweir inline const SwTxtNode   *SwNode::GetTxtNode() const
878cdf0e10cSrcweir {
879cdf0e10cSrcweir      return ND_TEXTNODE == nNodeType ? static_cast<const SwTxtNode*>(this) : 0;
880cdf0e10cSrcweir }
881cdf0e10cSrcweir #endif
882cdf0e10cSrcweir 
883cdf0e10cSrcweir inline void
884cdf0e10cSrcweir SwTxtNode::CutText(SwTxtNode * const pDest, const SwIndex & rDestStart,
885cdf0e10cSrcweir                     const SwIndex & rStart, const xub_StrLen nLen)
886cdf0e10cSrcweir {
887cdf0e10cSrcweir     CutImpl( pDest, rDestStart, rStart, nLen, true );
888cdf0e10cSrcweir }
889cdf0e10cSrcweir 
890cdf0e10cSrcweir #endif
891